diff --git a/.eslintignore b/.eslintignore index 0be7057993e451..9b5c5fccb643e4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,4 @@ lib/internal/v8_prof_polyfill.js -lib/internal/v8_prof_processor.js lib/punycode.js test/addons/??_*/ test/fixtures diff --git a/.eslintrc b/.eslintrc index 8e01cc4c94c0e4..f9b0ef3b015f77 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,7 @@ rules: no-duplicate-case: 2 no-empty-character-class: 2 no-ex-assign: 2 - no-extra-boolean-cast : 2 + no-extra-boolean-cast: 2 no-extra-parens: [2, "functions"] no-extra-semi: 2 no-func-assign: 2 @@ -30,6 +30,7 @@ rules: # Best Practices # http://eslint.org/docs/rules/#best-practices no-fallthrough: 2 + no-multi-spaces: 2 no-octal: 2 no-redeclare: 2 no-self-assign: 2 @@ -57,7 +58,9 @@ rules: comma-spacing: 2 eol-last: 2 indent: [2, 2, {SwitchCase: 1}] + key-spacing: [2, {mode: "minimum"}] keyword-spacing: 2 + linebreak-style: [2, "unix"] max-len: [2, 80, 2] new-parens: 2 no-mixed-spaces-and-tabs: 2 @@ -83,10 +86,15 @@ rules: no-new-symbol: 2 no-this-before-super: 2 prefer-const: 2 + template-curly-spacing: 2 # Custom rules in tools/eslint-rules + align-function-arguments: 2 + align-multiline-assignment: 2 + assert-fail-single-argument: 2 new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"] - + no-deepEqual: 2 + no-definegetter-definesetter: 2 # Global scoped method and vars globals: diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index dbd53cf22825f0..3ae4132fbcbdc7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,19 +1,13 @@ * **Version**: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 364754444ac945..bc5ba6fafcce0e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,21 +1,17 @@ ##### Checklist - - + - [ ] tests and code linting passes - [ ] a test and/or benchmark is included @@ -24,10 +20,8 @@ https://github.com/nodejs/node/blob/master/CONTRIBUTING.md ##### Affected core subsystem(s) - ##### Description of change - diff --git a/.gitignore b/.gitignore index 734d92d4d719af..c7361af80c79dc 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,8 @@ _UpgradeReport_Files/ ipch/ *.sdf *.opensdf +*.VC.opendb +.vs/ /config.mk /config.gypi diff --git a/AUTHORS b/AUTHORS index 5ab61aebf20966..de39c29bf2875c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -623,7 +623,7 @@ Steve Sharp Victor Widell Evan Rutledge Borden Johnny Ray -Steve Mao +Steve Mao Stiliyan Lazarov Wang Xinyong Ray Donnelly @@ -782,7 +782,7 @@ Chad Johnston Sam Stites Matthew Lye Matt Loring -P.S.V.R +Minqi Pan Jacob Edelman Mike Atkins hackerjs <4141095@qq.com> @@ -831,7 +831,7 @@ Claudio Rodriguez Ido Ben-Yair Kyle Smith Marti Martz -Stefan Budeanu +Stefan Budeanu Emily Aviva Kapor-Mater Sam P Gallagher-Bishop David Woods @@ -868,5 +868,122 @@ Super Zheng Rafał Pocztarski Michael Ruddy Andy Bettisworth +Jörg Krause +Alexander Martin +Prince J Wesley +janriemer +Arthur Gautier +Martin von Gagern +Hideki Yamamura +Lenny Markus +Nelson Pecora +Graham Fairweather +Nicholas Young +chrisjohn404 +Bo Borgerson +Mudit Ameta +Adri Van Houdt +Max Barinov +Damian Schenkelman +iamchenxin +Nik Nyby +Ben Ripkens +Ryan Sobol +jona +Martin Bark +José F. Romaniello +Richard Sun +Sequoia McDowell +zoubin +Robert Jefe Lindstaedt +Saquib +Daniel Sellers +Julien Waechter +Vitor Cortez +Michael Theriot +Peter Geiss +Richard Lau +José Moreira +Tom Atkinson +Glen Arrowsmith +Jeff Harris +Alexander Makarenko +Drew Folta +Myles Borins +Dmitriy Lazarev +Adam Langley +Kári Tristan Helgason +Manuel Valls +Prayag Verma +Gibson Fahnestock +Alan Cohen +Christophe Naud-Dulude +Matthias Bastian +Phillip Kovalev +Rainer Oviir +HUANG Wei +DC +Daniel Turing +Julie Pagano +Ruben Bridgewater +Felix Becker +Igor Klopov +Tsarevich Dmitry +Ojas Shirekar +Noah Rose +Rafael Cepeda +Chinedu Francis Nwafili +Braydon Fuller +Jiho Choi +Dirceu Pereira Tiegs +Marc Cuva +Chris Dew +Tristan Slominski +Hugo Wood +Owen Smith +Anton Andesen +Aayush Naik +Netto Farah +Craig Akimoto +Michael Barrett +Alexander Marchenko +Robert C Jensen +Vaibhav +Stefano Vozza +Daijiro Wachi +Kirill Fomichev +Mithun Patel +Alexander Penev +Andrea Giammarchi +Lance Ball +Jarrett Widman +Florian Margaine +Wolfgang Steiner +Bill Automata +Robert Chiras +Corey Kosak +John Eversole +Gareth Ellis +Eugene Obrezkov +Kyle Simpson +Bogdan Lobor +Daniel Wang +Mihai Potra +Brendon Pierson +Brad Hill +Mike Kaufman +Igor Kalashnikov +Anna Henningsen +Amery +James Reggio +Joran Dirk Greef +Matthew Douglass +William Kapke +Yuta Hiroto +Ilya Shaisultanov +James Lal +Josh Leder +surya panikkal +vsemozhetbyt # Generated by tools/update-authors.sh diff --git a/BUILDING.md b/BUILDING.md index a4aa0808237c54..e9bf0bc01337f2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -9,7 +9,7 @@ If you consistently can reproduce a test failure, search for it in the file a new issue. -### Unix / Macintosh +### Unix / OS X Prerequisites: @@ -17,8 +17,17 @@ Prerequisites: * `clang` and `clang++` 3.4 or newer * Python 2.6 or 2.7 * GNU Make 3.81 or newer + +On OS X, you will also need: +* [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 FreeBSD and OpenBSD, you may also need: * libexecinfo (FreeBSD and OpenBSD only) + ```text $ ./configure $ make @@ -41,12 +50,37 @@ To run the tests: $ make test ``` +To run the native module tests: + +```text +$ make test-addons +``` + +To run the npm test suite: + +*note: to run the suite on node v4 or earlier you must first* +*run `make install`* + +``` +$ make test-npm +``` + To build the documentation: +This will build Node.js first (if necessary) and then use it to build the docs: + ```text $ make doc ``` +If you have an existing Node.js you can build just the docs with: + +```text +$ NODE=node make doc-only +``` + +(Where `node` is the path to your executable.) + To read the documentation: ```text @@ -108,29 +142,14 @@ $ make ### `Intl` (ECMA-402) support: -[Intl](https://github.com/nodejs/node/wiki/Intl) support is not -enabled by default. - - -#### "small" (English only) support - -This option will build with "small" (English only) support, but -the full `Intl` (ECMA-402) APIs. With `--download=all` it will -download the ICU library as needed. - -##### Unix / Macintosh: +[Intl](https://github.com/nodejs/node/wiki/Intl) support is +enabled by default, with English data only. -```text -$ ./configure --with-intl=small-icu --download=all -``` - -##### Windows: - -```text -> vcbuild small-icu download-all -``` +#### Default: `small-icu` (English only) support -The `small-icu` mode builds with English-only data. You can add full +By default, only English data is included, but +the full `Intl` (ECMA-402) APIs. It does not need to download +any dependencies to function. You can add full data at runtime. *Note:* more docs are on @@ -139,9 +158,10 @@ data at runtime. #### Build with full ICU support (all locales supported by ICU): With the `--download=all`, this may download ICU if you don't have an -ICU in `deps/icu`. +ICU in `deps/icu`. (The embedded `small-icu` included in the default +Node.js source does not include all locales.) -##### Unix / Macintosh: +##### Unix / OS X: ```text $ ./configure --with-intl=full-icu --download=all @@ -155,22 +175,22 @@ $ ./configure --with-intl=full-icu --download=all #### Building without Intl support -The `Intl` object will not be available. This is the default at -present, so this option is not normally needed. +The `Intl` object will not be available, nor some other APIs such as +`String.normalize`. -##### Unix / Macintosh: +##### Unix / OS X: ```text -$ ./configure --with-intl=none +$ ./configure --without-intl ``` ##### Windows: ```text -> vcbuild intl-none +> vcbuild without-intl ``` -#### Use existing installed ICU (Unix / Macintosh only): +#### Use existing installed ICU (Unix / OS X only): ```text $ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu @@ -186,7 +206,7 @@ You can find other ICU releases at Download the file named something like `icu4c-**##.#**-src.tgz` (or `.zip`). -##### Unix / Macintosh +##### Unix / OS X ```text # from an already-unpacked ICU: diff --git a/CHANGELOG.md b/CHANGELOG.md index ccf8db4b7431f3..6abeb5e1294a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10134 +1,1407 @@ -# Node.js ChangeLog +# Node.js Changelog + +To make the changelog easier to both use and manage, it has been split into +multiple files organized according to significant major and minor Node.js +release lines. + +Select a Node.js version below to view the changelog history: + +* [Node.js v6](doc/changelogs/CHANGELOG_V6.md) +* [Node.js v5](doc/changelogs/CHANGELOG_V5.md) +* [Node.js v4](doc/changelogs/CHANGELOG_V4.md) +* [Node.js v0.12](doc/changelogs/CHANGELOG_V012.md) +* [Node.js v0.10](doc/changelogs/CHANGELOG_V010.md) +* [io.js](doc/changelogs/CHANGELOG_IOJS.md) and [Archive](doc/changelogs/CHANGELOG_ARCHIVE.md) + +Please use the following table to find the changelog for a specific Node.js +release. + + + + + + + + + + + + + + + + + +
v6Current + v5v4LTSv0.12LTSv0.10LTS
+6.2.1
+6.2.0
+6.1.0
+6.0.0
+
+5.11.1
+5.11.0
+5.10.1
+5.10.0
+5.9.1
+5.9.0
+5.8.0
+5.7.1
+5.7.0
+5.6.0
+5.5.0
+5.4.1
+5.4.0
+5.3.0
+5.2.0
+5.1.1
+5.1.0
+5.0.0
+
+4.4.4
+4.4.3
+4.4.2
+4.4.1
+4.4.0
+4.3.2
+4.3.1
+4.3.0
+4.2.6
+4.2.5
+4.2.4
+4.2.3
+4.2.2
+4.2.1
+4.2.0
+4.1.2
+4.1.1
+4.1.0
+4.0.0
+
+0.12.14
+0.12.13
+0.12.12
+0.12.11
+0.12.10
+0.12.9
+0.12.8
+0.12.7
+0.12.6
+0.12.5
+0.12.4
+0.12.3
+0.12.2
+0.12.1
+0.12.0
+
+0.10.45
+0.10.44
+0.10.43
+0.10.42
+0.10.41
+0.10.40
+0.10.39
+0.10.38
+0.10.37
+0.10.36
+0.10.35
+0.10.34
+0.10.33
+0.10.32
+0.10.31
+0.10.30
+0.10.29
+0.10.28
+0.10.27
+
+0.10.26
+0.10.25
+0.10.24
+0.10.23
+0.10.22
+0.10.21
+0.10.20
+0.10.19
+0.10.18
+0.10.17
+0.10.16
+0.10.15
+0.10.14
+0.10.13
+0.10.12
+0.10.11
+0.10.10
+0.10.9
+
+0.10.8
+0.10.7
+0.10.6
+0.10.5
+0.10.4
+0.10.3
+0.10.2
+0.10.1
+0.10.0
+
+ +### Notes + +* Release streams marked with `LTS` are currently covered by the + [Node.js Long Term Support plan](https://github.com/nodejs/LTS). +* Release versions displayed in **bold** text represent the most + recent actively supported release. + +---- +---- + +## 2016-05-06, Version 0.12.14 (Maintenance), @rvagg + +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.14. + +## 2016-05-06, Version 0.10.45 (Maintenance), @rvagg + +Moved to doc/changelogs/CHANGELOG_V010.md#0.10.45. + +## 2016-05-05, Version 6.1.0 (Current), @Fishrock123 + +Moved to doc/changelogs/CHANGELOG_V6.md#6.1.0. + +## 2016-05-05, Version 5.11.1 (Stable), @evanlucas + +Moved to doc/changelogs/CHANGELOG_V5.md#5.11.1. + +## 2016-05-05, Version 4.4.4 'Argon' (LTS), @thealphanerd + +Moved to doc/changelogs/CHANGELOG_V4.md#4.4.4. + +## 2016-04-26, Version 6.0.0 (Current), @jasnell + +Moved to doc/changelogs/CHANGELOG_V6.md#6.0.0. + +## 2016-04-20, Version 5.11.0 (Stable), @thealphanerd + +Moved to doc/changelogs/CHANGELOG_V5.md#5.11.0. ## 2016-04-05, Version 5.10.1 (Stable), @thealphanerd -### Notable changes - -**http**: - * Enclose IPv6 Host header in square brackets. This will enable proper seperation of the host adress from any port reference (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) - -**path**: - * Make win32.isAbsolute more consistent (Brian White) [#6028](https://github.com/nodejs/node/pull/6028) - -### Commits - -* [[`0f5a51ae4b`](https://github.com/nodejs/node/commit/0f5a51ae4b)] - **assert**: Check typed array view type in deepEqual (Anna Henningsen) [#5910](https://github.com/nodejs/node/pull/5910) -* [[`e966d1f5db`](https://github.com/nodejs/node/commit/e966d1f5db)] - **buffer**: don't set `kNoZeroFill` flag in allocUnsafe (Vladimir Kurchatkin) [#6007](https://github.com/nodejs/node/pull/6007) -* [[`3f75751c2e`](https://github.com/nodejs/node/commit/3f75751c2e)] - **build**: introduce ci targets for lint/benchmark (Johan Bergström) [#5921](https://github.com/nodejs/node/pull/5921) -* [[`781290b61d`](https://github.com/nodejs/node/commit/781290b61d)] - **doc**: refine child_process detach behaviour (Robert Jefe Lindstaedt) [#5330](https://github.com/nodejs/node/pull/5330) -* [[`aa9fb03202`](https://github.com/nodejs/node/commit/aa9fb03202)] - **doc**: use HTTPS for links where possible (Rich Trott) [#6019](https://github.com/nodejs/node/pull/6019) -* [[`dd25984838`](https://github.com/nodejs/node/commit/dd25984838)] - **doc**: note assert.throws() pitfall (Rich Trott) [#6029](https://github.com/nodejs/node/pull/6029) -* [[`f879f5e68a`](https://github.com/nodejs/node/commit/f879f5e68a)] - **doc**: document unspecified behavior for buf.write* methods (James M Snell) [#5925](https://github.com/nodejs/node/pull/5925) -* [[`f12c3861e0`](https://github.com/nodejs/node/commit/f12c3861e0)] - **doc**: clarify stdout/stderr arguments to callback (James M Snell) [#6015](https://github.com/nodejs/node/pull/6015) -* [[`ce173716be`](https://github.com/nodejs/node/commit/ce173716be)] - **doc**: add 'Command Line Options' to 'View on single page' (firedfox) [#6011](https://github.com/nodejs/node/pull/6011) -* [[`7337ef6422`](https://github.com/nodejs/node/commit/7337ef6422)] - **doc**: minor argument formatting in stream.markdown (James M Snell) [#6016](https://github.com/nodejs/node/pull/6016) -* [[`0ae5d027c6`](https://github.com/nodejs/node/commit/0ae5d027c6)] - **doc**: clarify that __dirname is module local (James M Snell) [#6018](https://github.com/nodejs/node/pull/6018) -* [[`8bec8aa41f`](https://github.com/nodejs/node/commit/8bec8aa41f)] - **doc**: consolidate timers docs in timers.markdown (Bryan English) [#5837](https://github.com/nodejs/node/pull/5837) -* [[`0a13099c42`](https://github.com/nodejs/node/commit/0a13099c42)] - **etw**: add event messages (João Reis) [#5936](https://github.com/nodejs/node/pull/5936) -* [[`c6ac6f2ea1`](https://github.com/nodejs/node/commit/c6ac6f2ea1)] - **http**: Corrects IPv6 address in Host header (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) -* [[`8317778925`](https://github.com/nodejs/node/commit/8317778925)] - **meta**: add "joining a wg" section to WORKING_GROUPS.md (Matteo Collina) [#5488](https://github.com/nodejs/node/pull/5488) -* [[`f3f19ee5e2`](https://github.com/nodejs/node/commit/f3f19ee5e2)] - **net**: refactor self=this to arrow functions (Benjamin Gruenbaum) [#5857](https://github.com/nodejs/node/pull/5857) -* [[`1c4007927d`](https://github.com/nodejs/node/commit/1c4007927d)] - **path**: fix win32.isAbsolute() inconsistency (Brian White) [#6028](https://github.com/nodejs/node/pull/6028) -* [[`059b607a4f`](https://github.com/nodejs/node/commit/059b607a4f)] - **test**: make use of globals explicit (Rich Trott) [#6014](https://github.com/nodejs/node/pull/6014) -* [[`cc8fcc5a07`](https://github.com/nodejs/node/commit/cc8fcc5a07)] - **test**: be explicit about polluting of `global` (Rich Trott) [#6017](https://github.com/nodejs/node/pull/6017) -* [[`7db7a820b9`](https://github.com/nodejs/node/commit/7db7a820b9)] - **test**: make arch available in status files (Santiago Gimeno) [#5997](https://github.com/nodejs/node/pull/5997) -* [[`02f2ebd9b4`](https://github.com/nodejs/node/commit/02f2ebd9b4)] - **test**: explicitly set global in test-repl (Rich Trott) [#6026](https://github.com/nodejs/node/pull/6026) -* [[`2ab1237137`](https://github.com/nodejs/node/commit/2ab1237137)] - **test**: fix flaky test-net-socket-timeout-unref (Rich Trott) [#6003](https://github.com/nodejs/node/pull/6003) -* [[`0127c2bd39`](https://github.com/nodejs/node/commit/0127c2bd39)] - **test**: fix test-dns.js flakiness (Rich Trott) [#5996](https://github.com/nodejs/node/pull/5996) -* [[`6052ced37f`](https://github.com/nodejs/node/commit/6052ced37f)] - **test**: fix error message checks in test-module-loading (James M Snell) [#5986](https://github.com/nodejs/node/pull/5986) -* [[`a40b0cb673`](https://github.com/nodejs/node/commit/a40b0cb673)] - **test**: refactor http-end-throw-socket-handling (Santiago Gimeno) [#5676](https://github.com/nodejs/node/pull/5676) -* [[`96bb315262`](https://github.com/nodejs/node/commit/96bb315262)] - **test**: ensure _handle property existence (Rich Trott) [#5916](https://github.com/nodejs/node/pull/5916) -* [[`4f1fa2adeb`](https://github.com/nodejs/node/commit/4f1fa2adeb)] - **test**: fix offending max-len linter error (Sakthipriyan Vairamani) [#5980](https://github.com/nodejs/node/pull/5980) -* [[`f14d71ccea`](https://github.com/nodejs/node/commit/f14d71ccea)] - **test**: stdin is not always a net.Socket (Jeremiah Senkpiel) [#5935](https://github.com/nodejs/node/pull/5935) -* [[`50a062e691`](https://github.com/nodejs/node/commit/50a062e691)] - **tools**: remove obsolete lint config file (Rich Trott) [#5959](https://github.com/nodejs/node/pull/5959) -* [[`7491fdcfe9`](https://github.com/nodejs/node/commit/7491fdcfe9)] - **tools**: remove disabling of already-disabled rule (Rich Trott) [#6013](https://github.com/nodejs/node/pull/6013) +Moved to doc/changelogs/CHANGELOG_V5.md#5.10.1. ## 2016-03-31, Version 0.10.44 (Maintenance), @rvagg -### Notable changes - -* npm: Upgrade to v2.15.1. Fixes a security flaw in the use of authentication tokens in HTTP requests that would allow an attacker to set up a server that could collect tokens from users of the command-line interface. Authentication tokens have previously been sent with every request made by the CLI for logged-in users, regardless of the destination of the request. This update fixes this by only including those tokens for requests made against the registry or registries used for the current install. IMPORTANT: This is a major upgrade to npm v2 LTS from the previously deprecated npm v1. (Forrest L Norvell) https://github.com/nodejs/node/pull/5967 -* openssl: OpenSSL v1.0.1s disables the EXPORT and LOW ciphers as they are obsolete and not considered safe. This release of Node.js turns on `OPENSSL_NO_WEAK_SSL_CIPHERS` to fully disable the 27 ciphers included in these lists which can be used in SSLv3 and higher. Full details can be found in our LTS discussion on the matter (https://github.com/nodejs/LTS/issues/85). (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 - -### Commits - -* [feceb77d7e] - deps: upgrade npm in LTS to 2.15.1 (Forrest L Norvell) https://github.com/nodejs/node/pull/5968 -* [0847954331] - deps: Disable EXPORT and LOW ciphers in openssl (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 -* [6bb86e727a] - test: change tls tests not to use LOW cipher (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 -* [905bec29ad] - win,build: support Visual C++ Build Tools 2015 (João Reis) https://github.com/nodejs/node/pull/5627 +Moved to doc/changelogs/CHANGELOG_V010.md#0.10.44. ## 2016-03-31, Version 5.10.0 (Stable), @evanlucas -### Notable changes - -* **buffer**: - * make byteLength work with ArrayBuffer & DataView (Jackson Tian) [#5255](https://github.com/nodejs/node/pull/5255) - * backport --zero-fill-buffers command line option (James M Snell) [#5744](https://github.com/nodejs/node/pull/5744) - * backport new buffer constructor APIs (James M Snell) [#5763](https://github.com/nodejs/node/pull/5763) - * add swap16() and swap32() methods (James M Snell) [#5724](https://github.com/nodejs/node/pull/5724) -* **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) -* **net**: emit host in lookup event (HUANG Wei) [#5598](https://github.com/nodejs/node/pull/5598) -* **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853) -* **npm**: Upgrade to v3.8.3. Fixes a security flaw in the use of authentication tokens in HTTP requests that - would allow an attacker to set up a server that could collect tokens from users of the command-line interface. - Authentication tokens have previously been sent with every request made by the CLI for logged-in users, - regardless of the destination of the request. This update fixes this by only including those tokens for requests - made against the registry or registries used for the current install. (Forrest L Norvell) [npm/node#6](https://github.com/npm/node/pull/6) -* **repl**: support standalone blocks (Prince J Wesley) [#5581](https://github.com/nodejs/node/pull/5581) -* **src**: override v8 thread defaults using cli options (Tom Gallacher) [#4344](https://github.com/nodejs/node/pull/4344) - -### Commits - -* [[`2cbbaafca9`](https://github.com/nodejs/node/commit/2cbbaafca9)] - **async_wrap**: don't abort on callback exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) -* [[`6f16882733`](https://github.com/nodejs/node/commit/6f16882733)] - **async_wrap**: notify post if intercepted exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) -* [[`a4856122d3`](https://github.com/nodejs/node/commit/a4856122d3)] - **async_wrap**: setupHooks now accepts object (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) -* [[`ee83c956c5`](https://github.com/nodejs/node/commit/ee83c956c5)] - **(SEMVER-MINOR)** **buffer**: make byteLength work with ArrayBuffer & DataView (Jackson Tian) [#5255](https://github.com/nodejs/node/pull/5255) -* [[`1f8e4b54ce`](https://github.com/nodejs/node/commit/1f8e4b54ce)] - **(SEMVER-MINOR)** **buffer**: add swap16() and swap32() methods (James M Snell) [#5724](https://github.com/nodejs/node/pull/5724) -* [[`bdf933bece`](https://github.com/nodejs/node/commit/bdf933bece)] - **buffer**: changing let in for loops back to var (Gareth Ellis) [#5819](https://github.com/nodejs/node/pull/5819) -* [[`c1534e7eaf`](https://github.com/nodejs/node/commit/c1534e7eaf)] - **(SEMVER-MINOR)** **buffer**: backport new buffer constructor APIs (James M Snell) [#5763](https://github.com/nodejs/node/pull/5763) -* [[`3c02727055`](https://github.com/nodejs/node/commit/3c02727055)] - **(SEMVER-MINOR)** **buffer**: backport --zero-fill-buffers command line option (James M Snell) [#5744](https://github.com/nodejs/node/pull/5744) -* [[`58b5c1e19f`](https://github.com/nodejs/node/commit/58b5c1e19f)] - **build**: add suport for x86 architecture (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) -* [[`389f5a85e6`](https://github.com/nodejs/node/commit/389f5a85e6)] - **build**: add script to create Android .mk files (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) -* [[`5ee5fa292f`](https://github.com/nodejs/node/commit/5ee5fa292f)] - **build**: add missing `openssl_fips%` to common.gypi (Fedor Indutny) [#5919](https://github.com/nodejs/node/pull/5919) -* [[`5681ffecf7`](https://github.com/nodejs/node/commit/5681ffecf7)] - **build**: enable compilation for linuxOne (Michael Dawson) [#5941](https://github.com/nodejs/node/pull/5941) -* [[`660ec9f889`](https://github.com/nodejs/node/commit/660ec9f889)] - **child_process**: refactor self=this in socket_list (Benjamin Gruenbaum) [#5860](https://github.com/nodejs/node/pull/5860) -* [[`e1a012f277`](https://github.com/nodejs/node/commit/e1a012f277)] - **deps**: upgrade npm to 3.8.3 (Forrest L Norvell) -* [[`ec1813199d`](https://github.com/nodejs/node/commit/ec1813199d)] - **deps**: backport 8d00c2c from v8 upstream (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577) -* [[`2a5c6d7006`](https://github.com/nodejs/node/commit/2a5c6d7006)] - **dns**: Refactor forEach to map (Benjamin Gruenbaum) [#5803](https://github.com/nodejs/node/pull/5803) -* [[`6a6112a2f3`](https://github.com/nodejs/node/commit/6a6112a2f3)] - **dns**: Use object without protoype for map (Benjamin Gruenbaum) [#5843](https://github.com/nodejs/node/pull/5843) -* [[`8fa0b5c1da`](https://github.com/nodejs/node/commit/8fa0b5c1da)] - **doc**: Add @mhdawson back to the CTC (James M Snell) [#5633](https://github.com/nodejs/node/pull/5633) -* [[`858a524325`](https://github.com/nodejs/node/commit/858a524325)] - **doc**: typo: interal->internal. (Corey Kosak) [#5849](https://github.com/nodejs/node/pull/5849) -* [[`5676a35bd9`](https://github.com/nodejs/node/commit/5676a35bd9)] - **doc**: explain path.format expected properties (John Eversole) [#5801](https://github.com/nodejs/node/pull/5801) -* [[`29778393a0`](https://github.com/nodejs/node/commit/29778393a0)] - **doc**: use consistent event name parameter (Benjamin Gruenbaum) [#5850](https://github.com/nodejs/node/pull/5850) -* [[`949b17ff6d`](https://github.com/nodejs/node/commit/949b17ff6d)] - **doc**: fix order of end tags of list after heading (firedfox) [#5874](https://github.com/nodejs/node/pull/5874) -* [[`8e790b7a0c`](https://github.com/nodejs/node/commit/8e790b7a0c)] - **doc**: add instructions to only sign a release (Jeremiah Senkpiel) [#5876](https://github.com/nodejs/node/pull/5876) -* [[`f1f9aff855`](https://github.com/nodejs/node/commit/f1f9aff855)] - **doc**: fix doc for Buffer.readInt32LE() (ghaiklor) [#5890](https://github.com/nodejs/node/pull/5890) -* [[`731f7b8055`](https://github.com/nodejs/node/commit/731f7b8055)] - **etw**: fix descriptors of events 9 and 23 (João Reis) [#5742](https://github.com/nodejs/node/pull/5742) -* [[`aac9ead379`](https://github.com/nodejs/node/commit/aac9ead379)] - **etw,build**: always generate .rc and .h files (João Reis) [#5657](https://github.com/nodejs/node/pull/5657) -* [[`80155d398c`](https://github.com/nodejs/node/commit/80155d398c)] - **(SEMVER-MINOR)** **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) -* [[`ae15d68ad1`](https://github.com/nodejs/node/commit/ae15d68ad1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879) -* [[`63c601bc15`](https://github.com/nodejs/node/commit/63c601bc15)] - **http**: speed up checkIsHttpToken (Jackson Tian) [#4790](https://github.com/nodejs/node/pull/4790) -* [[`40847b0b8b`](https://github.com/nodejs/node/commit/40847b0b8b)] - **lib**: rename /node.js to /bootstrap_node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) -* [[`e644eb3d69`](https://github.com/nodejs/node/commit/e644eb3d69)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753) -* [[`a757e0583c`](https://github.com/nodejs/node/commit/a757e0583c)] - **lib,src**: move src/node.js to lib/internal/node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) -* [[`e3c7b46326`](https://github.com/nodejs/node/commit/e3c7b46326)] - **lib,src**: refactor src/node.js into internal files (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) -* [[`b07bc5d996`](https://github.com/nodejs/node/commit/b07bc5d996)] - **(SEMVER-MINOR)** **net**: emit host in lookup event (HUANG Wei) [#5598](https://github.com/nodejs/node/pull/5598) -* [[`2fa959be15`](https://github.com/nodejs/node/commit/2fa959be15)] - **(SEMVER-MINOR)** **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853) -* [[`a2ad21645f`](https://github.com/nodejs/node/commit/a2ad21645f)] - **querystring**: don't stringify bad surrogate pair (Brian White) [#5858](https://github.com/nodejs/node/pull/5858) -* [[`427173204e`](https://github.com/nodejs/node/commit/427173204e)] - **(SEMVER-MINOR)** **repl**: support standalone blocks (Prince J Wesley) [#5581](https://github.com/nodejs/node/pull/5581) -* [[`d044898495`](https://github.com/nodejs/node/commit/d044898495)] - **src**: Add missing `using v8::MaybeLocal` (Anna Henningsen) [#5974](https://github.com/nodejs/node/pull/5974) -* [[`0d0c57ff5e`](https://github.com/nodejs/node/commit/0d0c57ff5e)] - **(SEMVER-MINOR)** **src**: override v8 thread defaults using cli options (Tom Gallacher) [#4344](https://github.com/nodejs/node/pull/4344) -* [[`f9d0166291`](https://github.com/nodejs/node/commit/f9d0166291)] - **src**: reword command and add ternary (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) -* [[`f1488bb24c`](https://github.com/nodejs/node/commit/f1488bb24c)] - **src,http_parser**: remove KickNextTick call (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) -* [[`8e8768ecbb`](https://github.com/nodejs/node/commit/8e8768ecbb)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920) -* [[`bf94b5a1b9`](https://github.com/nodejs/node/commit/bf94b5a1b9)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939) -* [[`2192528326`](https://github.com/nodejs/node/commit/2192528326)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914) -* [[`aebe6245b7`](https://github.com/nodejs/node/commit/aebe6245b7)] - **test**: add test for piping large input from stdin (Anna Henningsen) [#5949](https://github.com/nodejs/node/pull/5949) -* [[`a19de97d2f`](https://github.com/nodejs/node/commit/a19de97d2f)] - **test**: remove the use of curl in the test suite (Santiago Gimeno) [#5750](https://github.com/nodejs/node/pull/5750) -* [[`6928a17aa3`](https://github.com/nodejs/node/commit/6928a17aa3)] - **test**: exclude new fs watch test for AIX (Michael Dawson) [#5937](https://github.com/nodejs/node/pull/5937) -* [[`3238bff3b3`](https://github.com/nodejs/node/commit/3238bff3b3)] - **test**: confirm globals not used internally (Rich Trott) [#5882](https://github.com/nodejs/node/pull/5882) -* [[`a41fd93f68`](https://github.com/nodejs/node/commit/a41fd93f68)] - **test**: fix flaky test-net-socket-timeout (Brian White) [#5902](https://github.com/nodejs/node/pull/5902) -* [[`82a50d3def`](https://github.com/nodejs/node/commit/82a50d3def)] - **test**: move dns test to test/internet (Ben Noordhuis) [#5905](https://github.com/nodejs/node/pull/5905) -* [[`fb0c5bcac2`](https://github.com/nodejs/node/commit/fb0c5bcac2)] - **test**: fix flaky test-http-set-timeout (Rich Trott) [#5856](https://github.com/nodejs/node/pull/5856) -* [[`8344a522a8`](https://github.com/nodejs/node/commit/8344a522a8)] - **test**: fix test-debugger-client.js (Rich Trott) [#5851](https://github.com/nodejs/node/pull/5851) -* [[`7ec5397954`](https://github.com/nodejs/node/commit/7ec5397954)] - **timers**: fixing API refs to use safe internal refs (Kyle Simpson) [#5882](https://github.com/nodejs/node/pull/5882) -* [[`cb676cf3e7`](https://github.com/nodejs/node/commit/cb676cf3e7)] - **tools**: fix json doc generation (firedfox) [#5943](https://github.com/nodejs/node/pull/5943) -* [[`77bed269ad`](https://github.com/nodejs/node/commit/77bed269ad)] - **win,build**: build and test add-ons on test-ci (Bogdan Lobor) [#5886](https://github.com/nodejs/node/pull/5886) -* [[`afcd276ecc`](https://github.com/nodejs/node/commit/afcd276ecc)] - **zlib**: Fix handling of gzip magic bytes mid-file (Anna Henningsen) [#5863](https://github.com/nodejs/node/pull/5863) +Moved to doc/changelogs/CHANGELOG_V5.md#5.10.0. ## 2016-03-31, Version 4.4.2 'Argon' (LTS), @thealphanerd -### Notable Changes - -* **https**: - - Under certain conditions ssl sockets may have been causing a memory leak when keepalive is enabled. This is no longer the case. (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) -* **lib**: - - The way that we were internally passing arguments was causing a potential leak. By copying the arguments into an array we can avoid this. (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) -* **npm**: - - Upgrade to v2.15.1. Fixes a security flaw in the use of authentication tokens in HTTP requests that would allow an attacker to set up a server that could collect tokens from users of the command-line interface. Authentication tokens have previously been sent with every request made by the CLI for logged-in users, regardless of the destination of the request. This update fixes this by only including those tokens for requests made against the registry or registries used for the current install. (Forrest L Norvell) -* **repl**: - - Previously if you were using the repl in strict mode the column number would be wrong in a stack trace. This is no longer an issue. (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) - -### Commits - -* [[`96e163a79f`](https://github.com/nodejs/node/commit/96e163a79f)] - **buffer**: changing let in for loops back to var (Gareth Ellis) [#5819](https://github.com/nodejs/node/pull/5819) -* [[`0c6f6742f2`](https://github.com/nodejs/node/commit/0c6f6742f2)] - **console**: check that stderr is writable (Rich Trott) [#5635](https://github.com/nodejs/node/pull/5635) -* [[`55c3f804c4`](https://github.com/nodejs/node/commit/55c3f804c4)] - **deps**: upgrade npm in LTS to 2.15.1 (Forrest L Norvell) -* [[`1d0e4a987d`](https://github.com/nodejs/node/commit/1d0e4a987d)] - **deps**: remove unused openssl files (Ben Noordhuis) [#5619](https://github.com/nodejs/node/pull/5619) -* [[`d55599f4d8`](https://github.com/nodejs/node/commit/d55599f4d8)] - **dns**: use template literals (Benjamin Gruenbaum) [#5809](https://github.com/nodejs/node/pull/5809) -* [[`42bbdc9dd1`](https://github.com/nodejs/node/commit/42bbdc9dd1)] - **doc** Add @mhdawson back to the CTC (James M Snell) [#5633](https://github.com/nodejs/node/pull/5633) -* [[`8d86d232e7`](https://github.com/nodejs/node/commit/8d86d232e7)] - **doc**: typo: interal->internal. (Corey Kosak) [#5849](https://github.com/nodejs/node/pull/5849) -* [[`60ddab841e`](https://github.com/nodejs/node/commit/60ddab841e)] - **doc**: add instructions to only sign a release (Jeremiah Senkpiel) [#5876](https://github.com/nodejs/node/pull/5876) -* [[`040263e0f3`](https://github.com/nodejs/node/commit/040263e0f3)] - **doc**: grammar, clarity and links in timers doc (Bryan English) [#5792](https://github.com/nodejs/node/pull/5792) -* [[`8c24bd25a6`](https://github.com/nodejs/node/commit/8c24bd25a6)] - **doc**: fix order of end tags of list after heading (firedfox) [#5874](https://github.com/nodejs/node/pull/5874) -* [[`7c837028da`](https://github.com/nodejs/node/commit/7c837028da)] - **doc**: use consistent event name parameter (Benjamin Gruenbaum) [#5850](https://github.com/nodejs/node/pull/5850) -* [[`20faf9097d`](https://github.com/nodejs/node/commit/20faf9097d)] - **doc**: explain error message on missing main file (Wolfgang Steiner) [#5812](https://github.com/nodejs/node/pull/5812) -* [[`79d26ae196`](https://github.com/nodejs/node/commit/79d26ae196)] - **doc**: explain path.format expected properties (John Eversole) [#5801](https://github.com/nodejs/node/pull/5801) -* [[`e43e8e3a31`](https://github.com/nodejs/node/commit/e43e8e3a31)] - **doc**: add a cli options doc page (Jeremiah Senkpiel) [#5787](https://github.com/nodejs/node/pull/5787) -* [[`c0a24e4a1d`](https://github.com/nodejs/node/commit/c0a24e4a1d)] - **doc**: fix multiline return comments in querystring (Claudio Rodriguez) [#5705](https://github.com/nodejs/node/pull/5705) -* [[`bf1fe4693c`](https://github.com/nodejs/node/commit/bf1fe4693c)] - **doc**: Add windows example for Path.format (Mithun Patel) [#5700](https://github.com/nodejs/node/pull/5700) -* [[`3b8fc4fddc`](https://github.com/nodejs/node/commit/3b8fc4fddc)] - **doc**: update crypto docs to use good defaults (Bill Automata) [#5505](https://github.com/nodejs/node/pull/5505) -* [[`a6ec8a6cb7`](https://github.com/nodejs/node/commit/a6ec8a6cb7)] - **doc**: fix crypto update() signatures (Brian White) [#5500](https://github.com/nodejs/node/pull/5500) -* [[`eb0ed46665`](https://github.com/nodejs/node/commit/eb0ed46665)] - **doc**: reformat & improve node.1 manual page (Jeremiah Senkpiel) [#5497](https://github.com/nodejs/node/pull/5497) -* [[`b70ca4a4b4`](https://github.com/nodejs/node/commit/b70ca4a4b4)] - **doc**: updated fs #5862 removed irrelevant data in fs.markdown (topal) [#5877](https://github.com/nodejs/node/pull/5877) -* [[`81876612f7`](https://github.com/nodejs/node/commit/81876612f7)] - **https**: fix ssl socket leak when keepalive is used (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) -* [[`6daebdbd9b`](https://github.com/nodejs/node/commit/6daebdbd9b)] - **lib**: simplify code with String.prototype.repeat() (Jackson Tian) [#5359](https://github.com/nodejs/node/pull/5359) -* [[`108fc90dd7`](https://github.com/nodejs/node/commit/108fc90dd7)] - **lib**: reduce usage of `self = this` (Jackson Tian) [#5231](https://github.com/nodejs/node/pull/5231) -* [[`3c8e59c396`](https://github.com/nodejs/node/commit/3c8e59c396)] - **lib**: copy arguments object instead of leaking it (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) -* [[`8648420586`](https://github.com/nodejs/node/commit/8648420586)] - **net**: make `isIPv4` and `isIPv6` more efficient (Vladimir Kurchatkin) [#5478](https://github.com/nodejs/node/pull/5478) -* [[`07b7172d76`](https://github.com/nodejs/node/commit/07b7172d76)] - **net**: remove unused `var self = this` from old code (Benjamin Gruenbaum) [#5224](https://github.com/nodejs/node/pull/5224) -* [[`acbce4b72b`](https://github.com/nodejs/node/commit/acbce4b72b)] - **repl**: fix stack trace column number in strict mode (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) -* [[`0a1eb168e0`](https://github.com/nodejs/node/commit/0a1eb168e0)] - **test**: fix `test-cluster-worker-kill` (Santiago Gimeno) [#5814](https://github.com/nodejs/node/pull/5814) -* [[`86b876fe7b`](https://github.com/nodejs/node/commit/86b876fe7b)] - **test**: smaller chunk size for smaller person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) -* [[`1135ee97e7`](https://github.com/nodejs/node/commit/1135ee97e7)] - **test**: strip non-free icc profile from person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) -* [[`0836d7e2fb`](https://github.com/nodejs/node/commit/0836d7e2fb)] - **test**: fix flaky test-cluster-shared-leak (Claudio Rodriguez) [#5802](https://github.com/nodejs/node/pull/5802) -* [[`e57355c2f4`](https://github.com/nodejs/node/commit/e57355c2f4)] - **test**: make test-net-connect-options-ipv6.js better (Michael Dawson) [#5791](https://github.com/nodejs/node/pull/5791) -* [[`1b266fc15c`](https://github.com/nodejs/node/commit/1b266fc15c)] - **test**: remove the use of curl in the test suite (Santiago Gimeno) [#5750](https://github.com/nodejs/node/pull/5750) -* [[`7e45d4f076`](https://github.com/nodejs/node/commit/7e45d4f076)] - **test**: minimize test-http-get-pipeline-problem (Rich Trott) [#5728](https://github.com/nodejs/node/pull/5728) -* [[`78effc3484`](https://github.com/nodejs/node/commit/78effc3484)] - **test**: add batch of known issue tests (cjihrig) [#5653](https://github.com/nodejs/node/pull/5653) -* [[`d506eea4b7`](https://github.com/nodejs/node/commit/d506eea4b7)] - **test**: improve test-npm-install (Santiago Gimeno) [#5613](https://github.com/nodejs/node/pull/5613) -* [[`7520100e8b`](https://github.com/nodejs/node/commit/7520100e8b)] - **test**: add test-npm-install to parallel tests suite (Myles Borins) [#5166](https://github.com/nodejs/node/pull/5166) -* [[`b258dddb8c`](https://github.com/nodejs/node/commit/b258dddb8c)] - **test**: repl tab completion test (Santiago Gimeno) [#5534](https://github.com/nodejs/node/pull/5534) -* [[`f209effe8b`](https://github.com/nodejs/node/commit/f209effe8b)] - **test**: remove timer from test-http-1.0 (Santiago Gimeno) [#5129](https://github.com/nodejs/node/pull/5129) -* [[`3a901b0e3e`](https://github.com/nodejs/node/commit/3a901b0e3e)] - **tools**: remove unused imports (Sakthipriyan Vairamani) [#5765](https://github.com/nodejs/node/pull/5765) +Moved to doc/changelogs/CHANGELOG_V4.md#4.4.2. ## 2016-03-31, Version 0.12.13 (LTS), @rvagg -### Notable changes - -* npm: Upgrade to v2.15.1. (Forrest L Norvell) -* openssl: OpenSSL v1.0.1s disables the EXPORT and LOW ciphers as they are obsolete and not considered safe. This release of Node.js turns on `OPENSSL_NO_WEAK_SSL_CIPHERS` to fully disable the 27 ciphers included in these lists which can be used in SSLv3 and higher. Full details can be found in our LTS discussion on the matter (https://github.com/nodejs/LTS/issues/85). (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 - -### Commits - -* [4041ea6bc5] - deps: upgrade npm in LTS to 2.15.1 (Forrest L Norvell) -* [a115779026] - deps: Disable EXPORT and LOW ciphers in openssl (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 -* [ab907eb5a8] - test: skip cluster-disconnect-race on Windows (Gibson Fahnestock) https://github.com/nodejs/node/pull/5621 -* [9c06db7444] - test: change tls tests not to use LOW cipher (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5712 -* [154098a3dc] - test: bp fix for test-http-get-pipeline-problem.js (Michael Dawson) https://github.com/nodejs/node/pull/3013 -* [ff2bed6e86] - win,build: support Visual C++ Build Tools 2015 (João Reis) https://github.com/nodejs/node/pull/5627 +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.13. ## 2016-03-23, Version 5.9.1 (Stable), @Fishrock123 -### Notable changes - -* **buffer**: Now properly throws `RangeError`s on out-of-bounds writes (Matt Loring) [#5605](https://github.com/nodejs/node/pull/5605). - - This effects `write{Float|Double}` when the `noAssert` option is not used. -* **timers**: - - Returned timeout objects now have a `Timeout` constructor name (Jeremiah Senkpiel) [#5793](https://github.com/nodejs/node/pull/5793). - - Performance of `Immediate` processing is now ~20-40% faster (Brian White) [#4169](https://github.com/nodejs/node/pull/4169). -* **vm**: Fixed a contextify regression introduced in v5.9.0 (Ali Ijaz Sheikh) [#5800](https://github.com/nodejs/node/pull/5800). - -### Commits - -* [[`341b3d01c8`](https://github.com/nodejs/node/commit/341b3d01c8)] - **benchmark**: fix linting errors (Rich Trott) [#5840](https://github.com/nodejs/node/pull/5840) -* [[`72fb796bed`](https://github.com/nodejs/node/commit/72fb796bed)] - **buffer**: throw range error before truncating write (Matt Loring) [#5605](https://github.com/nodejs/node/pull/5605) -* [[`c5d83695e1`](https://github.com/nodejs/node/commit/c5d83695e1)] - **contextify**: tie lifetimes of context & sandbox (Ali Ijaz Sheikh) [#5800](https://github.com/nodejs/node/pull/5800) -* [[`ae24d05451`](https://github.com/nodejs/node/commit/ae24d05451)] - **deps**: remove unused openssl files (Ben Noordhuis) [#5619](https://github.com/nodejs/node/pull/5619) -* [[`54abbe7e6f`](https://github.com/nodejs/node/commit/54abbe7e6f)] - **dns**: use template literals (Benjamin Gruenbaum) [#5809](https://github.com/nodejs/node/pull/5809) -* [[`3fef69bf15`](https://github.com/nodejs/node/commit/3fef69bf15)] - **dns**: use isIp consistently (Benjamin Gruenbaum) [#5804](https://github.com/nodejs/node/pull/5804) -* [[`d2d0fe9d34`](https://github.com/nodejs/node/commit/d2d0fe9d34)] - **doc**: update crypto docs to use good defaults (Bill Automata) [#5505](https://github.com/nodejs/node/pull/5505) -* [[`1631f06477`](https://github.com/nodejs/node/commit/1631f06477)] - **doc**: add CTC meeting minutes 2016-02-10 (Rod Vagg) [#5273](https://github.com/nodejs/node/pull/5273) -* [[`7ab597d646`](https://github.com/nodejs/node/commit/7ab597d646)] - **doc**: add CTC meeting minutes 2016-02-03 (Rod Vagg) [#5272](https://github.com/nodejs/node/pull/5272) -* [[`e20d0b8802`](https://github.com/nodejs/node/commit/e20d0b8802)] - **doc**: explain error message on missing main file (Wolfgang Steiner) [#5812](https://github.com/nodejs/node/pull/5812) -* [[`e99082e32d`](https://github.com/nodejs/node/commit/e99082e32d)] - **doc**: add a cli options doc page (Jeremiah Senkpiel) [#5787](https://github.com/nodejs/node/pull/5787) -* [[`0ffd794b27`](https://github.com/nodejs/node/commit/0ffd794b27)] - **doc**: Add windows example for Path.format (Mithun Patel) [#5700](https://github.com/nodejs/node/pull/5700) -* [[`f53cc37578`](https://github.com/nodejs/node/commit/f53cc37578)] - **doc**: grammar, clarity and links in timers doc (Bryan English) [#5792](https://github.com/nodejs/node/pull/5792) -* [[`3ada8cc09a`](https://github.com/nodejs/node/commit/3ada8cc09a)] - **doc**: align doc/api/tls.markdown with style guide (Stefano Vozza) [#5706](https://github.com/nodejs/node/pull/5706) -* [[`5d28ce3942`](https://github.com/nodejs/node/commit/5d28ce3942)] - **doc**: topic blocking vs non-blocking (Jarrett Widman) [#5326](https://github.com/nodejs/node/pull/5326) -* [[`d9b4e15f75`](https://github.com/nodejs/node/commit/d9b4e15f75)] - **doc**: fix typo in synchronous randomBytes example (Andrea Giammarchi) [#5781](https://github.com/nodejs/node/pull/5781) -* [[`d8318c2226`](https://github.com/nodejs/node/commit/d8318c2226)] - **doc**: fix crypto update() signatures (Brian White) [#5500](https://github.com/nodejs/node/pull/5500) -* [[`15c5662959`](https://github.com/nodejs/node/commit/15c5662959)] - **doc**: fix multiline return comments in querystring (Claudio Rodriguez) [#5705](https://github.com/nodejs/node/pull/5705) -* [[`75f723c0aa`](https://github.com/nodejs/node/commit/75f723c0aa)] - **doc**: fix invalid path doc comments (Rich Trott) [#5670](https://github.com/nodejs/node/pull/5670) -* [[`724b87d75c`](https://github.com/nodejs/node/commit/724b87d75c)] - **doc**: explain path.format() algorithm (Rich Trott) [#5688](https://github.com/nodejs/node/pull/5688) -* [[`89df17ed0b`](https://github.com/nodejs/node/commit/89df17ed0b)] - **doc**: fix return value of write methods (Felix Böhm) [#5736](https://github.com/nodejs/node/pull/5736) -* [[`5ab51ee151`](https://github.com/nodejs/node/commit/5ab51ee151)] - **doc**: reformat & improve node.1 manual page (Jeremiah Senkpiel) [#5497](https://github.com/nodejs/node/pull/5497) -* [[`f34a00cee2`](https://github.com/nodejs/node/commit/f34a00cee2)] - **docs**: fix man pages link if tok type is code (Mithun Patel) [#5721](https://github.com/nodejs/node/pull/5721) -* [[`3bff3111f4`](https://github.com/nodejs/node/commit/3bff3111f4)] - **https**: fix ssl socket leak when keepalive is used (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) -* [[`7b21c09b73`](https://github.com/nodejs/node/commit/7b21c09b73)] - **lib**: simplify code with String.prototype.repeat() (Jackson Tian) [#5359](https://github.com/nodejs/node/pull/5359) -* [[`c75f97f43b`](https://github.com/nodejs/node/commit/c75f97f43b)] - **lib**: reduce usage of `self = this` (Jackson Tian) [#5231](https://github.com/nodejs/node/pull/5231) -* [[`1ccf9b4a56`](https://github.com/nodejs/node/commit/1ccf9b4a56)] - **net**: remove unused `var self = this` from old code (Benjamin Gruenbaum) [#5224](https://github.com/nodejs/node/pull/5224) -* [[`6e5835b8cd`](https://github.com/nodejs/node/commit/6e5835b8cd)] - **path**: refactor path.format() repeated code (Rich Trott) [#5673](https://github.com/nodejs/node/pull/5673) -* [[`15c7b3a127`](https://github.com/nodejs/node/commit/15c7b3a127)] - **src,tools**: use template literals (Rich Trott) [#5778](https://github.com/nodejs/node/pull/5778) -* [[`ca971b0d77`](https://github.com/nodejs/node/commit/ca971b0d77)] - **test**: smaller chunk size for smaller person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) -* [[`f95fc175eb`](https://github.com/nodejs/node/commit/f95fc175eb)] - **test**: strip non-free icc profile from person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) -* [[`7c2c7b0577`](https://github.com/nodejs/node/commit/7c2c7b0577)] - **test**: remove timer from test-http-1.0 (Santiago Gimeno) [#5129](https://github.com/nodejs/node/pull/5129) -* [[`70512e51a4`](https://github.com/nodejs/node/commit/70512e51a4)] - **test**: repl tab completion test (Santiago Gimeno) [#5534](https://github.com/nodejs/node/pull/5534) -* [[`89f091d621`](https://github.com/nodejs/node/commit/89f091d621)] - **test**: make test-net-connect-options-ipv6.js better (Michael Dawson) [#5791](https://github.com/nodejs/node/pull/5791) -* [[`d2fa64490f`](https://github.com/nodejs/node/commit/d2fa64490f)] - **test**: fix `test-cluster-worker-kill` (Santiago Gimeno) [#5814](https://github.com/nodejs/node/pull/5814) -* [[`f0d885a0a9`](https://github.com/nodejs/node/commit/f0d885a0a9)] - **test**: fix flaky test-cluster-shared-leak (Claudio Rodriguez) [#5802](https://github.com/nodejs/node/pull/5802) -* [[`b352cc7db4`](https://github.com/nodejs/node/commit/b352cc7db4)] - **test**: minimize test-http-get-pipeline-problem (Rich Trott) [#5728](https://github.com/nodejs/node/pull/5728) -* [[`21770c3806`](https://github.com/nodejs/node/commit/21770c3806)] - **test**: reduce brittleness of tab complete test (Matt Loring) [#5772](https://github.com/nodejs/node/pull/5772) -* [[`46f0e02620`](https://github.com/nodejs/node/commit/46f0e02620)] - **timers**: fix lint from 4fe02e2 (Jeremiah Senkpiel) [#5825](https://github.com/nodejs/node/pull/5825) -* [[`20a68e9eef`](https://github.com/nodejs/node/commit/20a68e9eef)] - **timers**: give Timeouts a constructor name (Jeremiah Senkpiel) [#5793](https://github.com/nodejs/node/pull/5793) -* [[`d3654d80f3`](https://github.com/nodejs/node/commit/d3654d80f3)] - **timers**: improve setImmediate() performance (Brian White) [#4169](https://github.com/nodejs/node/pull/4169) -* [[`b1a4870200`](https://github.com/nodejs/node/commit/b1a4870200)] - **tools**: remove unused imports (Sakthipriyan Vairamani) [#5765](https://github.com/nodejs/node/pull/5765) +Moved to doc/changelogs/CHANGELOG_V5.md#5.9.1. ## 2016-03-22, Version 4.4.1 'Argon' (LTS), @thealphanerd -This LTS release comes with 113 commits, 56 of which are doc related, -18 of which are build / tooling related, 16 of which are test related -and 7 which are benchmark related. - -### Notable Changes -* **build**: - - Updated Logos for the OSX + Windows installers - - (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) - - (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) - - New option to select your VS Version in the Windows installer - - (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) - - Support Visual C++ Build Tools 2015 - - (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) -* **tools**: - - Gyp now works on OSX without XCode - - (Shigeki Ohtsu) [nodejs/node#1325](https://github.com/nodejs/node/pull/1325) - -### Commits - -* [[`df283f8a03`](https://github.com/nodejs/node/commit/df283f8a03)] - **benchmark**: fix linting issues (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`c901741c60`](https://github.com/nodejs/node/commit/c901741c60)] - **benchmark**: use strict mode (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`4be2065dbc`](https://github.com/nodejs/node/commit/4be2065dbc)] - **benchmark**: refactor to eliminate redeclared vars (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`ddac368533`](https://github.com/nodejs/node/commit/ddac368533)] - **benchmark**: fix lint errors (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`03b20a73b9`](https://github.com/nodejs/node/commit/03b20a73b9)] - **benchmark**: add benchmark for buf.compare() (Rich Trott) [#5441](https://github.com/nodejs/node/pull/5441) -* [[`b816044845`](https://github.com/nodejs/node/commit/b816044845)] - **buffer**: remove duplicated code in fromObject (HUANG Wei) [#4948](https://github.com/nodejs/node/pull/4948) -* [[`067ce9b905`](https://github.com/nodejs/node/commit/067ce9b905)] - **build**: don't install github templates (Johan Bergström) [#5612](https://github.com/nodejs/node/pull/5612) -* [[`a1772dc515`](https://github.com/nodejs/node/commit/a1772dc515)] - **build**: update Node.js logo on OSX installer (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) -* [[`9058fc0383`](https://github.com/nodejs/node/commit/9058fc0383)] - **build**: correctly detect clang version (Stefan Budeanu) [#5553](https://github.com/nodejs/node/pull/5553) -* [[`1165ecc6f7`](https://github.com/nodejs/node/commit/1165ecc6f7)] - **build**: update Node.js logo on Win installer (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) -* [[`4990ddad72`](https://github.com/nodejs/node/commit/4990ddad72)] - **build**: remove --quiet from eslint invocation (firedfox) [#5519](https://github.com/nodejs/node/pull/5519) -* [[`46a5d519dd`](https://github.com/nodejs/node/commit/46a5d519dd)] - **build**: skip msi build if WiX is not found (Tsarevich Dmitry) [#5220](https://github.com/nodejs/node/pull/5220) -* [[`dac4e64491`](https://github.com/nodejs/node/commit/dac4e64491)] - **build**: add option to select VS version (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) -* [[`7a10fd3a56`](https://github.com/nodejs/node/commit/7a10fd3a56)] - **collaborator_guide**: clarify commit message rules (Wyatt Preul) [#5661](https://github.com/nodejs/node/pull/5661) -* [[`97e95d04c2`](https://github.com/nodejs/node/commit/97e95d04c2)] - **crypto**: PBKDF2 works with `int` not `ssize_t` (Fedor Indutny) [#5397](https://github.com/nodejs/node/pull/5397) -* [[`57b02e6a3e`](https://github.com/nodejs/node/commit/57b02e6a3e)] - **debugger**: remove unneeded callback check (Rich Trott) [#5319](https://github.com/nodejs/node/pull/5319) -* [[`19ae308867`](https://github.com/nodejs/node/commit/19ae308867)] - **deps**: update openssl config (Shigeki Ohtsu) [#5630](https://github.com/nodejs/node/pull/5630) -* [[`d7b81b5bc7`](https://github.com/nodejs/node/commit/d7b81b5bc7)] - **deps**: cherry-pick 2e4da65 from v8's 4.8 upstream (Michael Dawson) [#5293](https://github.com/nodejs/node/pull/5293) -* [[`1e05f371d6`](https://github.com/nodejs/node/commit/1e05f371d6)] - **doc**: fix typo in synchronous randomBytes example (Andrea Giammarchi) [#5781](https://github.com/nodejs/node/pull/5781) -* [[`5f54bd2088`](https://github.com/nodejs/node/commit/5f54bd2088)] - **doc**: topic blocking vs non-blocking (Jarrett Widman) [#5326](https://github.com/nodejs/node/pull/5326) -* [[`0943001563`](https://github.com/nodejs/node/commit/0943001563)] - **doc**: fix invalid path doc comments (Rich Trott) [#5797](https://github.com/nodejs/node/pull/5797) -* [[`bb423bb1e6`](https://github.com/nodejs/node/commit/bb423bb1e6)] - **doc**: update release tweet template (Jeremiah Senkpiel) [#5628](https://github.com/nodejs/node/pull/5628) -* [[`1e877f10aa`](https://github.com/nodejs/node/commit/1e877f10aa)] - **doc**: fix typo in child_process docs (Benjamin Gruenbaum) [#5681](https://github.com/nodejs/node/pull/5681) -* [[`d53dcc599b`](https://github.com/nodejs/node/commit/d53dcc599b)] - **doc**: update fansworld-claudio username on README (Claudio Rodriguez) [#5680](https://github.com/nodejs/node/pull/5680) -* [[`4332f8011e`](https://github.com/nodejs/node/commit/4332f8011e)] - **doc**: fix return value of write methods (Felix Böhm) [#5736](https://github.com/nodejs/node/pull/5736) -* [[`e572542de5`](https://github.com/nodejs/node/commit/e572542de5)] - **doc**: Add note about use of JSON.stringify() (Mithun Patel) [#5723](https://github.com/nodejs/node/pull/5723) -* [[`daf3ef66ef`](https://github.com/nodejs/node/commit/daf3ef66ef)] - **doc**: explain path.format() algorithm (Rich Trott) [#5688](https://github.com/nodejs/node/pull/5688) -* [[`f6d4982aa0`](https://github.com/nodejs/node/commit/f6d4982aa0)] - **doc**: clarify type of first argument in zlib (Kirill Fomichev) [#5685](https://github.com/nodejs/node/pull/5685) -* [[`07e71b2d44`](https://github.com/nodejs/node/commit/07e71b2d44)] - **doc**: fix typo in api/addons (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) -* [[`c6dc56175b`](https://github.com/nodejs/node/commit/c6dc56175b)] - **doc**: remove non-standard use of hyphens (Stefano Vozza) -* [[`4c92316972`](https://github.com/nodejs/node/commit/4c92316972)] - **doc**: add fansworld-claudio to collaborators (Claudio Rodriguez) [#5668](https://github.com/nodejs/node/pull/5668) -* [[`0a6e883f85`](https://github.com/nodejs/node/commit/0a6e883f85)] - **doc**: add thekemkid to collaborators (Glen Keane) [#5667](https://github.com/nodejs/node/pull/5667) -* [[`39c7d8a972`](https://github.com/nodejs/node/commit/39c7d8a972)] - **doc**: add AndreasMadsen to collaborators (Andreas Madsen) [#5666](https://github.com/nodejs/node/pull/5666) -* [[`eec3008970`](https://github.com/nodejs/node/commit/eec3008970)] - **doc**: add whitlockjc to collaborators (Jeremy Whitlock) [#5665](https://github.com/nodejs/node/pull/5665) -* [[`e5f254d83c`](https://github.com/nodejs/node/commit/e5f254d83c)] - **doc**: add benjamingr to collaborator list (Benjamin Gruenbaum) [#5664](https://github.com/nodejs/node/pull/5664) -* [[`3f718643c9`](https://github.com/nodejs/node/commit/3f718643c9)] - **doc**: add phillipj to collaborators (Phillip Johnsen) [#5663](https://github.com/nodejs/node/pull/5663) -* [[`2d5527fe69`](https://github.com/nodejs/node/commit/2d5527fe69)] - **doc**: add mattloring to collaborators (Matt Loring) [#5662](https://github.com/nodejs/node/pull/5662) -* [[`51763462bc`](https://github.com/nodejs/node/commit/51763462bc)] - **doc**: include typo in 'unhandledRejection' example (Robert C Jensen) [#5654](https://github.com/nodejs/node/pull/5654) -* [[`cae5da2f0a`](https://github.com/nodejs/node/commit/cae5da2f0a)] - **doc**: fix markdown links (Steve Mao) [#5641](https://github.com/nodejs/node/pull/5641) -* [[`b1b17efcb7`](https://github.com/nodejs/node/commit/b1b17efcb7)] - **doc**: move build instructions to a new document (Johan Bergström) [#5634](https://github.com/nodejs/node/pull/5634) -* [[`13a8bde1fa`](https://github.com/nodejs/node/commit/13a8bde1fa)] - **doc**: fix dns.resolveCname description typo (axvm) [#5622](https://github.com/nodejs/node/pull/5622) -* [[`1faea43c40`](https://github.com/nodejs/node/commit/1faea43c40)] - **doc**: fix typo in fs.symlink (Michaël Zasso) [#5560](https://github.com/nodejs/node/pull/5560) -* [[`98a1bb6989`](https://github.com/nodejs/node/commit/98a1bb6989)] - **doc**: document directories in test directory (Michael Barrett) [#5557](https://github.com/nodejs/node/pull/5557) -* [[`04d3f8a741`](https://github.com/nodejs/node/commit/04d3f8a741)] - **doc**: update link green to match homepage (silverwind) [#5548](https://github.com/nodejs/node/pull/5548) -* [[`1afab6ac9c`](https://github.com/nodejs/node/commit/1afab6ac9c)] - **doc**: add clarification on birthtime in fs stat (Kári Tristan Helgason) [#5479](https://github.com/nodejs/node/pull/5479) -* [[`d871ae2349`](https://github.com/nodejs/node/commit/d871ae2349)] - **doc**: fix typo in child_process documentation (Evan Lucas) [#5474](https://github.com/nodejs/node/pull/5474) -* [[`97a18bdbad`](https://github.com/nodejs/node/commit/97a18bdbad)] - **doc**: update NAN urls in ROADMAP.md and doc/releases.md (ronkorving) [#5472](https://github.com/nodejs/node/pull/5472) -* [[`d4a1fc7acd`](https://github.com/nodejs/node/commit/d4a1fc7acd)] - **doc**: add Testing WG (Rich Trott) [#5461](https://github.com/nodejs/node/pull/5461) -* [[`1642078580`](https://github.com/nodejs/node/commit/1642078580)] - **doc**: fix crypto function indentation level (Brian White) [#5460](https://github.com/nodejs/node/pull/5460) -* [[`2b0c7ad985`](https://github.com/nodejs/node/commit/2b0c7ad985)] - **doc**: fix links in tls, cluster docs (Alexander Makarenko) [#5364](https://github.com/nodejs/node/pull/5364) -* [[`901dbabea6`](https://github.com/nodejs/node/commit/901dbabea6)] - **doc**: fix relative links in net docs (Evan Lucas) [#5358](https://github.com/nodejs/node/pull/5358) -* [[`38d429172d`](https://github.com/nodejs/node/commit/38d429172d)] - **doc**: fix typo in pbkdf2Sync code sample (Marc Cuva) [#5306](https://github.com/nodejs/node/pull/5306) -* [[`d4cfc6f97c`](https://github.com/nodejs/node/commit/d4cfc6f97c)] - **doc**: add missing property in cluster example (Rafael Cepeda) [#5305](https://github.com/nodejs/node/pull/5305) -* [[`b66d6b1458`](https://github.com/nodejs/node/commit/b66d6b1458)] - **doc**: improve httpVersionMajor / httpVersionMajor (Jackson Tian) [#5296](https://github.com/nodejs/node/pull/5296) -* [[`70c872c9c4`](https://github.com/nodejs/node/commit/70c872c9c4)] - **doc**: improve unhandledException doc copy (James M Snell) [#5287](https://github.com/nodejs/node/pull/5287) -* [[`ba5e0b6110`](https://github.com/nodejs/node/commit/ba5e0b6110)] - **doc**: fix buf.readInt16LE output (Chinedu Francis Nwafili) [#5282](https://github.com/nodejs/node/pull/5282) -* [[`1624d5b049`](https://github.com/nodejs/node/commit/1624d5b049)] - **doc**: document base64url encoding support (Tristan Slominski) [#5243](https://github.com/nodejs/node/pull/5243) -* [[`b1d580c9d2`](https://github.com/nodejs/node/commit/b1d580c9d2)] - **doc**: update removeListener behaviour (Vaibhav) [#5201](https://github.com/nodejs/node/pull/5201) -* [[`ca17f91ba8`](https://github.com/nodejs/node/commit/ca17f91ba8)] - **doc**: add note for binary safe string reading (Anton Andesen) [#5155](https://github.com/nodejs/node/pull/5155) -* [[`0830bb4950`](https://github.com/nodejs/node/commit/0830bb4950)] - **doc**: clarify when writable.write callback is called (Kevin Locke) [#4810](https://github.com/nodejs/node/pull/4810) -* [[`17a74305c8`](https://github.com/nodejs/node/commit/17a74305c8)] - **doc**: add info to docs on how to submit docs patch (Sequoia McDowell) [#4591](https://github.com/nodejs/node/pull/4591) -* [[`470a9ca909`](https://github.com/nodejs/node/commit/470a9ca909)] - **doc**: add onboarding resources (Jeremiah Senkpiel) [#3726](https://github.com/nodejs/node/pull/3726) -* [[`3168e6b486`](https://github.com/nodejs/node/commit/3168e6b486)] - **doc**: update V8 URL (Craig Akimoto) [#5530](https://github.com/nodejs/node/pull/5530) -* [[`04d16eb7e8`](https://github.com/nodejs/node/commit/04d16eb7e8)] - **doc**: document fs.datasync(Sync) (Ron Korving) [#5402](https://github.com/nodejs/node/pull/5402) -* [[`29646200f8`](https://github.com/nodejs/node/commit/29646200f8)] - **doc**: add Evan Lucas to the CTC (Rod Vagg) -* [[`a2a32b7810`](https://github.com/nodejs/node/commit/a2a32b7810)] - **doc**: add Rich Trott to the CTC (Rod Vagg) [#5276](https://github.com/nodejs/node/pull/5276) -* [[`4e469d5e47`](https://github.com/nodejs/node/commit/4e469d5e47)] - **doc**: add Ali Ijaz Sheikh to the CTC (Rod Vagg) [#5277](https://github.com/nodejs/node/pull/5277) -* [[`d09b44f59b`](https://github.com/nodejs/node/commit/d09b44f59b)] - **doc**: add Сковорода Никита Андреевич to the CTC (Rod Vagg) [#5278](https://github.com/nodejs/node/pull/5278) -* [[`ebbc64bc97`](https://github.com/nodejs/node/commit/ebbc64bc97)] - **doc**: add "building node with ninja" guide (Jeremiah Senkpiel) [#4767](https://github.com/nodejs/node/pull/4767) -* [[`67245fa0e3`](https://github.com/nodejs/node/commit/67245fa0e3)] - **doc**: clarify code of conduct reporting (Julie Pagano) [#5107](https://github.com/nodejs/node/pull/5107) -* [[`cd78ff9706`](https://github.com/nodejs/node/commit/cd78ff9706)] - **doc**: fix links in Addons docs (Alexander Makarenko) [#5072](https://github.com/nodejs/node/pull/5072) -* [[`20539954ff`](https://github.com/nodejs/node/commit/20539954ff)] - **docs**: fix man pages link if tok type is code (Mithun Patel) [#5721](https://github.com/nodejs/node/pull/5721) -* [[`38d7b0b6ea`](https://github.com/nodejs/node/commit/38d7b0b6ea)] - **docs**: update link to iojs+release ci job (Myles Borins) [#5632](https://github.com/nodejs/node/pull/5632) -* [[`f982632f90`](https://github.com/nodejs/node/commit/f982632f90)] - **http**: remove old, confusing comment (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) -* [[`ca5d7a8bb6`](https://github.com/nodejs/node/commit/ca5d7a8bb6)] - **http**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) -* [[`2ce83bd8f9`](https://github.com/nodejs/node/commit/2ce83bd8f9)] - **http,util**: fix typos in comments (Alexander Makarenko) [#5279](https://github.com/nodejs/node/pull/5279) -* [[`b690916e5a`](https://github.com/nodejs/node/commit/b690916e5a)] - **lib**: freelist: use .pop() for allocation (Anton Khlynovskiy) [#2174](https://github.com/nodejs/node/pull/2174) -* [[`e7f45f0a17`](https://github.com/nodejs/node/commit/e7f45f0a17)] - **repl**: handle quotes within regexp literal (Prince J Wesley) [#5117](https://github.com/nodejs/node/pull/5117) -* [[`7c3b844f78`](https://github.com/nodejs/node/commit/7c3b844f78)] - **src**: return UV_EAI_NODATA on empty lookup (cjihrig) [#4715](https://github.com/nodejs/node/pull/4715) -* [[`242a65e930`](https://github.com/nodejs/node/commit/242a65e930)] - **stream**: prevent object map change in TransformState (Evan Lucas) [#5032](https://github.com/nodejs/node/pull/5032) -* [[`fb5ba6b928`](https://github.com/nodejs/node/commit/fb5ba6b928)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761) -* [[`04db9efd78`](https://github.com/nodejs/node/commit/04db9efd78)] - **stream**: fix no data on partial decode (Brian White) [#5226](https://github.com/nodejs/node/pull/5226) -* [[`cc0e36ff98`](https://github.com/nodejs/node/commit/cc0e36ff98)] - **string_decoder**: fix performance regression (Brian White) [#5134](https://github.com/nodejs/node/pull/5134) -* [[`666d3690d8`](https://github.com/nodejs/node/commit/666d3690d8)] - **test**: eval a strict function (Kári Tristan Helgason) [#5250](https://github.com/nodejs/node/pull/5250) -* [[`9952bcf203`](https://github.com/nodejs/node/commit/9952bcf203)] - **test**: bug repro for vm function redefinition (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) -* [[`063f22f1f0`](https://github.com/nodejs/node/commit/063f22f1f0)] - **test**: check memoryUsage properties The properties on memoryUsage were not checked before, this commit checks them. (Wyatt Preul) [#5546](https://github.com/nodejs/node/pull/5546) -* [[`7a0fcfc127`](https://github.com/nodejs/node/commit/7a0fcfc127)] - **test**: remove broken debugger scenarios (Rich Trott) [#5532](https://github.com/nodejs/node/pull/5532) -* [[`ba9ad2662c`](https://github.com/nodejs/node/commit/ba9ad2662c)] - **test**: apply Linux workaround to Linux only (Rich Trott) [#5471](https://github.com/nodejs/node/pull/5471) -* [[`4aa2c03d31`](https://github.com/nodejs/node/commit/4aa2c03d31)] - **test**: increase timeout for test-tls-fast-writing (Rich Trott) [#5466](https://github.com/nodejs/node/pull/5466) -* [[`b4ef644ce4`](https://github.com/nodejs/node/commit/b4ef644ce4)] - **test**: retry on known SmartOS bug (Rich Trott) [#5454](https://github.com/nodejs/node/pull/5454) -* [[`d681bf24b5`](https://github.com/nodejs/node/commit/d681bf24b5)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5422](https://github.com/nodejs/node/pull/5422) -* [[`b4fbe04514`](https://github.com/nodejs/node/commit/b4fbe04514)] - **test**: fix test-timers.reliability on OS X (Rich Trott) [#5379](https://github.com/nodejs/node/pull/5379) -* [[`99269ffdbf`](https://github.com/nodejs/node/commit/99269ffdbf)] - **test**: increase timeouts on some unref timers tests (Jeremiah Senkpiel) [#5352](https://github.com/nodejs/node/pull/5352) -* [[`85f927a774`](https://github.com/nodejs/node/commit/85f927a774)] - **test**: prevent flakey test on pi2 (Trevor Norris) [#5537](https://github.com/nodejs/node/pull/5537) -* [[`c86902d800`](https://github.com/nodejs/node/commit/c86902d800)] - **test**: mitigate flaky test-http-agent (Rich Trott) [#5346](https://github.com/nodejs/node/pull/5346) -* [[`f242e62817`](https://github.com/nodejs/node/commit/f242e62817)] - **test**: remove flaky designation from fixed tests (Rich Trott) [#5459](https://github.com/nodejs/node/pull/5459) -* [[`a39aacf035`](https://github.com/nodejs/node/commit/a39aacf035)] - **test**: refactor test-dgram-udp4 (Santiago Gimeno) [#5339](https://github.com/nodejs/node/pull/5339) -* [[`6386f62221`](https://github.com/nodejs/node/commit/6386f62221)] - **test**: remove unneeded bind() and related comments (Aayush Naik) [#5023](https://github.com/nodejs/node/pull/5023) -* [[`068b0cbd12`](https://github.com/nodejs/node/commit/068b0cbd12)] - **test**: move cluster tests to parallel (Rich Trott) [#4774](https://github.com/nodejs/node/pull/4774) -* [[`a673c9ae2d`](https://github.com/nodejs/node/commit/a673c9ae2d)] - **tls**: fix assert in context._external accessor (Ben Noordhuis) [#5521](https://github.com/nodejs/node/pull/5521) -* [[`8ffef48fee`](https://github.com/nodejs/node/commit/8ffef48fee)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [nodejs/node#1325](https://github.com/nodejs/node/pull/1325) -* [[`4b6a8f4321`](https://github.com/nodejs/node/commit/4b6a8f4321)] - **tools**: update gyp to b3cef02 (Imran Iqbal) [#3487](https://github.com/nodejs/node/pull/3487) -* [[`7501ddc878`](https://github.com/nodejs/node/commit/7501ddc878)] - **tools**: support testing known issues (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) -* [[`10ec1d2a6b`](https://github.com/nodejs/node/commit/10ec1d2a6b)] - **tools**: enable linting for benchmarks (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`deec8bc5f5`](https://github.com/nodejs/node/commit/deec8bc5f5)] - **tools**: reduce verbosity of cpplint (Sakthipriyan Vairamani) [#5578](https://github.com/nodejs/node/pull/5578) -* [[`64d5752711`](https://github.com/nodejs/node/commit/64d5752711)] - **tools**: enable no-self-assign ESLint rule (Rich Trott) [#5552](https://github.com/nodejs/node/pull/5552) -* [[`131ed494e2`](https://github.com/nodejs/node/commit/131ed494e2)] - **tools**: enable no-extra-parens in ESLint (Rich Trott) [#5512](https://github.com/nodejs/node/pull/5512) -* [[`d4b9f02fdc`](https://github.com/nodejs/node/commit/d4b9f02fdc)] - **tools**: apply custom buffer lint rule to /lib only (Rich Trott) [#5371](https://github.com/nodejs/node/pull/5371) -* [[`6867bed4c4`](https://github.com/nodejs/node/commit/6867bed4c4)] - **tools**: enable additional lint rules (Rich Trott) [#5357](https://github.com/nodejs/node/pull/5357) -* [[`5e6b7605ee`](https://github.com/nodejs/node/commit/5e6b7605ee)] - **tools**: add Node.js-specific ESLint rules (Rich Trott) [#5320](https://github.com/nodejs/node/pull/5320) -* [[`6dc49ae203`](https://github.com/nodejs/node/commit/6dc49ae203)] - **tools,benchmark**: increase lint compliance (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) -* [[`dff7091fce`](https://github.com/nodejs/node/commit/dff7091fce)] - **url**: group slashed protocols by protocol name (nettofarah) [#5380](https://github.com/nodejs/node/pull/5380) -* [[`0e97a3ea51`](https://github.com/nodejs/node/commit/0e97a3ea51)] - **win,build**: support Visual C++ Build Tools 2015 (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) +Moved to doc/changelogs/CHANGELOG_V4.md#4.4.1. ## 2016-03-16, Version 5.9.0 (Stable), @evanlucas -### Notable changes - -* **contextify**: Fixed a memory consumption issue related to heavy use of `vm.createContext` and `vm.runInNewContext`. (Ali Ijaz Sheikh) -https://github.com/nodejs/node/pull/5392 -* **governance**: The following members have been added as collaborators: - - Andreas Madsen (@AndreasMadsen) - - Benjamin Gruenbaum (@benjamingr) - - Claudio Rodriguez (@claudiorodriguez) - - Glen Keane (@thekemkid) - - Jeremy Whitlock (@whitlockjc) - - Matt Loring (@matthewloring) - - Phillip Johnsen (@phillipj) -* **lib**: copy arguments object instead of leaking it (Nathan Woltman) -https://github.com/nodejs/node/pull/4361 -* **src**: allow both -i and -e flags to be used at the same time (Rich Trott) -https://github.com/nodejs/node/pull/5655 -* **timers**: Internal Node.js timeouts now use the same logic path as those created with `setTimeout()` (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) - * This may cause a slightly different performance profile in some situations. So far, it has shown to be positive in most cases. -* **v8**: backport fb4ccae from v8 upstream (Vladimir Krivosheev) #4231 - - breakout events from v8 to offer better support for external debuggers -* **zlib**: add support for concatenated members (Kári Tristan Helgason) -https://github.com/nodejs/node/pull/5120 - * Previously, if multiple members were in the same archive, only the first would be read. The others are no longer thrown away. - -### Commits - -* [[`03b99bf8b9`](https://github.com/nodejs/node/commit/03b99bf8b9)] - **build**: don't install github templates (Johan Bergström) [#5612](https://github.com/nodejs/node/pull/5612) -* [[`a7819da15a`](https://github.com/nodejs/node/commit/a7819da15a)] - ***Revert*** "**build**: run lint before tests" (Rich Trott) [#5602](https://github.com/nodejs/node/pull/5602) -* [[`5e9cac4333`](https://github.com/nodejs/node/commit/5e9cac4333)] - **console**: check that stderr is writable (Rich Trott) [#5635](https://github.com/nodejs/node/pull/5635) -* [[`0662fcf209`](https://github.com/nodejs/node/commit/0662fcf209)] - **contextify**: cache sandbox and context in locals (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) -* [[`4f2c839d46`](https://github.com/nodejs/node/commit/4f2c839d46)] - **contextify**: replace deprecated SetWeak usage (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) -* [[`bfff07b4dd`](https://github.com/nodejs/node/commit/bfff07b4dd)] - **contextify**: cleanup weak ref for sandbox (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) -* [[`93f60cdc54`](https://github.com/nodejs/node/commit/93f60cdc54)] - **contextify**: cleanup weak ref for global proxy (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) -* [[`b6c355de0d`](https://github.com/nodejs/node/commit/b6c355de0d)] - **(SEMVER-MINOR)** **deps**: backport fb4ccae from v8 upstream (develar) [#4231](https://github.com/nodejs/node/pull/4231) -* [[`29510aa4fd`](https://github.com/nodejs/node/commit/29510aa4fd)] - **deps**: update openssl config (Shigeki Ohtsu) [#5630](https://github.com/nodejs/node/pull/5630) -* [[`532d1bf9ce`](https://github.com/nodejs/node/commit/532d1bf9ce)] - **deps**: sync deps/http_parser with nodejs/http_parser (James M Snell) [#5600](https://github.com/nodejs/node/pull/5600) -* [[`d5d64c327b`](https://github.com/nodejs/node/commit/d5d64c327b)] - **doc**: clarify commit message rules (Wyatt Preul) [#5661](https://github.com/nodejs/node/pull/5661) -* [[`8c4c84fe5b`](https://github.com/nodejs/node/commit/8c4c84fe5b)] - **doc**: add Testing WG (Rich Trott) [#5461](https://github.com/nodejs/node/pull/5461) -* [[`434af03825`](https://github.com/nodejs/node/commit/434af03825)] - **doc**: Add note about use of JSON.stringify() (Mithun Patel) [#5723](https://github.com/nodejs/node/pull/5723) -* [[`62926d85bd`](https://github.com/nodejs/node/commit/62926d85bd)] - **doc**: clarify type of first argument in zlib (Kirill Fomichev) [#5685](https://github.com/nodejs/node/pull/5685) -* [[`eb73574349`](https://github.com/nodejs/node/commit/eb73574349)] - **doc**: clarify when writable.write callback is called (Kevin Locke) [#4810](https://github.com/nodejs/node/pull/4810) -* [[`c579507034`](https://github.com/nodejs/node/commit/c579507034)] - **doc**: fix typo in api/addons (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) -* [[`8e45c9d9ea`](https://github.com/nodejs/node/commit/8e45c9d9ea)] - **doc**: fix typo in api/dgram (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) -* [[`44a9b100c5`](https://github.com/nodejs/node/commit/44a9b100c5)] - **doc**: fix typo in api/fs (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) -* [[`b667573bcb`](https://github.com/nodejs/node/commit/b667573bcb)] - **doc**: update fansworld-claudio username on README (Claudio Rodriguez) [#5680](https://github.com/nodejs/node/pull/5680) -* [[`9794abb5d1`](https://github.com/nodejs/node/commit/9794abb5d1)] - **doc**: add onboarding resources (Jeremiah Senkpiel) [#3726](https://github.com/nodejs/node/pull/3726) -* [[`31e39fbd7a`](https://github.com/nodejs/node/commit/31e39fbd7a)] - **doc**: remove non-standard use of hyphens (Stefano Vozza) -* [[`f3e9daa825`](https://github.com/nodejs/node/commit/f3e9daa825)] - **doc**: add clarification on birthtime in fs stat (Kári Tristan Helgason) [#5479](https://github.com/nodejs/node/pull/5479) -* [[`c379ec6522`](https://github.com/nodejs/node/commit/c379ec6522)] - **doc**: move build instructions to a new document (Johan Bergström) [#5634](https://github.com/nodejs/node/pull/5634) -* [[`2a442b3dfc`](https://github.com/nodejs/node/commit/2a442b3dfc)] - **doc**: update removeListener behaviour (Vaibhav) [#5201](https://github.com/nodejs/node/pull/5201) -* [[`f6ee0996e0`](https://github.com/nodejs/node/commit/f6ee0996e0)] - **doc**: fix typo in child_process docs (Benjamin Gruenbaum) [#5681](https://github.com/nodejs/node/pull/5681) -* [[`dd12661173`](https://github.com/nodejs/node/commit/dd12661173)] - **doc**: include typo in 'unhandledRejection' example (Robert C Jensen) [#5654](https://github.com/nodejs/node/pull/5654) -* [[`f7aecd6e94`](https://github.com/nodejs/node/commit/f7aecd6e94)] - **doc**: add thekemkid to collaborators (Glen Keane) [#5667](https://github.com/nodejs/node/pull/5667) -* [[`b81711acfb`](https://github.com/nodejs/node/commit/b81711acfb)] - **doc**: add phillipj to collaborators (Phillip Johnsen) [#5663](https://github.com/nodejs/node/pull/5663) -* [[`a33f2486f0`](https://github.com/nodejs/node/commit/a33f2486f0)] - **doc**: add fansworld-claudio to collaborators (Claudio Rodriguez) [#5668](https://github.com/nodejs/node/pull/5668) -* [[`285d5e7ba6`](https://github.com/nodejs/node/commit/285d5e7ba6)] - **doc**: add AndreasMadsen to collaborators (Andreas Madsen) [#5666](https://github.com/nodejs/node/pull/5666) -* [[`8e1f6706e3`](https://github.com/nodejs/node/commit/8e1f6706e3)] - **doc**: add benjamingr to collaborator list (Benjamin Gruenbaum) [#5664](https://github.com/nodejs/node/pull/5664) -* [[`f7842cbb24`](https://github.com/nodejs/node/commit/f7842cbb24)] - **doc**: add whitlockjc to collaborators (Jeremy Whitlock) [#5665](https://github.com/nodejs/node/pull/5665) -* [[`dd6f4ec2e4`](https://github.com/nodejs/node/commit/dd6f4ec2e4)] - **doc**: add mattloring to collaborators (Matt Loring) [#5662](https://github.com/nodejs/node/pull/5662) -* [[`9ebd559a55`](https://github.com/nodejs/node/commit/9ebd559a55)] - **doc**: fix markdown links (Steve Mao) [#5641](https://github.com/nodejs/node/pull/5641) -* [[`62d267e1ff`](https://github.com/nodejs/node/commit/62d267e1ff)] - **doc**: fix dns.resolveCname description typo (axvm) [#5622](https://github.com/nodejs/node/pull/5622) -* [[`9f8e2e2979`](https://github.com/nodejs/node/commit/9f8e2e2979)] - **doc**: update release tweet template (Jeremiah Senkpiel) [#5628](https://github.com/nodejs/node/pull/5628) -* [[`4d6fe300fe`](https://github.com/nodejs/node/commit/4d6fe300fe)] - **doc**: fix v5.8.0 changelog heading (Jeremiah Senkpiel) [#5559](https://github.com/nodejs/node/pull/5559) -* [[`4c1fdaeb2a`](https://github.com/nodejs/node/commit/4c1fdaeb2a)] - **docs**: update link to iojs+release ci job (Myles Borins) [#5632](https://github.com/nodejs/node/pull/5632) -* [[`205bed0bec`](https://github.com/nodejs/node/commit/205bed0bec)] - **lib**: copy arguments object instead of leaking it (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) -* [[`b16f67a0b9`](https://github.com/nodejs/node/commit/b16f67a0b9)] - **net**: make `isIPv4` and `isIPv6` more efficient (Vladimir Kurchatkin) [#5478](https://github.com/nodejs/node/pull/5478) -* [[`4ecd996baa`](https://github.com/nodejs/node/commit/4ecd996baa)] - **(SEMVER-MINOR)** **src**: allow combination of -i and -e cli flags (Rich Trott) [#5655](https://github.com/nodejs/node/pull/5655) -* [[`f225459496`](https://github.com/nodejs/node/commit/f225459496)] - **test**: improve test-npm-install (Santiago Gimeno) [#5613](https://github.com/nodejs/node/pull/5613) -* [[`cceae5ae78`](https://github.com/nodejs/node/commit/cceae5ae78)] - **test**: eval a strict function (Kári Tristan Helgason) [#5250](https://github.com/nodejs/node/pull/5250) -* [[`9a44c8c337`](https://github.com/nodejs/node/commit/9a44c8c337)] - **test**: add batch of known issue tests (cjihrig) [#5653](https://github.com/nodejs/node/pull/5653) -* [[`1b7b1ed2c9`](https://github.com/nodejs/node/commit/1b7b1ed2c9)] - **timers**: greatly improve code comments (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) -* [[`769254b0ba`](https://github.com/nodejs/node/commit/769254b0ba)] - **timers**: refactor timers (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) -* [[`0b545fb3f8`](https://github.com/nodejs/node/commit/0b545fb3f8)] - **win,build**: support Visual C++ Build Tools 2015 (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) -* [[`ef774ff9a8`](https://github.com/nodejs/node/commit/ef774ff9a8)] - **(SEMVER-MINOR)** **zlib**: add support for concatenated members (Kári Tristan Helgason) [#5120](https://github.com/nodejs/node/pull/5120) +Moved to doc/changelogs/CHANGELOG_V5.md#5.9.0. ## 2016-03-08, Version 5.8.0 (Stable), @Fishrock123 -### Notable changes - -* **child_process**: `send()` now accepts an options parameter (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283). - - Currently the only option is `keepOpen`, which keeps the underlying socket open after the message is sent. -* **constants**: `ENGINE_METHOD_RSA` is now correctly exposed (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463). -* Fixed two regressions which originated in v5.7.0: - - **http**: Errors inside of http client callbacks now propagate correctly (Trevor Norris) [#5591](https://github.com/nodejs/node/pull/5591). - - **path**: Fixed normalization of absolute paths (Evan Lucas) [#5589](https://github.com/nodejs/node/pull/5589). -* **repl**: `start()` no longer requires an options parameter (cjihrig) [#5388](https://github.com/nodejs/node/pull/5388). -* **util**: Improved `format()` performance 50-300% (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360). - -### Commits - -* [[`12ca84fc7f`](https://github.com/nodejs/node/commit/12ca84fc7f)] - **benchmark**: add util.format benchmark (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) -* [[`b955d02266`](https://github.com/nodejs/node/commit/b955d02266)] - **benchmark**: fix lint errors (Rich Trott) [#5517](https://github.com/nodejs/node/pull/5517) -* [[`2abf866b6e`](https://github.com/nodejs/node/commit/2abf866b6e)] - **build**: update Node.js logo on Win installer (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) -* [[`86900f8f2b`](https://github.com/nodejs/node/commit/86900f8f2b)] - **build**: correctly detect clang version (Stefan Budeanu) [#5553](https://github.com/nodejs/node/pull/5553) -* [[`a3017992e4`](https://github.com/nodejs/node/commit/a3017992e4)] - **(SEMVER-MINOR)** **child_process**: add keepOpen option to send() (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283) -* [[`6d4887ccc2`](https://github.com/nodejs/node/commit/6d4887ccc2)] - **(SEMVER-MINOR)** **child_process**: support options in send() (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283) -* [[`9db827c7aa`](https://github.com/nodejs/node/commit/9db827c7aa)] - **(SEMVER-MINOR)** **constants**: define ENGINE_METHOD_RSA (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463) -* [[`85013456cd`](https://github.com/nodejs/node/commit/85013456cd)] - **deps**: upgrade to npm 3.7.3 (Kat Marchán) [#5369](https://github.com/nodejs/node/pull/5369) -* [[`67e9f65958`](https://github.com/nodejs/node/commit/67e9f65958)] - **dgram**: default send address to 127.0.0.1 or ::1 (Matteo Collina) [#5493](https://github.com/nodejs/node/pull/5493) -* [[`3c92352c8c`](https://github.com/nodejs/node/commit/3c92352c8c)] - **doc**: document directories in test directory (Michael Barrett) [#5557](https://github.com/nodejs/node/pull/5557) -* [[`7be726f86a`](https://github.com/nodejs/node/commit/7be726f86a)] - **doc**: add info to docs on how to submit docs patch (Sequoia McDowell) [#4591](https://github.com/nodejs/node/pull/4591) -* [[`eb5a95e04a`](https://github.com/nodejs/node/commit/eb5a95e04a)] - **doc**: fix typo in fs.symlink (Michaël Zasso) [#5560](https://github.com/nodejs/node/pull/5560) -* [[`9ad901ef44`](https://github.com/nodejs/node/commit/9ad901ef44)] - **doc**: improve unhandledException doc copy (James M Snell) [#5287](https://github.com/nodejs/node/pull/5287) -* [[`3bd96fdb0f`](https://github.com/nodejs/node/commit/3bd96fdb0f)] - **doc**: update link green to match homepage (silverwind) [#5548](https://github.com/nodejs/node/pull/5548) -* [[`cb7e4fbac9`](https://github.com/nodejs/node/commit/cb7e4fbac9)] - **doc**: update V8 URL (Craig Akimoto) [#5530](https://github.com/nodejs/node/pull/5530) -* [[`b54a26fa61`](https://github.com/nodejs/node/commit/b54a26fa61)] - **(SEMVER-MINOR)** **doc**: correct name of engine methods (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463) -* [[`f3971f5817`](https://github.com/nodejs/node/commit/f3971f5817)] - **path**: fix normalize for absolutes (Evan Lucas) [#5589](https://github.com/nodejs/node/pull/5589) -* [[`e572e421b4`](https://github.com/nodejs/node/commit/e572e421b4)] - **(SEMVER-MINOR)** **repl**: accept no arguments to start() (cjihrig) [#5388](https://github.com/nodejs/node/pull/5388) -* [[`5e6d706758`](https://github.com/nodejs/node/commit/5e6d706758)] - **src,http**: fix uncaughtException miss in http (Trevor Norris) [#5591](https://github.com/nodejs/node/pull/5591) -* [[`9dc94d7b09`](https://github.com/nodejs/node/commit/9dc94d7b09)] - **test**: add test-npm-install to parallel tests suite (Myles Borins) [#5166](https://github.com/nodejs/node/pull/5166) -* [[`4f20f31b3e`](https://github.com/nodejs/node/commit/4f20f31b3e)] - **test**: remove broken debugger scenarios (Rich Trott) [#5532](https://github.com/nodejs/node/pull/5532) -* [[`29e26b38c5`](https://github.com/nodejs/node/commit/29e26b38c5)] - **test**: bug repro for vm function redefinition (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) -* [[`e6210d5f50`](https://github.com/nodejs/node/commit/e6210d5f50)] - **test**: prevent flakey test on pi2 (Trevor Norris) [#5537](https://github.com/nodejs/node/pull/5537) -* [[`40b36baa2f`](https://github.com/nodejs/node/commit/40b36baa2f)] - **test**: check memoryUsage properties (Wyatt Preul) [#5546](https://github.com/nodejs/node/pull/5546) -* [[`048c0f4738`](https://github.com/nodejs/node/commit/048c0f4738)] - **tools**: reduce verbosity of cpplint (Sakthipriyan Vairamani) [#5578](https://github.com/nodejs/node/pull/5578) -* [[`7965c897e0`](https://github.com/nodejs/node/commit/7965c897e0)] - **tools**: enable no-self-assign ESLint rule (Rich Trott) [#5552](https://github.com/nodejs/node/pull/5552) -* [[`5aa17dc136`](https://github.com/nodejs/node/commit/5aa17dc136)] - **tools**: support testing known issues (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) -* [[`9a3e87e9a8`](https://github.com/nodejs/node/commit/9a3e87e9a8)] - **tools**: enable linting for benchmarks (Rich Trott) [#5517](https://github.com/nodejs/node/pull/5517) -* [[`c4fa2a6715`](https://github.com/nodejs/node/commit/c4fa2a6715)] - **tools**: enable no-extra-parens in ESLint (Rich Trott) [#5512](https://github.com/nodejs/node/pull/5512) -* [[`971edde0cb`](https://github.com/nodejs/node/commit/971edde0cb)] - **util**: improve format() performance further (Brian White) [#5360](https://github.com/nodejs/node/pull/5360) -* [[`c32d460747`](https://github.com/nodejs/node/commit/c32d460747)] - **util**: improve util.format performance (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) +Moved to doc/changelogs/CHANGELOG_V5.md#5.8.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.4.0. ## 2016-03-08, Version 0.12.12 (LTS), @rvagg -### Notable changes: - -* openssl: Fully remove SSLv2 support, the `--enable-ssl2` command line argument will now produce an error. The DROWN Attack (https://drownattack.com/) creates a vulnerability where SSLv2 is enabled by a server, even if a client connection is not using SSLv2. The SSLv2 protocol is widely considered unacceptably broken and should not be supported. More information is available at https://www.openssl.org/news/vulnerabilities.html#2016-0800 - -Note that the upgrade to OpenSSL 1.0.1s in Node.js v0.12.11 removed internal SSLv2 support. The change in this release was originally intended for v0.12.11. The `--enable-ssl2` command line argument now produces an error rather than being a no-op. - -### Commits: - -* [dbfc9d9241] - crypto,tls: remove SSLv2 support (Ben Noordhuis) https://github.com/nodejs/node/pull/5536 - -## 2016-03-04, Version 0.10.43 (Maintenance), @rvagg - -### Notable changes: - -* http_parser: Update to http-parser 1.2 to fix an unintentionally strict limitation of allowable header characters. (James M Snell) https://github.com/nodejs/node/pull/5242 -* domains: - - Prevent an exit due to an exception being thrown rather than emitting an `'uncaughtException'` event on the `process` object when no error handler is set on the domain within which an error is thrown and an `'uncaughtException'` event listener is set on `process`. (Julien Gilli) https://github.com/nodejs/node/pull/3887 - - Fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. (Julien Gilli) https://github.com/nodejs/node/pull/3887 -* openssl: Upgrade from 1.0.1r to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508 - - 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 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 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 https://www.openssl.org/news/vulnerabilities.html#2016-0702 - - Remove SSLv2 support, the `--enable-ssl2` command line argument will now produce an error. The DROWN Attack (https://drownattack.com/) creates a vulnerability where SSLv2 is enabled by a server, even if a client connection is not using SSLv2. The SSLv2 protocol is widely considered unacceptably broken and should not be supported. More information is available at https://www.openssl.org/news/vulnerabilities.html#2016-0800 - -### Commits: - -* [164157abbb] - build: update Node.js logo on OSX installer (Rod Vagg) https://github.com/nodejs/node/pull/5401 -* [f8cb0dcf67] - crypto,tls: remove SSLv2 support (Ben Noordhuis) https://github.com/nodejs/node/pull/5529 -* [42ded2a590] - deps: upgrade openssl to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5508 -* [1e45a6111c] - deps: update http-parser to version 1.2 (James M Snell) https://github.com/nodejs/node/pull/5242 -* [6db377b2f4] - doc: remove SSLv2 descriptions (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5541 -* [563c359f5c] - domains: fix handling of uncaught exceptions (Julien Gilli) https://github.com/nodejs/node/pull/3887 -* [e483f3fd26] - test: fix hanging http obstext test (Ben Noordhuis) https://github.com/nodejs/node/pull/5511 +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.12. ## 2016-03-03, Version 0.12.11 (LTS), @rvagg -### Notable changes: - -* http_parser: Update to http-parser 2.3.2 to fix an unintentionally strict limitation of allowable header characters. (James M Snell) https://github.com/nodejs/node/pull/5241 -* domains: - - Prevent an exit due to an exception being thrown rather than emitting an 'uncaughtException' event on the `process` object when no error handler is set on the domain within which an error is thrown and an 'uncaughtException' event listener is set on `process`. (Julien Gilli) https://github.com/nodejs/node/pull/3885 - - Fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. (Julien Gilli) https://github.com/nodejs/node/pull/3885 -* openssl: Upgrade from 1.0.1r to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5509 - - 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 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 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 https://www.openssl.org/news/vulnerabilities.html#2016-0702 - -### Commits: - -* [1ab6653db9] - build: update Node.js logo on OSX installer (Rod Vagg) https://github.com/nodejs/node/pull/5401 -* [fcc64792ae] - child_process: guard against race condition (Rich Trott) https://github.com/nodejs/node/pull/5153 -* [6c468df9af] - child_process: fix data loss with readable event (Brian White) https://github.com/nodejs/node/pull/5037 -* [61a22019c2] - deps: upgrade openssl to 1.0.1s (Ben Noordhuis) https://github.com/nodejs/node/pull/5509 -* [fa26b13df7] - deps: update to http-parser 2.3.2 (James M Snell) https://github.com/nodejs/node/pull/5241 -* [46c8e2165f] - deps: backport 1f8555 from v8's upstream (Trevor Norris) https://github.com/nodejs/node/pull/3945 -* [ce58c2c31a] - doc: remove SSLv2 descriptions (Shigeki Ohtsu) https://github.com/nodejs/node/pull/5541 -* [018e4e0b1a] - domains: fix handling of uncaught exceptions (Julien Gilli) https://github.com/nodejs/node/pull/3885 -* [d421e85dc9] - lib: fix cluster handle leak (Rich Trott) https://github.com/nodejs/node/pull/5152 -* [3a48f0022f] - node: fix leaking Context handle (Trevor Norris) https://github.com/nodejs/node/pull/3945 -* [28dddabf6a] - src: fix build error without OpenSSL support (Jörg Krause) https://github.com/nodejs/node/pull/4201 -* [a79baf03cd] - src: use global SealHandleScope (Trevor Norris) https://github.com/nodejs/node/pull/3945 -* [be39f30447] - test: add test-domain-exit-dispose-again back (Julien Gilli) https://github.com/nodejs/node/pull/4278 -* [da66166b9a] - test: fix test-domain-exit-dispose-again (Julien Gilli) https://github.com/nodejs/node/pull/3991 +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.11. ## 2016-03-02, Version 5.7.1 (Stable), @Fishrock123 -### Notable changes - -* **governance**: The Core Technical Committee (CTC) added four new members to help guide Node.js core development: Evan Lucas, Rich Trott, Ali Ijaz Sheikh and Сковорода Никита Андреевич (Nikita Skovoroda). -* **openssl**: Upgrade from 1.0.2f to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507). - - Fix a double-free defect in parsing malformed DSA keys that may potentially be used for DoS or memory corruption attacks. It is likely to be very difficult to use this defect for a practical attack and is therefore considered low severity for Node.js users. More info is available at [CVE-2016-0705](https://www.openssl.org/news/vulnerabilities.html#2016-0705). - - Fix a defect that can cause memory corruption in certain very rare cases relating to the internal `BN_hex2bn()` and `BN_dec2bn()` functions. It is believed that Node.js is not invoking the code paths that use these functions so practical attacks via Node.js using this defect are _unlikely_ to be possible. More info is available at [CVE-2016-0797](https://www.openssl.org/news/vulnerabilities.html#2016-0797). - - Fix a defect that makes the _[CacheBleed Attack](https://ssrg.nicta.com.au/projects/TS/cachebleed/)_ possible. This defect enables attackers to execute side-channel attacks leading to the potential recovery of entire RSA private keys. It only affects the Intel Sandy Bridge (and possibly older) microarchitecture when using hyper-threading. Newer microarchitectures, including Haswell, are unaffected. More info is available at [CVE-2016-0702](https://www.openssl.org/news/vulnerabilities.html#2016-0702). -* Fixed several regressions that appeared in v5.7.0: - - **`path.relative()`**: - - Output is no longer unnecessarily verbose (Brian White) [#5389](https://github.com/nodejs/node/pull/5389). - - Resolving UNC paths on Windows now works correctly (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456). - - Resolving paths with prefixes now works correctly from the root directory (Owen Smith) [#5490](https://github.com/nodejs/node/pull/5490). - - **url**: Fixed an off-by-one error with `parse()` (Brian White) [#5394](https://github.com/nodejs/node/pull/5394). - - **dgram**: Now correctly handles a default address case when offset and length are specified (Matteo Collina) [#5407](https://github.com/nodejs/node/pull/5407). - -### Commits - -* [[`7cae774d9b`](https://github.com/nodejs/node/commit/7cae774d9b)] - **benchmark**: refactor to eliminate redeclared vars (Rich Trott) [#5468](https://github.com/nodejs/node/pull/5468) -* [[`6aebe16669`](https://github.com/nodejs/node/commit/6aebe16669)] - **benchmark**: add benchmark for buf.compare() (Rich Trott) [#5441](https://github.com/nodejs/node/pull/5441) -* [[`00660f55c8`](https://github.com/nodejs/node/commit/00660f55c8)] - **benchmark**: move string-decoder to its own category (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) -* [[`4650cb3818`](https://github.com/nodejs/node/commit/4650cb3818)] - **benchmark**: fix configuation parameters (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) -* [[`3ccb275139`](https://github.com/nodejs/node/commit/3ccb275139)] - **benchmark**: merge url.js with url-resolve.js (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) -* [[`c1e7dbffaa`](https://github.com/nodejs/node/commit/c1e7dbffaa)] - **benchmark**: move misc to categorized directories (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) -* [[`2f9fee6e8e`](https://github.com/nodejs/node/commit/2f9fee6e8e)] - **benchmark**: use strict mode (Rich Trott) [#5336](https://github.com/nodejs/node/pull/5336) -* [[`4c09e7f359`](https://github.com/nodejs/node/commit/4c09e7f359)] - **build**: remove --quiet from eslint invocation (firedfox) [#5519](https://github.com/nodejs/node/pull/5519) -* [[`2c619f2012`](https://github.com/nodejs/node/commit/2c619f2012)] - **build**: run lint before tests (Rich Trott) [#5470](https://github.com/nodejs/node/pull/5470) -* [[`f349a9a2cf`](https://github.com/nodejs/node/commit/f349a9a2cf)] - **build**: update Node.js logo on OSX installer (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) -* [[`88f393588a`](https://github.com/nodejs/node/commit/88f393588a)] - **crypto**: PBKDF2 works with `int` not `ssize_t` (Fedor Indutny) [#5397](https://github.com/nodejs/node/pull/5397) -* [[`1e86804503`](https://github.com/nodejs/node/commit/1e86804503)] - **deps**: upgrade openssl to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507) -* [[`d3f9b84be8`](https://github.com/nodejs/node/commit/d3f9b84be8)] - **dgram**: handle default address case when offset and length are specified (Matteo Collina) -* [[`f1f3832934`](https://github.com/nodejs/node/commit/f1f3832934)] - **doc**: update NAN urls in ROADMAP.md and doc/releases.md (ronkorving) [#5472](https://github.com/nodejs/node/pull/5472) -* [[`51bc062dab`](https://github.com/nodejs/node/commit/51bc062dab)] - **doc**: add CTC meeting minutes 2016-02-17 (Rod Vagg) [#5410](https://github.com/nodejs/node/pull/5410) -* [[`795c85ba1c`](https://github.com/nodejs/node/commit/795c85ba1c)] - **doc**: fix typo in child_process documentation (Evan Lucas) [#5474](https://github.com/nodejs/node/pull/5474) -* [[`0a56e9690b`](https://github.com/nodejs/node/commit/0a56e9690b)] - **doc**: add note for binary safe string reading (Anton Andesen) [#5155](https://github.com/nodejs/node/pull/5155) -* [[`ea8331e15f`](https://github.com/nodejs/node/commit/ea8331e15f)] - **doc**: improvements to crypto.markdown copy (Alexander Makarenko) [#5230](https://github.com/nodejs/node/pull/5230) -* [[`378a772034`](https://github.com/nodejs/node/commit/378a772034)] - **doc**: `require` behavior on case-insensitive systems (Hugo Wood) -* [[`06b7eb6636`](https://github.com/nodejs/node/commit/06b7eb6636)] - **doc**: document base64url encoding support (Tristan Slominski) [#5243](https://github.com/nodejs/node/pull/5243) -* [[`8ec3d904cb`](https://github.com/nodejs/node/commit/8ec3d904cb)] - **doc**: improve httpVersionMajor / httpVersionMajor (Jackson Tian) [#5296](https://github.com/nodejs/node/pull/5296) -* [[`534e88f56c`](https://github.com/nodejs/node/commit/534e88f56c)] - **doc**: fix relative links in net docs (Evan Lucas) [#5358](https://github.com/nodejs/node/pull/5358) -* [[`7b98a30976`](https://github.com/nodejs/node/commit/7b98a30976)] - **doc**: fix crypto function indentation level (Brian White) [#5460](https://github.com/nodejs/node/pull/5460) -* [[`c0fd802cc2`](https://github.com/nodejs/node/commit/c0fd802cc2)] - **doc**: link to man pages (dcposch@dcpos.ch) [#5073](https://github.com/nodejs/node/pull/5073) -* [[`f8c6701e22`](https://github.com/nodejs/node/commit/f8c6701e22)] - **doc**: add missing property in cluster example (Rafael Cepeda) [#5305](https://github.com/nodejs/node/pull/5305) -* [[`3bfe0483f0`](https://github.com/nodejs/node/commit/3bfe0483f0)] - **doc**: corrected name of argument in socket.send (Chris Dew) [#5449](https://github.com/nodejs/node/pull/5449) -* [[`c8725f5e95`](https://github.com/nodejs/node/commit/c8725f5e95)] - **doc**: fix links in tls, cluster docs (Alexander Makarenko) [#5364](https://github.com/nodejs/node/pull/5364) -* [[`7f2cf9af5c`](https://github.com/nodejs/node/commit/7f2cf9af5c)] - **doc**: explicit about VS 2015 support in readme (Phillip Johnsen) [#5406](https://github.com/nodejs/node/pull/5406) -* [[`12d3cdbfea`](https://github.com/nodejs/node/commit/12d3cdbfea)] - **doc**: remove out-of-date matter from internal docs (Rich Trott) [#5421](https://github.com/nodejs/node/pull/5421) -* [[`43853679f7`](https://github.com/nodejs/node/commit/43853679f7)] - **doc**: copyedit util doc (Rich Trott) [#5399](https://github.com/nodejs/node/pull/5399) -* [[`903e8d09e1`](https://github.com/nodejs/node/commit/903e8d09e1)] - **doc**: fix typo in pbkdf2Sync code sample (Marc Cuva) [#5306](https://github.com/nodejs/node/pull/5306) -* [[`79b1c22c9f`](https://github.com/nodejs/node/commit/79b1c22c9f)] - **doc**: fix buf.readInt16LE output (Chinedu Francis Nwafili) [#5282](https://github.com/nodejs/node/pull/5282) -* [[`e46915f2f3`](https://github.com/nodejs/node/commit/e46915f2f3)] - **doc**: note util.isError() @@toStringTag limitations (cjihrig) [#5414](https://github.com/nodejs/node/pull/5414) -* [[`935fd21fff`](https://github.com/nodejs/node/commit/935fd21fff)] - **doc**: clarify error handling in net.createServer (Dirceu Pereira Tiegs) [#5353](https://github.com/nodejs/node/pull/5353) -* [[`93dce6d4fe`](https://github.com/nodejs/node/commit/93dce6d4fe)] - **doc**: document fs.datasync(Sync) (Ron Korving) [#5402](https://github.com/nodejs/node/pull/5402) -* [[`96daf51358`](https://github.com/nodejs/node/commit/96daf51358)] - **doc**: add Evan Lucas to the CTC (Rod Vagg) [#5275](https://github.com/nodejs/node/pull/5275) -* [[`31b405d0cf`](https://github.com/nodejs/node/commit/31b405d0cf)] - **doc**: add Rich Trott to the CTC (Rod Vagg) [#5276](https://github.com/nodejs/node/pull/5276) -* [[`bcd154e402`](https://github.com/nodejs/node/commit/bcd154e402)] - **doc**: add Ali Ijaz Sheikh to the CTC (Rod Vagg) [#5277](https://github.com/nodejs/node/pull/5277) -* [[`9d0330c804`](https://github.com/nodejs/node/commit/9d0330c804)] - **doc**: add Сковорода Никита Андреевич to the CTC (Rod Vagg) [#5278](https://github.com/nodejs/node/pull/5278) -* [[`365cc63783`](https://github.com/nodejs/node/commit/365cc63783)] - **doc**: add "building node with ninja" guide (Jeremiah Senkpiel) [#4767](https://github.com/nodejs/node/pull/4767) -* [[`2b00c315e1`](https://github.com/nodejs/node/commit/2b00c315e1)] - **doc**: mention prototype check in deepStrictEqual() (cjihrig) [#5367](https://github.com/nodejs/node/pull/5367) -* [[`ff988b3ee6`](https://github.com/nodejs/node/commit/ff988b3ee6)] - **doc,tools,test**: lint doc-based addon tests (Rich Trott) [#5427](https://github.com/nodejs/node/pull/5427) -* [[`d77c3bf204`](https://github.com/nodejs/node/commit/d77c3bf204)] - **http_parser**: use `MakeCallback` (Trevor Norris) [#5419](https://github.com/nodejs/node/pull/5419) -* [[`e3421ac296`](https://github.com/nodejs/node/commit/e3421ac296)] - **lib**: freelist: use .pop() for allocation (Anton Khlynovskiy) [#2174](https://github.com/nodejs/node/pull/2174) -* [[`91d218d096`](https://github.com/nodejs/node/commit/91d218d096)] - **path**: fix path.relative() for prefixes at root (Owen Smith) [#5490](https://github.com/nodejs/node/pull/5490) -* [[`ef7a088906`](https://github.com/nodejs/node/commit/ef7a088906)] - **path**: fix win32 parse() (Zheng Chaoping) [#5484](https://github.com/nodejs/node/pull/5484) -* [[`871396ce8f`](https://github.com/nodejs/node/commit/871396ce8f)] - **path**: fix win32 relative() for UNC paths (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) -* [[`91782f1888`](https://github.com/nodejs/node/commit/91782f1888)] - **path**: fix win32 relative() when "to" is a prefix (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) -* [[`30cec18eeb`](https://github.com/nodejs/node/commit/30cec18eeb)] - **path**: fix verbose relative() output (Brian White) [#5389](https://github.com/nodejs/node/pull/5389) -* [[`2b88523836`](https://github.com/nodejs/node/commit/2b88523836)] - **repl**: fix stack trace column number in strict mode (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) -* [[`51db48f741`](https://github.com/nodejs/node/commit/51db48f741)] - **src,tools**: remove null sentinel from source array (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) -* [[`03a5daba55`](https://github.com/nodejs/node/commit/03a5daba55)] - **src,tools**: drop nul byte from built-in source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) -* [[`17d14f3346`](https://github.com/nodejs/node/commit/17d14f3346)] - **src,tools**: allow utf-8 in built-in js source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) -* [[`12ae6abc69`](https://github.com/nodejs/node/commit/12ae6abc69)] - **test**: increase timeout for test-tls-fast-writing (Rich Trott) [#5466](https://github.com/nodejs/node/pull/5466) -* [[`81348e8855`](https://github.com/nodejs/node/commit/81348e8855)] - **test**: apply Linux workaround to Linux only (Rich Trott) [#5471](https://github.com/nodejs/node/pull/5471) -* [[`c4d9cdb7d0`](https://github.com/nodejs/node/commit/c4d9cdb7d0)] - **test**: allow options for v8 testing (Michael Dawson) [#5502](https://github.com/nodejs/node/pull/5502) -* [[`d1a82c6824`](https://github.com/nodejs/node/commit/d1a82c6824)] - **test**: retry on known SmartOS bug (Rich Trott) [#5454](https://github.com/nodejs/node/pull/5454) -* [[`c7f8a13043`](https://github.com/nodejs/node/commit/c7f8a13043)] - **test**: remove unneeded bind() and related comments (Aayush Naik) [#5023](https://github.com/nodejs/node/pull/5023) -* [[`cc4cbb10df`](https://github.com/nodejs/node/commit/cc4cbb10df)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5422](https://github.com/nodejs/node/pull/5422) -* [[`0ebbf6cd53`](https://github.com/nodejs/node/commit/0ebbf6cd53)] - **test**: remove flaky designation from fixed tests (Rich Trott) [#5459](https://github.com/nodejs/node/pull/5459) -* [[`c83725c604`](https://github.com/nodejs/node/commit/c83725c604)] - **test**: add test-cases for posix path.relative() (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) -* [[`22bb7c9d27`](https://github.com/nodejs/node/commit/22bb7c9d27)] - **test**: fix test runner arg regression (Stefan Budeanu) [#5446](https://github.com/nodejs/node/pull/5446) -* [[`8c67b94b11`](https://github.com/nodejs/node/commit/8c67b94b11)] - **test**: refactor test-dgram-send-callback-recursive (Santiago Gimeno) [#5079](https://github.com/nodejs/node/pull/5079) -* [[`2c21d34a2f`](https://github.com/nodejs/node/commit/2c21d34a2f)] - **test**: refactor test-dgram-udp4 (Santiago Gimeno) [#5339](https://github.com/nodejs/node/pull/5339) -* [[`479a43c876`](https://github.com/nodejs/node/commit/479a43c876)] - **test**: allow passing args to executable (Stefan Budeanu) [#5376](https://github.com/nodejs/node/pull/5376) -* [[`ff75023812`](https://github.com/nodejs/node/commit/ff75023812)] - **test**: fix test-timers.reliability on OS X (Rich Trott) [#5379](https://github.com/nodejs/node/pull/5379) -* [[`991f82b4bd`](https://github.com/nodejs/node/commit/991f82b4bd)] - **test**: mitigate flaky test-http-agent (Rich Trott) [#5346](https://github.com/nodejs/node/pull/5346) -* [[`0f54553a99`](https://github.com/nodejs/node/commit/0f54553a99)] - **test**: increase timeouts on some unref timers tests (Jeremiah Senkpiel) [#5352](https://github.com/nodejs/node/pull/5352) -* [[`25c01cd779`](https://github.com/nodejs/node/commit/25c01cd779)] - **tls**: fix assert in context.\_external accessor (Ben Noordhuis) [#5521](https://github.com/nodejs/node/pull/5521) -* [[`5ffd7430d1`](https://github.com/nodejs/node/commit/5ffd7430d1)] - **tools**: apply custom buffer lint rule to /lib only (Rich Trott) [#5371](https://github.com/nodejs/node/pull/5371) -* [[`fa5d28f246`](https://github.com/nodejs/node/commit/fa5d28f246)] - **tools**: enable additional lint rules (Rich Trott) [#5357](https://github.com/nodejs/node/pull/5357) -* [[`b44b701e5b`](https://github.com/nodejs/node/commit/b44b701e5b)] - **tools,benchmark**: increase lint compliance (Rich Trott) [#5429](https://github.com/nodejs/node/pull/5429) -* [[`9424fa5732`](https://github.com/nodejs/node/commit/9424fa5732)] - **url**: group slashed protocols by protocol name (nettofarah) [#5380](https://github.com/nodejs/node/pull/5380) -* [[`dfe45f13e7`](https://github.com/nodejs/node/commit/dfe45f13e7)] - **url**: fix off-by-one error with parse() (Brian White) [#5394](https://github.com/nodejs/node/pull/5394) +Moved to doc/changelogs/CHANGELOG_V5.md#5.7.1. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.3.2. ## 2016-02-23, Version 5.7.0 (Stable), @rvagg -### Notable changes - -* **buffer**: - - You can now supply an `encoding` argument when filling a Buffer `Buffer#fill(string[, start[, end]][, encoding])`, supplying an existing Buffer will also work with `Buffer#fill(buffer[, start[, end]])`. See the [API documentation](https://nodejs.org/api/buffer.html#buffer_buf_fill_value_offset_end_encoding) for details on how this works. (Trevor Norris) [#4935](https://github.com/nodejs/node/pull/4935) - - `Buffer#indexOf()` no longer requires a `byteOffset` argument if you also wish to specify an `encoding`: `Buffer#indexOf(val[, byteOffset][, encoding])`. (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) -* **child_process**: `spawn()` and `spawnSync()` now support a `'shell'` option to allow for optional execution of the given command inside a shell. If set to `true`, `cmd.exe` will be used on Windows and `/bin/sh` elsewhere. A path to a custom shell can also be passed to override these defaults. On Windows, this option allows `.bat.` and `.cmd` files to be executed with `spawn()` and `spawnSync()`. (Colin Ihrig) [#4598](https://github.com/nodejs/node/pull/4598) -* **http_parser**: Update to http-parser 2.6.2 to fix an unintentionally strict limitation of allowable header characters (James M Snell) [#5237](https://github.com/nodejs/node/pull/5237) -* **dgram**: `socket.send()` now supports accepts an array of Buffers or Strings as the first argument. See the [API docs](https://nodejs.org/download/nightly/v6.0.0-nightly201602102848f84332/docs/api/dgram.html#dgram_socket_send_msg_offset_length_port_address_callback) for details on how this works. (Matteo Collina) [#4374](https://github.com/nodejs/node/pull/4374) -* **http**: Fix a bug where handling headers will mistakenly trigger an `'upgrade'` event where the server is just advertising its protocols. This bug can prevent HTTP clients from communicating with HTTP/2 enabled servers. (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) -* **net**: Added a `listening` Boolean property to `net` and `http` servers to indicate whether the server is listening for connections. (José Moreira) [#4743](https://github.com/nodejs/node/pull/4743) -* **node**: The C++ `node::MakeCallback()` API is now reentrant and calling it from inside another `MakeCallback()` call no longer causes the `nextTick` queue or Promises microtask queue to be processed out of order. (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* **tls**: Add a new `tlsSocket.getProtocol()` method to get the negotiated TLS protocol version of the current connection. (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) -* **vm**: Introduce new `'produceCachedData'` and `'cachedData'` options to `new vm.Script()` to interact with V8's code cache. When a new `vm.Script` object is created with the `'produceCachedData'` set to `true` a `Buffer` with V8's code cache data will be produced and stored in `cachedData` property of the returned object. This data in turn may be supplied back to another `vm.Script()` object with a `'cachedData'` option if the supplied source is the same. Successfully executing a script from cached data can speed up instantiation time. See the [API docs](https://nodejs.org/api/vm.html#vm_new_vm_script_code_options) for details. (Fedor Indutny) [#4777](https://github.com/nodejs/node/pull/4777) -* **performance**: Improvements in: - - `process.nextTick()` (Ruben Bridgewater) [#5092](https://github.com/nodejs/node/pull/5092) - - `path` module (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) - - `querystring` module (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) - - `streams` module when processing small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) - -### Commits - -* [[`3a96fa0030`](https://github.com/nodejs/node/commit/3a96fa0030)] - **async_wrap**: add parent uid to init hook (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) -* [[`4ef04c7c4c`](https://github.com/nodejs/node/commit/4ef04c7c4c)] - **async_wrap**: make uid the first argument in init (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) -* [[`4afe801f90`](https://github.com/nodejs/node/commit/4afe801f90)] - **async_wrap**: add uid to all asyncWrap hooks (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) -* [[`edf8f8a7da`](https://github.com/nodejs/node/commit/edf8f8a7da)] - **benchmark**: split path benchmarks (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) -* [[`8d713d8d51`](https://github.com/nodejs/node/commit/8d713d8d51)] - **benchmark**: allow empty parameters (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) -* [[`eb6d07327a`](https://github.com/nodejs/node/commit/eb6d07327a)] - **(SEMVER-MINOR)** **buffer**: add encoding parameter to fill() (Trevor Norris) [#4935](https://github.com/nodejs/node/pull/4935) -* [[`60d2048b6c`](https://github.com/nodejs/node/commit/60d2048b6c)] - **(SEMVER-MINOR)** **buffer**: properly retrieve binary length of needle (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) -* [[`4c67d74607`](https://github.com/nodejs/node/commit/4c67d74607)] - **(SEMVER-MINOR)** **buffer**: allow encoding param to collapse (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) -* [[`5fa4117bfc`](https://github.com/nodejs/node/commit/5fa4117bfc)] - **build**: add a help message and removed a TODO. (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) -* [[`09bfb865af`](https://github.com/nodejs/node/commit/09bfb865af)] - **build**: remove redundant TODO in configure (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) -* [[`3dfc11c516`](https://github.com/nodejs/node/commit/3dfc11c516)] - **build**: remove Makefile.build (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) -* [[`fc78d3d6a7`](https://github.com/nodejs/node/commit/fc78d3d6a7)] - **build**: skip msi build if WiX is not found (Tsarevich Dmitry) [#5220](https://github.com/nodejs/node/pull/5220) -* [[`356acb39d7`](https://github.com/nodejs/node/commit/356acb39d7)] - **build**: treat aarch64 as arm64 (Johan Bergström) [#5191](https://github.com/nodejs/node/pull/5191) -* [[`3b83d42b4a`](https://github.com/nodejs/node/commit/3b83d42b4a)] - **build**: fix build when python path contains spaces (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) -* [[`9e6ad2d8ff`](https://github.com/nodejs/node/commit/9e6ad2d8ff)] - **child_process**: fix data loss with readable event (Brian White) [#5036](https://github.com/nodejs/node/pull/5036) -* [[`ecc797600f`](https://github.com/nodejs/node/commit/ecc797600f)] - **(SEMVER-MINOR)** **child_process**: add shell option to spawn() (cjihrig) [#4598](https://github.com/nodejs/node/pull/4598) -* [[`efd6f68dce`](https://github.com/nodejs/node/commit/efd6f68dce)] - **cluster**: dont rely on `this` in `fork` (Igor Klopov) [#5216](https://github.com/nodejs/node/pull/5216) -* [[`df93d60caf`](https://github.com/nodejs/node/commit/df93d60caf)] - **console**: apply null as `this` for util.format (Jackson Tian) [#5222](https://github.com/nodejs/node/pull/5222) -* [[`c397ba8fa3`](https://github.com/nodejs/node/commit/c397ba8fa3)] - **contextify**: use offset/length from Uint8Array (Fedor Indutny) [#4947](https://github.com/nodejs/node/pull/4947) -* [[`3048ac0b57`](https://github.com/nodejs/node/commit/3048ac0b57)] - **crypto**: have fixed NodeBIOs return EOF (Adam Langley) [#5105](https://github.com/nodejs/node/pull/5105) -* [[`af074846f5`](https://github.com/nodejs/node/commit/af074846f5)] - **debugger**: remove unneeded callback check (Rich Trott) [#5319](https://github.com/nodejs/node/pull/5319) -* [[`7bac743f36`](https://github.com/nodejs/node/commit/7bac743f36)] - **debugger**: assert test before accessing this.binding (Prince J Wesley) [#5145](https://github.com/nodejs/node/pull/5145) -* [[`18c94e5a8d`](https://github.com/nodejs/node/commit/18c94e5a8d)] - **deps**: remove unnecessary files (Brian White) [#5212](https://github.com/nodejs/node/pull/5212) -* [[`967cf97bf0`](https://github.com/nodejs/node/commit/967cf97bf0)] - **deps**: cherry-pick 2e4da65 from v8's 4.8 upstream (Michael Dawson) [#5293](https://github.com/nodejs/node/pull/5293) -* [[`bbdf2684d5`](https://github.com/nodejs/node/commit/bbdf2684d5)] - **deps**: update to http-parser 2.6.2 (James M Snell) [#5237](https://github.com/nodejs/node/pull/5237) -* [[`127dd6275a`](https://github.com/nodejs/node/commit/127dd6275a)] - ***Revert*** "**deps**: sync with upstream c-ares/c-ares@4ef6817" (Ben Noordhuis) [#5199](https://github.com/nodejs/node/pull/5199) -* [[`35c3832994`](https://github.com/nodejs/node/commit/35c3832994)] - **deps**: sync with upstream c-ares/c-ares@4ef6817 (Fedor Indutny) [#5199](https://github.com/nodejs/node/pull/5199) -* [[`b4db31822f`](https://github.com/nodejs/node/commit/b4db31822f)] - **dgram**: scope redeclared variables (Rich Trott) [#4940](https://github.com/nodejs/node/pull/4940) -* [[`368c1d1098`](https://github.com/nodejs/node/commit/368c1d1098)] - **(SEMVER-MINOR)** **dgram**: support dgram.send with multiple buffers (Matteo Collina) [#4374](https://github.com/nodejs/node/pull/4374) -* [[`a8862f59eb`](https://github.com/nodejs/node/commit/a8862f59eb)] - **doc**: update repo docs to use 'CTC' (Alexis Campailla) [#5304](https://github.com/nodejs/node/pull/5304) -* [[`6cf8ec5bd1`](https://github.com/nodejs/node/commit/6cf8ec5bd1)] - **doc**: s/http/https in Myles Borins' GitHub link (Rod Vagg) [#5356](https://github.com/nodejs/node/pull/5356) -* [[`0389e3803c`](https://github.com/nodejs/node/commit/0389e3803c)] - **doc**: clarify child_process.execFile{,Sync} file arg (Kevin Locke) [#5310](https://github.com/nodejs/node/pull/5310) -* [[`c48290d9b7`](https://github.com/nodejs/node/commit/c48290d9b7)] - **doc**: fix buf.length slice example (Chinedu Francis Nwafili) [#5259](https://github.com/nodejs/node/pull/5259) -* [[`a6e437c619`](https://github.com/nodejs/node/commit/a6e437c619)] - **doc**: fix buffer\[index\] example (Chinedu Francis Nwafili) [#5253](https://github.com/nodejs/node/pull/5253) -* [[`73ef1bd423`](https://github.com/nodejs/node/commit/73ef1bd423)] - **doc**: fix template string (Rafael Cepeda) [#5240](https://github.com/nodejs/node/pull/5240) -* [[`fa04daa384`](https://github.com/nodejs/node/commit/fa04daa384)] - **doc**: clarify exceptions during uncaughtException (Noah Rose) [#5180](https://github.com/nodejs/node/pull/5180) -* [[`22f132e61d`](https://github.com/nodejs/node/commit/22f132e61d)] - **doc**: improvements to console.markdown copy (Alexander Makarenko) [#5225](https://github.com/nodejs/node/pull/5225) -* [[`48fa6f6063`](https://github.com/nodejs/node/commit/48fa6f6063)] - **doc**: update process.send() signature (cjihrig) [#5284](https://github.com/nodejs/node/pull/5284) -* [[`35d89d4662`](https://github.com/nodejs/node/commit/35d89d4662)] - **doc**: fix net.createConnection() example (Brian White) [#5219](https://github.com/nodejs/node/pull/5219) -* [[`149007c9f0`](https://github.com/nodejs/node/commit/149007c9f0)] - **doc**: replace node-forward link in CONTRIBUTING.md (Ben Noordhuis) [#5227](https://github.com/nodejs/node/pull/5227) -* [[`a6aaf2caab`](https://github.com/nodejs/node/commit/a6aaf2caab)] - **doc**: improve scrolling, various CSS tweaks (Roman Reiss) [#5198](https://github.com/nodejs/node/pull/5198) -* [[`18b00deeac`](https://github.com/nodejs/node/commit/18b00deeac)] - **doc**: update DCO to v1.1 (Mikeal Rogers) [#5170](https://github.com/nodejs/node/pull/5170) -* [[`3955bc4cd0`](https://github.com/nodejs/node/commit/3955bc4cd0)] - **doc**: fix minor inconsistencies in repl doc (Rich Trott) [#5193](https://github.com/nodejs/node/pull/5193) -* [[`287bce7b48`](https://github.com/nodejs/node/commit/287bce7b48)] - **doc**: merging behavior of writeHead vs setHeader (Alejandro Oviedo) [#5081](https://github.com/nodejs/node/pull/5081) -* [[`529e749d88`](https://github.com/nodejs/node/commit/529e749d88)] - **doc**: fix type references for link gen, link css (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) -* [[`275f6dbcbb`](https://github.com/nodejs/node/commit/275f6dbcbb)] - **(SEMVER-MINOR)** **doc**: correct tlsSocket.getCipher() description (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) -* [[`b706b0c2c5`](https://github.com/nodejs/node/commit/b706b0c2c5)] - **http**: remove old, confusing comment (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) -* [[`ed36235248`](https://github.com/nodejs/node/commit/ed36235248)] - **http**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) -* [[`7e82a566b3`](https://github.com/nodejs/node/commit/7e82a566b3)] - **(SEMVER-MINOR)** **http**: allow async createConnection() (Brian White) [#4638](https://github.com/nodejs/node/pull/4638) -* [[`411d813323`](https://github.com/nodejs/node/commit/411d813323)] - **http**: do not emit `upgrade` on advertisement (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) -* [[`bbc786b50f`](https://github.com/nodejs/node/commit/bbc786b50f)] - **http,util**: fix typos in comments (Alexander Makarenko) [#5279](https://github.com/nodejs/node/pull/5279) -* [[`a2d198c702`](https://github.com/nodejs/node/commit/a2d198c702)] - **net**: use `_server` for internal book-keeping (Fedor Indutny) [#5262](https://github.com/nodejs/node/pull/5262) -* [[`18d24e60c5`](https://github.com/nodejs/node/commit/18d24e60c5)] - **(SEMVER-MINOR)** **net**: add net.listening boolean property over a getter (José Moreira) [#4743](https://github.com/nodejs/node/pull/4743) -* [[`9cee86e3e9`](https://github.com/nodejs/node/commit/9cee86e3e9)] - **node**: set process._eventsCount to 0 on startup (Evan Lucas) [#5208](https://github.com/nodejs/node/pull/5208) -* [[`f2e4f621c5`](https://github.com/nodejs/node/commit/f2e4f621c5)] - **node**: improve process.nextTick performance (Ruben Bridgewater) [#5092](https://github.com/nodejs/node/pull/5092) -* [[`1c6f927bd1`](https://github.com/nodejs/node/commit/1c6f927bd1)] - **path**: fix input type checking regression (Brian White) [#5244](https://github.com/nodejs/node/pull/5244) -* [[`4dae8caf7a`](https://github.com/nodejs/node/commit/4dae8caf7a)] - **path**: performance improvements on all platforms (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) -* [[`46be1f4d0c`](https://github.com/nodejs/node/commit/46be1f4d0c)] - **querystring**: improve escape() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) -* [[`27e323e8c1`](https://github.com/nodejs/node/commit/27e323e8c1)] - **querystring**: improve unescapeBuffer() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) -* [[`301023b2b4`](https://github.com/nodejs/node/commit/301023b2b4)] - **querystring**: improve parse() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) -* [[`98907c716b`](https://github.com/nodejs/node/commit/98907c716b)] - **(SEMVER-MINOR)** **repl**: allow multiline function call (Zirak) [#3823](https://github.com/nodejs/node/pull/3823) -* [[`c551da8cb4`](https://github.com/nodejs/node/commit/c551da8cb4)] - **repl**: handle quotes within regexp literal (Prince J Wesley) [#5117](https://github.com/nodejs/node/pull/5117) -* [[`15091ccca2`](https://github.com/nodejs/node/commit/15091ccca2)] - **src**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) -* [[`830bb04d90`](https://github.com/nodejs/node/commit/830bb04d90)] - **src**: remove TryCatch in MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`7f22c8c8a6`](https://github.com/nodejs/node/commit/7f22c8c8a6)] - **src**: remove unused TickInfo::in_tick() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`406eb1f516`](https://github.com/nodejs/node/commit/406eb1f516)] - **src**: remove unused of TickInfo::last_threw() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`bcec2fecbd`](https://github.com/nodejs/node/commit/bcec2fecbd)] - **src**: add AsyncCallbackScope (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`2cb1594279`](https://github.com/nodejs/node/commit/2cb1594279)] - **src**: fix MakeCallback error handling (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`8d6e679a90`](https://github.com/nodejs/node/commit/8d6e679a90)] - **src,test,tools**: modify for more stringent linting (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) -* [[`7684b0fcdf`](https://github.com/nodejs/node/commit/7684b0fcdf)] - **stream**: fix no data on partial decode (Brian White) [#5226](https://github.com/nodejs/node/pull/5226) -* [[`f706cb0189`](https://github.com/nodejs/node/commit/f706cb0189)] - **streams**: 5% throughput gain when sending small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) -* [[`25513a473a`](https://github.com/nodejs/node/commit/25513a473a)] - **string_decoder**: fix performance regression (Brian White) [#5134](https://github.com/nodejs/node/pull/5134) -* [[`0e85530d8c`](https://github.com/nodejs/node/commit/0e85530d8c)] - **test**: use String.prototype.repeat() for clarity (Rich Trott) [#5311](https://github.com/nodejs/node/pull/5311) -* [[`5683efb90a`](https://github.com/nodejs/node/commit/5683efb90a)] - **test**: remove flaky mark for test-debug-no-context (Rich Trott) [#5317](https://github.com/nodejs/node/pull/5317) -* [[`c55bb79ace`](https://github.com/nodejs/node/commit/c55bb79ace)] - **test**: add test for https server close event (Braydon Fuller) [#5106](https://github.com/nodejs/node/pull/5106) -* [[`138ee983b0`](https://github.com/nodejs/node/commit/138ee983b0)] - **test**: refactor test-http-destroyed-socket-write2 (Santiago Gimeno) [#4970](https://github.com/nodejs/node/pull/4970) -* [[`df7d91f36b`](https://github.com/nodejs/node/commit/df7d91f36b)] - **test**: mitigate flaky test-debug-no-context (Rich Trott) [#5269](https://github.com/nodejs/node/pull/5269) -* [[`d9177e7c26`](https://github.com/nodejs/node/commit/d9177e7c26)] - **test**: test-process-getactivehandles is flaky (Alexis Campailla) [#5303](https://github.com/nodejs/node/pull/5303) -* [[`f5cc04732f`](https://github.com/nodejs/node/commit/f5cc04732f)] - **test**: mark test-http-regr-gh-2928 flaky (Rich Trott) [#5280](https://github.com/nodejs/node/pull/5280) -* [[`78b349d5d1`](https://github.com/nodejs/node/commit/78b349d5d1)] - **test**: disable fs watch tests for AIX (Michael Dawson) [#5187](https://github.com/nodejs/node/pull/5187) -* [[`82ee5e94df`](https://github.com/nodejs/node/commit/82ee5e94df)] - **test**: mark test-http-agent flaky (Rich Trott) [#5209](https://github.com/nodejs/node/pull/5209) -* [[`1494d6f213`](https://github.com/nodejs/node/commit/1494d6f213)] - **test**: minimal repl eval option test (Rich Trott) [#5192](https://github.com/nodejs/node/pull/5192) -* [[`e7bf951136`](https://github.com/nodejs/node/commit/e7bf951136)] - **test**: add addons test for MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) -* [[`98596a94fa`](https://github.com/nodejs/node/commit/98596a94fa)] - **(SEMVER-MINOR)** **test**: run v8 tests from node tree (Bryon Leung) [#4704](https://github.com/nodejs/node/pull/4704) -* [[`69c544f245`](https://github.com/nodejs/node/commit/69c544f245)] - **test**: fix flaky test-http-regr-gh-2928 (Rich Trott) [#5154](https://github.com/nodejs/node/pull/5154) -* [[`7c88410507`](https://github.com/nodejs/node/commit/7c88410507)] - **test**: fix child-process-fork-regr-gh-2847 again (Santiago Gimeno) [#5179](https://github.com/nodejs/node/pull/5179) -* [[`2c2cb6700d`](https://github.com/nodejs/node/commit/2c2cb6700d)] - **test**: remove unneeded common.indirectInstanceOf() (Rich Trott) [#5149](https://github.com/nodejs/node/pull/5149) -* [[`6340974f21`](https://github.com/nodejs/node/commit/6340974f21)] - **test**: don't run test-tick-processor.js on Aix (Michael Dawson) [#5093](https://github.com/nodejs/node/pull/5093) -* [[`a8f4db236c`](https://github.com/nodejs/node/commit/a8f4db236c)] - **test**: improve path tests (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) -* [[`8301773c1e`](https://github.com/nodejs/node/commit/8301773c1e)] - **test**: fix child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5121](https://github.com/nodejs/node/pull/5121) -* [[`f2bd86775b`](https://github.com/nodejs/node/commit/f2bd86775b)] - **test**: update arrow function style (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) -* [[`aed04b85c2`](https://github.com/nodejs/node/commit/aed04b85c2)] - **tls**: nullify `.ssl` on handle close (Fedor Indutny) [#5168](https://github.com/nodejs/node/pull/5168) -* [[`c3f8aab652`](https://github.com/nodejs/node/commit/c3f8aab652)] - **(SEMVER-MINOR)** **tls**: add getProtocol() to TLS sockets (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) -* [[`7fc2e3161f`](https://github.com/nodejs/node/commit/7fc2e3161f)] - **tools**: add Node.js-specific ESLint rules (Rich Trott) [#5320](https://github.com/nodejs/node/pull/5320) -* [[`983325cb0c`](https://github.com/nodejs/node/commit/983325cb0c)] - **tools**: replace obsolete ESLint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) -* [[`f601d040b5`](https://github.com/nodejs/node/commit/f601d040b5)] - **tools**: update ESLint to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) -* [[`13af565759`](https://github.com/nodejs/node/commit/13af565759)] - **tools**: remove obsolete lint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) -* [[`c566f44f1b`](https://github.com/nodejs/node/commit/c566f44f1b)] - **tools**: add recommended ES6 lint rules (Rich Trott) [#5210](https://github.com/nodejs/node/pull/5210) -* [[`b611caa0ba`](https://github.com/nodejs/node/commit/b611caa0ba)] - **tools**: add recommended linting rules (Rich Trott) [#5188](https://github.com/nodejs/node/pull/5188) -* [[`b1a16d1202`](https://github.com/nodejs/node/commit/b1a16d1202)] - **tools**: remove excessive comments from .eslintrc (Rich Trott) [#5151](https://github.com/nodejs/node/pull/5151) -* [[`c4ed5ece4d`](https://github.com/nodejs/node/commit/c4ed5ece4d)] - **tools**: enable no-proto rule for linter (Jackson Tian) [#5140](https://github.com/nodejs/node/pull/5140) -* [[`86f8477b56`](https://github.com/nodejs/node/commit/86f8477b56)] - **tools**: disallow mixed spaces and tabs for indents (Rich Trott) [#5135](https://github.com/nodejs/node/pull/5135) -* [[`21fd1496a9`](https://github.com/nodejs/node/commit/21fd1496a9)] - **tools**: alphabetize eslint stylistic issues section (Rich Trott) -* [[`22c8d50a1f`](https://github.com/nodejs/node/commit/22c8d50a1f)] - **tools**: parse types into links in doc html gen (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) -* [[`5c54d4987d`](https://github.com/nodejs/node/commit/5c54d4987d)] - **tools**: enable no-redeclare rule for linter (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) -* [[`a3a0cf603a`](https://github.com/nodejs/node/commit/a3a0cf603a)] - **tools**: add arrow function rules to eslint (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) -* [[`bcc26f747f`](https://github.com/nodejs/node/commit/bcc26f747f)] - **tools,doc**: fix linting errors (Rich Trott) [#5161](https://github.com/nodejs/node/pull/5161) -* [[`47274704aa`](https://github.com/nodejs/node/commit/47274704aa)] - **url**: fix lint and deopt issues (Brian White) [#5300](https://github.com/nodejs/node/pull/5300) -* [[`729ad75860`](https://github.com/nodejs/node/commit/729ad75860)] - **url**: improve url.parse() performance (Brian White) [#4892](https://github.com/nodejs/node/pull/4892) -* [[`6c8378b15b`](https://github.com/nodejs/node/commit/6c8378b15b)] - **vm**: fix `produceCachedData` (Jiho Choi) [#5343](https://github.com/nodejs/node/pull/5343) -* [[`d1cacb814f`](https://github.com/nodejs/node/commit/d1cacb814f)] - **(SEMVER-MINOR)** **vm**: introduce `cachedData`/`produceCachedData` (Fedor Indutny) [#4777](https://github.com/nodejs/node/pull/4777) +Moved to doc/changelogs/CHANGELOG_V5.md#5.7.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.3.1. ## 2016-02-09, Version 5.6.0 (Stable), @jasnell -This is an important security release. All Node.js users should consult the security release summary at nodejs.org for details on patched vulnerabilities. - -### Notable changes - -* **http**: fix defects in HTTP header parsing for requests and responses that can allow request smuggling (CVE-2016-2086) or response splitting (CVE-2016-2216). HTTP header parsing now aligns more closely with the HTTP spec including restricting the acceptable characters. -* **http-parser**: upgrade from 2.6.0 to 2.6.1 -* **npm**: upgrade npm from 3.3.12 to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) -* **openssl**: upgrade from 1.0.2e to 1.0.2f. To mitigate against the Logjam attack, TLS clients now reject Diffie-Hellman handshakes with parameters shorter than 1024-bits, up from the previous limit of 768-bits. - -### Commits - -* [[`3b6283c163`](https://github.com/nodejs/node/commit/3b6283c163)] - **benchmark**: add a constant declaration for `net` (Minwoo Jung) [#3950](https://github.com/nodejs/node/pull/3950) -* [[`3175f7450e`](https://github.com/nodejs/node/commit/3175f7450e)] - **buffer**: remove duplicated code in fromObject (HUANG Wei) [#4948](https://github.com/nodejs/node/pull/4948) -* [[`58d67e26a2`](https://github.com/nodejs/node/commit/58d67e26a2)] - **buffer**: validate list elements in Buffer.concat (Michaël Zasso) [#4951](https://github.com/nodejs/node/pull/4951) -* [[`bafc86f00e`](https://github.com/nodejs/node/commit/bafc86f00e)] - **buffer**: refactor redeclared variables (Rich Trott) [#4886](https://github.com/nodejs/node/pull/4886) -* [[`0fa4d90b94`](https://github.com/nodejs/node/commit/0fa4d90b94)] - **build**: Add VARIATION variable to binary target (Stefan Budeanu) [#4631](https://github.com/nodejs/node/pull/4631) -* [[`ec62789152`](https://github.com/nodejs/node/commit/ec62789152)] - **crypto**: fix memory leak in LoadPKCS12 (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) -* [[`d9e934c71f`](https://github.com/nodejs/node/commit/d9e934c71f)] - **crypto**: add `pfx` certs as CA certs too (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) -* [[`0d4b538175`](https://github.com/nodejs/node/commit/0d4b538175)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919) -* [[`abb0f6cd53`](https://github.com/nodejs/node/commit/abb0f6cd53)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914) -* [[`755619c554`](https://github.com/nodejs/node/commit/755619c554)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913) -* [[`d5d2f86f89`](https://github.com/nodejs/node/commit/d5d2f86f89)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.6.1 (James M Snell) -* [[`f0bd176d6d`](https://github.com/nodejs/node/commit/f0bd176d6d)] - **deps**: reapply c-ares floating patch (Ben Noordhuis) [#5090](https://github.com/nodejs/node/pull/5090) -* [[`f1a0827417`](https://github.com/nodejs/node/commit/f1a0827417)] - **deps**: sync with upstream bagder/c-ares@2bae2d5 (Fedor Indutny) [#5090](https://github.com/nodejs/node/pull/5090) -* [[`cbf36de8f1`](https://github.com/nodejs/node/commit/cbf36de8f1)] - **deps**: upgrade npm to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) -* [[`dd97d07a0d`](https://github.com/nodejs/node/commit/dd97d07a0d)] - **deps**: backport 8d00c2c from v8 upstream (Gibson Fahnestock) [#5024](https://github.com/nodejs/node/pull/5024) -* [[`b75263094b`](https://github.com/nodejs/node/commit/b75263094b)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`b312b7914f`](https://github.com/nodejs/node/commit/b312b7914f)] - **deps**: upgrade openssl sources to 1.0.2f (Myles Borins) [#4961](https://github.com/nodejs/node/pull/4961) -* [[`fa0457ed04`](https://github.com/nodejs/node/commit/fa0457ed04)] - **dns**: throw a TypeError in lookupService with invalid port (Evan Lucas) [#4839](https://github.com/nodejs/node/pull/4839) -* [[`c4c8b3bf2e`](https://github.com/nodejs/node/commit/c4c8b3bf2e)] - **doc**: fix dgram doc indentation (Rich Trott) [#5118](https://github.com/nodejs/node/pull/5118) -* [[`027cd2719f`](https://github.com/nodejs/node/commit/027cd2719f)] - **doc**: clarify code of conduct reporting (Julie Pagano) [#5107](https://github.com/nodejs/node/pull/5107) -* [[`9f7aa6f868`](https://github.com/nodejs/node/commit/9f7aa6f868)] - **doc**: clarify dgram socket.send() multi-buffer support (Matteo Collina) [#5130](https://github.com/nodejs/node/pull/5130) -* [[`a96ae2cb37`](https://github.com/nodejs/node/commit/a96ae2cb37)] - **doc**: console is asynchronous unless it's a file (Ben Noordhuis) [#5133](https://github.com/nodejs/node/pull/5133) -* [[`4c54c8f309`](https://github.com/nodejs/node/commit/4c54c8f309)] - **doc**: fix typo in dgram doc (Rich Trott) [#5114](https://github.com/nodejs/node/pull/5114) -* [[`9c93ea3d51`](https://github.com/nodejs/node/commit/9c93ea3d51)] - **doc**: fix links order in Buffer doc (Alexander Makarenko) [#5076](https://github.com/nodejs/node/pull/5076) -* [[`a0ba378880`](https://github.com/nodejs/node/commit/a0ba378880)] - **doc**: minor improvement in OS docs (Alexander Makarenko) [#5006](https://github.com/nodejs/node/pull/5006) -* [[`1e2108a6b7`](https://github.com/nodejs/node/commit/1e2108a6b7)] - **doc**: fix links in Addons docs (Alexander Makarenko) [#5072](https://github.com/nodejs/node/pull/5072) -* [[`e5134b1701`](https://github.com/nodejs/node/commit/e5134b1701)] - **doc**: fix inconsistent styling (Brian White) [#4996](https://github.com/nodejs/node/pull/4996) -* [[`dde160378e`](https://github.com/nodejs/node/commit/dde160378e)] - **doc**: fix link in cluster documentation (Timothy Gu) [#5068](https://github.com/nodejs/node/pull/5068) -* [[`e5254c12f4`](https://github.com/nodejs/node/commit/e5254c12f4)] - **doc**: fix reference to API `hash.final` (Minwoo Jung) [#5050](https://github.com/nodejs/node/pull/5050) -* [[`87fd9968a8`](https://github.com/nodejs/node/commit/87fd9968a8)] - **doc**: clarify optional arguments of Buffer methods (Michaël Zasso) [#5008](https://github.com/nodejs/node/pull/5008) -* [[`9908eced24`](https://github.com/nodejs/node/commit/9908eced24)] - **doc**: uppercase 'RSA-SHA256' in crypto.markdown (Rainer Oviir) [#5044](https://github.com/nodejs/node/pull/5044) -* [[`bf0383bbea`](https://github.com/nodejs/node/commit/bf0383bbea)] - **doc**: apply consistent styling for functions (Rich Trott) [#4974](https://github.com/nodejs/node/pull/4974) -* [[`8c7f4bab2d`](https://github.com/nodejs/node/commit/8c7f4bab2d)] - **doc**: multiple improvements in Stream docs (Alexander Makarenko) [#5009](https://github.com/nodejs/node/pull/5009) -* [[`ee013715b9`](https://github.com/nodejs/node/commit/ee013715b9)] - **doc**: improve styling consistency in VM docs (Alexander Makarenko) [#5005](https://github.com/nodejs/node/pull/5005) -* [[`9824b0d132`](https://github.com/nodejs/node/commit/9824b0d132)] - **doc**: fix anchor links from stream to http and events (piepmatz) [#5007](https://github.com/nodejs/node/pull/5007) -* [[`2c85f79569`](https://github.com/nodejs/node/commit/2c85f79569)] - **doc**: minor improvement to HTTPS doc (Alexander Makarenko) [#5002](https://github.com/nodejs/node/pull/5002) -* [[`9cf1370017`](https://github.com/nodejs/node/commit/9cf1370017)] - **doc**: improve styling consistency in Buffer docs (Alexander Makarenko) [#5001](https://github.com/nodejs/node/pull/5001) -* [[`2750cb0613`](https://github.com/nodejs/node/commit/2750cb0613)] - **doc**: consistent styling for functions in TLS docs (Alexander Makarenko) [#5000](https://github.com/nodejs/node/pull/5000) -* [[`4758bf13a5`](https://github.com/nodejs/node/commit/4758bf13a5)] - **doc**: update npm LICENSE using license-builder.sh (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) -* [[`3b08b5d22c`](https://github.com/nodejs/node/commit/3b08b5d22c)] - **doc**: fix minor typo in process doc (Prayag Verma) [#5018](https://github.com/nodejs/node/pull/5018) -* [[`129977c9c7`](https://github.com/nodejs/node/commit/129977c9c7)] - **doc**: fix typo in Readme.md (Prayag Verma) [#5017](https://github.com/nodejs/node/pull/5017) -* [[`5de3dc557f`](https://github.com/nodejs/node/commit/5de3dc557f)] - **doc**: fix `notDeepEqual` API (Minwoo Jung) [#4971](https://github.com/nodejs/node/pull/4971) -* [[`d47dadcc1f`](https://github.com/nodejs/node/commit/d47dadcc1f)] - **doc**: make buffer methods styles consistent (Timothy Gu) [#4873](https://github.com/nodejs/node/pull/4873) -* [[`17888b122c`](https://github.com/nodejs/node/commit/17888b122c)] - **doc**: fix JSON generation for aliased methods (Timothy Gu) [#4871](https://github.com/nodejs/node/pull/4871) -* [[`396e4b9199`](https://github.com/nodejs/node/commit/396e4b9199)] - **doc**: add more details to process.env (Evan Lucas) [#4924](https://github.com/nodejs/node/pull/4924) -* [[`bc11bf4659`](https://github.com/nodejs/node/commit/bc11bf4659)] - **doc**: don't use "interface" as a variable name (ChALkeR) [#4900](https://github.com/nodejs/node/pull/4900) -* [[`bcf55d2f44`](https://github.com/nodejs/node/commit/bcf55d2f44)] - **doc**: spell writable consistently (Peter Lyons) [#4954](https://github.com/nodejs/node/pull/4954) -* [[`4a6d0ac436`](https://github.com/nodejs/node/commit/4a6d0ac436)] - **doc**: update eol handling in readline (Kári Tristan Helgason) [#4927](https://github.com/nodejs/node/pull/4927) -* [[`e65d3638c0`](https://github.com/nodejs/node/commit/e65d3638c0)] - **doc**: replace function expressions with arrows (Benjamin Gruenbaum) [#4832](https://github.com/nodejs/node/pull/4832) -* [[`423a58d66f`](https://github.com/nodejs/node/commit/423a58d66f)] - **doc**: show links consistently in deprecations (Sakthipriyan Vairamani) [#4907](https://github.com/nodejs/node/pull/4907) -* [[`fd87659139`](https://github.com/nodejs/node/commit/fd87659139)] - **doc**: add docs working group (Bryan English) [#4244](https://github.com/nodejs/node/pull/4244) -* [[`19ed619cff`](https://github.com/nodejs/node/commit/19ed619cff)] - **doc**: remove unnecessary bind(this) (Dmitriy Lazarev) [#4797](https://github.com/nodejs/node/pull/4797) -* [[`5129930786`](https://github.com/nodejs/node/commit/5129930786)] - **doc**: keep the names in sorted order (Sakthipriyan Vairamani) [#4876](https://github.com/nodejs/node/pull/4876) -* [[`3c46c10d54`](https://github.com/nodejs/node/commit/3c46c10d54)] - **doc**: fix nonsensical grammar in Buffer::write (Jimb Esser) [#4863](https://github.com/nodejs/node/pull/4863) -* [[`a1af6fc1a7`](https://github.com/nodejs/node/commit/a1af6fc1a7)] - **doc**: add `servername` parameter docs (Alexander Makarenko) [#4729](https://github.com/nodejs/node/pull/4729) -* [[`f4eeba8467`](https://github.com/nodejs/node/commit/f4eeba8467)] - **doc**: fix code type of markdowns (Jackson Tian) [#4858](https://github.com/nodejs/node/pull/4858) -* [[`fa1d453359`](https://github.com/nodejs/node/commit/fa1d453359)] - **doc**: check for errors in 'listen' event (Benjamin Gruenbaum) [#4834](https://github.com/nodejs/node/pull/4834) -* [[`f462320f74`](https://github.com/nodejs/node/commit/f462320f74)] - **doc**: undo move http.IncomingMessage.statusMessage (Jeff Harris) [#4822](https://github.com/nodejs/node/pull/4822) -* [[`711245e5ac`](https://github.com/nodejs/node/commit/711245e5ac)] - **doc**: style fixes for the TOC (Roman Reiss) [#4748](https://github.com/nodejs/node/pull/4748) -* [[`611c2f6fdf`](https://github.com/nodejs/node/commit/611c2f6fdf)] - **doc**: proper markdown escaping -> \_\_, \*, \_ (Robert Jefe Lindstaedt) [#4805](https://github.com/nodejs/node/pull/4805) -* [[`5a860d9cb7`](https://github.com/nodejs/node/commit/5a860d9cb7)] - **doc**: Examples work when data exceeds buffer size (Glen Arrowsmith) [#4811](https://github.com/nodejs/node/pull/4811) -* [[`71ba14de86`](https://github.com/nodejs/node/commit/71ba14de86)] - **doc**: update list of personal traits in CoC (Kat Marchán) [#4801](https://github.com/nodejs/node/pull/4801) -* [[`97eedfc57a`](https://github.com/nodejs/node/commit/97eedfc57a)] - **doc**: harmonize $ node command line notation (Robert Jefe Lindstaedt) [#4806](https://github.com/nodejs/node/pull/4806) -* [[`2dde0f08c9`](https://github.com/nodejs/node/commit/2dde0f08c9)] - **doc**: add buf.indexOf encoding param with example (Karl Skomski) [#3373](https://github.com/nodejs/node/pull/3373) -* [[`66c74548de`](https://github.com/nodejs/node/commit/66c74548de)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733) -* [[`54e8845b5e`](https://github.com/nodejs/node/commit/54e8845b5e)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959) -* [[`fa940cf9bc`](https://github.com/nodejs/node/commit/fa940cf9bc)] - **fs**: remove unused branches (Benjamin Gruenbaum) [#4795](https://github.com/nodejs/node/pull/4795) -* [[`a3b84a4c93`](https://github.com/nodejs/node/commit/a3b84a4c93)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell) -* [[`9b03af254a`](https://github.com/nodejs/node/commit/9b03af254a)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773) -* [[`101de9de3f`](https://github.com/nodejs/node/commit/101de9de3f)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) -* [[`b2c8b7f6d3`](https://github.com/nodejs/node/commit/b2c8b7f6d3)] - **internal/child_process**: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752) -* [[`55030922e5`](https://github.com/nodejs/node/commit/55030922e5)] - **lib**: scope loop variables (Rich Trott) [#4965](https://github.com/nodejs/node/pull/4965) -* [[`725ad5b1ce`](https://github.com/nodejs/node/commit/725ad5b1ce)] - **lib**: remove string_decoder.js var redeclarations (Rich Trott) [#4978](https://github.com/nodejs/node/pull/4978) -* [[`c09eb44a59`](https://github.com/nodejs/node/commit/c09eb44a59)] - **module**: refactor redeclared variable (Rich Trott) [#4962](https://github.com/nodejs/node/pull/4962) -* [[`612ce66c78`](https://github.com/nodejs/node/commit/612ce66c78)] - **net**: refactor redeclared variables (Rich Trott) [#4963](https://github.com/nodejs/node/pull/4963) -* [[`c9b05dafe0`](https://github.com/nodejs/node/commit/c9b05dafe0)] - **net**: move isLegalPort to internal/net (Evan Lucas) [#4882](https://github.com/nodejs/node/pull/4882) -* [[`7003a4e3d8`](https://github.com/nodejs/node/commit/7003a4e3d8)] - **node_contextify**: do not incept debug context (Myles Borins) [#4815](https://github.com/nodejs/node/issues/4815) -* [[`5a77c095a6`](https://github.com/nodejs/node/commit/5a77c095a6)] - **process**: support symbol events (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) -* [[`85743c0e92`](https://github.com/nodejs/node/commit/85743c0e92)] - **querystring**: check that maxKeys is finite (Myles Borins) [#5066](https://github.com/nodejs/node/pull/5066) -* [[`5a10fe932c`](https://github.com/nodejs/node/commit/5a10fe932c)] - **querystring**: use String.prototype.split's limit (Manuel Valls) [#2288](https://github.com/nodejs/node/pull/2288) -* [[`2844cc03dc`](https://github.com/nodejs/node/commit/2844cc03dc)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977) -* [[`ac6627a0fe`](https://github.com/nodejs/node/commit/ac6627a0fe)] - **src**: avoid compiler warning in node_revert.cc (James M Snell) -* [[`459c5844c8`](https://github.com/nodejs/node/commit/459c5844c8)] - **(SEMVER-MINOR)** **src**: add --security-revert command line flag (James M Snell) -* [[`95615196de`](https://github.com/nodejs/node/commit/95615196de)] - **src**: clean up usage of __proto__ (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069) -* [[`e93b024214`](https://github.com/nodejs/node/commit/e93b024214)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843) -* [[`a2c257a3ef`](https://github.com/nodejs/node/commit/a2c257a3ef)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757) -* [[`b46f3b84d4`](https://github.com/nodejs/node/commit/b46f3b84d4)] - **src,deps**: replace LoadLibrary by LoadLibraryW (Cheng Zhao) [iojs/io.js#226](https://github.com/iojs/io.js/pull/226) -* [[`ee8d4bb075`](https://github.com/nodejs/node/commit/ee8d4bb075)] - **stream**: prevent object map change in TransformState (Evan Lucas) [#5032](https://github.com/nodejs/node/pull/5032) -* [[`c8b6de244e`](https://github.com/nodejs/node/commit/c8b6de244e)] - **stream**: refactor redeclared variables (Rich Trott) [#4816](https://github.com/nodejs/node/pull/4816) -* [[`9dcc45e9c5`](https://github.com/nodejs/node/commit/9dcc45e9c5)] - **test**: enable to work pkcs12 test in FIPS mode (Shigeki Ohtsu) [#5150](https://github.com/nodejs/node/pull/5150) -* [[`e4390664ae`](https://github.com/nodejs/node/commit/e4390664ae)] - **test**: disable gh-5100 test when in FIPS mode (Fedor Indutny) [#5144](https://github.com/nodejs/node/pull/5144) -* [[`cf3aa911ec`](https://github.com/nodejs/node/commit/cf3aa911ec)] - **test**: fix flaky test-dgram-pingpong (Rich Trott) [#5125](https://github.com/nodejs/node/pull/5125) -* [[`63884f57dd`](https://github.com/nodejs/node/commit/63884f57dd)] - **test**: mark flaky tests on Raspberry Pi (Rich Trott) [#5082](https://github.com/nodejs/node/pull/5082) -* [[`09917c99d8`](https://github.com/nodejs/node/commit/09917c99d8)] - **test**: fix `net-socket-timeout-unref` flakiness (Santiago Gimeno) [#4772](https://github.com/nodejs/node/pull/4772) -* [[`83da19aa48`](https://github.com/nodejs/node/commit/83da19aa48)] - **test**: fix redeclared test-event-emitter-* vars (Rich Trott) [#4985](https://github.com/nodejs/node/pull/4985) -* [[`87b27c913d`](https://github.com/nodejs/node/commit/87b27c913d)] - **test**: fix redeclared test-intl var (Rich Trott) [#4988](https://github.com/nodejs/node/pull/4988) -* [[`e98772d68e`](https://github.com/nodejs/node/commit/e98772d68e)] - **test**: remove redeclared var in test-domain (Rich Trott) [#4984](https://github.com/nodejs/node/pull/4984) -* [[`443d0463ca`](https://github.com/nodejs/node/commit/443d0463ca)] - **test**: add common.platformTimeout() to dgram test (Rich Trott) [#4938](https://github.com/nodejs/node/pull/4938) -* [[`90219c3398`](https://github.com/nodejs/node/commit/90219c3398)] - **test**: fix flaky cluster test on Windows 10 (Rich Trott) [#4934](https://github.com/nodejs/node/pull/4934) -* [[`3488fa81b5`](https://github.com/nodejs/node/commit/3488fa81b5)] - **test**: fix variable redeclarations (Rich Trott) [#4992](https://github.com/nodejs/node/pull/4992) -* [[`7dc0905d4d`](https://github.com/nodejs/node/commit/7dc0905d4d)] - **test**: fix redeclared test-util-* vars (Rich Trott) [#4994](https://github.com/nodejs/node/pull/4994) -* [[`53e7d605c9`](https://github.com/nodejs/node/commit/53e7d605c9)] - **test**: fix redeclared vars in sequential tests (Rich Trott) [#4999](https://github.com/nodejs/node/pull/4999) -* [[`a62ace9f7e`](https://github.com/nodejs/node/commit/a62ace9f7e)] - **test**: fix tls-no-rsa-key flakiness (Santiago Gimeno) [#4043](https://github.com/nodejs/node/pull/4043) -* [[`9b8f025816`](https://github.com/nodejs/node/commit/9b8f025816)] - **test**: fix redeclared vars in test-url (Rich Trott) [#4993](https://github.com/nodejs/node/pull/4993) -* [[`51fb8845d5`](https://github.com/nodejs/node/commit/51fb8845d5)] - **test**: fix redeclared test-path vars (Rich Trott) [#4991](https://github.com/nodejs/node/pull/4991) -* [[`b16b360ae8`](https://github.com/nodejs/node/commit/b16b360ae8)] - **test**: fix var redeclarations in test-os (Rich Trott) [#4990](https://github.com/nodejs/node/pull/4990) -* [[`d6199773e8`](https://github.com/nodejs/node/commit/d6199773e8)] - **test**: fix test-net-* variable redeclarations (Rich Trott) [#4989](https://github.com/nodejs/node/pull/4989) -* [[`9dd5b3e01b`](https://github.com/nodejs/node/commit/9dd5b3e01b)] - **test**: fix redeclared test-http-* vars (Rich Trott) [#4987](https://github.com/nodejs/node/pull/4987) -* [[`835bf13c1d`](https://github.com/nodejs/node/commit/835bf13c1d)] - **test**: fix var redeclarations in test-fs-* (Rich Trott) [#4986](https://github.com/nodejs/node/pull/4986) -* [[`71d7a4457d`](https://github.com/nodejs/node/commit/71d7a4457d)] - **test**: fix redeclared vars in test-vm-* (Rich Trott) [#4997](https://github.com/nodejs/node/pull/4997) -* [[`38459402a5`](https://github.com/nodejs/node/commit/38459402a5)] - **test**: fix inconsistent styling in test-url (Brian White) [#5014](https://github.com/nodejs/node/pull/5014) -* [[`4934798c0d`](https://github.com/nodejs/node/commit/4934798c0d)] - **test**: pummel test fixes (Rich Trott) [#4998](https://github.com/nodejs/node/pull/4998) -* [[`3970504298`](https://github.com/nodejs/node/commit/3970504298)] - **test**: remove var redeclarations in test-crypto-* (Rich Trott) [#4981](https://github.com/nodejs/node/pull/4981) -* [[`a2881e2187`](https://github.com/nodejs/node/commit/a2881e2187)] - **test**: remove test-cluster-* var redeclarations (Rich Trott) [#4980](https://github.com/nodejs/node/pull/4980) -* [[`c3d93299c2`](https://github.com/nodejs/node/commit/c3d93299c2)] - **test**: fix test-http-extra-response flakiness (Santiago Gimeno) [#4979](https://github.com/nodejs/node/pull/4979) -* [[`0384a43885`](https://github.com/nodejs/node/commit/0384a43885)] - **test**: Add assertion for TLS peer certificate fingerprint (Alan Cohen) [#4923](https://github.com/nodejs/node/pull/4923) -* [[`48a353fe41`](https://github.com/nodejs/node/commit/48a353fe41)] - **test**: scope redeclared vars in test-child-process* (Rich Trott) [#4944](https://github.com/nodejs/node/pull/4944) -* [[`89d1149467`](https://github.com/nodejs/node/commit/89d1149467)] - **test**: fix test-tls-zero-clear-in flakiness (Santiago Gimeno) [#4888](https://github.com/nodejs/node/pull/4888) -* [[`f7ed47341a`](https://github.com/nodejs/node/commit/f7ed47341a)] - **test**: remove Object.observe from tests (Vladimir Kurchatkin) [#4769](https://github.com/nodejs/node/pull/4769) -* [[`d95e53dc3b`](https://github.com/nodejs/node/commit/d95e53dc3b)] - **test**: refactor switch (Rich Trott) [#4870](https://github.com/nodejs/node/pull/4870) -* [[`7f1e3e929a`](https://github.com/nodejs/node/commit/7f1e3e929a)] - **test**: remove race condition in http flood test (Rich Trott) [#4793](https://github.com/nodejs/node/pull/4793) -* [[`6539c64e67`](https://github.com/nodejs/node/commit/6539c64e67)] - **test**: scope redeclared variable (Rich Trott) [#4854](https://github.com/nodejs/node/pull/4854) -* [[`62fb941557`](https://github.com/nodejs/node/commit/62fb941557)] - **test**: fix irregular whitespace issue (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) -* [[`3b225209f0`](https://github.com/nodejs/node/commit/3b225209f0)] - **test**: fs.link() test runs on same device (Drew Folta) [#4861](https://github.com/nodejs/node/pull/4861) -* [[`1860eae110`](https://github.com/nodejs/node/commit/1860eae110)] - **test**: refactor test-net-settimeout (Rich Trott) [#4799](https://github.com/nodejs/node/pull/4799) -* [[`ae9a8cd053`](https://github.com/nodejs/node/commit/ae9a8cd053)] - **test**: mark test-tick-processor flaky (Rich Trott) [#4809](https://github.com/nodejs/node/pull/4809) -* [[`57cea9e421`](https://github.com/nodejs/node/commit/57cea9e421)] - **test**: remove test-http-exit-delay (Rich Trott) [#4786](https://github.com/nodejs/node/pull/4786) -* [[`2119c76d5a`](https://github.com/nodejs/node/commit/2119c76d5a)] - **test**: refactor test-fs-watch (Rich Trott) [#4776](https://github.com/nodejs/node/pull/4776) -* [[`e487b72459`](https://github.com/nodejs/node/commit/e487b72459)] - **test**: move cluster tests to parallel (Rich Trott) [#4774](https://github.com/nodejs/node/pull/4774) -* [[`8c694a658c`](https://github.com/nodejs/node/commit/8c694a658c)] - **test**: improve test-cluster-disconnect-suicide-race (Rich Trott) [#4739](https://github.com/nodejs/node/pull/4739) -* [[`14f5bb7a99`](https://github.com/nodejs/node/commit/14f5bb7a99)] - **test,buffer**: refactor redeclarations (Rich Trott) [#4893](https://github.com/nodejs/node/pull/4893) -* [[`62479e3406`](https://github.com/nodejs/node/commit/62479e3406)] - **tls**: scope loop vars with let (Rich Trott) [#4853](https://github.com/nodejs/node/pull/4853) -* [[`d6fbd81a7a`](https://github.com/nodejs/node/commit/d6fbd81a7a)] - **tls_wrap**: reach error reporting for UV_EPROTO (Fedor Indutny) [#4885](https://github.com/nodejs/node/pull/4885) -* [[`f75d06bf10`](https://github.com/nodejs/node/commit/f75d06bf10)] - **tools**: lint for empty character classes in regex (Rich Trott) [#5115](https://github.com/nodejs/node/pull/5115) -* [[`53cbd0564f`](https://github.com/nodejs/node/commit/53cbd0564f)] - **tools**: lint for spacing around unary operators (Rich Trott) [#5063](https://github.com/nodejs/node/pull/5063) -* [[`7fa5959c59`](https://github.com/nodejs/node/commit/7fa5959c59)] - **tools**: fix redeclared vars in doc/json.js (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) -* [[`e95fd6ae70`](https://github.com/nodejs/node/commit/e95fd6ae70)] - **tools**: apply linting to doc tools (Rich Trott) [#4973](https://github.com/nodejs/node/pull/4973) -* [[`777ed82162`](https://github.com/nodejs/node/commit/777ed82162)] - **tools**: fix detecting constructor for JSON doc (Timothy Gu) [#4966](https://github.com/nodejs/node/pull/4966) -* [[`5d55f59c85`](https://github.com/nodejs/node/commit/5d55f59c85)] - **tools**: add property types in JSON documentation (Timothy Gu) [#4884](https://github.com/nodejs/node/pull/4884) -* [[`fd5c56698e`](https://github.com/nodejs/node/commit/fd5c56698e)] - **tools**: add support for subkeys in release tools (Myles Borins) [#4807](https://github.com/nodejs/node/pull/4807) -* [[`34df6a5c0c`](https://github.com/nodejs/node/commit/34df6a5c0c)] - **tools**: enable assorted ESLint error rules (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) -* [[`386ad7e0b5`](https://github.com/nodejs/node/commit/386ad7e0b5)] - **tools**: fix setting path containing an ampersand (Brian White) [#4804](https://github.com/nodejs/node/pull/4804) -* [[`e415eb27e5`](https://github.com/nodejs/node/commit/e415eb27e5)] - **url**: change scoping of variables with let (Kári Tristan Helgason) [#4867](https://github.com/nodejs/node/pull/4867) +Moved to doc/changelogs/CHANGELOG_V5.md#5.6.0. ## 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/d94f864abd)] - **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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.3.0. ## 2016-02-09, Version 0.12.10 (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. - -### 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.3.0 to 2.3.1 -* openssl: upgrade from 1.0.1q to 1.0.1r. 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` -* build: - - xz compressed tar files will be made available from nodejs.org for v0.12 builds from v0.12.10 onward - - A headers.tar.gz file will be made available from nodejs.org for v0.12 builds from v0.12.10 onward, a future change to node-gyp will be required to make use of these - -### Commits - -* [4312848bff] - build: enable xz compressed tarballs where possible (Rod Vagg) https://github.com/nodejs/node/pull/4894 -* [247626245c] - deps: upgrade openssl sources to 1.0.1r (Shigeki Ohtsu) https://github.com/joyent/node/pull/25368 -* [744c9749fc] - deps: update http-parser to version 2.3.1 (James M Snell) -* [d1c56ec7d1] - doc: clarify v0.12.9 notable items (Rod Vagg) https://github.com/nodejs/node/pull/4154 -* [e128d9a5b4] - http: strictly forbid invalid characters from headers (James M Snell) -* [bdb9f2cf89] - src: avoiding compiler warnings in node_revert.cc (James M Snell) -* [23bced1fb3] - src: add --security-revert command line flag (James M Snell) -* [f41a3c73e7] - tools: backport tools/install.py for headers (Richard Lau) https://github.com/nodejs/node/pull/4149 +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.10. ## 2016-02-09, Version 0.10.42 (Maintenance), @jasnell -This is an important security release. All Node.js users should consult the security release summary at nodejs.org for details on patched vulnerabilities. - -### Notable changes - -* http: fix defects in HTTP header parsing for requests and responses that can allow request smuggling (CVE-2016-2086) or response splitting (CVE-2016-2216). HTTP header parsing now aligns more closely with the HTTP spec including restricting the acceptable characters. -* http-parser: upgrade from 1.0 to 1.1 -* openssl: upgrade from 1.0.1q to 1.0.1r. 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` -* build: - - xz compressed tar files will be made available from nodejs.org for v0.10 builds from v0.10.42 onward - - A headers.tar.gz file will be made available from nodejs.org for v0.10 builds from v0.10.42 onward, a future change to node-gyp will be required to make use of these - -### Commits - -* [fdc332183e] - build: enable xz compressed tarballs where possible (Rod Vagg) https://github.com/nodejs/node/pull/4894 -* [2d35b421b5] - deps: upgrade openssl sources to 1.0.1r (Shigeki Ohtsu) https://github.com/joyent/node/pull/25368 -* [b31c0f3ea4] - deps: update http-parser to version 1.1 (James M Snell) -* [616ec1d6b0] - doc: clarify v0.10.41 openssl tls security impact (Rod Vagg) https://github.com/nodejs/node/pull/4153 -* [ccb3c2377c] - http: strictly forbid invalid characters from headers (James M Snell) -* [f0af0d1f96] - src: avoid compiler warning in node_revert.cc (James M Snell) -* [df80e856c6] - src: add --security-revert command line flag (James M Snell) -* [ff58dcdd74] - tools: backport tools/install.py for headers (Richard Lau) https://github.com/nodejs/node/pull/4149 +Moved to doc/changelogs/CHANGELOG_V010.md#0.10.42. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.6. ## 2016-01-20, Version 5.5.0 (Stable), @evanlucas -### Notable Changes - -- **events**: make sure console functions exist (Dave) [#4479](https://github.com/nodejs/node/pull/4479) -- **fs**: add autoClose option to fs.createWriteStream (Saquib) [#3679](https://github.com/nodejs/node/pull/3679) -- **http**: improves expect header handling (Daniel Sellers) [#4501](https://github.com/nodejs/node/pull/4501) -- **node**: allow preload modules with -i (Evan Lucas) [#4696](https://github.com/nodejs/node/pull/4696) -- **v8,src**: expose statistics about heap spaces (`v8.getHeapSpaceStatistics()`) (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) -* Minor performance improvements: - - **lib**: Use arrow functions instead of bind where possible (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622). - - (Mistakenly missing from v5.4.0) - - **module**: cache stat() results more aggressively (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) - - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`8d0ca10752`](https://github.com/nodejs/node/commit/8d0ca10752)] - **buffer**: make byteLength work with Buffer correctly (Jackson Tian) [#4738](https://github.com/nodejs/node/pull/4738) -* [[`83d2b7707e`](https://github.com/nodejs/node/commit/83d2b7707e)] - **buffer**: remove unnecessary TODO comments (Peter Geiss) [#4719](https://github.com/nodejs/node/pull/4719) -* [[`8182ec094d`](https://github.com/nodejs/node/commit/8182ec094d)] - **build**: add option to select VS version (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) -* [[`4383acd9f4`](https://github.com/nodejs/node/commit/4383acd9f4)] - **build**: fix and refactor VTune config in vcbuild.bat (Rod Vagg) [#4192](https://github.com/nodejs/node/pull/4192) -* [[`be0b0b8cb9`](https://github.com/nodejs/node/commit/be0b0b8cb9)] - **build**: minor corrections in VTune configure text (Rod Vagg) [#4192](https://github.com/nodejs/node/pull/4192) -* [[`9571be12f6`](https://github.com/nodejs/node/commit/9571be12f6)] - **cluster**: fix race condition setting suicide prop (Santiago Gimeno) [#4349](https://github.com/nodejs/node/pull/4349) -* [[`ebd9addcd1`](https://github.com/nodejs/node/commit/ebd9addcd1)] - **crypto**: clear error stack in ECDH::Initialize (Fedor Indutny) [#4689](https://github.com/nodejs/node/pull/4689) -* [[`66b9c0d8bd`](https://github.com/nodejs/node/commit/66b9c0d8bd)] - **debugger**: remove variable redeclarations (Rich Trott) [#4633](https://github.com/nodejs/node/pull/4633) -* [[`88b2889679`](https://github.com/nodejs/node/commit/88b2889679)] - **dgram**: prevent disabled optimization of bind() (Brian White) [#4613](https://github.com/nodejs/node/pull/4613) -* [[`d56e3f8b67`](https://github.com/nodejs/node/commit/d56e3f8b67)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) -* [[`212a44df03`](https://github.com/nodejs/node/commit/212a44df03)] - **doc**: clarify protocol default in http.request() (cjihrig) [#4714](https://github.com/nodejs/node/pull/4714) -* [[`3297036345`](https://github.com/nodejs/node/commit/3297036345)] - **doc**: update branch-diff arguments in release doc (Rod Vagg) [#4691](https://github.com/nodejs/node/pull/4691) -* [[`666c089e68`](https://github.com/nodejs/node/commit/666c089e68)] - **doc**: fix named anchors in addons.markdown and http.markdown (Michael Theriot) [#4708](https://github.com/nodejs/node/pull/4708) -* [[`310530b7ec`](https://github.com/nodejs/node/commit/310530b7ec)] - **doc**: add path property to Write/ReadStream in fs.markdown (Claudio Rodriguez) [#4368](https://github.com/nodejs/node/pull/4368) -* [[`3470574cb6`](https://github.com/nodejs/node/commit/3470574cb6)] - **doc**: clarify explanation of first stream section (Vitor Cortez) [#4234](https://github.com/nodejs/node/pull/4234) -* [[`d91646b9c7`](https://github.com/nodejs/node/commit/d91646b9c7)] - **doc**: rebuild LICENSE using tools/license-builder.sh (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) -* [[`265e2f557b`](https://github.com/nodejs/node/commit/265e2f557b)] - **doc**: fix typo in doc/node.1 (Jérémy Lal) [#4680](https://github.com/nodejs/node/pull/4680) -* [[`4c132fe61e`](https://github.com/nodejs/node/commit/4c132fe61e)] - **doc**: make references clickable (Roman Klauke) [#4654](https://github.com/nodejs/node/pull/4654) -* [[`d139704ff7`](https://github.com/nodejs/node/commit/d139704ff7)] - **doc**: improve child_process.execFile() code example (Ryan Sobol) [#4504](https://github.com/nodejs/node/pull/4504) -* [[`eeb6fdcd0f`](https://github.com/nodejs/node/commit/eeb6fdcd0f)] - **doc**: add docs for more stream options (zoubin) [#4639](https://github.com/nodejs/node/pull/4639) -* [[`b6ab6d2de5`](https://github.com/nodejs/node/commit/b6ab6d2de5)] - **doc**: add branch-diff example to releases.md (Myles Borins) [#4636](https://github.com/nodejs/node/pull/4636) -* [[`287325c5e8`](https://github.com/nodejs/node/commit/287325c5e8)] - **docs**: update gpg key for Myles Borins (Myles Borins) [#4657](https://github.com/nodejs/node/pull/4657) -* [[`65825b79aa`](https://github.com/nodejs/node/commit/65825b79aa)] - **docs**: fix npm command in releases.md (Myles Borins) [#4656](https://github.com/nodejs/node/pull/4656) -* [[`f9a59c1d3b`](https://github.com/nodejs/node/commit/f9a59c1d3b)] - **(SEMVER-MINOR)** **events**: make sure console functions exist (Dave) [#4479](https://github.com/nodejs/node/pull/4479) -* [[`6039a7c1b5`](https://github.com/nodejs/node/commit/6039a7c1b5)] - **(SEMVER-MINOR)** **fs**: add autoClose option to fs.createWriteStream (Saquib) [#3679](https://github.com/nodejs/node/pull/3679) -* [[`ed55169834`](https://github.com/nodejs/node/commit/ed55169834)] - **gitignore**: never ignore debug module (Michaël Zasso) [#2286](https://github.com/nodejs/node/pull/2286) -* [[`d755432fa9`](https://github.com/nodejs/node/commit/d755432fa9)] - **(SEMVER-MINOR)** **http**: improves expect header handling (Daniel Sellers) [#4501](https://github.com/nodejs/node/pull/4501) -* [[`7ce0e04f44`](https://github.com/nodejs/node/commit/7ce0e04f44)] - **lib**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) -* [[`ae5bcf9528`](https://github.com/nodejs/node/commit/ae5bcf9528)] - **lib**: use arrow functions instead of bind (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622) -* [[`0ec093cd41`](https://github.com/nodejs/node/commit/0ec093cd41)] - **lib,test**: remove extra semicolons (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) -* [[`d8f5bd4fe1`](https://github.com/nodejs/node/commit/d8f5bd4fe1)] - **module**: avoid ArgumentsAdaptorTrampoline frame (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) -* [[`83f8d98806`](https://github.com/nodejs/node/commit/83f8d98806)] - **module**: cache stat() results more aggressively (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) -* [[`ff64a4c395`](https://github.com/nodejs/node/commit/ff64a4c395)] - **(SEMVER-MINOR)** **node**: allow preload modules with -i (Evan Lucas) [#4696](https://github.com/nodejs/node/pull/4696) -* [[`4bc1a47761`](https://github.com/nodejs/node/commit/4bc1a47761)] - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) -* [[`ad63d350d4`](https://github.com/nodejs/node/commit/ad63d350d4)] - **readline**: Remove XXX and output debuglog (Kohei TAKATA) [#4690](https://github.com/nodejs/node/pull/4690) -* [[`da550aa063`](https://github.com/nodejs/node/commit/da550aa063)] - **repl**: make sure historyPath is trimmed (Evan Lucas) [#4539](https://github.com/nodejs/node/pull/4539) -* [[`1a6e7d1b52`](https://github.com/nodejs/node/commit/1a6e7d1b52)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757) -* [[`8bad51977a`](https://github.com/nodejs/node/commit/8bad51977a)] - **src**: return UV_EAI_NODATA on empty lookup (cjihrig) [#4715](https://github.com/nodejs/node/pull/4715) -* [[`761cf2bf6a`](https://github.com/nodejs/node/commit/761cf2bf6a)] - **src**: don't check failure with ERR_peek_error() (Ben Noordhuis) [#4731](https://github.com/nodejs/node/pull/4731) -* [[`953f4a3999`](https://github.com/nodejs/node/commit/953f4a3999)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761) -* [[`e65f1f7954`](https://github.com/nodejs/node/commit/e65f1f7954)] - **test**: fix tls-multi-key race condition (Santiago Gimeno) [#3966](https://github.com/nodejs/node/pull/3966) -* [[`3727ae0d7d`](https://github.com/nodejs/node/commit/3727ae0d7d)] - **test**: use addon.md block headings as test dir names (Rod Vagg) [#4412](https://github.com/nodejs/node/pull/4412) -* [[`47960a07c0`](https://github.com/nodejs/node/commit/47960a07c0)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736) -* [[`9926b5a25f`](https://github.com/nodejs/node/commit/9926b5a25f)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) -* [[`d1aabd6264`](https://github.com/nodejs/node/commit/d1aabd6264)] - **test**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) -* [[`e98bcfa2cb`](https://github.com/nodejs/node/commit/e98bcfa2cb)] - **test**: remove 1 second delay from test (Rich Trott) [#4616](https://github.com/nodejs/node/pull/4616) -* [[`6cfd0b5a32`](https://github.com/nodejs/node/commit/6cfd0b5a32)] - **test**: fix flaky test-net-socket-local-address (cjihrig) [#4650](https://github.com/nodejs/node/pull/4650) -* [[`e22cc6c2eb`](https://github.com/nodejs/node/commit/e22cc6c2eb)] - **test**: fix race in test-net-server-pause-on-connect (Rich Trott) [#4637](https://github.com/nodejs/node/pull/4637) -* [[`9164c00bdb`](https://github.com/nodejs/node/commit/9164c00bdb)] - **test**: move resource intensive tests to sequential (Rich Trott) [#4615](https://github.com/nodejs/node/pull/4615) -* [[`d8ba2c0de4`](https://github.com/nodejs/node/commit/d8ba2c0de4)] - **test**: fix `http-upgrade-client` flakiness (Santiago Gimeno) [#4602](https://github.com/nodejs/node/pull/4602) -* [[`6018fa1f57`](https://github.com/nodejs/node/commit/6018fa1f57)] - **test**: fix `http-upgrade-agent` flakiness (Santiago Gimeno) [#4520](https://github.com/nodejs/node/pull/4520) -* [[`c33f6a87d0`](https://github.com/nodejs/node/commit/c33f6a87d0)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) -* [[`162e16afdb`](https://github.com/nodejs/node/commit/162e16afdb)] - **tools**: enable no-extra-semi rule in eslint (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) -* [[`031b87d42d`](https://github.com/nodejs/node/commit/031b87d42d)] - **tools**: add license-builder.sh to construct LICENSE (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) -* [[`ec8e0ae697`](https://github.com/nodejs/node/commit/ec8e0ae697)] - **tools**: fix style issue after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) -* [[`4d5ee7a512`](https://github.com/nodejs/node/commit/4d5ee7a512)] - **tools**: update eslint config (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) -* [[`2d441493a4`](https://github.com/nodejs/node/commit/2d441493a4)] - **tools**: update eslint to v1.10.3 (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) -* [[`aba3cc834e`](https://github.com/nodejs/node/commit/aba3cc834e)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) -* [[`5f57005ec9`](https://github.com/nodejs/node/commit/5f57005ec9)] - **(SEMVER-MINOR)** **v8,src**: expose statistics about heap spaces (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) +Moved to doc/changelogs/CHANGELOG_V5.md#5.5.0. ## 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) - +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.5. ## 2016-01-12, Version 5.4.1 (Stable), @TheAlphaNerd -### Notable Changes - -* Minor performance improvements: - - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) -* Various bug fixes -* Various doc fixes -* Various test improvements - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### commits - -* [[`ff539c5bb5`](https://github.com/nodejs/node/commit/ff539c5bb5)] - **cluster**: ignore queryServer msgs on disconnection (Santiago Gimeno) [#4465](https://github.com/nodejs/node/pull/4465) -* [[`00148b3de1`](https://github.com/nodejs/node/commit/00148b3de1)] - **deps**: backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4625](https://github.com/nodejs/node/pull/4625) -* [[`3912b5cbda`](https://github.com/nodejs/node/commit/3912b5cbda)] - **doc**: adds usage of readline line-by-line parsing (Robert Jefe Lindstaedt) [#4609](https://github.com/nodejs/node/pull/4609) -* [[`102fb7d3a1`](https://github.com/nodejs/node/commit/102fb7d3a1)] - **doc**: remove "above" and "below" references (Richard Sun) [#4499](https://github.com/nodejs/node/pull/4499) -* [[`df87176ae0`](https://github.com/nodejs/node/commit/df87176ae0)] - **doc**: update stylesheet to match frontpage (Roman Reiss) [#4621](https://github.com/nodejs/node/pull/4621) -* [[`ede98d1f98`](https://github.com/nodejs/node/commit/ede98d1f98)] - **doc**: stronger suggestion for userland assert (Wyatt Preul) [#4535](https://github.com/nodejs/node/pull/4535) -* [[`fdfc72c977`](https://github.com/nodejs/node/commit/fdfc72c977)] - **doc**: label http.IncomingMessage as a Class (Sequoia McDowell) [#4589](https://github.com/nodejs/node/pull/4589) -* [[`b181e26975`](https://github.com/nodejs/node/commit/b181e26975)] - **doc**: document http's server.listen return value (Sequoia McDowell) [#4590](https://github.com/nodejs/node/pull/4590) -* [[`97aaeb8519`](https://github.com/nodejs/node/commit/97aaeb8519)] - **doc**: fix description about the latest-codename (Minwoo Jung) [#4583](https://github.com/nodejs/node/pull/4583) -* [[`0126615d1e`](https://github.com/nodejs/node/commit/0126615d1e)] - **doc**: add Evan Lucas to Release Team (Evan Lucas) [#4579](https://github.com/nodejs/node/pull/4579) -* [[`ec73c69412`](https://github.com/nodejs/node/commit/ec73c69412)] - **doc**: add Myles Borins to Release Team (Myles Borins) [#4578](https://github.com/nodejs/node/pull/4578) -* [[`e703c9a4e2`](https://github.com/nodejs/node/commit/e703c9a4e2)] - **doc**: bring releases.md up to date (cjihrig) [#4540](https://github.com/nodejs/node/pull/4540) -* [[`ac1108d5e7`](https://github.com/nodejs/node/commit/ac1108d5e7)] - **doc**: add missing backtick for readline (Brian White) [#4549](https://github.com/nodejs/node/pull/4549) -* [[`09bc0c6a05`](https://github.com/nodejs/node/commit/09bc0c6a05)] - **doc**: improvements to crypto.markdown copy (James M Snell) [#4435](https://github.com/nodejs/node/pull/4435) -* [[`787c5d96bd`](https://github.com/nodejs/node/commit/787c5d96bd)] - **http**: remove variable redeclaration (Rich Trott) [#4612](https://github.com/nodejs/node/pull/4612) -* [[`145b66820f`](https://github.com/nodejs/node/commit/145b66820f)] - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) -* [[`ffb7deb443`](https://github.com/nodejs/node/commit/ffb7deb443)] - **net**: remove hot path comment from connect (Evan Lucas) [#4648](https://github.com/nodejs/node/pull/4648) -* [[`799aa74d90`](https://github.com/nodejs/node/commit/799aa74d90)] - **net**: fix dns lookup for android (Josh Dague) [#4580](https://github.com/nodejs/node/pull/4580) -* [[`9accebe087`](https://github.com/nodejs/node/commit/9accebe087)] - **net, doc**: fix line wrapping lint in net.js (James M Snell) [#4588](https://github.com/nodejs/node/pull/4588) -* [[`37a546b490`](https://github.com/nodejs/node/commit/37a546b490)] - **src**: remove redeclarations of variables (Rich Trott) [#4605](https://github.com/nodejs/node/pull/4605) -* [[`b515ccc2a1`](https://github.com/nodejs/node/commit/b515ccc2a1)] - **stream**: remove useless if test in transform (zoubin) [#4617](https://github.com/nodejs/node/pull/4617) -* [[`ea6e26d904`](https://github.com/nodejs/node/commit/ea6e26d904)] - **test**: remove duplicate fork module import (Rich Trott) [#4634](https://github.com/nodejs/node/pull/4634) -* [[`b14b2aec5e`](https://github.com/nodejs/node/commit/b14b2aec5e)] - **test**: require common module only once (Rich Trott) [#4611](https://github.com/nodejs/node/pull/4611) -* [[`f28a640505`](https://github.com/nodejs/node/commit/f28a640505)] - **test**: only include http module once (Rich Trott) [#4606](https://github.com/nodejs/node/pull/4606) -* [[`6f9a96f497`](https://github.com/nodejs/node/commit/6f9a96f497)] - **test**: fix flaky unrefed timers test (Rich Trott) [#4599](https://github.com/nodejs/node/pull/4599) -* [[`b70eec8f7b`](https://github.com/nodejs/node/commit/b70eec8f7b)] - **tls_legacy**: do not read on OpenSSL's stack (Fedor Indutny) [#4624](https://github.com/nodejs/node/pull/4624) +Moved to doc/changelogs/CHANGELOG_V5.md#5.4.1. ## 2016-01-06, Version 5.4.0 (Stable), @Fishrock123 -### Notable changes - -* **http**: - - A new status code was added: 451 - "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377). - - Idle sockets that have been kept alive now handle errors (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482). -* This release also includes several minor performance improvements: - - **assert**: deepEqual is now speedier when comparing TypedArrays (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330). - - **lib**: Use arrow functions instead of bind where possible (Minwoo Jung) [node#3622](https://github.com/nodejs/node/pull/3622). - - **node**: Improved accessor perf of `process.env` (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780). - - **node**: Improved performance of `process.hrtime()` (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780), (Evan Lucas) [#4484](https://github.com/nodejs/node/pull/4484). - - **node**: Improved GetActiveHandles performance (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780). - - **util**: Use faster iteration in `util.format()` (Jackson Tian) [#3964](https://github.com/nodejs/node/pull/3964). - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`d265fc821a`](https://github.com/nodejs/node/commit/d265fc821a)] - **assert**: typed array deepequal performance fix (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330) -* [[`6d8053ab56`](https://github.com/nodejs/node/commit/6d8053ab56)] - **buffer**: faster case for create Buffer from new Buffer(0) (Jackson Tian) [#4326](https://github.com/nodejs/node/pull/4326) -* [[`8781c59878`](https://github.com/nodejs/node/commit/8781c59878)] - **buffer**: refactor create buffer (Jackson Tian) [#4340](https://github.com/nodejs/node/pull/4340) -* [[`252628294b`](https://github.com/nodejs/node/commit/252628294b)] - **child_process**: guard against race condition (Rich Trott) [#4418](https://github.com/nodejs/node/pull/4418) -* [[`fcf632bc6a`](https://github.com/nodejs/node/commit/fcf632bc6a)] - **crypto**: load PFX chain the same way as regular one (Fedor Indutny) [#4165](https://github.com/nodejs/node/pull/4165) -* [[`a5094a35a0`](https://github.com/nodejs/node/commit/a5094a35a0)] - **debugger**: guard against call from non-node context (Ben Noordhuis) [#4328](https://github.com/nodejs/node/pull/4328) -* [[`b4c51c5b76`](https://github.com/nodejs/node/commit/b4c51c5b76)] - **deps**: backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) -* [[`334e73942e`](https://github.com/nodejs/node/commit/334e73942e)] - **doc**: fix heading level error in Buffer doc (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) -* [[`5be0259181`](https://github.com/nodejs/node/commit/5be0259181)] - **doc**: close backtick in process.title description (Dave) [#4534](https://github.com/nodejs/node/pull/4534) -* [[`35aec4c14d`](https://github.com/nodejs/node/commit/35aec4c14d)] - **doc**: fix numbering in stream.markdown (Richard Sun) [#4538](https://github.com/nodejs/node/pull/4538) -* [[`982f3227a5`](https://github.com/nodejs/node/commit/982f3227a5)] - **doc**: improvements to dgram.markdown copy (James M Snell) [#4437](https://github.com/nodejs/node/pull/4437) -* [[`6cdfa38d23`](https://github.com/nodejs/node/commit/6cdfa38d23)] - **doc**: improvements to errors.markdown copy (James M Snell) [#4454](https://github.com/nodejs/node/pull/4454) -* [[`6c7bcd5007`](https://github.com/nodejs/node/commit/6c7bcd5007)] - **doc**: fix website wg mislink (jona) [#4357](https://github.com/nodejs/node/pull/4357) -* [[`eee50821dc`](https://github.com/nodejs/node/commit/eee50821dc)] - **doc**: mention that http.Server inherits from net.Server (Ryan Sobol) [#4455](https://github.com/nodejs/node/pull/4455) -* [[`c745b4d5f8`](https://github.com/nodejs/node/commit/c745b4d5f8)] - **doc**: explain ClientRequest#setTimeout time unit (Ben Ripkens) [#4458](https://github.com/nodejs/node/pull/4458) -* [[`40076bf7f8`](https://github.com/nodejs/node/commit/40076bf7f8)] - **doc**: fix spelling error in lib/url.js comment (Nik Nyby) [#4390](https://github.com/nodejs/node/pull/4390) -* [[`5a223d64e3`](https://github.com/nodejs/node/commit/5a223d64e3)] - **doc**: add anchors for _transform _flush _writev in stream.markdown (iamchenxin) [#4448](https://github.com/nodejs/node/pull/4448) -* [[`e8bbeecc4c`](https://github.com/nodejs/node/commit/e8bbeecc4c)] - **doc**: improvements to debugger.markdown copy (James M Snell) [#4436](https://github.com/nodejs/node/pull/4436) -* [[`ccd75fe3fb`](https://github.com/nodejs/node/commit/ccd75fe3fb)] - **doc**: improvements to events.markdown copy (James M Snell) [#4468](https://github.com/nodejs/node/pull/4468) -* [[`ed15962777`](https://github.com/nodejs/node/commit/ed15962777)] - **doc**: improvements to dns.markdown copy (James M Snell) [#4449](https://github.com/nodejs/node/pull/4449) -* [[`e177cc9fdf`](https://github.com/nodejs/node/commit/e177cc9fdf)] - **doc**: improvements to console.markdown copy (James M Snell) [#4428](https://github.com/nodejs/node/pull/4428) -* [[`c1bc9a1023`](https://github.com/nodejs/node/commit/c1bc9a1023)] - **doc**: improve child_process.markdown copy (James M Snell) [#4383](https://github.com/nodejs/node/pull/4383) -* [[`150f62847c`](https://github.com/nodejs/node/commit/150f62847c)] - **doc**: copyedit setTimeout() documentation (Rich Trott) [#4434](https://github.com/nodejs/node/pull/4434) -* [[`9e667354be`](https://github.com/nodejs/node/commit/9e667354be)] - **doc**: fix formatting in process.markdown (Rich Trott) [#4433](https://github.com/nodejs/node/pull/4433) -* [[`bc1c0dc3fb`](https://github.com/nodejs/node/commit/bc1c0dc3fb)] - **doc**: catch the WORKING_GROUPS.md bootstrap docs up to date (James M Snell) [#4367](https://github.com/nodejs/node/pull/4367) -* [[`c835ba3601`](https://github.com/nodejs/node/commit/c835ba3601)] - **doc**: improve assert.markdown copy (James M Snell) [#4360](https://github.com/nodejs/node/pull/4360) -* [[`e79eda74c0`](https://github.com/nodejs/node/commit/e79eda74c0)] - **doc**: copyedit releases.md (Rich Trott) [#4384](https://github.com/nodejs/node/pull/4384) -* [[`6450d8667f`](https://github.com/nodejs/node/commit/6450d8667f)] - **doc**: improve grammar in tls docs (Adri Van Houdt) [#4315](https://github.com/nodejs/node/pull/4315) -* [[`474a0f081a`](https://github.com/nodejs/node/commit/474a0f081a)] - **doc**: improvements to buffer.markdown copy (James M Snell) [#4370](https://github.com/nodejs/node/pull/4370) -* [[`57684d650e`](https://github.com/nodejs/node/commit/57684d650e)] - **doc**: improve addons.markdown copy (James M Snell) [#4320](https://github.com/nodejs/node/pull/4320) -* [[`04dd861221`](https://github.com/nodejs/node/commit/04dd861221)] - **doc**: fix, modernize examples in docs (James M Snell) [#4282](https://github.com/nodejs/node/pull/4282) -* [[`5ce6e99474`](https://github.com/nodejs/node/commit/5ce6e99474)] - **doc**: Typo in buffer.markdown referencing buf.write() (chrisjohn404) [#4324](https://github.com/nodejs/node/pull/4324) -* [[`699bf2c464`](https://github.com/nodejs/node/commit/699bf2c464)] - **doc**: fix link in addons.markdown (Nicholas Young) [#4331](https://github.com/nodejs/node/pull/4331) -* [[`e742422757`](https://github.com/nodejs/node/commit/e742422757)] - **fs**: use pushValueToArray for readdir(Sync) (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`1dd2d015d2`](https://github.com/nodejs/node/commit/1dd2d015d2)] - **(SEMVER-MINOR)** **http**: handle errors on idle sockets (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) -* [[`083ae166bb`](https://github.com/nodejs/node/commit/083ae166bb)] - **http**: use `self.keepAlive` instead of `self.options.keepAlive` (Damian Schenkelman) [#4407](https://github.com/nodejs/node/pull/4407) -* [[`ffb4a6e0e4`](https://github.com/nodejs/node/commit/ffb4a6e0e4)] - **http**: fix non-string header value concatenation (Brian White) [#4460](https://github.com/nodejs/node/pull/4460) -* [[`c77fd6829a`](https://github.com/nodejs/node/commit/c77fd6829a)] - **(SEMVER-MINOR)** **http**: 451 status code "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377) -* [[`8f7af9a489`](https://github.com/nodejs/node/commit/8f7af9a489)] - **http**: remove excess calls to removeSocket (Dave) [#4172](https://github.com/nodejs/node/pull/4172) -* [[`b841967103`](https://github.com/nodejs/node/commit/b841967103)] - **http**: Remove an unnecessary assignment (Bo Borgerson) [#4323](https://github.com/nodejs/node/pull/4323) -* [[`b8366e76dd`](https://github.com/nodejs/node/commit/b8366e76dd)] - **http_parser**: use pushValueToArray for headers (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`ca97e7276e`](https://github.com/nodejs/node/commit/ca97e7276e)] - **https**: use `servername` in agent key (Fedor Indutny) [#4389](https://github.com/nodejs/node/pull/4389) -* [[`b5aaccc6af`](https://github.com/nodejs/node/commit/b5aaccc6af)] - **lib**: remove unused modules (Rich Trott) [#4396](https://github.com/nodejs/node/pull/4396) -* [[`921fb540c1`](https://github.com/nodejs/node/commit/921fb540c1)] - **node**: improve performance of process.hrtime() (Evan Lucas) [#4484](https://github.com/nodejs/node/pull/4484) -* [[`ecef817a28`](https://github.com/nodejs/node/commit/ecef817a28)] - **node**: improve accessor perf of process.env (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`89f056bdf3`](https://github.com/nodejs/node/commit/89f056bdf3)] - **node**: improve performance of hrtime() (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`c8fc217dc7`](https://github.com/nodejs/node/commit/c8fc217dc7)] - **node**: improve GetActiveHandles performance (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`8464667071`](https://github.com/nodejs/node/commit/8464667071)] - **node**: fix erroneously named function call (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) -* [[`e57fd51a5e`](https://github.com/nodejs/node/commit/e57fd51a5e)] - **os**: fix crash in GetInterfaceAddresses (Martin Bark) [#4272](https://github.com/nodejs/node/pull/4272) -* [[`65c40d753f`](https://github.com/nodejs/node/commit/65c40d753f)] - **repl**: remove unused function (Rich Trott) -* [[`3d41a44dba`](https://github.com/nodejs/node/commit/3d41a44dba)] - **repl**: Fixed node repl history edge case. (Mudit Ameta) [#4108](https://github.com/nodejs/node/pull/4108) -* [[`d11930d604`](https://github.com/nodejs/node/commit/d11930d604)] - **repl**: use String#repeat instead of Array#join (Evan Lucas) [#3900](https://github.com/nodejs/node/pull/3900) -* [[`4220d25626`](https://github.com/nodejs/node/commit/4220d25626)] - **test**: fix linting for the v5.x branch (Jeremiah Senkpiel) [#4547](https://github.com/nodejs/node/pull/4547) -* [[`4b14f1c983`](https://github.com/nodejs/node/commit/4b14f1c983)] - **test**: remove unused vars (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) -* [[`2a69ab32ec`](https://github.com/nodejs/node/commit/2a69ab32ec)] - **test**: add test-domain-exit-dispose-again back (Julien Gilli) [#4256](https://github.com/nodejs/node/pull/4256) -* [[`ae0246641c`](https://github.com/nodejs/node/commit/ae0246641c)] - **test**: remove unused vars from parallel tests (Rich Trott) [#4511](https://github.com/nodejs/node/pull/4511) -* [[`984db93e7c`](https://github.com/nodejs/node/commit/984db93e7c)] - **test**: fix flaky test-cluster-shared-leak (Rich Trott) [#4510](https://github.com/nodejs/node/pull/4510) -* [[`30b0d7583a`](https://github.com/nodejs/node/commit/30b0d7583a)] - **test**: fix flaky streams test (Rich Trott) [#4516](https://github.com/nodejs/node/pull/4516) -* [[`46fefbc1b5`](https://github.com/nodejs/node/commit/46fefbc1b5)] - **test**: fix flaky test-http-agent-keepalive (Rich Trott) [#4524](https://github.com/nodejs/node/pull/4524) -* [[`e04a8401d9`](https://github.com/nodejs/node/commit/e04a8401d9)] - **test**: remove flaky designations for tests (Rich Trott) [#4519](https://github.com/nodejs/node/pull/4519) -* [[`a703b1bf73`](https://github.com/nodejs/node/commit/a703b1bf73)] - **test**: remove time check (Rich Trott) [#4494](https://github.com/nodejs/node/pull/4494) -* [[`02b3a5be52`](https://github.com/nodejs/node/commit/02b3a5be52)] - **test**: refactor test-fs-empty-readStream (Rich Trott) [#4490](https://github.com/nodejs/node/pull/4490) -* [[`ab3e5c1417`](https://github.com/nodejs/node/commit/ab3e5c1417)] - **test**: write to tmp dir rather than fixture dir (Rich Trott) [#4489](https://github.com/nodejs/node/pull/4489) -* [[`06043fdfa3`](https://github.com/nodejs/node/commit/06043fdfa3)] - **test**: remove unused modules (Rich Trott) [#4475](https://github.com/nodejs/node/pull/4475) -* [[`f1a66bc249`](https://github.com/nodejs/node/commit/f1a66bc249)] - **test**: clarify role of domains in test (Rich Trott) [#4474](https://github.com/nodejs/node/pull/4474) -* [[`08a3490dd6`](https://github.com/nodejs/node/commit/08a3490dd6)] - **test**: inherit JOBS from environment (Johan Bergström) [#4495](https://github.com/nodejs/node/pull/4495) -* [[`3bfc18763a`](https://github.com/nodejs/node/commit/3bfc18763a)] - **test**: improve assert message (Rich Trott) [#4461](https://github.com/nodejs/node/pull/4461) -* [[`d46d850461`](https://github.com/nodejs/node/commit/d46d850461)] - **test**: shorten path for bogus socket (Rich Trott) [#4478](https://github.com/nodejs/node/pull/4478) -* [[`f68f86cd0a`](https://github.com/nodejs/node/commit/f68f86cd0a)] - **test**: fix race condition in test-http-client-onerror (Devin Nakamura) [#4346](https://github.com/nodejs/node/pull/4346) -* [[`ec0b6362cf`](https://github.com/nodejs/node/commit/ec0b6362cf)] - **test**: remove unused assert module imports (Rich Trott) [#4438](https://github.com/nodejs/node/pull/4438) -* [[`ba2445046c`](https://github.com/nodejs/node/commit/ba2445046c)] - **test**: don't use cwd for relative path (Johan Bergström) [#4477](https://github.com/nodejs/node/pull/4477) -* [[`5110e4deed`](https://github.com/nodejs/node/commit/5110e4deed)] - **test**: don't assume a certain folder structure (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) -* [[`55c6946400`](https://github.com/nodejs/node/commit/55c6946400)] - **test**: make temp path customizable (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) -* [[`b19d19efaa`](https://github.com/nodejs/node/commit/b19d19efaa)] - **test**: extend timeout in Debug mode (Rich Trott) [#4431](https://github.com/nodejs/node/pull/4431) -* [[`c6a99ddd37`](https://github.com/nodejs/node/commit/c6a99ddd37)] - **test**: remove unused variables from net tests (Rich Trott) [#4430](https://github.com/nodejs/node/pull/4430) -* [[`54004f0e26`](https://github.com/nodejs/node/commit/54004f0e26)] - **test**: remove unused vars in ChildProcess tests (Rich Trott) [#4425](https://github.com/nodejs/node/pull/4425) -* [[`e72112f90e`](https://github.com/nodejs/node/commit/e72112f90e)] - **test**: fix flaky cluster-disconnect-race (Brian White) [#4457](https://github.com/nodejs/node/pull/4457) -* [[`715afc9bbd`](https://github.com/nodejs/node/commit/715afc9bbd)] - **test**: fix flaky cluster-net-send (Brian White) [#4444](https://github.com/nodejs/node/pull/4444) -* [[`03c4bc704f`](https://github.com/nodejs/node/commit/03c4bc704f)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Brian White) [#4442](https://github.com/nodejs/node/pull/4442) -* [[`684eb32072`](https://github.com/nodejs/node/commit/684eb32072)] - **test**: remove unused variables from HTTPS tests (Rich Trott) [#4426](https://github.com/nodejs/node/pull/4426) -* [[`585c01f674`](https://github.com/nodejs/node/commit/585c01f674)] - **test**: remove unused variables from TLS tests (Rich Trott) [#4424](https://github.com/nodejs/node/pull/4424) -* [[`c36ca37e2a`](https://github.com/nodejs/node/commit/c36ca37e2a)] - **test**: remove unused variables form http tests (Rich Trott) [#4422](https://github.com/nodejs/node/pull/4422) -* [[`c639d0f1fe`](https://github.com/nodejs/node/commit/c639d0f1fe)] - **test**: mark test-debug-no-context is flaky (Rich Trott) [#4421](https://github.com/nodejs/node/pull/4421) -* [[`cd79ec268d`](https://github.com/nodejs/node/commit/cd79ec268d)] - **test**: remove unnecessary assignments (Rich Trott) [#4408](https://github.com/nodejs/node/pull/4408) -* [[`0799a9abaf`](https://github.com/nodejs/node/commit/0799a9abaf)] - **test**: remove unused var from test-assert.js (Rich Trott) [#4405](https://github.com/nodejs/node/pull/4405) -* [[`3710028a85`](https://github.com/nodejs/node/commit/3710028a85)] - **test**: remove unused `util` imports (Rich Trott) [#4397](https://github.com/nodejs/node/pull/4397) -* [[`8c9d0c1f6f`](https://github.com/nodejs/node/commit/8c9d0c1f6f)] - **test**: refactor test-net-connect-options-ipv6 (Rich Trott) [#4395](https://github.com/nodejs/node/pull/4395) -* [[`874209022f`](https://github.com/nodejs/node/commit/874209022f)] - **test**: fix http-response-multiheaders (Santiago Gimeno) [#3958](https://github.com/nodejs/node/pull/3958) -* [[`71b79bcf54`](https://github.com/nodejs/node/commit/71b79bcf54)] - **test**: test each block in addon.md contains js & cc (Rod Vagg) [#4411](https://github.com/nodejs/node/pull/4411) -* [[`00b37de243`](https://github.com/nodejs/node/commit/00b37de243)] - **test**: fix domain-top-level-error-handler-throw (Santiago Gimeno) [#4364](https://github.com/nodejs/node/pull/4364) -* [[`6d14b6520f`](https://github.com/nodejs/node/commit/6d14b6520f)] - **test**: use platformTimeout() in more places (Brian White) [#4387](https://github.com/nodejs/node/pull/4387) -* [[`82f74caa56`](https://github.com/nodejs/node/commit/82f74caa56)] - **test**: fix flaky test-net-error-twice (Brian White) [#4342](https://github.com/nodejs/node/pull/4342) -* [[`96501e55be`](https://github.com/nodejs/node/commit/96501e55be)] - **test**: try other ipv6 localhost alternatives (Brian White) [#4325](https://github.com/nodejs/node/pull/4325) -* [[`69343d6d2e`](https://github.com/nodejs/node/commit/69343d6d2e)] - **tls_wrap**: clear errors on return (Fedor Indutny) [#4515](https://github.com/nodejs/node/pull/4515) -* [[`ca9812cf4d`](https://github.com/nodejs/node/commit/ca9812cf4d)] - **tools**: fix warning in doc parsing (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) -* [[`386030b524`](https://github.com/nodejs/node/commit/386030b524)] - **tools**: implement no-unused-vars for eslint (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) -* [[`14a947fc70`](https://github.com/nodejs/node/commit/14a947fc70)] - **tools**: run tick processor without forking (Matt Loring) [#4224](https://github.com/nodejs/node/pull/4224) -* [[`8039ca06eb`](https://github.com/nodejs/node/commit/8039ca06eb)] - **util**: faster arrayToHash (Jackson Tian) [#3964](https://github.com/nodejs/node/pull/3964) +Moved to doc/changelogs/CHANGELOG_V5.md#5.4.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.4. ## 2015-12-16, Version 5.3.0 (Stable), @cjihrig -### Notable changes - -* **buffer**: - - `Buffer.prototype.includes()` has been added to keep parity with TypedArrays. (Alexander Martin) [#3567](https://github.com/nodejs/node/pull/3567). -* **domains**: - - Fix handling of uncaught exceptions. (Julien Gilli) [#3654](https://github.com/nodejs/node/pull/3654). -* **https**: - - Added support for disabling session caching. (Fedor Indutny) [#4252](https://github.com/nodejs/node/pull/4252). -* **repl**: - - Allow third party modules to be imported using `require()`. This corrects a regression from 5.2.0. (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215). -* **deps**: - - Upgrade libuv to 1.8.0. (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276). - - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`6ca5ea3860`](https://github.com/nodejs/node/commit/6ca5ea3860)] - 2015-12-09, Version 5.2.0 (Stable) (Rod Vagg) [#4181](https://github.com/nodejs/node/pull/4181) -* [[`da5cdc2207`](https://github.com/nodejs/node/commit/da5cdc2207)] - **assert**: accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) -* [[`67e181986a`](https://github.com/nodejs/node/commit/67e181986a)] - **(SEMVER-MINOR)** **buffer**: add includes() for parity with TypedArray (Alexander Martin) [#3567](https://github.com/nodejs/node/pull/3567) -* [[`84dea1bd0c`](https://github.com/nodejs/node/commit/84dea1bd0c)] - **configure**: fix arm vfpv2 (Jörg Krause) [#4203](https://github.com/nodejs/node/pull/4203) -* [[`a7f5dfd14c`](https://github.com/nodejs/node/commit/a7f5dfd14c)] - **configure**: use \_\_ARM\_ARCH to determine arm version (João Reis) [#4123](https://github.com/nodejs/node/pull/4123) -* [[`0e3912be0b`](https://github.com/nodejs/node/commit/0e3912be0b)] - **configure**: respect CC\_host in host arch detection (João Reis) [#4117](https://github.com/nodejs/node/pull/4117) -* [[`69b94ec55c`](https://github.com/nodejs/node/commit/69b94ec55c)] - **deps**: upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276) -* [[`a8854e5b59`](https://github.com/nodejs/node/commit/a8854e5b59)] - **doc**: document the cache parameter for fs.realpathSync (Jackson Tian) [#4285](https://github.com/nodejs/node/pull/4285) -* [[`9e1b7aa874`](https://github.com/nodejs/node/commit/9e1b7aa874)] - **doc**: document backlog for server.listen() variants (Jan Schär) [#4025](https://github.com/nodejs/node/pull/4025) -* [[`435d571f22`](https://github.com/nodejs/node/commit/435d571f22)] - **doc**: update AUTHORS list (Rod Vagg) [#4183](https://github.com/nodejs/node/pull/4183) -* [[`3b3061365a`](https://github.com/nodejs/node/commit/3b3061365a)] - **doc**: update irc channels: #node.js and #node-dev (Nelson Pecora) [#2743](https://github.com/nodejs/node/pull/2743) -* [[`9538fd02e5`](https://github.com/nodejs/node/commit/9538fd02e5)] - **doc**: clarify error events in HTTP module documentation (Lenny Markus) [#4275](https://github.com/nodejs/node/pull/4275) -* [[`c6efd535e4`](https://github.com/nodejs/node/commit/c6efd535e4)] - **doc**: fix improper http.get sample code (Hideki Yamamura) [#4263](https://github.com/nodejs/node/pull/4263) -* [[`498c9adb08`](https://github.com/nodejs/node/commit/498c9adb08)] - **doc**: add CTC meeting minutes 2015-10-28 (Rod Vagg) [#3661](https://github.com/nodejs/node/pull/3661) -* [[`671347cf13`](https://github.com/nodejs/node/commit/671347cf13)] - **doc**: fixup socket.remoteAddress (Arthur Gautier) [#4198](https://github.com/nodejs/node/pull/4198) -* [[`f050cab3d8`](https://github.com/nodejs/node/commit/f050cab3d8)] - **doc**: copyedit console doc (Rich Trott) [#4225](https://github.com/nodejs/node/pull/4225) -* [[`1a21a5368b`](https://github.com/nodejs/node/commit/1a21a5368b)] - **doc**: move description of 'equals' method to right place (janriemer) [#4227](https://github.com/nodejs/node/pull/4227) -* [[`9a9c5259bf`](https://github.com/nodejs/node/commit/9a9c5259bf)] - **doc**: Fixing broken links to the v8 wiki (Tom Gallacher) [#4241](https://github.com/nodejs/node/pull/4241) -* [[`37ed05b8c1`](https://github.com/nodejs/node/commit/37ed05b8c1)] - **doc**: copyedit child_process doc (Rich Trott) [#4188](https://github.com/nodejs/node/pull/4188) -* [[`e47ae5808b`](https://github.com/nodejs/node/commit/e47ae5808b)] - **doc**: copyedit buffer doc (Rich Trott) [#4187](https://github.com/nodejs/node/pull/4187) -* [[`70fb06a90b`](https://github.com/nodejs/node/commit/70fb06a90b)] - **doc**: clarify assert.fail doc (Rich Trott) [#4186](https://github.com/nodejs/node/pull/4186) -* [[`e3187cc81e`](https://github.com/nodejs/node/commit/e3187cc81e)] - **doc**: copyedit addons doc (Rich Trott) [#4185](https://github.com/nodejs/node/pull/4185) -* [[`931ab967ff`](https://github.com/nodejs/node/commit/931ab967ff)] - **doc**: add calvinmetcalf to collaborators (Calvin Metcalf) [#4218](https://github.com/nodejs/node/pull/4218) -* [[`01ce23148b`](https://github.com/nodejs/node/commit/01ce23148b)] - **doc**: add mcollina to collaborators (Matteo Collina) [#4220](https://github.com/nodejs/node/pull/4220) -* [[`bd8753aabf`](https://github.com/nodejs/node/commit/bd8753aabf)] - **doc**: add rmg to collaborators (Ryan Graham) [#4219](https://github.com/nodejs/node/pull/4219) -* [[`73a9a6fc92`](https://github.com/nodejs/node/commit/73a9a6fc92)] - **doc**: harmonize description of `ca` argument (Ben Noordhuis) [#4213](https://github.com/nodejs/node/pull/4213) -* [[`dfc8bedbc5`](https://github.com/nodejs/node/commit/dfc8bedbc5)] - **doc**: change references from node to Node.js (Roman Klauke) [#4177](https://github.com/nodejs/node/pull/4177) -* [[`7a518788e9`](https://github.com/nodejs/node/commit/7a518788e9)] - **doc, test**: symbols as event names (Bryan English) [#4151](https://github.com/nodejs/node/pull/4151) -* [[`425a3545d2`](https://github.com/nodejs/node/commit/425a3545d2)] - **(SEMVER-MINOR)** **domains**: fix handling of uncaught exceptions (Julien Gilli) [#3654](https://github.com/nodejs/node/pull/3654) -* [[`acef181fde`](https://github.com/nodejs/node/commit/acef181fde)] - **(SEMVER-MINOR)** **https**: support disabling session caching (Fedor Indutny) [#4252](https://github.com/nodejs/node/pull/4252) -* [[`2a60e2ad71`](https://github.com/nodejs/node/commit/2a60e2ad71)] - **module,src**: do not wrap modules with -1 lineOffset (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) -* [[`d3c498b1b7`](https://github.com/nodejs/node/commit/d3c498b1b7)] - **node**: remove unused variables in AppendExceptionLine (Yazhong Liu) [#4264](https://github.com/nodejs/node/pull/4264) -* [[`aad6b9f0eb`](https://github.com/nodejs/node/commit/aad6b9f0eb)] - **repl**: display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) -* [[`213ede6cee`](https://github.com/nodejs/node/commit/213ede6cee)] - **repl**: fix require('3rdparty') regression (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215) -* [[`f176b31e74`](https://github.com/nodejs/node/commit/f176b31e74)] - **src**: remove \_\_builtin\_bswap16 call (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) -* [[`ce2471673f`](https://github.com/nodejs/node/commit/ce2471673f)] - **src**: remove unused BITS_PER_LONG macro (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) -* [[`b799a74709`](https://github.com/nodejs/node/commit/b799a74709)] - **src**: fix line numbers on core errors (cjihrig) [#4254](https://github.com/nodejs/node/pull/4254) -* [[`c311b61430`](https://github.com/nodejs/node/commit/c311b61430)] - **src**: fix deprecation message for ErrnoException (Martin von Gagern) [#4269](https://github.com/nodejs/node/pull/4269) -* [[`2859f9ef92`](https://github.com/nodejs/node/commit/2859f9ef92)] - **test**: fix debug-port-cluster flakiness (Ben Noordhuis) [#4310](https://github.com/nodejs/node/pull/4310) -* [[`cb0b4a6bc0`](https://github.com/nodejs/node/commit/cb0b4a6bc0)] - **test**: add test for debugging one line files (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) -* [[`0b9c3a30d6`](https://github.com/nodejs/node/commit/0b9c3a30d6)] - **test**: add test for tls.parseCertString (Evan Lucas) [#4283](https://github.com/nodejs/node/pull/4283) -* [[`7598ed6cc0`](https://github.com/nodejs/node/commit/7598ed6cc0)] - **test**: parallelize test-repl-persistent-history (Jeremiah Senkpiel) [#4247](https://github.com/nodejs/node/pull/4247) -* [[`668449ad14`](https://github.com/nodejs/node/commit/668449ad14)] - **test**: use regular timeout times for ARMv8 (Jeremiah Senkpiel) [#4248](https://github.com/nodejs/node/pull/4248) -* [[`23e7703c85`](https://github.com/nodejs/node/commit/23e7703c85)] - **test**: fix http-many-ended-pipelines flakiness (Santiago Gimeno) [#4041](https://github.com/nodejs/node/pull/4041) -* [[`3b94991bda`](https://github.com/nodejs/node/commit/3b94991bda)] - **test**: fix tls-inception flakiness (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) -* [[`86a3bd09b0`](https://github.com/nodejs/node/commit/86a3bd09b0)] - **test**: fix tls-inception (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) -* [[`1e89830a11`](https://github.com/nodejs/node/commit/1e89830a11)] - **test**: don't assume openssl s\_client supports -ssl3 (Ben Noordhuis) [#4204](https://github.com/nodejs/node/pull/4204) -* [[`c5b4f6bc99`](https://github.com/nodejs/node/commit/c5b4f6bc99)] - **(SEMVER-MINOR)** **tls**: introduce `secureContext` for `tls.connect` (Fedor Indutny) [#4246](https://github.com/nodejs/node/pull/4246) -* [[`e0bb118a1d`](https://github.com/nodejs/node/commit/e0bb118a1d)] - **tls_wrap**: inherit from the `AsyncWrap` first (Fedor Indutny) [#4268](https://github.com/nodejs/node/pull/4268) -* [[`d63cceeb10`](https://github.com/nodejs/node/commit/d63cceeb10)] - **tools**: add .editorconfig (ronkorving) [#2993](https://github.com/nodejs/node/pull/2993) -* [[`4b267df93e`](https://github.com/nodejs/node/commit/4b267df93e)] - **udp**: remove a needless instanceof Buffer check (ronkorving) [#4301](https://github.com/nodejs/node/pull/4301) +Moved to doc/changelogs/CHANGELOG_V5.md#5.3.0. ## 2015-12-09, Version 5.2.0 (Stable), @rvagg -### Notable changes - -* **build**: - - Add support for Intel's VTune JIT profiling when compiled with `--enable-vtune-profiling`. For more information about VTune, see . (Chunyang Dai) [#3785](https://github.com/nodejs/node/pull/3785). - - Properly enable V8 snapshots by default. Due to a configuration error, snapshots have been kept off by default when the intention is for the feature to be enabled. (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962). -* **crypto**: - - Simplify use of ECDH (Elliptic Curve Diffie-Hellman) objects (created via `crypto.createECDH(curve_name)`) with private keys that are not dynamically generated via `generateKeys()`. The public key is now computed when explicitly setting a private key. Added validity checks to reduce the possibility of computing weak or invalid shared secrets. Also, deprecated the `setPublicKey()` method for ECDH objects as its usage is unnecessary and can lead to inconsistent state. (Michael Ruddy) [#3511](https://github.com/nodejs/node/pull/3511). - - Update root certificates from the current list stored maintained by Mozilla NSS. (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951). - - Multiple CA certificates can now be passed with the `ca` option to TLS methods as an array of strings or in a single new-line separated string. (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) -* **tools**: Include a tick processor in core, exposed via the `--prof-process` command-line argument which can be used to process V8 profiling output files generated when using the `--prof` command-line argument. (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021). - - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`08a3f29fd4`](https://github.com/nodejs/node/commit/08a3f29fd4)] - **buffer**: fix range checking for slowToString (Matt Loring) [#4019](https://github.com/nodejs/node/pull/4019) -* [[`e3a8e8bba4`](https://github.com/nodejs/node/commit/e3a8e8bba4)] - **buffer**: Prevent Buffer constructor deopt (Bryce Baril) [#4158](https://github.com/nodejs/node/pull/4158) -* [[`0e18e68324`](https://github.com/nodejs/node/commit/0e18e68324)] - **buffer**: fix writeInt{B,L}E for some neg values (Peter A. Bigot) [#3994](https://github.com/nodejs/node/pull/3994) -* [[`ab5b529dd2`](https://github.com/nodejs/node/commit/ab5b529dd2)] - **buffer**: default to UTF8 in byteLength() (Tom Gallacher) [#4010](https://github.com/nodejs/node/pull/4010) -* [[`fcf0e8ebdf`](https://github.com/nodejs/node/commit/fcf0e8ebdf)] - **buffer**: move checkFloat from lib into src (Matt Loring) [#3763](https://github.com/nodejs/node/pull/3763) -* [[`12649f4496`](https://github.com/nodejs/node/commit/12649f4496)] - **build**: add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) -* [[`a76d788119`](https://github.com/nodejs/node/commit/a76d788119)] - **build**: update signtool description, add url (Rod Vagg) [#4011](https://github.com/nodejs/node/pull/4011) -* [[`ed255abdc1`](https://github.com/nodejs/node/commit/ed255abdc1)] - **(SEMVER-MINOR)** **build,src**: add Intel Vtune profiling support (Chunyang Dai) [#3785](https://github.com/nodejs/node/pull/3785) -* [[`7793c364fc`](https://github.com/nodejs/node/commit/7793c364fc)] - **child_process**: flush consuming streams (Dave) [#4071](https://github.com/nodejs/node/pull/4071) -* [[`f29c5d6e70`](https://github.com/nodejs/node/commit/f29c5d6e70)] - **configure**: `v8_use_snapshot` should be `true` (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962) -* [[`da5ac55c83`](https://github.com/nodejs/node/commit/da5ac55c83)] - **(SEMVER-MINOR)** **crypto**: simplify using pre-existing keys with ECDH (Michael Ruddy) [#3511](https://github.com/nodejs/node/pull/3511) -* [[`cfc97641ee`](https://github.com/nodejs/node/commit/cfc97641ee)] - **crypto**: fix native module compilation with FIPS (Stefan Budeanu) [#4023](https://github.com/nodejs/node/pull/4023) -* [[`b81b45dabd`](https://github.com/nodejs/node/commit/b81b45dabd)] - **crypto**: update root certificates (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) -* [[`def681a07e`](https://github.com/nodejs/node/commit/def681a07e)] - **crypto**: disable crypto.createCipher in FIPS mode (Stefan Budeanu) [#3754](https://github.com/nodejs/node/pull/3754) -* [[`ce423f3624`](https://github.com/nodejs/node/commit/ce423f3624)] - **debugger**: introduce exec method for debugger (Jackson Tian) -* [[`99fd1ec28d`](https://github.com/nodejs/node/commit/99fd1ec28d)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3937](https://github.com/nodejs/node/pull/3937) -* [[`82252b2a17`](https://github.com/nodejs/node/commit/82252b2a17)] - **doc**: add brief Node.js overview to README (wurde) [#4174](https://github.com/nodejs/node/pull/4174) -* [[`634c5f1f81`](https://github.com/nodejs/node/commit/634c5f1f81)] - **doc**: url.format - true slash postfix behaviour (fansworld-claudio) [#4119](https://github.com/nodejs/node/pull/4119) -* [[`6f957a70d8`](https://github.com/nodejs/node/commit/6f957a70d8)] - **doc**: s/node.js/Node.js in readme (Rod Vagg) [#3998](https://github.com/nodejs/node/pull/3998) -* [[`0cd4a52392`](https://github.com/nodejs/node/commit/0cd4a52392)] - **doc**: improve child_process.markdown wording (yorkie) [#4138](https://github.com/nodejs/node/pull/4138) -* [[`fd5ed6888d`](https://github.com/nodejs/node/commit/fd5ed6888d)] - **doc**: add JungMinu to collaborators (Minwoo Jung) [#4143](https://github.com/nodejs/node/pull/4143) -* [[`fa0cdf75d9`](https://github.com/nodejs/node/commit/fa0cdf75d9)] - **doc**: add iarna to collaborators (Rebecca Turner) [#4144](https://github.com/nodejs/node/pull/4144) -* [[`424eb962b1`](https://github.com/nodejs/node/commit/424eb962b1)] - **doc**: add zkat to collaborators (Kat Marchán) [#4142](https://github.com/nodejs/node/pull/4142) -* [[`85b601224b`](https://github.com/nodejs/node/commit/85b601224b)] - **doc**: add HTTP working group (James M Snell) [#3919](https://github.com/nodejs/node/pull/3919) -* [[`f4164bd8df`](https://github.com/nodejs/node/commit/f4164bd8df)] - **doc**: update links to use https where possible (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) -* [[`3169eed1e3`](https://github.com/nodejs/node/commit/3169eed1e3)] - **doc**: add links and backticks around names (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) -* [[`f3417e2574`](https://github.com/nodejs/node/commit/f3417e2574)] - **doc**: standardize references to node.js in docs (Scott Buchanan) [#4136](https://github.com/nodejs/node/pull/4136) -* [[`95dd60c657`](https://github.com/nodejs/node/commit/95dd60c657)] - **doc**: reword https.Agent example text (Jan Krems) [#4075](https://github.com/nodejs/node/pull/4075) -* [[`c61237d3ea`](https://github.com/nodejs/node/commit/c61237d3ea)] - **doc**: fix internal link to child.send() (Luigi Pinca) [#4089](https://github.com/nodejs/node/pull/4089) -* [[`aaeced915e`](https://github.com/nodejs/node/commit/aaeced915e)] - **doc**: fix the exception description (yorkie) [#3658](https://github.com/nodejs/node/pull/3658) -* [[`a2b7596ac0`](https://github.com/nodejs/node/commit/a2b7596ac0)] - **doc**: fix color of linked code blocks (jpersson) [#4068](https://github.com/nodejs/node/pull/4068) -* [[`f3c50f5fb5`](https://github.com/nodejs/node/commit/f3c50f5fb5)] - **doc**: fix rare case of misaligned columns (Roman Reiss) [#3948](https://github.com/nodejs/node/pull/3948) -* [[`f0a2e2cdec`](https://github.com/nodejs/node/commit/f0a2e2cdec)] - **doc**: message.header duplication correction (Bryan English) [#3997](https://github.com/nodejs/node/pull/3997) -* [[`b1dfa8bebb`](https://github.com/nodejs/node/commit/b1dfa8bebb)] - **doc**: fix typo in README (Rich Trott) [#4000](https://github.com/nodejs/node/pull/4000) -* [[`4602e01221`](https://github.com/nodejs/node/commit/4602e01221)] - **doc**: replace sane with reasonable (Lewis Cowper) [#3980](https://github.com/nodejs/node/pull/3980) -* [[`4849a54386`](https://github.com/nodejs/node/commit/4849a54386)] - **doc**: Adding best practises for crypto.pbkdf2 (Tom Gallacher) [#3290](https://github.com/nodejs/node/pull/3290) -* [[`77251d99de`](https://github.com/nodejs/node/commit/77251d99de)] - **doc**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) -* [[`f4ca007b42`](https://github.com/nodejs/node/commit/f4ca007b42)] - **doc**: clarify that fs streams expect blocking fd (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) -* [[`26eeae8016`](https://github.com/nodejs/node/commit/26eeae8016)] - **doc**: fix broken references (Alexander Gromnitsky) [#3944](https://github.com/nodejs/node/pull/3944) -* [[`f90227b0e8`](https://github.com/nodejs/node/commit/f90227b0e8)] - **doc**: move fs.existsSync() deprecation message (Martin Forsberg) [#3942](https://github.com/nodejs/node/pull/3942) -* [[`bbcb2a2e65`](https://github.com/nodejs/node/commit/bbcb2a2e65)] - **doc**: clarify module loading behavior (cjihrig) [#3920](https://github.com/nodejs/node/pull/3920) -* [[`0997178037`](https://github.com/nodejs/node/commit/0997178037)] - **doc**: add reference for buffer.inspect() (cjihrig) [#3921](https://github.com/nodejs/node/pull/3921) -* [[`6c16c40283`](https://github.com/nodejs/node/commit/6c16c40283)] - **doc**: clarify v5.1.1 notable items (Rod Vagg) [#4156](https://github.com/nodejs/node/pull/4156) -* [[`4c8800c2de`](https://github.com/nodejs/node/commit/4c8800c2de)] - **fs,doc**: use `target` instead of `destination` (yorkie) [#3912](https://github.com/nodejs/node/pull/3912) -* [[`1f0e8dca8e`](https://github.com/nodejs/node/commit/1f0e8dca8e)] - **installer**: install the tick processor (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) -* [[`e8e4e0718b`](https://github.com/nodejs/node/commit/e8e4e0718b)] - **meta**: remove use of profanity in source (Myles Borins) [#4122](https://github.com/nodejs/node/pull/4122) -* [[`13834caa28`](https://github.com/nodejs/node/commit/13834caa28)] - **module**: fix column offsets in errors (Tristian Flanagan) [#2867](https://github.com/nodejs/node/pull/2867) -* [[`8988e1e117`](https://github.com/nodejs/node/commit/8988e1e117)] - **module,repl**: remove repl require() hack (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) -* [[`baac81d95f`](https://github.com/nodejs/node/commit/baac81d95f)] - **net**: add local address/port for better errors (Jan Schär) [#3946](https://github.com/nodejs/node/pull/3946) -* [[`12754c5dc3`](https://github.com/nodejs/node/commit/12754c5dc3)] - **net**: small code cleanup (Jan Schär) [#3943](https://github.com/nodejs/node/pull/3943) -* [[`8a5e4345fd`](https://github.com/nodejs/node/commit/8a5e4345fd)] - **node**: s/doNTCallbackX/nextTickCallbackWithXArgs/ (Rod Vagg) [#4167](https://github.com/nodejs/node/pull/4167) -* [[`0869ef3c55`](https://github.com/nodejs/node/commit/0869ef3c55)] - **(SEMVER-MINOR)** **repl**: allow leading period in multiline input (Zirak) [#3835](https://github.com/nodejs/node/pull/3835) -* [[`aaab108dfe`](https://github.com/nodejs/node/commit/aaab108dfe)] - **repl**: attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) -* [[`b08126dc9d`](https://github.com/nodejs/node/commit/b08126dc9d)] - **src**: refactor vcbuild configure args creation (Rod Vagg) [#3399](https://github.com/nodejs/node/pull/3399) -* [[`da3137d0c5`](https://github.com/nodejs/node/commit/da3137d0c5)] - **src**: don't print garbage errors (cjihrig) [#4112](https://github.com/nodejs/node/pull/4112) -* [[`9e9346fa32`](https://github.com/nodejs/node/commit/9e9346fa32)] - **src**: use GetCurrentProcessId() for process.pid (Ben Noordhuis) [#4163](https://github.com/nodejs/node/pull/4163) -* [[`d969c0965c`](https://github.com/nodejs/node/commit/d969c0965c)] - **src**: define Is* util functions with macros (cjihrig) [#4118](https://github.com/nodejs/node/pull/4118) -* [[`458facdf66`](https://github.com/nodejs/node/commit/458facdf66)] - **src**: define getpid() based on OS (cjihrig) [#4146](https://github.com/nodejs/node/pull/4146) -* [[`7e18f2ec62`](https://github.com/nodejs/node/commit/7e18f2ec62)] - **(SEMVER-MINOR)** **src**: add BE support to StringBytes::Encode() (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) -* [[`756ab9caad`](https://github.com/nodejs/node/commit/756ab9caad)] - **stream**: be less eager with readable flag (Brian White) [#4141](https://github.com/nodejs/node/pull/4141) -* [[`8f845ba28a`](https://github.com/nodejs/node/commit/8f845ba28a)] - **stream_wrap**: error if stream has StringDecoder (Fedor Indutny) [#4031](https://github.com/nodejs/node/pull/4031) -* [[`1c1af81ea0`](https://github.com/nodejs/node/commit/1c1af81ea0)] - **streams**: update .readable/.writable to false (Brian White) [#4083](https://github.com/nodejs/node/pull/4083) -* [[`1d50819c85`](https://github.com/nodejs/node/commit/1d50819c85)] - **test**: check range fix for slowToString (Sakthipriyan Vairamani) [#4019](https://github.com/nodejs/node/pull/4019) -* [[`0c2a0dc859`](https://github.com/nodejs/node/commit/0c2a0dc859)] - **test**: skip long path tests on non-Windows (Rafał Pocztarski) [#4116](https://github.com/nodejs/node/pull/4116) -* [[`8a60aa1303`](https://github.com/nodejs/node/commit/8a60aa1303)] - **test**: don't check the # of chunks in test-http-1.0 (Santiago Gimeno) [#3961](https://github.com/nodejs/node/pull/3961) -* [[`e84aeec883`](https://github.com/nodejs/node/commit/e84aeec883)] - **test**: mark test-cluster-shared-leak flaky (Rich Trott) [#4162](https://github.com/nodejs/node/pull/4162) -* [[`b3f3b2e157`](https://github.com/nodejs/node/commit/b3f3b2e157)] - **test**: fix cluster-worker-isdead (Santiago Gimeno) [#3954](https://github.com/nodejs/node/pull/3954) -* [[`da6be4d31a`](https://github.com/nodejs/node/commit/da6be4d31a)] - **test**: fix time resolution constraint (Gireesh Punathil) [#3981](https://github.com/nodejs/node/pull/3981) -* [[`9d16729b20`](https://github.com/nodejs/node/commit/9d16729b20)] - **test**: skip instead of fail when mem constrained (Michael Cornacchia) [#3697](https://github.com/nodejs/node/pull/3697) -* [[`be41eb751b`](https://github.com/nodejs/node/commit/be41eb751b)] - **test**: refactor test-http-exit-delay (Rich Trott) [#4055](https://github.com/nodejs/node/pull/4055) -* [[`4b43bf0385`](https://github.com/nodejs/node/commit/4b43bf0385)] - **test**: fix flaky test-net-socket-local-address (Rich Trott) [#4109](https://github.com/nodejs/node/pull/4109) -* [[`cb55c67a00`](https://github.com/nodejs/node/commit/cb55c67a00)] - **test**: improve cluster-disconnect-handles test (Brian White) [#4084](https://github.com/nodejs/node/pull/4084) -* [[`2b5b127e14`](https://github.com/nodejs/node/commit/2b5b127e14)] - **test**: fix cluster-disconnect-handles flakiness (Santiago Gimeno) [#4009](https://github.com/nodejs/node/pull/4009) -* [[`430264817b`](https://github.com/nodejs/node/commit/430264817b)] - **test**: add test for repl.defineCommand() (Bryan English) [#3908](https://github.com/nodejs/node/pull/3908) -* [[`22b0971222`](https://github.com/nodejs/node/commit/22b0971222)] - **test**: eliminate multicast test FreeBSD flakiness (Rich Trott) [#4042](https://github.com/nodejs/node/pull/4042) -* [[`c50003746b`](https://github.com/nodejs/node/commit/c50003746b)] - **test**: mark test flaky on FreeBSD (Rich Trott) [#4016](https://github.com/nodejs/node/pull/4016) -* [[`69c95bbdb7`](https://github.com/nodejs/node/commit/69c95bbdb7)] - **test**: move ArrayStream to common (cjihrig) [#4027](https://github.com/nodejs/node/pull/4027) -* [[`d94a70ec51`](https://github.com/nodejs/node/commit/d94a70ec51)] - **test**: fix test-domain-exit-dispose-again (Julien Gilli) [#3990](https://github.com/nodejs/node/pull/3990) -* [[`00b839a2b8`](https://github.com/nodejs/node/commit/00b839a2b8)] - **test**: use platform-based timeout for reliability (Rich Trott) [#4015](https://github.com/nodejs/node/pull/4015) -* [[`054a216b6f`](https://github.com/nodejs/node/commit/054a216b6f)] - **test**: mark cluster-net-send test flaky on windows (Rich Trott) [#4006](https://github.com/nodejs/node/pull/4006) -* [[`d0621c5649`](https://github.com/nodejs/node/commit/d0621c5649)] - **test**: mark fork regression test flaky on windows (Rich Trott) [#4005](https://github.com/nodejs/node/pull/4005) -* [[`19ed33df80`](https://github.com/nodejs/node/commit/19ed33df80)] - **test**: skip test if in FreeBSD jail (Rich Trott) [#3995](https://github.com/nodejs/node/pull/3995) -* [[`a863e8d667`](https://github.com/nodejs/node/commit/a863e8d667)] - **test**: remove flaky status for cluster test (Rich Trott) [#3975](https://github.com/nodejs/node/pull/3975) -* [[`dd0d15fc47`](https://github.com/nodejs/node/commit/dd0d15fc47)] - **test**: add TAP diagnostic message for retried tests (Rich Trott) [#3960](https://github.com/nodejs/node/pull/3960) -* [[`1fe4d30efc`](https://github.com/nodejs/node/commit/1fe4d30efc)] - **test**: retry on smartos if ECONNREFUSED (Rich Trott) [#3941](https://github.com/nodejs/node/pull/3941) -* [[`665a35d45e`](https://github.com/nodejs/node/commit/665a35d45e)] - **test**: address flaky test-http-client-timeout-event (Rich Trott) [#3968](https://github.com/nodejs/node/pull/3968) -* [[`f9fe0aee53`](https://github.com/nodejs/node/commit/f9fe0aee53)] - **test**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) -* [[`54aafa17af`](https://github.com/nodejs/node/commit/54aafa17af)] - **test**: http complete list of non-concat headers (Bryan English) [#3930](https://github.com/nodejs/node/pull/3930) -* [[`788541b40c`](https://github.com/nodejs/node/commit/788541b40c)] - **test**: fix race condition in unrefd interval test (Michael Cornacchia) [#3550](https://github.com/nodejs/node/pull/3550) -* [[`e129d83996`](https://github.com/nodejs/node/commit/e129d83996)] - **test**: skip/replace weak crypto tests in FIPS mode (Stefan Budeanu) [#3757](https://github.com/nodejs/node/pull/3757) -* [[`bc27379453`](https://github.com/nodejs/node/commit/bc27379453)] - **test**: avoid test timeouts on rpi (Stefan Budeanu) [#3902](https://github.com/nodejs/node/pull/3902) -* [[`272732e76b`](https://github.com/nodejs/node/commit/272732e76b)] - **test**: fix flaky test-child-process-spawnsync-input (Rich Trott) [#3889](https://github.com/nodejs/node/pull/3889) -* [[`781f8c0d1e`](https://github.com/nodejs/node/commit/781f8c0d1e)] - **test**: add OS X to module loading error test (Evan Lucas) [#3901](https://github.com/nodejs/node/pull/3901) -* [[`f99c6363de`](https://github.com/nodejs/node/commit/f99c6363de)] - **test**: module loading error fix solaris #3798 (fansworld-claudio) [#3855](https://github.com/nodejs/node/pull/3855) -* [[`1279adc756`](https://github.com/nodejs/node/commit/1279adc756)] - **timers**: optimize callback call: bind -> arrow (Andrei Sedoi) [#4038](https://github.com/nodejs/node/pull/4038) -* [[`80f7f65464`](https://github.com/nodejs/node/commit/80f7f65464)] - **(SEMVER-MINOR)** **tls**: support reading multiple cas from one input (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) -* [[`939f305d56`](https://github.com/nodejs/node/commit/939f305d56)] - **tls_wrap**: slice buffer properly in `ClearOut` (Fedor Indutny) [#4184](https://github.com/nodejs/node/pull/4184) -* [[`6d4a03d3d2`](https://github.com/nodejs/node/commit/6d4a03d3d2)] - **(SEMVER-MINOR)** **tools**: list missing whitespace/if-one-line cpplint (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) -* [[`1c1c1a0f2b`](https://github.com/nodejs/node/commit/1c1c1a0f2b)] - **(SEMVER-MINOR)** **tools**: add --prof-process flag to node binary (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) -* [[`d7a7d3e6f7`](https://github.com/nodejs/node/commit/d7a7d3e6f7)] - **tools**: update certdata.txt (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) -* [[`1b434e0654`](https://github.com/nodejs/node/commit/1b434e0654)] - **util**: determine object types in C++ (cjihrig) [#4100](https://github.com/nodejs/node/pull/4100) -* [[`c93e2678f0`](https://github.com/nodejs/node/commit/c93e2678f0)] - **util**: fix constructor/instanceof checks (Brian White) [#3385](https://github.com/nodejs/node/pull/3385) -* [[`098a3113e1`](https://github.com/nodejs/node/commit/098a3113e1)] - **util**: move .decorateErrorStack to internal/util (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) -* [[`e68ea16c32`](https://github.com/nodejs/node/commit/e68ea16c32)] - **util**: add decorateErrorStack() (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) -* [[`c584c3e08f`](https://github.com/nodejs/node/commit/c584c3e08f)] - **util,src**: allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) +Moved to doc/changelogs/CHANGELOG_V5.md#5.2.0. ## 2015-12-04, Version 5.1.1 (Stable), @rvagg -### Notable changes - -* **http**: Fix CVE-2015-8027, a bug whereby an HTTP socket may no longer have a parser associated with it but a pipelined request attempts to trigger a pause or resume on the non-existent parser, a potential denial-of-service vulnerability. (Fedor Indutny) -* **openssl**: Upgrade to 1.0.2e, containing fixes for: - - CVE-2015-3193 "BN_mod_exp may produce incorrect results on x86_64", an attack may be possible against a Node.js TLS server using DHE key exchange. Details are available at . - - CVE-2015-3194 "Certificate verify crash with missing PSS parameter", a potential denial-of-service vector for Node.js TLS servers using client certificate authentication; TLS clients are also impacted. Details are available at . - (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) -* **v8**: Backport fix for CVE-2015-6764, a bug in `JSON.stringify()` that can result in out-of-bounds reads for arrays. (Ben Noordhuis) - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`678398f250`](https://github.com/nodejs/node/commit/678398f250)] - **deps**: backport a7e50a5 from upstream v8 (Ben Noordhuis) -* [[`76a552c938`](https://github.com/nodejs/node/commit/76a552c938)] - **deps**: backport 6df9a1d from upstream v8 (Ben Noordhuis) -* [[`533881f889`](https://github.com/nodejs/node/commit/533881f889)] - **deps**: upgrade openssl sources to 1.0.2e (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) -* [[`12e70fafd3`](https://github.com/nodejs/node/commit/12e70fafd3)] - **http**: fix pipeline regression (Fedor Indutny) +Moved to doc/changelogs/CHANGELOG_V5.md#5.1.1. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.3. ## 2015-12-04, Version 0.12.9 (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.1q, fixes 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 . (Ben Noordhuis) https://github.com/nodejs/node/pull/4133 - -### Commits - -* [8d24a14f2c] - deps: upgrade to openssl 1.0.1q (Ben Noordhuis) https://github.com/nodejs/node/pull/4133 -* [dfc6f4a9af] - http: fix pipeline regression (Fedor Indutny) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.9. ## 2015-12-04, Version 0.10.41 (Maintenance), @rvagg -Security Update - -### Notable changes - -* build: Add support for Microsoft Visual Studio 2015 -* npm: Upgrade to v1.4.29 from v1.4.28. A special one-off release as part of the strategy to get a version of npm into Node.js v0.10.x that works with the current registry (https://github.com/nodejs/LTS/issues/37). This version of npm prints out a banner each time it is run. The banner warns that the next standard release of Node.js v0.10.x will ship with a version of npm v2. -* openssl: Upgrade to 1.0.1q, containing fixes 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 . (Ben Noordhuis) https://github.com/nodejs/node/pull/4133 - -### Commits - -* [16ca0779f5] - src/node.cc: fix build error without OpenSSL support (Jörg Krause) https://github.com/nodejs/node-v0.x-archive/pull/25862 -* [c559c7911d] - build: backport tools/release.sh (Rod Vagg) https://github.com/nodejs/node/pull/3965 -* [268d2b4637] - build: backport config for new CI infrastructure (Rod Vagg) https://github.com/nodejs/node/pull/3965 -* [c88a0b26da] - build: update manifest to include Windows 10 (Lucien Greathouse) https://github.com/nodejs/node/pull/2838 -* [8564a9f5f7] - build: gcc version detection on openSUSE Tumbleweed (Henrique Aparecido Lavezzo) https://github.com/nodejs/node-v0.x-archive/pull/25671 -* [9c7bd6de56] - build: run-ci makefile rule (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [ffa1e1f31d] - build: support flaky tests in test-ci (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [100dd19e61] - build: support Jenkins via test-ci (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [ec861f6f90] - build: make release process easier for multi users (Julien Gilli) https://github.com/nodejs/node-v0.x-archive/pull/25638 -* [d7ae79a452] - build,win: fix node.exe resource version (João Reis) https://github.com/nodejs/node/pull/3053 -* [6ac47aa9f5] - build,win: try next MSVS version on failure (João Reis) https://github.com/nodejs/node/pull/2910 -* [e669b27740] - crypto: replace rwlocks with simple mutexes (Ben Noordhuis) https://github.com/nodejs/node/pull/2723 -* [ce0a48826e] - deps: upgrade to openssl 1.0.1q (Ben Noordhuis) https://github.com/nodejs/node/pull/4132 -* [b68781e500] - deps: upgrade npm to 1.4.29 (Forrest L Norvell) https://github.com/nodejs/node/pull/3639 -* [7cf0d9c1d9] - deps: fix openssl for MSVS 2015 (Andy Polyakov) https://github.com/nodejs/node-v0.x-archive/pull/25857 -* [9ee8a14f9e] - deps: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) https://github.com/nodejs/node-v0.x-archive/pull/25857 -* [a525c7244e] - deps: update gyp to 25ed9ac (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25857 -* [6502160294] - dns: allow v8 to optimize lookup() (Brian White) https://github.com/nodejs/node-v0.x-archive/pull/8942 -* [5d829a63ab] - doc: backport README.md (Rod Vagg) https://github.com/nodejs/node/pull/3965 -* [62c8948109] - doc: fix Folders as Modules omission of index.json (Elan Shanker) https://github.com/nodejs/node-v0.x-archive/pull/8868 -* [572663f303] - https: don't overwrite servername option (skenqbx) https://github.com/nodejs/node-v0.x-archive/pull/9368 -* [75c84b2439] - test: add test for https agent servername option (skenqbx) https://github.com/nodejs/node-v0.x-archive/pull/9368 -* [841a6dd264] - test: mark more tests as flaky (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25807 -* [a7fee30da1] - test: mark test-tls-securepair-server as flaky (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25807 -* [7df57703dd] - test: mark test-net-error-twice flaky on SmartOS (Julien Gilli) https://github.com/nodejs/node-v0.x-archive/pull/25760 -* [e10892cccc] - test: make test-abort-fatal-error non flaky (Julien Gilli) https://github.com/nodejs/node-v0.x-archive/pull/25755 -* [a2f879f197] - test: mark recently failing tests as flaky (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [e7010bdf92] - test: runner should return 0 on flaky tests (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [c283c9bbb3] - test: support writing test output to file (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [eeaed586bb] - test: runner support for flaky tests (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [3bb8174b94] - test: refactor to use common testcfg (Timothy J Fontaine) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [df59d43586] - tools: pass constant to logger instead of string (Johan Bergström) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [d103d4ed9a] - tools: fix test.py after v8 upgrade (Ben Noordhuis) https://github.com/nodejs/node-v0.x-archive/pull/25686 -* [8002192b4e] - win: manifest node.exe for Windows 8.1 (Alexis Campailla) https://github.com/nodejs/node/pull/2838 -* [66ec1dae8f] - win: add MSVS 2015 support (Rod Vagg) https://github.com/nodejs/node-v0.x-archive/pull/25857 -* [e192f61514] - win: fix custom actions for WiX older than 3.9 (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25569 -* [16bcd68dc5] - win: fix custom actions on Visual Studio != 2013 (Julien Gilli) https://github.com/nodejs/node-v0.x-archive/pull/25569 -* [517986c2f4] - win: backport bringing back xp/2k3 support (Bert Belder) https://github.com/nodejs/node-v0.x-archive/pull/25569 -* [10f251e8dd] - win: backport set env before generating projects (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25569 +Moved to doc/changelogs/CHANGELOG_V010.md#0.10.41. ## 2015.11.25, Version 0.12.8 (LTS), @rvagg -* [d9399569bd] - build: backport tools/release.sh (Rod Vagg) https://github.com/nodejs/node/pull/3642 -* [78c5b4c8bd] - build: backport config for new CI infrastructure (Rod Vagg) https://github.com/nodejs/node/pull/3642 -* [83441616a5] - build: fix --without-ssl compile time error (Ben Noordhuis) https://github.com/nodejs/node/pull/3825 -* [8887666b0b] - build: update manifest to include Windows 10 (Lucien Greathouse) https://github.com/nodejs/node/pull/2843 -* [08afe4ec8e] - build: add MSVS 2015 support (Rod Vagg) https://github.com/nodejs/node/pull/2843 -* [4f2456369c] - build: work around VS2015 issue in ICU <56 (Steven R. Loomis) https://github.com/nodejs/node-v0.x-archive/pull/25804 -* [15030f26fd] - build: Intl: bump ICU4C from 54 to 55 (backport) (Steven R. Loomis) https://github.com/nodejs/node-v0.x-archive/pull/25856 -* [1083fa70f0] - build: run-ci makefile rule (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [2d2494cf14] - build: support flaky tests in test-ci (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [b25d26f2ef] - build: support Jenkins via test-ci (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [7e4b47f38a] - build,win: fix node.exe resource version (João Reis) https://github.com/nodejs/node/pull/3053 -* [e07c86e240] - build,win: try next MSVS version on failure (João Reis) https://github.com/nodejs/node/pull/2843 -* [b5a0abcfdf] - child_process: clone spawn options argument (cjihrig) https://github.com/nodejs/node-v0.x-archive/pull/9159 -* [8b81f98c41] - configure: add --without-mdb flag (cgalibern) https://github.com/nodejs/node-v0.x-archive/pull/25707 -* [071c860c2b] - crypto: replace rwlocks with simple mutexes (Ben Noordhuis) https://github.com/nodejs/node/pull/2723 -* [ca97fb6be3] - deps: upgrade npm to 2.14.9 (Forrest L Norvell) https://github.com/nodejs/node/pull/3684 -* [583734342e] - deps: fix openssl for MSVS 2015 (Andy Polyakov) https://github.com/nodejs/node/pull/2843 -* [02c262a4c6] - deps: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) https://github.com/nodejs/node/pull/2843 -* [f0fba0bce8] - deps: update gyp to 25ed9ac (João Reis) https://github.com/nodejs/node/pull/2843 -* [f693565813] - deps: upgrade to npm 2.13.4 (Kat Marchán) https://github.com/nodejs/node-v0.x-archive/pull/25825 -* [618b142679] - deps,v8: fix compilation in VS2015 (João Reis) https://github.com/nodejs/node/pull/2843 -* [49b4f0d54e] - doc: backport README.md (Rod Vagg) https://github.com/nodejs/node/pull/3642 -* [2860c53562] - doc: fixed child_process.exec doc (Tyler Anton) https://github.com/nodejs/node-v0.x-archive/pull/14088 -* [4a91fa11a3] - doc: Update docs for os.platform() (George Kotchlamazashvili) https://github.com/nodejs/node-v0.x-archive/pull/25777 -* [b03ab02fe8] - doc: Change the link for v8 docs to v8dox.com (Chad Walker) https://github.com/nodejs/node-v0.x-archive/pull/25811 -* [1fd8f37efd] - doc: buffer, adding missing backtick (Dyana Rose) https://github.com/nodejs/node-v0.x-archive/pull/25811 -* [162d0db3bb] - doc: tls.markdown, adjust version from v0.10.39 to v0.10.x (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [eda2560cdc] - doc: additional refinement to readable event (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [881d9bea01] - doc: readable event clarification (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [b6378f0c75] - doc: stream.unshift does not reset reading state (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [4952e2b4d2] - doc: clarify Readable._read and Readable.push (fresheneesz) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [14000b97d4] - doc: two minor stream doc improvements (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [6b6bd21497] - doc: Clarified read method with specified size argument. (Philippe Laferriere) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [16f547600a] - doc: Document http.request protocol option (Ville Skyttä) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [618e4ecda9] - doc: add a note about readable in flowing mode (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [0b165be37b] - doc: fix line wrapping in buffer.markdown (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [70dd13f88d] - doc: add CleartextStream deprecation notice (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [418cde0765] - doc: mention that mode is ignored if file exists (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [85bcb281e4] - doc: improve http.abort description (James M Snell) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [5ccb429ee8] - doc, comments: Grammar and spelling fixes (Ville Skyttä) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [a24db43101] - docs: event emitter behavior notice (Samuel Mills (Henchman)) https://github.com/nodejs/node-v0.x-archive/pull/25467 -* [8cbf7cb021] - docs: events clarify emitter.listener() behavior (Benjamin Steephenson) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [b7229debbe] - docs: Fix default options for fs.createWriteStream() (Chris Neave) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [f0453caea2] - domains: port caeb677 from v0.10 to v0.12 (Jeremy Whitlock) https://github.com/nodejs/node-v0.x-archive/pull/25835 -* [261fa3620f] - src: fix intermittent SIGSEGV in resolveTxt (Evan Lucas) https://github.com/nodejs/node-v0.x-archive/pull/9300 -* [1f7257b02d] - test: mark test-https-aws-ssl flaky on linux (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25893 -* [cf435d55db] - test: mark test-signal-unregister as flaky (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25750 -* [ceb6a8c131] - test: fix test-debug-port-from-cmdline (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25748 -* [22997731e6] - test: add regression test for #25735 (Fedor Indutny) https://github.com/nodejs/node-v0.x-archive/pull/25739 -* [39e05639f4] - test: mark http-pipeline-flood flaky on win32 (Julien Gilli) https://github.com/nodejs/node-v0.x-archive/pull/25707 -* [78d256e7f5] - test: unmark tests that are no longer flaky (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25676 -* [a9b642cf5b] - test: runner should return 0 on flaky tests (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [b48639befd] - test: support writing test output to file (Alexis Campailla) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [caa16b41d6] - (SEMVER-MINOR) tls: prevent server from using dhe keys < 768 (Michael Dawson) https://github.com/nodejs/node/pull/3890 -* [0363cf4a80] - tls: Closing parent socket also closes the tls sock (Devin Nakamura) https://github.com/nodejs/node-v0.x-archive/pull/25642 -* [75697112e8] - tls: do not hang without `newSession` handler (Fedor Indutny) https://github.com/nodejs/node-v0.x-archive/pull/25739 -* [d998a65058] - tools: pass constant to logger instead of string (Johan Bergström) https://github.com/nodejs/node-v0.x-archive/pull/25653 -* [1982ed6e63] - v8: port fbff705 from v0.10 to v0.12 (Jeremy Whitlock) https://github.com/nodejs/node-v0.x-archive/pull/25835 -* [44d7054252] - win: fix custom actions for WiX older than 3.9 (João Reis) https://github.com/nodejs/node/pull/2843 -* [586c4d8b8e] - win: fix custom actions on Visual Studio != 2013 (Julien Gilli) https://github.com/nodejs/node/pull/2843 -* [14db629497] - win,msi: correct installation path registry keys (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25640 -* [8e80528453] - win,msi: change InstallScope to perMachine (João Reis) https://github.com/nodejs/node-v0.x-archive/pull/25640 -* [35bbe98401] - Update addons.markdown (Max Deepfield) https://github.com/nodejs/node-v0.x-archive/pull/25885 -* [9a6f1ce416] - comma (Julien Valéry) https://github.com/nodejs/node-v0.x-archive/pull/25811 -* [d384bf8f84] - Update assert.markdown (daveboivin) https://github.com/nodejs/node-v0.x-archive/pull/25811 -* [89b22ccbe1] - Fixed typo (Andrew Murray) https://github.com/nodejs/node-v0.x-archive/pull/25811 -* [5ad05af380] - Update util.markdown (Daniel Rentz) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [cb660ab3d3] - Update child_process.markdown, spelling (Jared Fox) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [59c67fe3cd] - updated documentation for fs.createReadStream (Michele Caini) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [53b6a615a5] - Documentation update about Buffer initialization (Sarath) https://github.com/nodejs/node-v0.x-archive/pull/25591 -* [b8d47a7b6f] - fix (Fedor Indutny) https://github.com/nodejs/node-v0.x-archive/pull/25739 +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.8. ## 2015-11-17, Version 5.1.0 (Stable), @Fishrock123 -### Notable changes - -* **buffer**: The `noAssert` option for many buffer functions will now silently drop invalid write values rather than crashing (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767). - - This makes the behavior match what the docs suggest. -* **child_process**: `child.send()` now properly returns a boolean like the docs suggest (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577). -* **doc**: All of the API docs have been re-ordered so as to read in alphabetical order (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662). -* **http_parser**: update http-parser to 2.6.0 from 2.5.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569). - - Now supports the following HTTP methods: `LINK`, `UNLINK`, `BIND`, `REBIND`, `UNBIND`. - - Also added ACL and IPv6 Zone ID support. -* **npm**: upgrade npm to 3.3.12 from v3.3.6 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685). - - See the release notes for [v3.3.7](https://github.com/npm/npm/releases/tag/v3.3.7), [v3.3.8](https://github.com/npm/npm/releases/tag/v3.3.8), [v3.3.9](https://github.com/npm/npm/releases/tag/v3.3.9), [v3.3.10](https://github.com/npm/npm/releases/tag/v3.3.10), [v3.3.11](https://github.com/npm/npm/releases/tag/v3.3.11), and [v3.3.12](https://github.com/npm/npm/releases/tag/v3.3.12) for more details. -* **repl**: The REPL no longer crashes if the [persistent history](https://nodejs.org/api/repl.html#repl_persistent_history) file cannot be opened (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630). -* **tls**: The default `sessionIdContext` now uses SHA1 in FIPS mode rather than MD5 (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755). -* **v8**: Added some more useful post-mortem data (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779). - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - -### Commits - -* [[`b663d2bbb5`](https://github.com/nodejs/node/commit/b663d2bbb5)] - **async_wrap**: call callback in destructor (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) -* [[`eccbec99ea`](https://github.com/nodejs/node/commit/eccbec99ea)] - **async_wrap**: new instances get uid (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) -* [[`5d34c81a5c`](https://github.com/nodejs/node/commit/5d34c81a5c)] - **async_wrap**: allow some hooks to be optional (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) -* [[`7bff0138e2`](https://github.com/nodejs/node/commit/7bff0138e2)] - **buffer**: let WriteFloatGeneric silently drop values (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767) -* [[`56673693cd`](https://github.com/nodejs/node/commit/56673693cd)] - **buffer**: neuter external `nullptr` buffers (Fedor Indutny) [#3624](https://github.com/nodejs/node/pull/3624) -* [[`2d0ca0293a`](https://github.com/nodejs/node/commit/2d0ca0293a)] - **build**: fix configuring with prebuilt libraries (Markus Tzoe) [#3135](https://github.com/nodejs/node/pull/3135) -* [[`2a69b6820f`](https://github.com/nodejs/node/commit/2a69b6820f)] - **build**: fix --with-intl=system-icu for x-compile (Steven R. Loomis) [#3808](https://github.com/nodejs/node/pull/3808) -* [[`8f5a2550a7`](https://github.com/nodejs/node/commit/8f5a2550a7)] - **build**: omit -gline-tables-only for --enable-asan (Ben Noordhuis) [#3680](https://github.com/nodejs/node/pull/3680) -* [[`84bb74547d`](https://github.com/nodejs/node/commit/84bb74547d)] - **child_process**: add safety checks on stdio access (cjihrig) [#3799](https://github.com/nodejs/node/pull/3799) -* [[`e888471a11`](https://github.com/nodejs/node/commit/e888471a11)] - **child_process**: don't fork bomb ourselves from -e (Ben Noordhuis) [#3575](https://github.com/nodejs/node/pull/3575) -* [[`47f3735e88`](https://github.com/nodejs/node/commit/47f3735e88)] - **cluster**: send suicide message on disconnect (cjihrig) [#3720](https://github.com/nodejs/node/pull/3720) -* [[`d64a56cba5`](https://github.com/nodejs/node/commit/d64a56cba5)] - **cluster**: remove handles when disconnecting worker (Ben Noordhuis) [#3677](https://github.com/nodejs/node/pull/3677) -* [[`5ed30da5a0`](https://github.com/nodejs/node/commit/5ed30da5a0)] - **console**: use 'label' argument for time and timeEnd (Roman Reiss) [#3590](https://github.com/nodejs/node/pull/3590) -* [[`7a290abea6`](https://github.com/nodejs/node/commit/7a290abea6)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) -* [[`2c9fb147be`](https://github.com/nodejs/node/commit/2c9fb147be)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753) -* [[`66dccaf0cd`](https://github.com/nodejs/node/commit/66dccaf0cd)] - **debugger**: also exit when the repl emits 'exit' (Felix Böhm) [#2369](https://github.com/nodejs/node/pull/2369) -* [[`fd0253be4d`](https://github.com/nodejs/node/commit/fd0253be4d)] - **deps**: backport bc2e393 from v8 upstream (evan.lucas) [#3792](https://github.com/nodejs/node/pull/3792) -* [[`59077acc3d`](https://github.com/nodejs/node/commit/59077acc3d)] - **deps**: cherry-pick 68e89fb from v8's upstream (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779) -* [[`9ef81ff5d3`](https://github.com/nodejs/node/commit/9ef81ff5d3)] - **deps**: update V8 to 4.6.85.31 (Michaël Zasso) [#3698](https://github.com/nodejs/node/pull/3698) -* [[`b48dbf9fce`](https://github.com/nodejs/node/commit/b48dbf9fce)] - **deps**: upgrade npm to 3.3.12 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685) -* [[`7caeb14e11`](https://github.com/nodejs/node/commit/7caeb14e11)] - **(SEMVER-MINOR)** **deps**: update http-parser to 2.6.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569) -* [[`08e0de59fa`](https://github.com/nodejs/node/commit/08e0de59fa)] - **deps**: upgrade npm to 3.3.10 (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) -* [[`ac9e4ffe8e`](https://github.com/nodejs/node/commit/ac9e4ffe8e)] - **dns**: prevent undefined values in results (Junliang Yan) [#3696](https://github.com/nodejs/node/pull/3696) -* [[`ea67d870f4`](https://github.com/nodejs/node/commit/ea67d870f4)] - **doc**: document release types in readme (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) -* [[`60d3daa65c`](https://github.com/nodejs/node/commit/60d3daa65c)] - **doc**: replace head of readme with updated text (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) -* [[`df1fdba2ae`](https://github.com/nodejs/node/commit/df1fdba2ae)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3859](https://github.com/nodejs/node/pull/3859) -* [[`7ecd5422c8`](https://github.com/nodejs/node/commit/7ecd5422c8)] - **doc**: address use of profanity in code of conduct (James M Snell) [#3827](https://github.com/nodejs/node/pull/3827) -* [[`c2393d1f2a`](https://github.com/nodejs/node/commit/c2393d1f2a)] - **doc**: consistent reference-style links (Bryan English) [#3845](https://github.com/nodejs/node/pull/3845) -* [[`96f53c6b02`](https://github.com/nodejs/node/commit/96f53c6b02)] - **doc**: add link to \[customizing util.inspect colors\]. (Jesse McCarthy) [#3749](https://github.com/nodejs/node/pull/3749) -* [[`132297d3f6`](https://github.com/nodejs/node/commit/132297d3f6)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) -* [[`d137f0fd28`](https://github.com/nodejs/node/commit/d137f0fd28)] - **doc**: add warning about Windows process groups (Roman Klauke) [#3681](https://github.com/nodejs/node/pull/3681) -* [[`45ff31cf94`](https://github.com/nodejs/node/commit/45ff31cf94)] - **doc**: added what buf.copy returns (Manuel B) [#3555](https://github.com/nodejs/node/pull/3555) -* [[`5d1faa28cb`](https://github.com/nodejs/node/commit/5d1faa28cb)] - **doc**: reword message.headers to indicate they are not read-only (Tristian Flanagan) [#3814](https://github.com/nodejs/node/pull/3814) -* [[`25c3807051`](https://github.com/nodejs/node/commit/25c3807051)] - **doc**: clarify duplicate header handling (Bryan English) [#3810](https://github.com/nodejs/node/pull/3810) -* [[`ae2d1ee302`](https://github.com/nodejs/node/commit/ae2d1ee302)] - **doc**: repl: add defineComand and displayPrompt (Bryan English) [#3765](https://github.com/nodejs/node/pull/3765) -* [[`09e524d013`](https://github.com/nodejs/node/commit/09e524d013)] - **doc**: sort tls alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`7e60b81c81`](https://github.com/nodejs/node/commit/7e60b81c81)] - **doc**: sort stream alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`cd931a8a13`](https://github.com/nodejs/node/commit/cd931a8a13)] - **doc**: sort net alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`cfa8198af8`](https://github.com/nodejs/node/commit/cfa8198af8)] - **doc**: sort process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`e1a512607a`](https://github.com/nodejs/node/commit/e1a512607a)] - **doc**: sort zlib alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`0996b97240`](https://github.com/nodejs/node/commit/0996b97240)] - **doc**: sort util alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`df07072b66`](https://github.com/nodejs/node/commit/df07072b66)] - **doc**: sort https alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`6e9d01c7d8`](https://github.com/nodejs/node/commit/6e9d01c7d8)] - **doc**: sort http alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`18da02fa0f`](https://github.com/nodejs/node/commit/18da02fa0f)] - **doc**: sort modules alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`29054ffc0c`](https://github.com/nodejs/node/commit/29054ffc0c)] - **doc**: sort readline alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`389ead37ef`](https://github.com/nodejs/node/commit/389ead37ef)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`d383d624de`](https://github.com/nodejs/node/commit/d383d624de)] - **doc**: sort string_decoder alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`0d2262887c`](https://github.com/nodejs/node/commit/0d2262887c)] - **doc**: sort timers alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`14b5a95d03`](https://github.com/nodejs/node/commit/14b5a95d03)] - **doc**: sort tty alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`d4dda77e4a`](https://github.com/nodejs/node/commit/d4dda77e4a)] - **doc**: sort url alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`39b8259bd5`](https://github.com/nodejs/node/commit/39b8259bd5)] - **doc**: sort vm alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`d357b3090e`](https://github.com/nodejs/node/commit/d357b3090e)] - **doc**: sort querystring alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`1f56abaa98`](https://github.com/nodejs/node/commit/1f56abaa98)] - **doc**: sort punycode alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`bc63667456`](https://github.com/nodejs/node/commit/bc63667456)] - **doc**: sort path alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`22961e011c`](https://github.com/nodejs/node/commit/22961e011c)] - **doc**: sort os alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`4ba18489d3`](https://github.com/nodejs/node/commit/4ba18489d3)] - **doc**: sort globals alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`c3f5ea704f`](https://github.com/nodejs/node/commit/c3f5ea704f)] - **doc**: sort fs alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`ce3ac8dd1e`](https://github.com/nodejs/node/commit/ce3ac8dd1e)] - **doc**: sort events alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`63a78749b8`](https://github.com/nodejs/node/commit/63a78749b8)] - **doc**: sort errors alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`488326da8d`](https://github.com/nodejs/node/commit/488326da8d)] - **doc**: sort dgram alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`e1c357e881`](https://github.com/nodejs/node/commit/e1c357e881)] - **doc**: sort crypto alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`4118fd5794`](https://github.com/nodejs/node/commit/4118fd5794)] - **doc**: sort dns alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`3e046acc50`](https://github.com/nodejs/node/commit/3e046acc50)] - **doc**: sort console alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`05f1af7124`](https://github.com/nodejs/node/commit/05f1af7124)] - **doc**: sort cluster alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`5c30e5dada`](https://github.com/nodejs/node/commit/5c30e5dada)] - **doc**: sort child_process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`fb6a09cd0e`](https://github.com/nodejs/node/commit/fb6a09cd0e)] - **doc**: sort buffer alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`c7c05d8f02`](https://github.com/nodejs/node/commit/c7c05d8f02)] - **doc**: sort assert alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) -* [[`f2c2e53321`](https://github.com/nodejs/node/commit/f2c2e53321)] - **doc**: add note to util.isBuffer (Evan Lucas) [#3790](https://github.com/nodejs/node/pull/3790) -* [[`35fb9f91eb`](https://github.com/nodejs/node/commit/35fb9f91eb)] - **doc**: Describe FIPSDIR environment variable (Stefan Budeanu) [#3752](https://github.com/nodejs/node/pull/3752) -* [[`da911f158b`](https://github.com/nodejs/node/commit/da911f158b)] - **doc**: update lts description in the collaborator guide (James M Snell) [#3668](https://github.com/nodejs/node/pull/3668) -* [[`597f8751d1`](https://github.com/nodejs/node/commit/597f8751d1)] - **doc**: add note on tls connection meta data methods (Tyler Henkel) [#3746](https://github.com/nodejs/node/pull/3746) -* [[`a32d9e31dc`](https://github.com/nodejs/node/commit/a32d9e31dc)] - **doc**: add romankl to collaborators (Roman Klauke) [#3725](https://github.com/nodejs/node/pull/3725) -* [[`e5b9109d12`](https://github.com/nodejs/node/commit/e5b9109d12)] - **doc**: add thealphanerd to collaborators (Myles Borins) [#3723](https://github.com/nodejs/node/pull/3723) -* [[`a05a0b47e3`](https://github.com/nodejs/node/commit/a05a0b47e3)] - **doc**: add saghul as a collaborator (Saúl Ibarra Corretgé) [#3724](https://github.com/nodejs/node/pull/3724) -* [[`b14d9c5f16`](https://github.com/nodejs/node/commit/b14d9c5f16)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) -* [[`44f779b112`](https://github.com/nodejs/node/commit/44f779b112)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) -* [[`a0db5fb355`](https://github.com/nodejs/node/commit/a0db5fb355)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) -* [[`409f29972e`](https://github.com/nodejs/node/commit/409f29972e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) -* [[`801866280e`](https://github.com/nodejs/node/commit/801866280e)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) -* [[`325c4c7af5`](https://github.com/nodejs/node/commit/325c4c7af5)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) -* [[`045e04e531`](https://github.com/nodejs/node/commit/045e04e531)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) -* [[`7fd8f1371e`](https://github.com/nodejs/node/commit/7fd8f1371e)] - **doc**: add note about timeout delay > TIMEOUT_MAX (Guilherme Souza) [#3512](https://github.com/nodejs/node/pull/3512) -* [[`7d0b589644`](https://github.com/nodejs/node/commit/7d0b589644)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) -* [[`efa19bdcb5`](https://github.com/nodejs/node/commit/efa19bdcb5)] - **doc**: add final full stop in CONTRIBUTING.md (Emily Aviva Kapor-Mater) [#3576](https://github.com/nodejs/node/pull/3576) -* [[`90723afe32`](https://github.com/nodejs/node/commit/90723afe32)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) -* [[`530bb9144f`](https://github.com/nodejs/node/commit/530bb9144f)] - **docs**: improve discoverability of Code of Conduct (Ashley Williams) [#3774](https://github.com/nodejs/node/pull/3774) -* [[`73e40f0327`](https://github.com/nodejs/node/commit/73e40f0327)] - **docs**: fs - change links to buffer encoding to Buffer class anchor (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) -* [[`7a84fa6c60`](https://github.com/nodejs/node/commit/7a84fa6c60)] - **docs**: fs - remove encoding list and link to buffer (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) -* [[`2aa6a6d998`](https://github.com/nodejs/node/commit/2aa6a6d998)] - **fs**: return null error on readFile() success (Zheng Chaoping) [#3740](https://github.com/nodejs/node/pull/3740) -* [[`c96400c572`](https://github.com/nodejs/node/commit/c96400c572)] - **gitignore**: don't ignore 'debug' in deps/npm (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) -* [[`a7f28a098e`](https://github.com/nodejs/node/commit/a7f28a098e)] - **http**: remove unneeded cb check from setTimeout() (Ashok Suthar) [#3631](https://github.com/nodejs/node/pull/3631) -* [[`d2b5dcb2de`](https://github.com/nodejs/node/commit/d2b5dcb2de)] - **lib**: return boolean from child.send() (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577) -* [[`5c54fa0095`](https://github.com/nodejs/node/commit/5c54fa0095)] - **module**: cache regular expressions (Evan Lucas) [#3869](https://github.com/nodejs/node/pull/3869) -* [[`89285db128`](https://github.com/nodejs/node/commit/89285db128)] - **module**: remove unnecessary JSON.stringify (Andres Suarez) [#3578](https://github.com/nodejs/node/pull/3578) -* [[`fd3f0d8e6e`](https://github.com/nodejs/node/commit/fd3f0d8e6e)] - **querystring**: Parse multiple separator characters (Yosuke Furukawa) [#3807](https://github.com/nodejs/node/pull/3807) -* [[`75dbafc3f8`](https://github.com/nodejs/node/commit/75dbafc3f8)] - **repl**: To exit, press ^C again or type .exit. (Hemanth.HM) [#3368](https://github.com/nodejs/node/pull/3368) -* [[`5073da0481`](https://github.com/nodejs/node/commit/5073da0481)] - **repl**: don't crash if cannot open history file (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630) -* [[`59cd28114d`](https://github.com/nodejs/node/commit/59cd28114d)] - **src**: Add missing va_end before return (Ömer Fadıl Usta) [#3565](https://github.com/nodejs/node/pull/3565) -* [[`02e012e984`](https://github.com/nodejs/node/commit/02e012e984)] - **src**: force line buffering for stderr (Rich Trott) [#3701](https://github.com/nodejs/node/pull/3701) -* [[`2498e29344`](https://github.com/nodejs/node/commit/2498e29344)] - **src**: Revert "nix stdin _readableState.reading" (Roman Reiss) [#3490](https://github.com/nodejs/node/pull/3490) -* [[`65cd03cda6`](https://github.com/nodejs/node/commit/65cd03cda6)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) -* [[`d72bb1e96a`](https://github.com/nodejs/node/commit/d72bb1e96a)] - ***Revert*** "**src**: fix stuck debugger process" (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) -* [[`047abbd6eb`](https://github.com/nodejs/node/commit/047abbd6eb)] - **test**: move test-specific function out of common (Rich Trott) [#3871](https://github.com/nodejs/node/pull/3871) -* [[`19a36ff355`](https://github.com/nodejs/node/commit/19a36ff355)] - **test**: fix flaky SmartOS test (Rich Trott) [#3830](https://github.com/nodejs/node/pull/3830) -* [[`4bb27baf8d`](https://github.com/nodejs/node/commit/4bb27baf8d)] - **test**: skip test if FreeBSD jail will break it (Rich Trott) [#3839](https://github.com/nodejs/node/pull/3839) -* [[`1c1e70864b`](https://github.com/nodejs/node/commit/1c1e70864b)] - **test**: fix path to module for repl test on Windows (Michael Cornacchia) [#3608](https://github.com/nodejs/node/pull/3608) -* [[`413ca53107`](https://github.com/nodejs/node/commit/413ca53107)] - **test**: increase crypto strength for FIPS standard (Stefan Budeanu) [#3758](https://github.com/nodejs/node/pull/3758) -* [[`2ec5e17d16`](https://github.com/nodejs/node/commit/2ec5e17d16)] - **test**: add test-zlib-flush-drain (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) -* [[`de707f0876`](https://github.com/nodejs/node/commit/de707f0876)] - **test**: add hasFipsCrypto to test/common.js (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) -* [[`828b786e48`](https://github.com/nodejs/node/commit/828b786e48)] - **test**: add test for invalid DSA key size (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) -* [[`252e810059`](https://github.com/nodejs/node/commit/252e810059)] - **test**: Fix test-cluster-worker-exit.js for AIX (Imran Iqbal) [#3666](https://github.com/nodejs/node/pull/3666) -* [[`91248b1094`](https://github.com/nodejs/node/commit/91248b1094)] - **test**: run pipeline flood test in parallel (Rich Trott) [#3811](https://github.com/nodejs/node/pull/3811) -* [[`583f58e5d6`](https://github.com/nodejs/node/commit/583f58e5d6)] - **test**: stronger crypto in test fixtures (Stefan Budeanu) [#3759](https://github.com/nodejs/node/pull/3759) -* [[`2e67db3104`](https://github.com/nodejs/node/commit/2e67db3104)] - **test**: refactor test-http-pipeline-flood (Rich Trott) [#3636](https://github.com/nodejs/node/pull/3636) -* [[`1ab59ab9b3`](https://github.com/nodejs/node/commit/1ab59ab9b3)] - **test**: fix flaky test test-http-pipeline-flood (Devin Nakamura) [#3636](https://github.com/nodejs/node/pull/3636) -* [[`1c8a7c6351`](https://github.com/nodejs/node/commit/1c8a7c6351)] - **test**: enhance fs-watch-recursive test (Sakthipriyan Vairamani) [#2599](https://github.com/nodejs/node/pull/2599) -* [[`81997840f2`](https://github.com/nodejs/node/commit/81997840f2)] - **test**: fix test-module-loading-error for musl (Hugues Malphettes) [#3657](https://github.com/nodejs/node/pull/3657) -* [[`9cdceac782`](https://github.com/nodejs/node/commit/9cdceac782)] - **test**: use really invalid hostname (Sakthipriyan Vairamani) [#3711](https://github.com/nodejs/node/pull/3711) -* [[`f3594e77b2`](https://github.com/nodejs/node/commit/f3594e77b2)] - **test**: fix test-net-persistent-keepalive for AIX (Imran Iqbal) [#3646](https://github.com/nodejs/node/pull/3646) -* [[`81522480f1`](https://github.com/nodejs/node/commit/81522480f1)] - **test**: more regression tests for minDHSize option (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) -* [[`935b97769e`](https://github.com/nodejs/node/commit/935b97769e)] - **test**: add regression test for 512 bits DH key (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) -* [[`e302c33bb0`](https://github.com/nodejs/node/commit/e302c33bb0)] - **test**: mark http-pipeline-flood flaky (Rich Trott) [#3616](https://github.com/nodejs/node/pull/3616) -* [[`5977963bce`](https://github.com/nodejs/node/commit/5977963bce)] - **test**: remove flaky designation from ls-no-sslv3 (Rich Trott) [#3620](https://github.com/nodejs/node/pull/3620) -* [[`1e98d90db8`](https://github.com/nodejs/node/commit/1e98d90db8)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) -* [[`2f16be2b70`](https://github.com/nodejs/node/commit/2f16be2b70)] - **tls**: Use SHA1 for sessionIdContext in FIPS mode (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755) -* [[`05f0549b50`](https://github.com/nodejs/node/commit/05f0549b50)] - **tls**: copy client CAs and cert store on CertCb (Fedor Indutny) [#3537](https://github.com/nodejs/node/pull/3537) -* [[`bea35424a2`](https://github.com/nodejs/node/commit/bea35424a2)] - **tools**: add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) -* [[`d036b35349`](https://github.com/nodejs/node/commit/d036b35349)] - **tools**: enforce `throw new Error()` with lint rule (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) -* [[`38bb0d864e`](https://github.com/nodejs/node/commit/38bb0d864e)] - **tools**: Use `throw new Error()` consistently (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) -* [[`e40d28283a`](https://github.com/nodejs/node/commit/e40d28283a)] - **tools**: update npm test tooling for 3.3.10+ (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) -* [[`cbd358ce33`](https://github.com/nodejs/node/commit/cbd358ce33)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325) -* [[`3137e46cb8`](https://github.com/nodejs/node/commit/3137e46cb8)] - **tools**: update gyp to b3cef02 (Imran Iqbal) [#3487](https://github.com/nodejs/node/pull/3487) -* [[`d61cb90ee3`](https://github.com/nodejs/node/commit/d61cb90ee3)] - **util**: use Object.create(null) for dictionary object (Minwoo Jung) [#3831](https://github.com/nodejs/node/pull/3831) -* [[`9a45c21e6c`](https://github.com/nodejs/node/commit/9a45c21e6c)] - **util**: use regexp instead of str.replace().join() (qinjia) [#3689](https://github.com/nodejs/node/pull/3689) -* [[`33ffc62670`](https://github.com/nodejs/node/commit/33ffc62670)] - **zlib**: only apply drain listener if given callback (Craig Cavalier) [#3534](https://github.com/nodejs/node/pull/3534) -* [[`d70deabf90`](https://github.com/nodejs/node/commit/d70deabf90)] - **zlib**: pass kind to recursive calls to flush (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) +Moved to doc/changelogs/CHANGELOG_V5.md#5.1.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.2. ## 2015-10-29, Version 5.0.0 (Stable), @rvagg -### Notable Changes - -* **buffer**: _(Breaking)_ Removed both `'raw'` and `'raws'` encoding types from `Buffer`, these have been deprecated for a long time (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859). -* **console**: _(Breaking)_ Values reported by `console.time()` now have 3 decimals of accuracy added (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166). -* **fs**: - - `fs.readFile*()`, `fs.writeFile*()`, and `fs.appendFile*()` now also accept a file descriptor as their first argument (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163). - - _(Breaking)_ In `fs.readFile()`, if an encoding is specified and the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485). - - _(Breaking)_ In `fs.read()` (using the `fs.read(fd, length, position, encoding, callback)` form), if the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503). -* **http**: - - Fixed a bug where pipelined http requests would stall (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342). - - _(Breaking)_ When parsing HTTP, don't add duplicates of the following headers: `Retry-After`, `ETag`, `Last-Modified`, `Server`, `Age`, `Expires`. This is in addition to the following headers which already block duplicates: `Content-Type`, `Content-Length`, `User-Agent`, `Referer`, `Host`, `Authorization`, `Proxy-Authorization`, `If-Modified-Since`, `If-Unmodified-Since`, `From`, `Location`, `Max-Forwards` (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). - - _(Breaking)_ The `callback` argument to `OutgoingMessage#setTimeout()` must be a function or a `TypeError` is thrown (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). - - _(Breaking)_ HTTP methods and header names must now conform to the RFC 2616 "token" rule, a list of allowed characters that excludes control characters and a number of _separator_ characters. Specifically, methods and header names must now match ```/^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/``` or a `TypeError` will be thrown (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526). -* **node**: - - _(Breaking)_ Deprecated the `_linklist` module (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078). - - _(Breaking)_ Removed `require.paths` and `require.registerExtension()`, both had been previously set to throw `Error` when accessed (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922). -* **npm**: Upgraded to version 3.3.6 from 2.14.7, see https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a major version bump for npm and it has seen a significant amount of change. Please see the original [npm v3.0.0 release notes](https://github.com/npm/npm/blob/master/CHANGELOG.md#v300-2015-06-25) for a list of major changes (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310). -* **src**: _(Breaking)_ Bumped `NODE_MODULE_VERSION` to `47` from `46`, this is necessary due to the V8 upgrade. Native add-ons will need to be recompiled (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400). -* **timers**: Attempt to reuse the timer handle for `setTimeout().unref()`. This fixes a long-standing known issue where unrefed timers would perviously hold `beforeExit` open (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407). -* **tls**: - - Added ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564). - - TLS options can now be passed in an object to `createSecurePair()` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441). - - _(Breaking)_ The default minimum DH key size for `tls.connect()` is now 1024 bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A new `minDHSize` TLS option can be used to override the default. (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831). -* **util**: - - _(Breaking)_ `util.p()` was deprecated for years, and has now been removed (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432). - - _(Breaking)_ `util.inherits()` can now work with ES6 classes. This is considered a breaking change because of potential subtle side-effects caused by a change from directly reassigning the prototype of the constructor using `ctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })` to using `Object.setPrototypeOf(ctor.prototype, superCtor.prototype)` (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455). -* **v8**: _(Breaking)_ Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351). - - Implements the spread operator, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator for further information. - - Implements `new.target`, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target for further information. -* **zlib**: Decompression now throws on truncated input (e.g. unexpected end of file) (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595). - -### Known issues - -* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) -* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) -* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). -* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). - - -### Commits - -* [[`6a04cc0a43`](https://github.com/nodejs/node/commit/6a04cc0a43)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) -* [[`1a41feb559`](https://github.com/nodejs/node/commit/1a41feb559)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) -* [[`5f6579d366`](https://github.com/nodejs/node/commit/5f6579d366)] - **(SEMVER-MAJOR)** **buffer**: remove raw & raws encoding (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859) -* [[`70fca2a81e`](https://github.com/nodejs/node/commit/70fca2a81e)] - **build**: Updates for AIX npm support - part 1 (Michael Dawson) [#3114](https://github.com/nodejs/node/pull/3114) -* [[`b36b4f385a`](https://github.com/nodejs/node/commit/b36b4f385a)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) -* [[`a89eeca590`](https://github.com/nodejs/node/commit/a89eeca590)] - **console**: rename argument of time and timeEnd (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) -* [[`870108aaa8`](https://github.com/nodejs/node/commit/870108aaa8)] - **(SEMVER-MAJOR)** **console**: sub-millisecond accuracy for console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) -* [[`0a43697ce8`](https://github.com/nodejs/node/commit/0a43697ce8)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) -* [[`8c0318ce8d`](https://github.com/nodejs/node/commit/8c0318ce8d)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) -* [[`2974debc6e`](https://github.com/nodejs/node/commit/2974debc6e)] - **deps**: update V8 to 4.6.85.28 (Michaël Zasso) [#3484](https://github.com/nodejs/node/pull/3484) -* [[`f76af49b13`](https://github.com/nodejs/node/commit/f76af49b13)] - **deps**: fix upgrade to npm 3.3.6 (Rebecca Turner) [#3494](https://github.com/nodejs/node/pull/3494) -* [[`32b51c97ec`](https://github.com/nodejs/node/commit/32b51c97ec)] - **deps**: upgrade npm to 3.3.6 (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310) -* [[`770cd229f9`](https://github.com/nodejs/node/commit/770cd229f9)] - **deps**: upgrade V8 to 4.6.85.25 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`972a0c8515`](https://github.com/nodejs/node/commit/972a0c8515)] - **deps**: backport 0d01728 from v8's upstream (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`1fdec65203`](https://github.com/nodejs/node/commit/1fdec65203)] - **deps**: improve ArrayBuffer performance in v8 (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`5cd1fd836a`](https://github.com/nodejs/node/commit/5cd1fd836a)] - **deps**: backport 56a0a79 from V8 upstream (Julien Gilli) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`7fb128d8df`](https://github.com/nodejs/node/commit/7fb128d8df)] - **deps**: cherry-pick backports to V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`d8011d1683`](https://github.com/nodejs/node/commit/d8011d1683)] - **(SEMVER-MAJOR)** **deps**: upgrade V8 to 4.6.85.23 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`a334ddc467`](https://github.com/nodejs/node/commit/a334ddc467)] - ***Revert*** "**deps**: backport 03ef3cd from V8 upstream" (Ali Ijaz Sheikh) [#3237](https://github.com/nodejs/node/pull/3237) -* [[`6fff47ffac`](https://github.com/nodejs/node/commit/6fff47ffac)] - **deps**: backport 03ef3cd from V8 upstream (Ali Ijaz Sheikh) [#3165](https://github.com/nodejs/node/pull/3165) -* [[`680dda8023`](https://github.com/nodejs/node/commit/680dda8023)] - **dns**: remove nonexistant exports.ADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) -* [[`239ad899a3`](https://github.com/nodejs/node/commit/239ad899a3)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) -* [[`5e76587fdf`](https://github.com/nodejs/node/commit/5e76587fdf)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) -* [[`0317c880da`](https://github.com/nodejs/node/commit/0317c880da)] - **doc**: add TSC meeting minutes 2015-10-21 (Rod Vagg) [#3480](https://github.com/nodejs/node/pull/3480) -* [[`cd245b12e0`](https://github.com/nodejs/node/commit/cd245b12e0)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) -* [[`ff9ef893fd`](https://github.com/nodejs/node/commit/ff9ef893fd)] - **doc**: add TSC meeting minutes 2015-10-14 (Rod Vagg) [#3463](https://github.com/nodejs/node/pull/3463) -* [[`605c5a7754`](https://github.com/nodejs/node/commit/605c5a7754)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) -* [[`cf75a175e5`](https://github.com/nodejs/node/commit/cf75a175e5)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) -* [[`1b75d4bda3`](https://github.com/nodejs/node/commit/1b75d4bda3)] - **doc**: update WORKING_GROUPS.md - add missing groups (Michael Dawson) [#3450](https://github.com/nodejs/node/pull/3450) -* [[`c658de2f99`](https://github.com/nodejs/node/commit/c658de2f99)] - **doc**: add TSC meeting minutes 2015-09-30 (Rod Vagg) [#3235](https://github.com/nodejs/node/pull/3235) -* [[`d0b8c5d3a4`](https://github.com/nodejs/node/commit/d0b8c5d3a4)] - **doc**: add TSC meeting minutes 2015-10-07 (Rod Vagg) [#3364](https://github.com/nodejs/node/pull/3364) -* [[`b483afcb20`](https://github.com/nodejs/node/commit/b483afcb20)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) -* [[`b607366a1c`](https://github.com/nodejs/node/commit/b607366a1c)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) -* [[`086103b32e`](https://github.com/nodejs/node/commit/086103b32e)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) -* [[`f6ebc8277b`](https://github.com/nodejs/node/commit/f6ebc8277b)] - **doc**: reword description of console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) -* [[`503f279527`](https://github.com/nodejs/node/commit/503f279527)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) -* [[`dae9fae0fe`](https://github.com/nodejs/node/commit/dae9fae0fe)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) -* [[`4fc638804c`](https://github.com/nodejs/node/commit/4fc638804c)] - **doc**: update V8 options in man page (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`a441aa6e1d`](https://github.com/nodejs/node/commit/a441aa6e1d)] - **doc**: update WORKING_GROUPS.md to include Intl (Steven R. Loomis) [#3251](https://github.com/nodejs/node/pull/3251) -* [[`81503e597b`](https://github.com/nodejs/node/commit/81503e597b)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) -* [[`3ef2e4acf3`](https://github.com/nodejs/node/commit/3ef2e4acf3)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) -* [[`b9279aa193`](https://github.com/nodejs/node/commit/b9279aa193)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) -* [[`cdfa271164`](https://github.com/nodejs/node/commit/cdfa271164)] - **doc**: update AUTHORS list (Rod Vagg) -* [[`47b06f6bb1`](https://github.com/nodejs/node/commit/47b06f6bb1)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) -* [[`4c9abbd1bb`](https://github.com/nodejs/node/commit/4c9abbd1bb)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) -* [[`2bb147535e`](https://github.com/nodejs/node/commit/2bb147535e)] - **(SEMVER-MAJOR)** **fs**: don't throw in read if buffer too big (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503) -* [[`7added3b39`](https://github.com/nodejs/node/commit/7added3b39)] - **(SEMVER-MAJOR)** **fs**: pass err to callback if buffer is too big (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485) -* [[`5e0759f6fd`](https://github.com/nodejs/node/commit/5e0759f6fd)] - **(SEMVER-MINOR)** **fs**: add file descriptor support to *File() funcs (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163) -* [[`d1a2e5357e`](https://github.com/nodejs/node/commit/d1a2e5357e)] - **gitignore**: don't ignore debug source directory in V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`ab03635fb1`](https://github.com/nodejs/node/commit/ab03635fb1)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) -* [[`e655a437b3`](https://github.com/nodejs/node/commit/e655a437b3)] - **(SEMVER-MAJOR)** **http**: do not allow multiple instances of certain response headers (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) -* [[`0094a8dad7`](https://github.com/nodejs/node/commit/0094a8dad7)] - **(SEMVER-MAJOR)** **http**: add callback is function check (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) -* [[`6192c9892f`](https://github.com/nodejs/node/commit/6192c9892f)] - **(SEMVER-MAJOR)** **http**: add checkIsHttpToken check for header fields (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526) -* [[`c9786bb680`](https://github.com/nodejs/node/commit/c9786bb680)] - **(SEMVER-MAJOR)** http{s}: don't connect to localhost on invalid URL (Sakthipriyan Vairamani) [#2967](https://github.com/nodejs/node/pull/2967) -* [[`1929d5be73`](https://github.com/nodejs/node/commit/1929d5be73)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) -* [[`97d081709e`](https://github.com/nodejs/node/commit/97d081709e)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) -* [[`f236b3a904`](https://github.com/nodejs/node/commit/f236b3a904)] - **(SEMVER-MINOR)** **lib,doc**: return boolean from child.send() (Rich Trott) [#3516](https://github.com/nodejs/node/pull/3516) -* [[`6e887cc630`](https://github.com/nodejs/node/commit/6e887cc630)] - **lib,test**: update let to const where applicable (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) -* [[`47befffc53`](https://github.com/nodejs/node/commit/47befffc53)] - **(SEMVER-MAJOR)** **lib,test**: deprecate _linklist (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078) -* [[`d5ce53458e`](https://github.com/nodejs/node/commit/d5ce53458e)] - **lttng**: update flags for gc tracing (Glen Keane) [#3388](https://github.com/nodejs/node/pull/3388) -* [[`6ad458b752`](https://github.com/nodejs/node/commit/6ad458b752)] - **(SEMVER-MAJOR)** **module**: remove unnecessary property and method (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922) -* [[`ae196175f4`](https://github.com/nodejs/node/commit/ae196175f4)] - **node**: improve GetActiveRequests performance (Trevor Norris) [#3375](https://github.com/nodejs/node/pull/3375) -* [[`bd4311bc9c`](https://github.com/nodejs/node/commit/bd4311bc9c)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) -* [[`ce391ed849`](https://github.com/nodejs/node/commit/ce391ed849)] - **(SEMVER-MAJOR)** **repl**: event ordering: delay 'close' until 'flushHistory' (Jeremiah Senkpiel) [#3435](https://github.com/nodejs/node/pull/3435) -* [[`4c80c02ac7`](https://github.com/nodejs/node/commit/4c80c02ac7)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) -* [[`134a60c785`](https://github.com/nodejs/node/commit/134a60c785)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) -* [[`bf7c3dabb4`](https://github.com/nodejs/node/commit/bf7c3dabb4)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION To 47 (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400) -* [[`2d3560767e`](https://github.com/nodejs/node/commit/2d3560767e)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) -* [[`ff877e93e1`](https://github.com/nodejs/node/commit/ff877e93e1)] - **src**: fix stuck debugger process (Liang-Chi Hsieh) [#2778](https://github.com/nodejs/node/pull/2778) -* [[`8854183fe5`](https://github.com/nodejs/node/commit/8854183fe5)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) -* [[`85b74de9de`](https://github.com/nodejs/node/commit/85b74de9de)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) -* [[`b8cea49c88`](https://github.com/nodejs/node/commit/b8cea49c88)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) -* [[`4a5dbeab43`](https://github.com/nodejs/node/commit/4a5dbeab43)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) -* [[`74e2328b3a`](https://github.com/nodejs/node/commit/74e2328b3a)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) -* [[`8c6c0f915a`](https://github.com/nodejs/node/commit/8c6c0f915a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) -* [[`1a968e67a5`](https://github.com/nodejs/node/commit/1a968e67a5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) -* [[`9d8d752456`](https://github.com/nodejs/node/commit/9d8d752456)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) -* [[`60de9f8d7b`](https://github.com/nodejs/node/commit/60de9f8d7b)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) -* [[`cd83f7ed7f`](https://github.com/nodejs/node/commit/cd83f7ed7f)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) -* [[`08da5c2a06`](https://github.com/nodejs/node/commit/08da5c2a06)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) -* [[`7c35fbcb14`](https://github.com/nodejs/node/commit/7c35fbcb14)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) -* [[`ad2b272417`](https://github.com/nodejs/node/commit/ad2b272417)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) -* [[`04fb14cc35`](https://github.com/nodejs/node/commit/04fb14cc35)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) -* [[`eef0f0cd63`](https://github.com/nodejs/node/commit/eef0f0cd63)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) -* [[`bbbd81eab2`](https://github.com/nodejs/node/commit/bbbd81eab2)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) -* [[`f78c8e7426`](https://github.com/nodejs/node/commit/f78c8e7426)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) -* [[`28e9a4f41b`](https://github.com/nodejs/node/commit/28e9a4f41b)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) -* [[`9e981556e5`](https://github.com/nodejs/node/commit/9e981556e5)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) -* [[`ee2e641e0a`](https://github.com/nodejs/node/commit/ee2e641e0a)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) -* [[`e2b8393ee8`](https://github.com/nodejs/node/commit/e2b8393ee8)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) -* [[`676e61872f`](https://github.com/nodejs/node/commit/676e61872f)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) -* [[`bbdbef9274`](https://github.com/nodejs/node/commit/bbdbef9274)] - **test**: fix tests after V8 upgrade (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) -* [[`6c032a8333`](https://github.com/nodejs/node/commit/6c032a8333)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) -* [[`f45c315763`](https://github.com/nodejs/node/commit/f45c315763)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) -* [[`e3d9d25083`](https://github.com/nodejs/node/commit/e3d9d25083)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) -* [[`6f14b3a7db`](https://github.com/nodejs/node/commit/6f14b3a7db)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) -* [[`7d94611ac9`](https://github.com/nodejs/node/commit/7d94611ac9)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) -* [[`3202456baa`](https://github.com/nodejs/node/commit/3202456baa)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) -* [[`31c971d641`](https://github.com/nodejs/node/commit/31c971d641)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) -* [[`5bbc6df7de`](https://github.com/nodejs/node/commit/5bbc6df7de)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) -* [[`522e3d3cd3`](https://github.com/nodejs/node/commit/522e3d3cd3)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) -* [[`b64ce5960f`](https://github.com/nodejs/node/commit/b64ce5960f)] - **tls**: remove util and calls to util.format (Myles Borins) [#3456](https://github.com/nodejs/node/pull/3456) -* [[`c64af7d99e`](https://github.com/nodejs/node/commit/c64af7d99e)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) -* [[`2296a4fc0f`](https://github.com/nodejs/node/commit/2296a4fc0f)] - **(SEMVER-MINOR)** **tls**: add `options` argument to createSecurePair (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) -* [[`0140e1b5e3`](https://github.com/nodejs/node/commit/0140e1b5e3)] - **tls**: output warning of setDHParam to console.trace (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) -* [[`f72e178a78`](https://github.com/nodejs/node/commit/f72e178a78)] - **(SEMVER-MAJOR)** **tls**: add minDHSize option to tls.connect() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) -* [[`6d92ebac11`](https://github.com/nodejs/node/commit/6d92ebac11)] - **tls**: add TLSSocket.getEphemeralKeyInfo() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) -* [[`62ad1d0113`](https://github.com/nodejs/node/commit/62ad1d0113)] - **(SEMVER-MINOR)** **tls, crypto**: add ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) -* [[`5029f41b2f`](https://github.com/nodejs/node/commit/5029f41b2f)] - **(SEMVER-MINOR)** **tls,crypto**: move NPN protcol data to hidden value (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) -* [[`701e38c25f`](https://github.com/nodejs/node/commit/701e38c25f)] - **tools**: enable prefer-const eslint rule (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) -* [[`6e78382605`](https://github.com/nodejs/node/commit/6e78382605)] - **tools**: ensure npm always uses the local node (Jeremiah Senkpiel) [#3489](https://github.com/nodejs/node/pull/3489) -* [[`3c3435d017`](https://github.com/nodejs/node/commit/3c3435d017)] - **tools**: update test-npm to work with npm 3 (Rebecca Turner) [#3489](https://github.com/nodejs/node/pull/3489) -* [[`b4f4c24539`](https://github.com/nodejs/node/commit/b4f4c24539)] - **tools**: use absolute paths in test-npm (Rebecca Turner) [#3309](https://github.com/nodejs/node/pull/3309) -* [[`80573153b8`](https://github.com/nodejs/node/commit/80573153b8)] - **(SEMVER-MAJOR)** **util**: make inherits work with classes (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455) -* [[`412252ca04`](https://github.com/nodejs/node/commit/412252ca04)] - **(SEMVER-MAJOR)** **util**: Remove p, has been deprecated for years (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432) -* [[`718c304a4f`](https://github.com/nodejs/node/commit/718c304a4f)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) -* [[`6936468de2`](https://github.com/nodejs/node/commit/6936468de2)] - **vm**: remove Watchdog dependency on Environment (Ido Ben-Yair) [#3274](https://github.com/nodejs/node/pull/3274) -* [[`80169b1f0a`](https://github.com/nodejs/node/commit/80169b1f0a)] - **(SEMVER-MAJOR)** **zlib**: decompression throw on truncated input (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595) +Moved to doc/changelogs/CHANGELOG_V5.md#5.0.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.1. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.2.0. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.1.2. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.1.1. ## 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) +Moved to doc/changelogs/CHANGELOG_V4.md#4.1.0. ## 2015-09-15, io.js Version 3.3.1 @rvagg -### Notable changes - -* **buffer**: Fixed a minor errors that was causing crashes (Michaël Zasso) [#2635](https://github.com/nodejs/node/pull/2635), -* **child_process**: Fix error that was causing crashes (Evan Lucas) [#2727](https://github.com/nodejs/node/pull/2727) -* **crypto**: Replace use of rwlocks, unsafe on Windows XP / 2003 (Ben Noordhuis) [#2723](https://github.com/nodejs/node/pull/2723) -* **libuv**: Upgrade from 1.7.3 to 1.7.4 (Saúl Ibarra Corretgé) [#2817](https://github.com/nodejs/node/pull/2817) -* **node**: Fix faulty `process.release.libUrl` on Windows (Rod Vagg) [#2699](https://github.com/nodejs/node/pull/2699) -* **node-gyp**: Float v3.0.3 which has improved support for Node.js and io.js v0.10 to v4+ (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) -* **npm**: Upgrade to version 2.14.3 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) - -### 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 - -* [[`b73ff52fe6`](https://github.com/nodejs/node/commit/b73ff52fe6)] - **bindings**: close after reading module struct (Fedor Indutny) [#2792](https://github.com/nodejs/node/pull/2792) -* [[`aa1140e59a`](https://github.com/nodejs/node/commit/aa1140e59a)] - **buffer**: SlowBuffer only accept valid numeric values (Michaël Zasso) [#2635](https://github.com/nodejs/node/pull/2635) -* [[`574475d56e`](https://github.com/nodejs/node/commit/574475d56e)] - **build**: clean up the generated tap file (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) -* [[`aa0001271e`](https://github.com/nodejs/node/commit/aa0001271e)] - **build**: remote commands on staging in single session (Rod Vagg) [#2717](https://github.com/nodejs/node/pull/2717) -* [[`1428661095`](https://github.com/nodejs/node/commit/1428661095)] - **build**: fix v8_enable_handle_zapping override (Karl Skomski) [#2731](https://github.com/nodejs/node/pull/2731) -* [[`5a51edd718`](https://github.com/nodejs/node/commit/5a51edd718)] - **build**: add --enable-asan with builtin leakcheck (Karl Skomski) [#2376](https://github.com/nodejs/node/pull/2376) -* [[`618caa5de0`](https://github.com/nodejs/node/commit/618caa5de0)] - **child_process**: use stdio.fd even if it is 0 (Evan Lucas) [#2727](https://github.com/nodejs/node/pull/2727) -* [[`7be4e49cb6`](https://github.com/nodejs/node/commit/7be4e49cb6)] - **child_process**: check execFile and fork args (James M Snell) [#2667](https://github.com/nodejs/node/pull/2667) -* [[`7f5d6e72c6`](https://github.com/nodejs/node/commit/7f5d6e72c6)] - **cluster**: allow shared reused dgram sockets (Fedor Indutny) [#2548](https://github.com/nodejs/node/pull/2548) -* [[`e68c7ec498`](https://github.com/nodejs/node/commit/e68c7ec498)] - **contextify**: ignore getters during initialization (Fedor Indutny) [nodejs/io.js#2091](https://github.com/nodejs/io.js/pull/2091) -* [[`610fa964aa`](https://github.com/nodejs/node/commit/610fa964aa)] - **cpplint**: make it possible to run outside git repo (Ben Noordhuis) [#2710](https://github.com/nodejs/node/pull/2710) -* [[`4237373dd7`](https://github.com/nodejs/node/commit/4237373dd7)] - **crypto**: replace rwlocks with simple mutexes (Ben Noordhuis) [#2723](https://github.com/nodejs/node/pull/2723) -* [[`777eb00306`](https://github.com/nodejs/node/commit/777eb00306)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) -* [[`b729ad384b`](https://github.com/nodejs/node/commit/b729ad384b)] - **deps**: upgrade to npm 2.14.3 (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) -* [[`b09fde761c`](https://github.com/nodejs/node/commit/b09fde761c)] - **deps**: update libuv to version 1.7.4 (Saúl Ibarra Corretgé) [#2817](https://github.com/nodejs/node/pull/2817) -* [[`4cf225daad`](https://github.com/nodejs/node/commit/4cf225daad)] - **deps**: float node-gyp v3.0.0 (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) -* [[`118f48c0f3`](https://github.com/nodejs/node/commit/118f48c0f3)] - **deps**: create .npmrc during npm tests (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) -* [[`b3fee8e6a6`](https://github.com/nodejs/node/commit/b3fee8e6a6)] - **deps**: upgrade to npm 2.14.2 (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) -* [[`4593539b92`](https://github.com/nodejs/node/commit/4593539b92)] - **deps**: backport 75e43a6 from v8 upstream (saper) [#2636](https://github.com/nodejs/node/pull/2636) -* [[`2d1438cfe0`](https://github.com/nodejs/node/commit/2d1438cfe0)] - **doc**: fix broken link in repl.markdown (Danny Nemer) [#2827](https://github.com/nodejs/node/pull/2827) -* [[`9dd9c85a48`](https://github.com/nodejs/node/commit/9dd9c85a48)] - **doc**: fix typos in README (Ionică Bizău) [#2852](https://github.com/nodejs/node/pull/2852) -* [[`476125d403`](https://github.com/nodejs/node/commit/476125d403)] - **doc**: add tunniclm as a collaborator (Mike Tunnicliffe) [#2826](https://github.com/nodejs/node/pull/2826) -* [[`0603a92d48`](https://github.com/nodejs/node/commit/0603a92d48)] - **doc**: fix two doc errors in stream and process (Jeremiah Senkpiel) [#2549](https://github.com/nodejs/node/pull/2549) -* [[`da2902ddfd`](https://github.com/nodejs/node/commit/da2902ddfd)] - **doc**: use "Calls" over "Executes" for consistency (Minwoo Jung) [#2800](https://github.com/nodejs/node/pull/2800) -* [[`5e93bc4fba`](https://github.com/nodejs/node/commit/5e93bc4fba)] - **doc**: use US English for consistency (Anne-Gaelle Colom) [#2784](https://github.com/nodejs/node/pull/2784) -* [[`3ee7fbcefd`](https://github.com/nodejs/node/commit/3ee7fbcefd)] - **doc**: use 3rd person singular for consistency (Anne-Gaelle Colom) [#2765](https://github.com/nodejs/node/pull/2765) -* [[`4fdccb9eb7`](https://github.com/nodejs/node/commit/4fdccb9eb7)] - **doc**: fix comma splice in Assertion Testing doc (Rich Trott) [#2728](https://github.com/nodejs/node/pull/2728) -* [[`28c2d310d6`](https://github.com/nodejs/node/commit/28c2d310d6)] - **doc**: update AUTHORS list (Rod Vagg) -* [[`324c073fb9`](https://github.com/nodejs/node/commit/324c073fb9)] - **doc**: add TSC meeting minutes 2015-09-02 (Rod Vagg) [#2674](https://github.com/nodejs/node/pull/2674) -* [[`8929445686`](https://github.com/nodejs/node/commit/8929445686)] - **doc**: update url doc to account for escaping (Jeremiah Senkpiel) [#2605](https://github.com/nodejs/node/pull/2605) -* [[`512dad6883`](https://github.com/nodejs/node/commit/512dad6883)] - **doc**: reorder collaborators by their usernames (Johan Bergström) [#2322](https://github.com/nodejs/node/pull/2322) -* [[`8372ea2ca5`](https://github.com/nodejs/node/commit/8372ea2ca5)] - **doc,test**: enable recursive file watching in Windows (Sakthipriyan Vairamani) [#2649](https://github.com/nodejs/node/pull/2649) -* [[`daf6c533cc`](https://github.com/nodejs/node/commit/daf6c533cc)] - **events,lib**: don't require EE#listenerCount() (Jeremiah Senkpiel) [#2661](https://github.com/nodejs/node/pull/2661) -* [[`d8371a801e`](https://github.com/nodejs/node/commit/d8371a801e)] - **http_server**: fix resume after socket close (Fedor Indutny) [#2824](https://github.com/nodejs/node/pull/2824) -* [[`7f7d4fdddd`](https://github.com/nodejs/node/commit/7f7d4fdddd)] - **node-gyp**: float 3.0.1, minor fix for download url (Rod Vagg) [#2737](https://github.com/nodejs/node/pull/2737) -* [[`91cee73294`](https://github.com/nodejs/node/commit/91cee73294)] - **src**: use ZCtxt as a source for v8::Isolates (Roman Klauke) [#2547](https://github.com/nodejs/node/pull/2547) -* [[`ac98e13b95`](https://github.com/nodejs/node/commit/ac98e13b95)] - **src**: s/ia32/x86 for process.release.libUrl for win (Rod Vagg) [#2699](https://github.com/nodejs/node/pull/2699) -* [[`ca6c3223e1`](https://github.com/nodejs/node/commit/ca6c3223e1)] - **src**: use standard conform snprintf on windows (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) -* [[`b028978a53`](https://github.com/nodejs/node/commit/b028978a53)] - **src**: fix buffer overflow for long exception lines (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) -* [[`e73eafd7e7`](https://github.com/nodejs/node/commit/e73eafd7e7)] - **src**: fix memory leak in ExternString (Karl Skomski) [#2402](https://github.com/nodejs/node/pull/2402) -* [[`d370306de1`](https://github.com/nodejs/node/commit/d370306de1)] - **src**: only set v8 flags if argc > 1 (Evan Lucas) [#2646](https://github.com/nodejs/node/pull/2646) -* [[`ed087836af`](https://github.com/nodejs/node/commit/ed087836af)] - **streams**: refactor LazyTransform to internal/ (Brendan Ashworth) [#2566](https://github.com/nodejs/node/pull/2566) -* [[`993c22fe0e`](https://github.com/nodejs/node/commit/993c22fe0e)] - **test**: remove disabled test (Rich Trott) [#2841](https://github.com/nodejs/node/pull/2841) -* [[`1474f29d1f`](https://github.com/nodejs/node/commit/1474f29d1f)] - **test**: split up internet dns tests (Rich Trott) [#2802](https://github.com/nodejs/node/pull/2802) -* [[`601a97622b`](https://github.com/nodejs/node/commit/601a97622b)] - **test**: increase dgram timeout for armv6 (Rich Trott) [#2808](https://github.com/nodejs/node/pull/2808) -* [[`1dad19ba81`](https://github.com/nodejs/node/commit/1dad19ba81)] - **test**: remove valid hostname check in test-dns.js (Rich Trott) [#2785](https://github.com/nodejs/node/pull/2785) -* [[`f3d5891a3f`](https://github.com/nodejs/node/commit/f3d5891a3f)] - **test**: expect error for test_lookup_ipv6_hint on FreeBSD (Rich Trott) [#2724](https://github.com/nodejs/node/pull/2724) -* [[`2ffb21baf1`](https://github.com/nodejs/node/commit/2ffb21baf1)] - **test**: fix use of `common` before required (Rod Vagg) [#2685](https://github.com/nodejs/node/pull/2685) -* [[`b2c5479a14`](https://github.com/nodejs/node/commit/b2c5479a14)] - **test**: refactor to eliminate flaky test (Rich Trott) [#2609](https://github.com/nodejs/node/pull/2609) -* [[`fcfd15f8f9`](https://github.com/nodejs/node/commit/fcfd15f8f9)] - **test**: mark eval_messages as flaky (Alexis Campailla) [#2648](https://github.com/nodejs/node/pull/2648) -* [[`1865cad7ae`](https://github.com/nodejs/node/commit/1865cad7ae)] - **test**: mark test-vm-syntax-error-stderr as flaky (João Reis) [#2662](https://github.com/nodejs/node/pull/2662) -* [[`b0014ecd27`](https://github.com/nodejs/node/commit/b0014ecd27)] - **test**: mark test-repl-persistent-history as flaky (João Reis) [#2659](https://github.com/nodejs/node/pull/2659) -* [[`74ff9bc86c`](https://github.com/nodejs/node/commit/74ff9bc86c)] - **timers**: minor _unrefActive fixes and improvements (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540) -* [[`5d14a6eca7`](https://github.com/nodejs/node/commit/5d14a6eca7)] - **timers**: don't mutate unref list while iterating it (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) -* [[`6e744c58f2`](https://github.com/nodejs/node/commit/6e744c58f2)] - **timers**: Avoid linear scan in _unrefActive. (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) -* [[`07fbf835ad`](https://github.com/nodejs/node/commit/07fbf835ad)] - **tools**: open `test.tap` file in write-binary mode (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) -* [[`6d9198f7f1`](https://github.com/nodejs/node/commit/6d9198f7f1)] - **tools**: add missing tick processor polyfill (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) -* [[`7b16597527`](https://github.com/nodejs/node/commit/7b16597527)] - **tools**: fix flakiness in test-tick-processor (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) -* [[`ef83029356`](https://github.com/nodejs/node/commit/ef83029356)] - **tools**: remove hyphen in TAP result (Sakthipriyan Vairamani) [#2718](https://github.com/nodejs/node/pull/2718) -* [[`ac45ef9157`](https://github.com/nodejs/node/commit/ac45ef9157)] - **win,msi**: fix documentation shortcut url (Brian White) [#2781](https://github.com/nodejs/node/pull/2781) +Moved to doc/changelogs/CHANGELOG_IOJS.md#3.3.1. ## 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) + 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) +Moved to doc/changelogs/CHANGELOG_IOJS.md#3.3.0. ## 2015-08-25, Version 3.2.0, @rvagg -### Notable changes - -* **events**: Added `EventEmitter#listenerCount(event)` as a replacement for `EventEmitter.listenerCount(emitter, event)`, which has now been marked as deprecated in the docs. (Sakthipriyan Vairamani) [#2349](https://github.com/nodejs/node/pull/2349) -* **module**: Fixed an error with preloaded modules when the current working directory doesn't exist. (Bradley Meck) [#2353](https://github.com/nodejs/node/pull/2353) -* **node**: Startup time is now about 5% faster when not passing V8 flags. (Evan Lucas) [#2483](https://github.com/nodejs/node/pull/2483) -* **repl**: Tab-completion now works better with arrays. (James M Snell) [#2409](https://github.com/nodejs/node/pull/2409) -* **string_bytes**: Fixed an unaligned write in the handling of UCS2 encoding. (Fedor Indutny) [#2480](https://github.com/nodejs/node/pull/2480) -* **tls**: Added a new `--tls-cipher-list` flag that can be used to override the built-in default cipher list. (James M Snell) [#2412](https://github.com/nodejs/node/pull/2412) _Note: it is suggested you use the built-in cipher list as it has been carefully selected to reflect current security best practices and risk mitigation._ - -### 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 - -* [[`1cd794f129`](https://github.com/nodejs/node/commit/1cd794f129)] - **buffer**: reapply 07c0667 (Fedor Indutny) [#2487](https://github.com/nodejs/node/pull/2487) -* [[`156781dedd`](https://github.com/nodejs/node/commit/156781dedd)] - **build**: use required platform in android-configure (Evan Lucas) [#2501](https://github.com/nodejs/node/pull/2501) -* [[`77075ec906`](https://github.com/nodejs/node/commit/77075ec906)] - **crypto**: fix mem {de}allocation in ExportChallenge (Karl Skomski) [#2359](https://github.com/nodejs/node/pull/2359) -* [[`cb30414d9e`](https://github.com/nodejs/node/commit/cb30414d9e)] - **doc**: sync CHANGELOG.md from master (Roman Reiss) [#2524](https://github.com/nodejs/node/pull/2524) -* [[`9330f5ef45`](https://github.com/nodejs/node/commit/9330f5ef45)] - **doc**: make the deprecations consistent (Sakthipriyan Vairamani) [#2450](https://github.com/nodejs/node/pull/2450) -* [[`09437e0146`](https://github.com/nodejs/node/commit/09437e0146)] - **doc**: fix comments in tls_wrap.cc and _http_client.js (Minwoo Jung) [#2489](https://github.com/nodejs/node/pull/2489) -* [[`c9867fed29`](https://github.com/nodejs/node/commit/c9867fed29)] - **doc**: document response.finished in http.markdown (hackerjs) [#2414](https://github.com/nodejs/node/pull/2414) -* [[`7f23a83c42`](https://github.com/nodejs/node/commit/7f23a83c42)] - **doc**: update AUTHORS list (Rod Vagg) [#2505](https://github.com/nodejs/node/pull/2505) -* [[`cd0c362f67`](https://github.com/nodejs/node/commit/cd0c362f67)] - **doc**: update AUTHORS list (Rod Vagg) [#2318](https://github.com/nodejs/node/pull/2318) -* [[`2c7b9257ea`](https://github.com/nodejs/node/commit/2c7b9257ea)] - **doc**: add TSC meeting minutes 2015-07-29 (Rod Vagg) [#2437](https://github.com/nodejs/node/pull/2437) -* [[`aaefde793e`](https://github.com/nodejs/node/commit/aaefde793e)] - **doc**: add TSC meeting minutes 2015-08-19 (Rod Vagg) [#2460](https://github.com/nodejs/node/pull/2460) -* [[`51ef9106f5`](https://github.com/nodejs/node/commit/51ef9106f5)] - **doc**: add TSC meeting minutes 2015-06-03 (Rod Vagg) [#2453](https://github.com/nodejs/node/pull/2453) -* [[`7130b4cf1d`](https://github.com/nodejs/node/commit/7130b4cf1d)] - **doc**: fix links to original converged repo (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) -* [[`14f2aee1df`](https://github.com/nodejs/node/commit/14f2aee1df)] - **doc**: fix links to original gh issues for TSC meetings (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) -* [[`87a9ef0a40`](https://github.com/nodejs/node/commit/87a9ef0a40)] - **doc**: add audio recording links to TSC meeting minutes (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) -* [[`f5cf24afbc`](https://github.com/nodejs/node/commit/f5cf24afbc)] - **doc**: add TSC meeting minutes 2015-07-22 (Rod Vagg) [#2436](https://github.com/nodejs/node/pull/2436) -* [[`3f821b96eb`](https://github.com/nodejs/node/commit/3f821b96eb)] - **doc**: fix spelling mistake in node.js comment (Jacob Edelman) [#2391](https://github.com/nodejs/node/pull/2391) -* [[`3e6a6fcdd6`](https://github.com/nodejs/node/commit/3e6a6fcdd6)] - **(SEMVER-MINOR)** **events**: deprecate static listenerCount function (Sakthipriyan Vairamani) [#2349](https://github.com/nodejs/node/pull/2349) -* [[`023386c852`](https://github.com/nodejs/node/commit/023386c852)] - **fs**: replace bad_args macro with concrete error msg (Roman Klauke) [#2495](https://github.com/nodejs/node/pull/2495) -* [[`d1c27b2e29`](https://github.com/nodejs/node/commit/d1c27b2e29)] - **module**: fix module preloading when cwd is ENOENT (Bradley Meck) [#2353](https://github.com/nodejs/node/pull/2353) -* [[`5d7486941b`](https://github.com/nodejs/node/commit/5d7486941b)] - **repl**: filter integer keys from repl tab complete list (James M Snell) [#2409](https://github.com/nodejs/node/pull/2409) -* [[`7f02443a9a`](https://github.com/nodejs/node/commit/7f02443a9a)] - **repl**: dont throw ENOENT on NODE_REPL_HISTORY_FILE (Todd Kennedy) [#2451](https://github.com/nodejs/node/pull/2451) -* [[`56a2ae9cef`](https://github.com/nodejs/node/commit/56a2ae9cef)] - **src**: improve startup time (Evan Lucas) [#2483](https://github.com/nodejs/node/pull/2483) -* [[`14653c7429`](https://github.com/nodejs/node/commit/14653c7429)] - **stream**: rename poorly named function (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) -* [[`1c6e014bfa`](https://github.com/nodejs/node/commit/1c6e014bfa)] - **stream**: micro-optimize high water mark calculation (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) -* [[`f1f4b4c46d`](https://github.com/nodejs/node/commit/f1f4b4c46d)] - **stream**: fix off-by-factor-16 error in comment (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) -* [[`2d3f09bd76`](https://github.com/nodejs/node/commit/2d3f09bd76)] - **stream_base**: various improvements (Fedor Indutny) [#2351](https://github.com/nodejs/node/pull/2351) -* [[`c1ce423b35`](https://github.com/nodejs/node/commit/c1ce423b35)] - **string_bytes**: fix unaligned write in UCS2 (Fedor Indutny) [#2480](https://github.com/nodejs/node/pull/2480) -* [[`e4d0e86165`](https://github.com/nodejs/node/commit/e4d0e86165)] - **test**: refactor test-https-simple.js (Rich Trott) [#2433](https://github.com/nodejs/node/pull/2433) -* [[`0ea5c8d737`](https://github.com/nodejs/node/commit/0ea5c8d737)] - **test**: remove test-timers-first-fire (João Reis) [#2458](https://github.com/nodejs/node/pull/2458) -* [[`536c3d0537`](https://github.com/nodejs/node/commit/536c3d0537)] - **test**: use reserved IP in test-net-connect-timeout (Rich Trott) [#2257](https://github.com/nodejs/node/pull/2257) -* [[`5df06fd8df`](https://github.com/nodejs/node/commit/5df06fd8df)] - **test**: add spaces after keywords (Brendan Ashworth) -* [[`e714b5620e`](https://github.com/nodejs/node/commit/e714b5620e)] - **test**: remove unreachable code (Michaël Zasso) [#2289](https://github.com/nodejs/node/pull/2289) -* [[`3579f3a2a4`](https://github.com/nodejs/node/commit/3579f3a2a4)] - **test**: disallow unreachable code (Michaël Zasso) [#2289](https://github.com/nodejs/node/pull/2289) -* [[`3545e236fc`](https://github.com/nodejs/node/commit/3545e236fc)] - **test**: reduce timeouts in test-net-keepalive (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) -* [[`b60e690023`](https://github.com/nodejs/node/commit/b60e690023)] - **test**: improve test-net-server-pause-on-connect (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) -* [[`11d1b8fcaf`](https://github.com/nodejs/node/commit/11d1b8fcaf)] - **test**: improve test-net-pingpong (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) -* [[`5fef5c6562`](https://github.com/nodejs/node/commit/5fef5c6562)] - **(SEMVER-MINOR)** **tls**: add --tls-cipher-list command line switch (James M Snell) [#2412](https://github.com/nodejs/node/pull/2412) -* [[`d9b70f9cbf`](https://github.com/nodejs/node/commit/d9b70f9cbf)] - **tls**: handle empty cert in checkServerIndentity (Mike Atkins) [#2343](https://github.com/nodejs/node/pull/2343) -* [[`4f8e34c202`](https://github.com/nodejs/node/commit/4f8e34c202)] - **tools**: add license boilerplate to check-imports.sh (James M Snell) [#2386](https://github.com/nodejs/node/pull/2386) -* [[`b76b9197f9`](https://github.com/nodejs/node/commit/b76b9197f9)] - **tools**: enable space-after-keywords in eslint (Brendan Ashworth) -* [[`64a8f30a70`](https://github.com/nodejs/node/commit/64a8f30a70)] - **tools**: fix anchors in generated documents (Sakthipriyan Vairamani) [#2491](https://github.com/nodejs/node/pull/2491) -* [[`22e344ea10`](https://github.com/nodejs/node/commit/22e344ea10)] - **win**: fix custom actions for WiX older than 3.9 (João Reis) [#2365](https://github.com/nodejs/node/pull/2365) -* [[`b5bd3ebfc8`](https://github.com/nodejs/node/commit/b5bd3ebfc8)] - **win**: fix custom actions on Visual Studio != 2013 (Julien Gilli) [#2365](https://github.com/nodejs/node/pull/2365) +Moved to doc/changelogs/CHANGELOG_IOJS.md#3.2.0. ## 2015-08-18, Version 3.1.0, @Fishrock123 -### Notable changes - -* **buffer**: Fixed a couple large memory leaks (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352). -* **crypto**: - - Fixed a couple of minor memory leaks (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375). - - Signing now checks for OpenSSL errors (P.S.V.R) [#2342](https://github.com/nodejs/node/pull/2342). **Note that this may expose previously hidden errors in user code.** -* **intl**: Intl support using small-icu is now enabled by default in builds (Steven R. Loomis) [#2264](https://github.com/nodejs/node/pull/2264). - - [`String#normalize()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) can now be used for unicode normalization. - - The [`Intl`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl) object and various `String` and `Number` methods are present, but only support the English locale. - - For support of all locales, node must be built with [full-icu](https://github.com/nodejs/node#build-with-full-icu-support-all-locales-supported-by-icu). -* **tls**: Fixed tls throughput being much lower after an incorrect merge (Fedor Indutny) [#2381](https://github.com/nodejs/node/pull/2381). -* **tools**: The v8 tick processor now comes bundled with node (Matt Loring) [#2090](https://github.com/nodejs/node/pull/2090). - - This can be used by producing performance profiling output by running node with `--perf`, then running your appropriate platform's script on the output as found in [tools/v8-prof](https://github.com/nodejs/node/tree/master/tools/v8-prof). -* **util**: `util.inspect(obj)` now prints the constructor name of the object if there is one (Christopher Monsanto) [#1935](https://github.com/nodejs/io.js/pull/1935). - -### Known issues - -See https://github.com/nodejs/io.js/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/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 - -* [[`3645dc62ed`](https://github.com/nodejs/node/commit/3645dc62ed)] - **build**: work around VS2015 issue in ICU <56 (Steven R. Loomis) [#2283](https://github.com/nodejs/node/pull/2283) -* [[`1f12e03266`](https://github.com/nodejs/node/commit/1f12e03266)] - **(SEMVER-MINOR)** **build**: intl: converge from joyent/node (Steven R. Loomis) [#2264](https://github.com/nodejs/node/pull/2264) -* [[`071640abdd`](https://github.com/nodejs/node/commit/071640abdd)] - **build**: Intl: bump ICU4C from 54 to 55 (Steven R. Loomis) [#2293](https://github.com/nodejs/node/pull/2293) -* [[`07a88b0c8b`](https://github.com/nodejs/node/commit/07a88b0c8b)] - **build**: update manifest to include Windows 10 (Lucien Greathouse) [#2332](https://github.com/nodejs/io.js/pull/2332) -* [[`0bb099f444`](https://github.com/nodejs/node/commit/0bb099f444)] - **build**: expand ~ in install prefix early (Ben Noordhuis) [#2307](https://github.com/nodejs/io.js/pull/2307) -* [[`7fe6dd8f5d`](https://github.com/nodejs/node/commit/7fe6dd8f5d)] - **crypto**: check for OpenSSL errors when signing (P.S.V.R) [#2342](https://github.com/nodejs/node/pull/2342) -* [[`605f6ee904`](https://github.com/nodejs/node/commit/605f6ee904)] - **crypto**: fix memory leak in PBKDF2Request (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`ba6eb8af12`](https://github.com/nodejs/node/commit/ba6eb8af12)] - **crypto**: fix memory leak in ECDH::SetPrivateKey (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`6a16368611`](https://github.com/nodejs/node/commit/6a16368611)] - **crypto**: fix memory leak in PublicKeyCipher::Cipher (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`a760a87803`](https://github.com/nodejs/node/commit/a760a87803)] - **crypto**: fix memory leak in SafeX509ExtPrint (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`f45487cd6e`](https://github.com/nodejs/node/commit/f45487cd6e)] - **crypto**: fix memory leak in SetDHParam (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`2ff183dd86`](https://github.com/nodejs/node/commit/2ff183dd86)] - **doc**: Update FIPS instructions in README.md (Michael Dawson) [#2278](https://github.com/nodejs/node/pull/2278) -* [[`6483bc2e8f`](https://github.com/nodejs/node/commit/6483bc2e8f)] - **doc**: clarify options for fs.watchFile() (Rich Trott) [#2425](https://github.com/nodejs/node/pull/2425) -* [[`e76822f454`](https://github.com/nodejs/node/commit/e76822f454)] - **doc**: multiple documentation updates cherry picked from v0.12 (James M Snell) [#2302](https://github.com/nodejs/io.js/pull/2302) -* [[`1738c9680b`](https://github.com/nodejs/node/commit/1738c9680b)] - **net**: ensure Socket reported address is current (Ryan Graham) [#2095](https://github.com/nodejs/io.js/pull/2095) -* [[`844d3f0e3e`](https://github.com/nodejs/node/commit/844d3f0e3e)] - **path**: use '===' instead of '==' for comparison (Sam Stites) [#2388](https://github.com/nodejs/node/pull/2388) -* [[`7118b8a882`](https://github.com/nodejs/node/commit/7118b8a882)] - **path**: remove dead code in favor of unit tests (Nathan Woltman) [#2282](https://github.com/nodejs/io.js/pull/2282) -* [[`34f2cfa806`](https://github.com/nodejs/node/commit/34f2cfa806)] - **src**: better error message on failed Buffer malloc (Karl Skomski) [#2422](https://github.com/nodejs/node/pull/2422) -* [[`b196c1da3c`](https://github.com/nodejs/node/commit/b196c1da3c)] - **src**: fix memory leak in DLOpen (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) -* [[`d1307b2995`](https://github.com/nodejs/node/commit/d1307b2995)] - **src**: don't use fopen() in require() fast path (Ben Noordhuis) [#2377](https://github.com/nodejs/node/pull/2377) -* [[`455ec570d1`](https://github.com/nodejs/node/commit/455ec570d1)] - **src**: rename Buffer::Use() to Buffer::New() (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) -* [[`fd63e1ce2b`](https://github.com/nodejs/node/commit/fd63e1ce2b)] - **src**: introduce internal Buffer::Copy() function (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) -* [[`5586ceca13`](https://github.com/nodejs/node/commit/5586ceca13)] - **src**: move internal functions out of node_buffer.h (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) -* [[`bff9bcddb6`](https://github.com/nodejs/node/commit/bff9bcddb6)] - **src**: plug memory leaks (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) -* [[`ccf12df4f3`](https://github.com/nodejs/node/commit/ccf12df4f3)] - **(SEMVER-MINOR)** **src**: add total_available_size to v8 statistics (Roman Klauke) [#2348](https://github.com/nodejs/io.js/pull/2348) -* [[`194eeb841b`](https://github.com/nodejs/node/commit/194eeb841b)] - **test**: drop Isolate::GetCurrent() from addon tests (Ben Noordhuis) [#2427](https://github.com/nodejs/node/pull/2427) -* [[`46cdb2f6e2`](https://github.com/nodejs/node/commit/46cdb2f6e2)] - **test**: lint addon tests (Ben Noordhuis) [#2427](https://github.com/nodejs/node/pull/2427) -* [[`850c794882`](https://github.com/nodejs/node/commit/850c794882)] - **test**: refactor test-fs-watchfile.js (Rich Trott) [#2393](https://github.com/nodejs/node/pull/2393) -* [[`a3160c0a33`](https://github.com/nodejs/node/commit/a3160c0a33)] - **test**: correct spelling of 'childProcess' (muddletoes) [#2389](https://github.com/nodejs/node/pull/2389) -* [[`e51f90d747`](https://github.com/nodejs/node/commit/e51f90d747)] - **test**: option to run a subset of tests (João Reis) [#2260](https://github.com/nodejs/io.js/pull/2260) -* [[`cc46d3bca3`](https://github.com/nodejs/node/commit/cc46d3bca3)] - **test**: clarify dropMembership() call (Rich Trott) [#2062](https://github.com/nodejs/io.js/pull/2062) -* [[`0ee4df9c7a`](https://github.com/nodejs/node/commit/0ee4df9c7a)] - **test**: make listen-fd-cluster/server more robust (Sam Roberts) [#1944](https://github.com/nodejs/io.js/pull/1944) -* [[`cf9ba81398`](https://github.com/nodejs/node/commit/cf9ba81398)] - **test**: address timing issues in simple http tests (Gireesh Punathil) [#2294](https://github.com/nodejs/io.js/pull/2294) -* [[`cbb75c4f86`](https://github.com/nodejs/node/commit/cbb75c4f86)] - **tls**: fix throughput issues after incorrect merge (Fedor Indutny) [#2381](https://github.com/nodejs/node/pull/2381) -* [[`94b765f409`](https://github.com/nodejs/node/commit/94b765f409)] - **tls**: fix check for reused session (Fedor Indutny) [#2312](https://github.com/nodejs/io.js/pull/2312) -* [[`e83a41ad65`](https://github.com/nodejs/node/commit/e83a41ad65)] - **tls**: introduce internal `onticketkeycallback` (Fedor Indutny) [#2312](https://github.com/nodejs/io.js/pull/2312) -* [[`fb0f5d733f`](https://github.com/nodejs/node/commit/fb0f5d733f)] - **(SEMVER-MINOR)** **tools**: run the tick processor without building v8 (Matt Loring) [#2090](https://github.com/nodejs/node/pull/2090) -* [[`7606bdb897`](https://github.com/nodejs/node/commit/7606bdb897)] - **(SEMVER-MINOR)** **util**: display constructor when inspecting objects (Christopher Monsanto) [#1935](https://github.com/nodejs/io.js/pull/1935) +Moved to doc/changelogs/CHANGELOG_IOJS.md#3.1.0. ## 2015-08-04, Version 3.0.0, @rvagg -### Notable changes - -* **buffer**: - - Due to changes in V8, it has been necessary to reimplement `Buffer` on top of V8's `Uint8Array`. Every effort has been made to minimize the performance impact, however `Buffer` instantiation is measurably slower. Access operations may be faster in some circumstances but the exact performance profile and difference over previous versions will depend on how `Buffer` is used within applications. (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825). - - `Buffer` can now take `ArrayBuffer`s as a constructor argument (Trevor Norris) [#2002](https://github.com/nodejs/node/pull/2002). - - When a single buffer is passed to `Buffer.concat()`, a new, copied `Buffer` object will be returned; previous behavior was to return the original `Buffer` object (Sakthipriyan Vairamani) [#1937](https://github.com/nodejs/node/pull/1937). -* **build**: PPC support has been added to core to allow compiling on pLinux BE and LE (AIX support coming soon) (Michael Dawson) [#2124](https://github.com/nodejs/node/pull/2124). -* **dgram**: If an error occurs within `socket.send()` and a callback has been provided, the error is only passed as the first argument to the callback and not emitted on the `socket` object; previous behavior was to do both (Matteo Collina & Chris Dickinson) [#1796](https://github.com/nodejs/node/pull/1796) -* **freelist**: Deprecate the undocumented `freelist` core module (Sakthipriyan Vairamani) [#2176](https://github.com/nodejs/node/pull/2176). -* **http**: - - Status codes now all use the official [IANA names](http://www.iana.org/assignments/http-status-codes) as per [RFC7231](https://tools.ietf.org/html/rfc7231), e.g. `http.STATUS_CODES[414]` now returns `'URI Too Long'` rather than `'Request-URI Too Large'` (jomo) [#1470](https://github.com/nodejs/node/pull/1470). - - Calling .getName() on an HTTP agent no longer returns a trailing colon, HTTPS agents will no longer return an extra colon near the middle of the string (Brendan Ashworth) [#1617](https://github.com/nodejs/node/pull/1617). -* **node**: - - `NODE_MODULE_VERSION` has been bumped to `45` to reflect the break in ABI (Rod Vagg) [#2096](https://github.com/nodejs/node/pull/2096). - - Introduce a new `process.release` object that contains a `name` property set to `'io.js'` and `sourceUrl`, `headersUrl` and `libUrl` (Windows only) properties containing URLs for the relevant resources; this is intended to be used by node-gyp (Rod Vagg) [#2154](https://github.com/nodejs/node/pull/2154). - - The version of node-gyp bundled with io.js now downloads and uses a tarball of header files from iojs.org rather than the full source for compiling native add-ons; it is hoped this is a temporary floating patch and the change will be upstreamed to node-gyp soon (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066). -* **repl**: Persistent history is now enabled by default. The history file is located at ~/.node_repl_history, which can be overridden by the new environment variable `NODE_REPL_HISTORY`. This deprecates the previous `NODE_REPL_HISTORY_FILE` variable. Additionally, the format of the file has been changed to plain text to better handle file corruption. (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224). -* **smalloc**: The `smalloc` module has been removed as it is no longer possible to provide the API due to changes in V8 (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022). -* **tls**: Add `server.getTicketKeys()` and `server.setTicketKeys()` methods for [TLS session key](https://www.ietf.org/rfc/rfc5077.txt) rotation (Fedor Indutny) [#2227](https://github.com/nodejs/node/pull/2227). -* **v8**: Upgraded to 4.4.63.26 - - ES6: Enabled [computed property names](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names) - - ES6: `Array` can now be subclassed in strict mode - - ES6: Implement [rest parameters](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/rest_parameters) in staging, use the `--harmony-rest-parameters` command line flag - - ES6: Implement the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator) in staging, use the `--harmony-spreadcalls` command line flag - - Removed `SetIndexedPropertiesToExternalArrayData` and related APIs, forcing a shift to `Buffer` to be reimplemented based on `Uint8Array` - - Introduction of `Maybe` and `MaybeLocal` C++ API for objects which _may_ or _may not_ have a value. - - Added support for PPC - -See also https://github.com/nodejs/node/wiki/Breaking-Changes#300-from-2x for a summary of the breaking changes (SEMVER-MAJOR). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/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/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 - -* [[`60a974d200`](https://github.com/nodejs/node/commit/60a974d200)] - **buffer**: fix missing null/undefined check (Trevor Norris) [#2195](https://github.com/nodejs/node/pull/2195) -* [[`e6ab2d92bc`](https://github.com/nodejs/node/commit/e6ab2d92bc)] - **buffer**: fix not return on error (Trevor Norris) [#2225](https://github.com/nodejs/node/pull/2225) -* [[`1057d1186b`](https://github.com/nodejs/node/commit/1057d1186b)] - **buffer**: rename internal/buffer_new.js to buffer.js (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) -* [[`4643b8b667`](https://github.com/nodejs/node/commit/4643b8b667)] - **(SEMVER-MINOR)** **buffer**: allow ArrayBuffer as Buffer argument (Trevor Norris) [#2002](https://github.com/nodejs/node/pull/2002) -* [[`e5ada116cd`](https://github.com/nodejs/node/commit/e5ada116cd)] - **buffer**: minor cleanup from rebase (Trevor Norris) [#2003](https://github.com/nodejs/node/pull/2003) -* [[`b625ab4242`](https://github.com/nodejs/node/commit/b625ab4242)] - **buffer**: fix usage of kMaxLength (Trevor Norris) [#2003](https://github.com/nodejs/node/pull/2003) -* [[`eea66e2a7b`](https://github.com/nodejs/node/commit/eea66e2a7b)] - **(SEMVER-MAJOR)** **buffer**: fix case of one buffer passed to concat (Sakthipriyan Vairamani) [#1937](https://github.com/nodejs/node/pull/1937) -* [[`8664084166`](https://github.com/nodejs/node/commit/8664084166)] - **buffer**: make additional changes to native API (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`36f78f4c1c`](https://github.com/nodejs/node/commit/36f78f4c1c)] - **buffer**: switch API to return MaybeLocal (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`571ec13841`](https://github.com/nodejs/node/commit/571ec13841)] - **buffer**: switch to using Maybe API (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`d75f5c8d0e`](https://github.com/nodejs/node/commit/d75f5c8d0e)] - **buffer**: finish implementing FreeCallback (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`63da0dfd3a`](https://github.com/nodejs/node/commit/63da0dfd3a)] - **buffer**: implement Uint8Array backed Buffer (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`23be6ca189`](https://github.com/nodejs/node/commit/23be6ca189)] - **buffer**: allow ARGS_THIS to accept a name (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`971de5e417`](https://github.com/nodejs/node/commit/971de5e417)] - **build**: prepare Windows installer for i18n support (Frederic Hemberger) [#2247](https://github.com/nodejs/node/pull/2247) -* [[`2ba8b23661`](https://github.com/nodejs/node/commit/2ba8b23661)] - **build**: add 'x86' option back in to configure (Rod Vagg) [#2233](https://github.com/nodejs/node/pull/2233) -* [[`b4226e797a`](https://github.com/nodejs/node/commit/b4226e797a)] - **build**: first set of updates to enable PPC support (Michael Dawson) [#2124](https://github.com/nodejs/node/pull/2124) -* [[`24dd016deb`](https://github.com/nodejs/node/commit/24dd016deb)] - **build**: produce symbol map files on windows (Ali Ijaz Sheikh) [#2243](https://github.com/nodejs/node/pull/2243) -* [[`423d8944ce`](https://github.com/nodejs/node/commit/423d8944ce)] - **cluster**: do not unconditionally set --debug-port (cjihrig) [#1949](https://github.com/nodejs/node/pull/1949) -* [[`fa98b97171`](https://github.com/nodejs/node/commit/fa98b97171)] - **cluster**: add handle ref/unref stubs in rr mode (Ben Noordhuis) [#2274](https://github.com/nodejs/node/pull/2274) -* [[`944f68046c`](https://github.com/nodejs/node/commit/944f68046c)] - **crypto**: remove kMaxLength on randomBytes() (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) -* [[`3d3c687012`](https://github.com/nodejs/node/commit/3d3c687012)] - **deps**: update V8 to 4.4.63.26 (Michaël Zasso) [#2220](https://github.com/nodejs/node/pull/2220) -* [[`3aad4fa89a`](https://github.com/nodejs/node/commit/3aad4fa89a)] - **deps**: upgrade v8 to 4.4.63.12 (Ben Noordhuis) [#2092](https://github.com/nodejs/node/pull/2092) -* [[`70d1f32f56`](https://github.com/nodejs/node/commit/70d1f32f56)] - **(SEMVER-MAJOR)** **deps**: update v8 to 4.4.63.9 (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) -* [[`deb7ee93a7`](https://github.com/nodejs/node/commit/deb7ee93a7)] - **deps**: backport 7b24219346 from v8 upstream (Rod Vagg) [#1805](https://github.com/nodejs/node/pull/1805) -* [[`d58e780504`](https://github.com/nodejs/node/commit/d58e780504)] - **(SEMVER-MAJOR)** **deps**: update v8 to 4.3.61.21 (Chris Dickinson) [iojs/io.js#1632](https://github.com/iojs/io.js/pull/1632) -* [[`2a63cf612b`](https://github.com/nodejs/node/commit/2a63cf612b)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`bf63266460`](https://github.com/nodejs/node/commit/bf63266460)] - **deps**: upgrade to npm 2.13.3 (Kat Marchán) [#2284](https://github.com/nodejs/node/pull/2284) -* [[`ef2c8cd4ec`](https://github.com/nodejs/node/commit/ef2c8cd4ec)] - **(SEMVER-MAJOR)** **dgram**: make send cb act as "error" event handler (Matteo Collina) [#1796](https://github.com/nodejs/node/pull/1796) -* [[`3da057fef6`](https://github.com/nodejs/node/commit/3da057fef6)] - **(SEMVER-MAJOR)** **dgram**: make send cb act as "error" event handler (Chris Dickinson) [#1796](https://github.com/nodejs/node/pull/1796) -* [[`df1994fe53`](https://github.com/nodejs/node/commit/df1994fe53)] - ***Revert*** "**dns**: remove AI_V4MAPPED hint flag on FreeBSD" (cjihrig) [iojs/io.js#1555](https://github.com/iojs/io.js/pull/1555) -* [[`1721968b22`](https://github.com/nodejs/node/commit/1721968b22)] - **doc**: document repl persistent history changes (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) -* [[`d12df7f159`](https://github.com/nodejs/node/commit/d12df7f159)] - **doc**: update v8 flags in man page (Michaël Zasso) [iojs/io.js#1701](https://github.com/iojs/io.js/pull/1701) -* [[`d168d01b04`](https://github.com/nodejs/node/commit/d168d01b04)] - **doc**: properly inheriting from EventEmitter (Sakthipriyan Vairamani) [#2168](https://github.com/nodejs/node/pull/2168) -* [[`500f2538cc`](https://github.com/nodejs/node/commit/500f2538cc)] - **doc**: a listener, not "an" listener (Sam Roberts) [#1025](https://github.com/nodejs/node/pull/1025) -* [[`54627a919d`](https://github.com/nodejs/node/commit/54627a919d)] - **doc**: server close event does not have an argument (Sam Roberts) [#1025](https://github.com/nodejs/node/pull/1025) -* [[`ed85c95a9c`](https://github.com/nodejs/node/commit/ed85c95a9c)] - **doc,test**: documents behaviour of non-existent file (Sakthipriyan Vairamani) [#2169](https://github.com/nodejs/node/pull/2169) -* [[`2965442308`](https://github.com/nodejs/node/commit/2965442308)] - **(SEMVER-MAJOR)** **http**: fix agent.getName() and add tests (Brendan Ashworth) [#1617](https://github.com/nodejs/node/pull/1617) -* [[`2d9456e3e6`](https://github.com/nodejs/node/commit/2d9456e3e6)] - **(SEMVER-MAJOR)** **http**: use official IANA Status Codes (jomo) [#1470](https://github.com/nodejs/node/pull/1470) -* [[`11e4249227`](https://github.com/nodejs/node/commit/11e4249227)] - **(SEMVER-MAJOR)** **http_server**: `prefinish` vs `finish` (Fedor Indutny) [#1411](https://github.com/nodejs/node/pull/1411) -* [[`9bc2e26720`](https://github.com/nodejs/node/commit/9bc2e26720)] - **net**: do not set V4MAPPED on FreeBSD (Julien Gilli) [iojs/io.js#1555](https://github.com/iojs/io.js/pull/1555) -* [[`ba9ccf227e`](https://github.com/nodejs/node/commit/ba9ccf227e)] - **node**: remove redundant --use-old-buffer (Rod Vagg) [#2275](https://github.com/nodejs/node/pull/2275) -* [[`ef65321083`](https://github.com/nodejs/node/commit/ef65321083)] - **(SEMVER-MAJOR)** **node**: do not override `message`/`stack` of error (Fedor Indutny) [#2108](https://github.com/nodejs/node/pull/2108) -* [[`9f727f5e03`](https://github.com/nodejs/node/commit/9f727f5e03)] - **node-gyp**: detect RC build with x.y.z-rc.n format (Rod Vagg) [#2171](https://github.com/nodejs/node/pull/2171) -* [[`e52f963632`](https://github.com/nodejs/node/commit/e52f963632)] - **node-gyp**: download header tarball for compile (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066) -* [[`902c9ca51d`](https://github.com/nodejs/node/commit/902c9ca51d)] - **node-gyp**: make aware of nightly, next-nightly & rc (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066) -* [[`4cffaa3f55`](https://github.com/nodejs/node/commit/4cffaa3f55)] - **(SEMVER-MINOR)** **readline**: allow tabs in input (Rich Trott) [#1761](https://github.com/nodejs/node/pull/1761) -* [[`ed6c249104`](https://github.com/nodejs/node/commit/ed6c249104)] - **(SEMVER-MAJOR)** **repl**: persist history in plain text (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) -* [[`f7d5e4c618`](https://github.com/nodejs/node/commit/f7d5e4c618)] - **(SEMVER-MINOR)** **repl**: default persistence to ~/.node_repl_history (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) -* [[`ea05e760cd`](https://github.com/nodejs/node/commit/ea05e760cd)] - **repl**: don't clobber RegExp.$ properties (Sakthipriyan Vairamani) [#2137](https://github.com/nodejs/node/pull/2137) -* [[`d20093246b`](https://github.com/nodejs/node/commit/d20093246b)] - **src**: disable vector ICs on arm (Michaël Zasso) [#2220](https://github.com/nodejs/node/pull/2220) -* [[`04fd4fad46`](https://github.com/nodejs/node/commit/04fd4fad46)] - **(SEMVER-MINOR)** **src**: introduce process.release object (Rod Vagg) [#2154](https://github.com/nodejs/node/pull/2154) -* [[`9d34bd1147`](https://github.com/nodejs/node/commit/9d34bd1147)] - **src**: increment NODE_MODULE_VERSION to 45 (Rod Vagg) [#2096](https://github.com/nodejs/node/pull/2096) -* [[`ceee8d2807`](https://github.com/nodejs/node/commit/ceee8d2807)] - **test**: add tests for persistent repl history (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) -* [[`8e1a8ffe24`](https://github.com/nodejs/node/commit/8e1a8ffe24)] - **test**: remove two obsolete pummel tests (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) -* [[`ae731ec0fa`](https://github.com/nodejs/node/commit/ae731ec0fa)] - **test**: don't use arguments.callee (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) -* [[`21d31c08e7`](https://github.com/nodejs/node/commit/21d31c08e7)] - **test**: remove obsolete harmony flags (Chris Dickinson) -* [[`64cf71195c`](https://github.com/nodejs/node/commit/64cf71195c)] - **test**: change the hostname to an invalid name (Sakthipriyan Vairamani) [#2287](https://github.com/nodejs/node/pull/2287) -* [[`80a1cf7425`](https://github.com/nodejs/node/commit/80a1cf7425)] - **test**: fix messages and use return to skip tests (Sakthipriyan Vairamani) [#2290](https://github.com/nodejs/node/pull/2290) -* [[`d5ab92bcc1`](https://github.com/nodejs/node/commit/d5ab92bcc1)] - **test**: use common.isWindows consistently (Sakthipriyan Vairamani) [#2269](https://github.com/nodejs/node/pull/2269) -* [[`bc733f7065`](https://github.com/nodejs/node/commit/bc733f7065)] - **test**: fix fs.readFile('/dev/stdin') tests (Ben Noordhuis) [#2265](https://github.com/nodejs/node/pull/2265) -* [[`3cbb5870e5`](https://github.com/nodejs/node/commit/3cbb5870e5)] - **tools**: expose skip output to test runner (Johan Bergström) [#2130](https://github.com/nodejs/node/pull/2130) -* [[`3b021efe11`](https://github.com/nodejs/node/commit/3b021efe11)] - **vm**: fix symbol access (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) -* [[`7b81e4ba36`](https://github.com/nodejs/node/commit/7b81e4ba36)] - **vm**: remove unnecessary access checks (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) -* [[`659dadd410`](https://github.com/nodejs/node/commit/659dadd410)] - **vm**: fix property descriptors of sandbox properties (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) -* [[`9bac1dbae9`](https://github.com/nodejs/node/commit/9bac1dbae9)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#3.0.0. ## 2015-07-28, Version 2.5.0, @cjihrig -### Notable changes - -* **https**: TLS sessions in Agent are reused (Fedor Indutny) [#2228](https://github.com/nodejs/node/pull/2228) -* **src**: base64 decoding is now 50% faster (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) -* **npm**: Upgraded to v2.13.2, release notes can be found in (Kat Marchán) [#2241](https://github.com/nodejs/node/pull/2241). - -### Known issues - -See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. - -* Using multiple REPL instances in parallel may cause some REPL history corruption or loss. [#1634](https://github.com/nodejs/node/issues/1634) -* 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/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/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 - -* [[`bf2cd225a8`](https://github.com/nodejs/node/commit/bf2cd225a8)] - **process**: resize stderr on SIGWINCH (Jeremiah Senkpiel) [#2231](https://github.com/nodejs/node/pull/2231) -* [[`99d9d7e716`](https://github.com/nodejs/node/commit/99d9d7e716)] - **benchmark**: add remaining path benchmarks & optimize (Nathan Woltman) [#2103](https://github.com/nodejs/node/pull/2103) -* [[`66fc8ca22b`](https://github.com/nodejs/node/commit/66fc8ca22b)] - **(SEMVER-MINOR)** **cluster**: emit 'message' event on cluster master (Sam Roberts) [#861](https://github.com/nodejs/node/pull/861) -* [[`eb35968de7`](https://github.com/nodejs/node/commit/eb35968de7)] - **crypto**: fix legacy SNICallback (Fedor Indutny) [#1720](https://github.com/nodejs/node/pull/1720) -* [[`fef190cea6`](https://github.com/nodejs/node/commit/fef190cea6)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`b73a7465c5`](https://github.com/nodejs/node/commit/b73a7465c5)] - **deps**: upgrade to npm 2.13.2 (Kat Marchán) [#2241](https://github.com/nodejs/node/pull/2241) -* [[`0a7bf81d2f`](https://github.com/nodejs/node/commit/0a7bf81d2f)] - **deps**: update V8 to 4.2.77.21 (Ali Ijaz Sheikh) [#2238](https://github.com/nodejs/node/issues/2238) -* [[`73cdcdd581`](https://github.com/nodejs/node/commit/73cdcdd581)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`04893a736d`](https://github.com/nodejs/node/commit/04893a736d)] - **deps**: upgrade to npm 2.13.1 (Kat Marchán) [#2210](https://github.com/nodejs/node/pull/2210) -* [[`a3c1b9720e`](https://github.com/nodejs/node/commit/a3c1b9720e)] - **doc**: add GPG fingerprint for cjihrig (cjihrig) [#2217](https://github.com/nodejs/node/pull/2217) -* [[`d9f857df3b`](https://github.com/nodejs/node/commit/d9f857df3b)] - **doc**: note about custom inspect functions (Sakthipriyan Vairamani) [#2142](https://github.com/nodejs/node/pull/2142) -* [[`4ef2b5fbfb`](https://github.com/nodejs/node/commit/4ef2b5fbfb)] - **doc**: Replace util.debug with console.error (Yosuke Furukawa) [#2214](https://github.com/nodejs/node/pull/2214) -* [[`b612f085ec`](https://github.com/nodejs/node/commit/b612f085ec)] - **doc**: add joaocgreis as a collaborator (João Reis) [#2208](https://github.com/nodejs/node/pull/2208) -* [[`6b85d5a4b3`](https://github.com/nodejs/node/commit/6b85d5a4b3)] - **doc**: add TSC meeting minutes 2015-07-15 (Rod Vagg) [#2191](https://github.com/nodejs/node/pull/2191) -* [[`c7d8b09162`](https://github.com/nodejs/node/commit/c7d8b09162)] - **doc**: recompile before testing core module changes (Phillip Johnsen) [#2051](https://github.com/nodejs/node/pull/2051) -* [[`9afee6785e`](https://github.com/nodejs/node/commit/9afee6785e)] - **http**: Check this.connection before using it (Sakthipriyan Vairamani) [#2172](https://github.com/nodejs/node/pull/2172) -* [[`2ca5a3db47`](https://github.com/nodejs/node/commit/2ca5a3db47)] - **https**: reuse TLS sessions in Agent (Fedor Indutny) [#2228](https://github.com/nodejs/node/pull/2228) -* [[`fef87fee1d`](https://github.com/nodejs/node/commit/fef87fee1d)] - **(SEMVER-MINOR)** **lib,test**: add freelist deprecation and test (Sakthipriyan Vairamani) [#2176](https://github.com/nodejs/node/pull/2176) -* [[`503b089dd8`](https://github.com/nodejs/node/commit/503b089dd8)] - **net**: don't throw on immediately destroyed socket (Evan Lucas) [#2251](https://github.com/nodejs/node/pull/2251) -* [[`93660c8b8e`](https://github.com/nodejs/node/commit/93660c8b8e)] - **node**: remove bad fn call and check (Trevor Norris) [#2157](https://github.com/nodejs/node/pull/2157) -* [[`afd7e37ee0`](https://github.com/nodejs/node/commit/afd7e37ee0)] - **repl**: better empty line handling (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) -* [[`81ea52aa01`](https://github.com/nodejs/node/commit/81ea52aa01)] - **repl**: improving line continuation handling (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) -* [[`30edb5aee9`](https://github.com/nodejs/node/commit/30edb5aee9)] - **repl**: preventing REPL crash with inherited properties (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) -* [[`77fa385e5d`](https://github.com/nodejs/node/commit/77fa385e5d)] - **repl**: fixing `undefined` in invalid REPL keyword error (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) -* [[`8fd3ce100e`](https://github.com/nodejs/node/commit/8fd3ce100e)] - **src**: make base64 decoding 50% faster (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) -* [[`c786d6341d`](https://github.com/nodejs/node/commit/c786d6341d)] - **test**: do not use public IPs for timeout testing (Rich Trott) [#2057](https://github.com/nodejs/node/pull/2057) -* [[`4e78cd71c0`](https://github.com/nodejs/node/commit/4e78cd71c0)] - **test**: skip IPv6 part before testing it (Sakthipriyan Vairamani) [#2226](https://github.com/nodejs/node/pull/2226) -* [[`ac70bc8240`](https://github.com/nodejs/node/commit/ac70bc8240)] - **test**: fix valgrind uninitialized memory warning (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) -* [[`ac7d3fa0d9`](https://github.com/nodejs/node/commit/ac7d3fa0d9)] - **test**: add -no_rand_screen to s_client opts on Win (Shigeki Ohtsu) [#2209](https://github.com/nodejs/node/pull/2209) -* [[`79c865a53f`](https://github.com/nodejs/node/commit/79c865a53f)] - **test**: changing process.exit to return while skipping tests (Sakthipriyan Vairamani) [#2109](https://github.com/nodejs/node/pull/2109) -* [[`69298d36cf`](https://github.com/nodejs/node/commit/69298d36cf)] - **test**: formatting skip messages for TAP parsing (Sakthipriyan Vairamani) [#2109](https://github.com/nodejs/node/pull/2109) -* [[`543dabb609`](https://github.com/nodejs/node/commit/543dabb609)] - **timers**: improve Timer.now() performance (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) -* [[`3663b124e6`](https://github.com/nodejs/node/commit/3663b124e6)] - **timers**: remove unused Timer.again() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) -* [[`bcce5cf9bb`](https://github.com/nodejs/node/commit/bcce5cf9bb)] - **timers**: remove unused Timer.getRepeat() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) -* [[`f2c83bd202`](https://github.com/nodejs/node/commit/f2c83bd202)] - **timers**: remove unused Timer.setRepeat() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) -* [[`e11fc67225`](https://github.com/nodejs/node/commit/e11fc67225)] - **(SEMVER-MINOR)** **tls**: add `getTicketKeys()`/`setTicketKeys()` (Fedor Indutny) [#2227](https://github.com/nodejs/node/pull/2227) -* [[`68b06e94e3`](https://github.com/nodejs/node/commit/68b06e94e3)] - **tools**: use local or specified $NODE for test-npm (Jeremiah Senkpiel) [#1984](https://github.com/nodejs/node/pull/1984) -* [[`ab479659c7`](https://github.com/nodejs/node/commit/ab479659c7)] - **util**: delay creation of debug context (Ali Ijaz Sheikh) [#2248](https://github.com/nodejs/node/pull/2248) -* [[`6391f4d2fd`](https://github.com/nodejs/node/commit/6391f4d2fd)] - **util**: removing redundant checks in is* functions (Sakthipriyan Vairamani) [#2179](https://github.com/nodejs/node/pull/2179) -* [[`b148c0dff3`](https://github.com/nodejs/node/commit/b148c0dff3)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) -* [[`f90f1e75bb`](https://github.com/nodejs/node/commit/f90f1e75bb)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.5.0. ## 2015-07-17, Version 2.4.0, @Fishrock123 -### Notable changes - -* **src**: Added a new `--track-heap-objects` flag to track heap object allocations for heap snapshots (Bradley Meck) [#2135](https://github.com/nodejs/node/pull/2135). -* **readline**: Fixed a freeze that affected the repl if the keypress event handler threw (Alex Kocharin) [#2107](https://github.com/nodejs/node/pull/2107). -* **npm**: Upgraded to v2.13.0, release notes can be found in (Forrest L Norvell) [#2152](https://github.com/nodejs/node/pull/2152). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/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/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 - -* [[`f95f9ef6ea`](https://github.com/nodejs/node/commit/f95f9ef6ea)] - **build**: always use prefix=/ for tar-headers (Rod Vagg) [#2082](https://github.com/nodejs/node/pull/2082) -* [[`12bc397207`](https://github.com/nodejs/node/commit/12bc397207)] - **build**: run-ci makefile rule (Alexis Campailla) [#2134](https://github.com/nodejs/node/pull/2134) -* [[`84012c99e0`](https://github.com/nodejs/node/commit/84012c99e0)] - **build**: fix vcbuild merge issues (Alexis Campailla) [#2131](https://github.com/nodejs/node/pull/2131) -* [[`47e2c5c828`](https://github.com/nodejs/node/commit/47e2c5c828)] - **build**: bail early if clean is invoked (Johan Bergström) [#2127](https://github.com/nodejs/node/pull/2127) -* [[`5acad6b163`](https://github.com/nodejs/node/commit/5acad6b163)] - **child_process**: fix arguments comments (Roman Reiss) [#2161](https://github.com/nodejs/node/pull/2161) -* [[`3c4121c418`](https://github.com/nodejs/node/commit/3c4121c418)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`938cc757bb`](https://github.com/nodejs/node/commit/938cc757bb)] - **deps**: upgrade to npm 2.13.0 (Forrest L Norvell) [#2152](https://github.com/nodejs/node/pull/2152) -* [[`6f306e0ed2`](https://github.com/nodejs/node/commit/6f306e0ed2)] - **doc**: add targos as a collaborator (Michaël Zasso) [#2200](https://github.com/nodejs/node/pull/2200) -* [[`c019d9a239`](https://github.com/nodejs/node/commit/c019d9a239)] - **doc**: add thefourtheye as a collaborator (Sakthipriyan Vairamani) [#2199](https://github.com/nodejs/node/pull/2199) -* [[`4e92dbc26b`](https://github.com/nodejs/node/commit/4e92dbc26b)] - **doc**: add TSC members from the combined project (Jeremiah Senkpiel) [#2085](https://github.com/nodejs/node/pull/2085) -* [[`6c3aabf455`](https://github.com/nodejs/node/commit/6c3aabf455)] - **doc**: add TSC meeting minutes 2015-07-08 (Rod Vagg) [#2184](https://github.com/nodejs/node/pull/2184) -* [[`30a0d47d51`](https://github.com/nodejs/node/commit/30a0d47d51)] - **doc**: add TSC meeting minutes 2015-07-01 (Rod Vagg) [#2132](https://github.com/nodejs/node/pull/2132) -* [[`23efb05cc3`](https://github.com/nodejs/node/commit/23efb05cc3)] - **doc**: document fs.watchFile behaviour on ENOENT (Brendan Ashworth) [#2093](https://github.com/nodejs/node/pull/2093) -* [[`65963ec26f`](https://github.com/nodejs/node/commit/65963ec26f)] - **doc,test**: empty strings in path module (Sakthipriyan Vairamani) [#2106](https://github.com/nodejs/node/pull/2106) -* [[`0ab81e6f58`](https://github.com/nodejs/node/commit/0ab81e6f58)] - **docs**: link to more up-to-date v8 docs (Jeremiah Senkpiel) [#2196](https://github.com/nodejs/node/pull/2196) -* [[`1afc0c9e86`](https://github.com/nodejs/node/commit/1afc0c9e86)] - **fs**: fix error on bad listener type (Brendan Ashworth) [#2093](https://github.com/nodejs/node/pull/2093) -* [[`2ba84606a6`](https://github.com/nodejs/node/commit/2ba84606a6)] - **path**: assert path.join() arguments equally (Phillip Johnsen) [#2159](https://github.com/nodejs/node/pull/2159) -* [[`bd01603201`](https://github.com/nodejs/node/commit/bd01603201)] - **readline**: fix freeze if `keypress` event throws (Alex Kocharin) [#2107](https://github.com/nodejs/node/pull/2107) -* [[`59f6b5da2a`](https://github.com/nodejs/node/commit/59f6b5da2a)] - **repl**: Prevent crash when tab-completed with Proxy (Sakthipriyan Vairamani) [#2120](https://github.com/nodejs/node/pull/2120) -* [[`cf14a2427c`](https://github.com/nodejs/node/commit/cf14a2427c)] - **(SEMVER-MINOR)** **src**: add --track-heap-objects (Bradley Meck) [#2135](https://github.com/nodejs/node/pull/2135) -* [[`2b4b600660`](https://github.com/nodejs/node/commit/2b4b600660)] - **test**: fix test-debug-port-from-cmdline (João Reis) [#2186](https://github.com/nodejs/node/pull/2186) -* [[`d4ceb16da2`](https://github.com/nodejs/node/commit/d4ceb16da2)] - **test**: properly clean up temp directory (Roman Reiss) [#2164](https://github.com/nodejs/node/pull/2164) -* [[`842eb5b853`](https://github.com/nodejs/node/commit/842eb5b853)] - **test**: add test for dgram.setTTL (Evan Lucas) [#2121](https://github.com/nodejs/node/pull/2121) -* [[`cff7300a57`](https://github.com/nodejs/node/commit/cff7300a57)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.4.0. ## 2015-07-09, Version 2.3.4, @Fishrock123 -### Notable changes - -* **openssl**: Upgrade to 1.0.2d, fixes CVE-2015-1793 (Alternate Chains Certificate Forgery) (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141). -* **npm**: Upgraded to v2.12.1, release notes can be found in and (Kat Marchán) [#2112](https://github.com/nodejs/node/pull/2112). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/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/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 - -* [[`0d15161c24`](https://github.com/nodejs/node/commit/0d15161c24)] - **benchmark**: Add some path benchmarks for #1778 (Nathan Woltman) [#1778](https://github.com/nodejs/node/pull/1778) -* [[`c70e68fa32`](https://github.com/nodejs/node/commit/c70e68fa32)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) -* [[`ca93f7f2e6`](https://github.com/nodejs/node/commit/ca93f7f2e6)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) -* [[`b18c841ec1`](https://github.com/nodejs/node/commit/b18c841ec1)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`863cdbdd08`](https://github.com/nodejs/node/commit/863cdbdd08)] - **deps**: upgrade to npm 2.12.1 (Kat Marchán) [#2112](https://github.com/nodejs/node/pull/2112) -* [[`84b3915764`](https://github.com/nodejs/node/commit/84b3915764)] - **doc**: document current release procedure (Rod Vagg) [#2099](https://github.com/nodejs/node/pull/2099) -* [[`46140334cd`](https://github.com/nodejs/node/commit/46140334cd)] - **doc**: update AUTHORS list (Rod Vagg) [#2100](https://github.com/nodejs/node/pull/2100) -* [[`bca53dce76`](https://github.com/nodejs/node/commit/bca53dce76)] - **path**: refactor for performance and consistency (Nathan Woltman) [#1778](https://github.com/nodejs/node/pull/1778) -* [[`6bef15afe7`](https://github.com/nodejs/node/commit/6bef15afe7)] - **src**: remove traceSyncIO property from process (Bradley Meck) [#2143](https://github.com/nodejs/node/pull/2143) -* [[`2ba1740ba1`](https://github.com/nodejs/node/commit/2ba1740ba1)] - **test**: add missing crypto checks (Johan Bergström) [#2129](https://github.com/nodejs/node/pull/2129) -* [[`180fd392ca`](https://github.com/nodejs/node/commit/180fd392ca)] - **test**: refactor test-repl-tab-complete (Sakthipriyan Vairamani) [#2122](https://github.com/nodejs/node/pull/2122) -* [[`fb05c8e27d`](https://github.com/nodejs/node/commit/fb05c8e27d)] - ***Revert*** "**test**: add test for missing `close`/`finish` event" (Fedor Indutny) -* [[`9436a860cb`](https://github.com/nodejs/node/commit/9436a860cb)] - **test**: add test for missing `close`/`finish` event (Mark Plomer) [iojs/io.js#1373](https://github.com/iojs/io.js/pull/1373) -* [[`ee3ce2ed88`](https://github.com/nodejs/node/commit/ee3ce2ed88)] - **tools**: install gdbinit from v8 to $PREFIX/share (Ali Ijaz Sheikh) [#2123](https://github.com/nodejs/node/pull/2123) -* [[`dd523c75da`](https://github.com/nodejs/node/commit/dd523c75da)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.3.4. ## 2015-07-09, Version 1.8.4, @Fishrock123 -**Maintenance release** - -### Notable changes - -* **openssl**: Upgrade to 1.0.2d, fixes CVE-2015-1793 (Alternate Chains Certificate Forgery) [#2141](https://github.com/nodejs/node/pull/2141). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`52b1230628`](https://github.com/nodejs/node/commit/52b1230628)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) -* [[`20ff1e2ecb`](https://github.com/nodejs/node/commit/20ff1e2ecb)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) +Moved to doc/changelogs/CHANGELOG_IOJS.md#1.8.4. ## 2015-07-09, Version 0.12.7 (Stable) -### Commits - -* [[`0cf9f27703`](https://github.com/nodejs/node/commit/0cf9f27703)] - **deps**: upgrade openssl sources to 1.0.1p [#25654](https://github.com/joyent/node/pull/25654) -* [[`8917e430b8`](https://github.com/nodejs/node/commit/8917e430b8)] - **deps**: upgrade to npm 2.11.3 [#25545](https://github.com/joyent/node/pull/25545) -* [[`88a27a9621`](https://github.com/nodejs/node/commit/88a27a9621)] - **V8**: cherry-pick JitCodeEvent patch from upstream (Ben Noordhuis) [#25589](https://github.com/joyent/node/pull/25589) -* [[`18d413d299`](https://github.com/nodejs/node/commit/18d413d299)] - **win,msi**: create npm folder in AppData directory (Steven Rockarts) [#8838](https://github.com/joyent/node/pull/8838) - -## 2015-07-09, Version 0.10.40 (Maintenance) - -### Commits - -* [[`0cf9f27703`](https://github.com/nodejs/node/commit/0cf9f27703)] - **openssl**: upgrade to 1.0.1p [#25654](https://github.com/joyent/node/pull/25654) -* [[`5a60e0d904`](https://github.com/nodejs/node/commit/5a60e0d904)] - **V8**: back-port JitCodeEvent patch from upstream (Ben Noordhuis) [#25588](https://github.com/joyent/node/pull/25588) -* [[`18d413d299`](https://github.com/nodejs/node/commit/18d413d299)] - **win,msi**: create npm folder in AppData directory (Steven Rockarts) [#8838](https://github.com/joyent/node/pull/8838) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.7. ## 2015-07-04, Version 2.3.3, @Fishrock123 -### Notable changes - -* **deps**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack. - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/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/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 - -* [[`030f8045c7`](https://github.com/nodejs/node/commit/030f8045c7)] - **deps**: fix out-of-band write in utf8 decoder (Fedor Indutny) -* [[`0f09b8db28`](https://github.com/nodejs/node/commit/0f09b8db28)] - **doc**: don't recommend domains for error handling (Benjamin Gruenbaum) [#2056](https://github.com/nodejs/node/pull/2056) -* [[`9cd44bb2b6`](https://github.com/nodejs/node/commit/9cd44bb2b6)] - **util**: prepend '(node) ' to deprecation messages (Sakthipriyan Vairamani) [#1892](https://github.com/nodejs/node/pull/1892) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.3.3. ## 2015-07-04, Version 1.8.3, @rvagg -**Maintenance release** - -## Notable changes - -* **v8**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack. -* **openssl**: Upgrade to 1.0.2b and 1.0.2c, introduces DHE man-in-the-middle protection (Logjam) and fixes malformed ECParameters causing infinite loop (CVE-2015-1788). See the [security advisory](https://www.openssl.org/news/secadv_20150611.txt) for full details. (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) [#1958](https://github.com/nodejs/node/pull/1958) -* **build**: - - Added support for compiling with Microsoft Visual C++ 2015 - - Started building and distributing headers-only tarballs along with binaries - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`d8f260d33b`](https://github.com/nodejs/node/commit/d8f260d33b)] - **build**: add tar-headers target for headers-only tar (Rod Vagg) [#1975](https://github.com/nodejs/node/pull/1975) -* [[`00ba429674`](https://github.com/nodejs/node/commit/00ba429674)] - **build**: update build targets for io.js (Rod Vagg) [#1938](https://github.com/nodejs/node/pull/1938) -* [[`39e2207ff1`](https://github.com/nodejs/node/commit/39e2207ff1)] - **build**: fix cherry-pick ooops, fix comment wording (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) -* [[`561919a67a`](https://github.com/nodejs/node/commit/561919a67a)] - **build**: add MSVS 2015 support (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) -* [[`8e1134c04c`](https://github.com/nodejs/node/commit/8e1134c04c)] - **build**: remove lint from test-ci on windows (Johan Bergström) [#2004](https://github.com/nodejs/node/pull/2004) -* [[`e52e99085e`](https://github.com/nodejs/node/commit/e52e99085e)] - **build**: don't run lint from test-ci (Johan Bergström) [#1965](https://github.com/nodejs/node/pull/1965) -* [[`c5d1ec7fea`](https://github.com/nodejs/node/commit/c5d1ec7fea)] - **build**: simplify execution of built binary (Johan Bergström) [#1955](https://github.com/nodejs/node/pull/1955) -* [[`2ce147551a`](https://github.com/nodejs/node/commit/2ce147551a)] - **build,win**: set env before generating projects (Alexis Campailla) [joyent/node#20109](https://github.com/joyent/node/pull/20109) -* [[`78de5f85f2`](https://github.com/nodejs/node/commit/78de5f85f2)] - **deps**: fix out-of-band write in utf8 decoder (Ben Noordhuis) -* [[`83ee07b6be`](https://github.com/nodejs/node/commit/83ee07b6be)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#2016](https://github.com/nodejs/node/pull/2016) -* [[`a97125520d`](https://github.com/nodejs/node/commit/a97125520d)] - **deps**: update UPGRADING.md doc to openssl-1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`0e2d068e0b`](https://github.com/nodejs/node/commit/0e2d068e0b)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`310b8d1120`](https://github.com/nodejs/node/commit/310b8d1120)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`a472946747`](https://github.com/nodejs/node/commit/a472946747)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`b2467e3ebf`](https://github.com/nodejs/node/commit/b2467e3ebf)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`e548abb800`](https://github.com/nodejs/node/commit/e548abb800)] - **deps**: upgrade openssl sources to 1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`1feaa68e85`](https://github.com/nodejs/node/commit/1feaa68e85)] - **deps**: update asm files for openssl-1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`151720fae7`](https://github.com/nodejs/node/commit/151720fae7)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`139da6a02a`](https://github.com/nodejs/node/commit/139da6a02a)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`283642827a`](https://github.com/nodejs/node/commit/283642827a)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`d593b552de`](https://github.com/nodejs/node/commit/d593b552de)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`2a3367a4bd`](https://github.com/nodejs/node/commit/2a3367a4bd)] - **deps**: upgrade openssl sources to 1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`5c29c0c519`](https://github.com/nodejs/node/commit/5c29c0c519)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`2cd7f73d9f`](https://github.com/nodejs/node/commit/2cd7f73d9f)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) -* [[`c65484a74d`](https://github.com/nodejs/node/commit/c65484a74d)] - **tls**: make server not use DHE in less than 1024bits (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739) -* [[`77f518403f`](https://github.com/nodejs/node/commit/77f518403f)] - **win,node-gyp**: make delay-load hook C89 compliant (Sharat M R) [TooTallNate/node-gyp#616](https://github.com/TooTallNa +Moved to doc/changelogs/CHANGELOG_IOJS.md#1.8.3. ## 2015-07-03, Version 0.12.6 (Stable) -### Notable changes - -* **deps**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack. - -### Commits - -* [[`78b0e30954`](https://github.com/nodejs/node/commit/78b0e30954)] - **deps**: fix out-of-band write in utf8 decoder (Fedor Indutny) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.6. ## 2015-07-01, Version 2.3.2, @rvagg -### Notable changes - -* **build**: - - Added support for compiling with Microsoft Visual C++ 2015 - - Started building and distributing headers-only tarballs along with binaries - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`9180140231`](https://github.com/nodejs/node/commit/9180140231)] - **_stream_wrap**: prevent use after free in TLS (Fedor Indutny) [#1910](https://github.com/nodejs/node/pull/1910) -* [[`05a73c0f25`](https://github.com/nodejs/node/commit/05a73c0f25)] - **benchmark**: make concurrent requests configurable (Rich Trott) [#2068](https://github.com/nodejs/node/pull/2068) -* [[`f52d73352e`](https://github.com/nodejs/node/commit/f52d73352e)] - **benchmark**: fix typo in README (Rich Trott) [#2067](https://github.com/nodejs/node/pull/2067) -* [[`1cd9eeb556`](https://github.com/nodejs/node/commit/1cd9eeb556)] - **buffer**: prevent abort on bad proto (Trevor Norris) [#2012](https://github.com/nodejs/node/pull/2012) -* [[`8350f3a3a2`](https://github.com/nodejs/node/commit/8350f3a3a2)] - **buffer**: optimize Buffer#toString() (Ben Noordhuis) [#2027](https://github.com/nodejs/node/pull/2027) -* [[`628a3ab093`](https://github.com/nodejs/node/commit/628a3ab093)] - **build**: add tar-headers target for headers-only tar (Rod Vagg) [#1975](https://github.com/nodejs/node/pull/1975) -* [[`dcbb9e1da6`](https://github.com/nodejs/node/commit/dcbb9e1da6)] - **build**: update build targets for io.js (Rod Vagg) [#1938](https://github.com/nodejs/node/pull/1938) -* [[`c87c34c242`](https://github.com/nodejs/node/commit/c87c34c242)] - **build**: fix cherry-pick ooops, fix comment wording (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) -* [[`4208dc4fef`](https://github.com/nodejs/node/commit/4208dc4fef)] - **build**: add MSVS 2015 support (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) -* [[`834a365113`](https://github.com/nodejs/node/commit/834a365113)] - **build**: DTrace is enabled by default on darwin (Evan Lucas) [#2019](https://github.com/nodejs/node/pull/2019) -* [[`c0c0d73269`](https://github.com/nodejs/node/commit/c0c0d73269)] - **build,win**: set env before generating projects (Alexis Campailla) [joyent/node#20109](https://github.com/joyent/node/pull/20109) -* [[`9e890fe8b4`](https://github.com/nodejs/node/commit/9e890fe8b4)] - **crypto**: fix VerifyCallback in case of verify error (Shigeki Ohtsu) [#2064](https://github.com/nodejs/node/pull/2064) -* [[`1f371e3988`](https://github.com/nodejs/node/commit/1f371e3988)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#2016](https://github.com/nodejs/node/pull/2016) -* [[`c370bd3aea`](https://github.com/nodejs/node/commit/c370bd3aea)] - **doc**: make the abbreviation 1MM clear (Ivan Yan) [#2053](https://github.com/nodejs/node/pull/2053) -* [[`54d5437566`](https://github.com/nodejs/node/commit/54d5437566)] - **doc**: Added sample command to test iojs build (Jimmy Hsu) [#850](https://github.com/nodejs/node/pull/850) -* [[`f1f1b7e597`](https://github.com/nodejs/node/commit/f1f1b7e597)] - **doc**: add TSC meeting minutes 2015-06-17 (Rod Vagg) [#2048](https://github.com/nodejs/node/pull/2048) -* [[`dbd5dc932d`](https://github.com/nodejs/node/commit/dbd5dc932d)] - **doc**: clarify prerequisites in benchmark/README.md (Jeremiah Senkpiel) [#2034](https://github.com/nodejs/node/pull/2034) -* [[`50dbc8e143`](https://github.com/nodejs/node/commit/50dbc8e143)] - **doc**: add TSC meeting minutes 2015-05-27 (Rod Vagg) [#2037](https://github.com/nodejs/node/pull/2037) -* [[`941ad362a7`](https://github.com/nodejs/node/commit/941ad362a7)] - **doc**: archive io.js TC minutes (Rod Vagg) -* [[`644b2eaa89`](https://github.com/nodejs/node/commit/644b2eaa89)] - **doc**: rename tc-meetings to tsc-meetings (Rod Vagg) -* [[`1330ee3b27`](https://github.com/nodejs/node/commit/1330ee3b27)] - **doc**: add TC meeting 2015-05-13 minutes (Rod Vagg) [#1700](https://github.com/nodejs/node/pull/1700) -* [[`392e8fd64e`](https://github.com/nodejs/node/commit/392e8fd64e)] - **doc**: add @shigeki and @mscdex to TC (Rod Vagg) [#2008](https://github.com/nodejs/node/pull/2008) -* [[`af249fa8a1`](https://github.com/nodejs/node/commit/af249fa8a1)] - **net**: wrap connect in nextTick (Evan Lucas) [#2054](https://github.com/nodejs/node/pull/2054) -* [[`7f63449fde`](https://github.com/nodejs/node/commit/7f63449fde)] - **net**: fix debug for dnsopts (Evan Lucas) [#2059](https://github.com/nodejs/node/pull/2059) -* [[`eabed2f518`](https://github.com/nodejs/node/commit/eabed2f518)] - **repl**: remove obsolete TODO (Rich Trott) [#2081](https://github.com/nodejs/node/pull/2081) -* [[`a198c68b56`](https://github.com/nodejs/node/commit/a198c68b56)] - **repl**: make 'Unexpected token' errors recoverable (Julien Gilli) [#2052](https://github.com/nodejs/node/pull/2052) -* [[`d735b2c6ef`](https://github.com/nodejs/node/commit/d735b2c6ef)] - **repl**: fix tab completion for a non-global context (Sangmin Yoon) [#2052](https://github.com/nodejs/node/pull/2052) -* [[`8cee8f54fc`](https://github.com/nodejs/node/commit/8cee8f54fc)] - **src**: nix stdin _readableState.reading manipulation (Chris Dickinson) [#454](https://github.com/nodejs/node/pull/454) -* [[`856c11f8c8`](https://github.com/nodejs/node/commit/856c11f8c8)] - **test**: purge stale disabled tests (Rich Trott) [#2045](https://github.com/nodejs/node/pull/2045) -* [[`4d5089e181`](https://github.com/nodejs/node/commit/4d5089e181)] - **test**: do not swallow OpenSSL support error (Rich Trott) [#2042](https://github.com/nodejs/node/pull/2042) -* [[`06721fe005`](https://github.com/nodejs/node/commit/06721fe005)] - **test**: fix test-repl-tab-complete.js (cjihrig) [#2052](https://github.com/nodejs/node/pull/2052) -* [[`8e9089ac35`](https://github.com/nodejs/node/commit/8e9089ac35)] - **test**: check for error on Windows (Rich Trott) [#2035](https://github.com/nodejs/node/pull/2035) -* [[`776a65ebcd`](https://github.com/nodejs/node/commit/776a65ebcd)] - **test**: remove obsolete TODO comments (Rich Trott) [#2033](https://github.com/nodejs/node/pull/2033) -* [[`bdfeb798ad`](https://github.com/nodejs/node/commit/bdfeb798ad)] - **test**: remove obsolete TODO comments (Rich Trott) [#2032](https://github.com/nodejs/node/pull/2032) -* [[`58e914f9bc`](https://github.com/nodejs/node/commit/58e914f9bc)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325) -* [[`99cbbc0a13`](https://github.com/nodejs/node/commit/99cbbc0a13)] - **tools**: update gyp to 25ed9ac (Ben Noordhuis) [#2074](https://github.com/nodejs/node/pull/2074) -* [[`e3f9335c40`](https://github.com/nodejs/node/commit/e3f9335c40)] - **tools**: re-enable comma-spacing linter rule (Roman Reiss) [#2072](https://github.com/nodejs/node/pull/2072) -* [[`d91e10b3bd`](https://github.com/nodejs/node/commit/d91e10b3bd)] - **tools**: update eslint to 0.24.0 (Roman Reiss) [#2072](https://github.com/nodejs/node/pull/2072) -* [[`6c61ca5325`](https://github.com/nodejs/node/commit/6c61ca5325)] - **url**: fix typo in comment (Rich Trott) [#2071](https://github.com/nodejs/node/pull/2071) -* [[`1a51f0058c`](https://github.com/nodejs/node/commit/1a51f0058c)] - **v8**: cherry-pick JitCodeEvent patch from upstream (Ben Noordhuis) [#2075](https://github.com/nodejs/node/pull/2075) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.3.2. ## 2015-06-23, Version 2.3.1, @rvagg -### Notable changes - -* **module**: The number of syscalls made during a `require()` have been significantly reduced again (see [#1801](https://github.com/nodejs/node/pull/1801) from v2.2.0 for previous work), which should lead to a performance improvement (Pierre Inglebert) [#1920](https://github.com/nodejs/node/pull/1920). -* **npm**: - * Upgrade to [v2.11.2](https://github.com/npm/npm/releases/tag/v2.11.2) (Rebecca Turner) [#1956](https://github.com/nodejs/node/pull/1956). - * Upgrade to [v2.11.3](https://github.com/npm/npm/releases/tag/v2.11.3) (Forrest L Norvell) [#2018](https://github.com/nodejs/node/pull/2018). -* **zlib**: A bug was discovered where the process would abort if the final part of a zlib decompression results in a buffer that would exceed the maximum length of `0x3fffffff` bytes (~1GiB). This was likely to only occur during buffered decompression (rather than streaming). This is now fixed and will instead result in a thrown `RangeError` (Michaël Zasso) [#1811](https://github.com/nodejs/node/pull/1811). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`e56758a5e0`](https://github.com/nodejs/node/commit/e56758a5e0)] - **async-wrap**: add provider id and object info cb (Trevor Norris) [#1896](https://github.com/nodejs/node/pull/1896) -* [[`d5637e67c9`](https://github.com/nodejs/node/commit/d5637e67c9)] - **buffer**: fix cyclic dependency with util (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) -* [[`c5353d7c62`](https://github.com/nodejs/node/commit/c5353d7c62)] - **build**: remove lint from test-ci on windows (Johan Bergström) [#2004](https://github.com/nodejs/node/pull/2004) -* [[`c207e8d223`](https://github.com/nodejs/node/commit/c207e8d223)] - **build**: fix pkg-config output parsing in configure (Ben Noordhuis) [#1986](https://github.com/nodejs/node/pull/1986) -* [[`8d8a26e8f7`](https://github.com/nodejs/node/commit/8d8a26e8f7)] - **build**: don't run lint from test-ci (Johan Bergström) [#1965](https://github.com/nodejs/node/pull/1965) -* [[`1ec53c044d`](https://github.com/nodejs/node/commit/1ec53c044d)] - **build**: simplify execution of built binary (Johan Bergström) [#1955](https://github.com/nodejs/node/pull/1955) -* [[`3beb880716`](https://github.com/nodejs/node/commit/3beb880716)] - **crypto**: add cert check to CNNIC Whitelist (Shigeki Ohtsu) [#1895](https://github.com/nodejs/node/pull/1895) -* [[`48c0fb8b1a`](https://github.com/nodejs/node/commit/48c0fb8b1a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`6a359b1ce9`](https://github.com/nodejs/node/commit/6a359b1ce9)] - **deps**: upgrade to npm 2.11.3 (Forrest L Norvell) [#2018](https://github.com/nodejs/node/pull/2018) -* [[`6aab2f3b9a`](https://github.com/nodejs/node/commit/6aab2f3b9a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`3e12561b55`](https://github.com/nodejs/node/commit/3e12561b55)] - **deps**: upgrade to npm 2.11.2 (Rebecca Turner) [#1956](https://github.com/nodejs/node/pull/1956) -* [[`8ac50819b6`](https://github.com/nodejs/node/commit/8ac50819b6)] - **doc**: add security section to README.md (Rod Vagg) [#1948](https://github.com/nodejs/node/pull/1948) -* [[`1f93b63b11`](https://github.com/nodejs/node/commit/1f93b63b11)] - **doc**: change the info to the same as in gitconfig (Christian Tellnes) [#2000](https://github.com/nodejs/node/pull/2000) -* [[`0cf94e6856`](https://github.com/nodejs/node/commit/0cf94e6856)] - **doc**: mention CI in Collaborator Guide (Rich Trott) [#1995](https://github.com/nodejs/node/pull/1995) -* [[`7a3006efe4`](https://github.com/nodejs/node/commit/7a3006efe4)] - **doc**: add TOC links to Collaborator Guide (Rich Trott) [#1994](https://github.com/nodejs/node/pull/1994) -* [[`30638b150f`](https://github.com/nodejs/node/commit/30638b150f)] - **doc**: add TSC meeting notes 2015-06-10 (Bert Belder) [#1943](https://github.com/nodejs/node/pull/1943) -* [[`c4ec04136b`](https://github.com/nodejs/node/commit/c4ec04136b)] - **doc**: reformat authors section (Johan Bergström) [#1966](https://github.com/nodejs/node/pull/1966) -* [[`96165f9be2`](https://github.com/nodejs/node/commit/96165f9be2)] - **doc**: minor clarification in the modules API doc. (Сковорода Никита Андреевич) [#1983](https://github.com/nodejs/node/pull/1983) -* [[`5c2707c1b2`](https://github.com/nodejs/node/commit/5c2707c1b2)] - **doc**: benchmark/README.md copyedit (Rich Trott) [#1970](https://github.com/nodejs/node/pull/1970) -* [[`74fdf732d0`](https://github.com/nodejs/node/commit/74fdf732d0)] - **doc**: copyedit COLLABORATOR_GUIDE.md (Rich Trott) [#1964](https://github.com/nodejs/node/pull/1964) -* [[`5fe6e83640`](https://github.com/nodejs/node/commit/5fe6e83640)] - **doc**: copyedit GOVERNANCE.md (Rich Trott) [#1963](https://github.com/nodejs/node/pull/1963) -* [[`428526544c`](https://github.com/nodejs/node/commit/428526544c)] - **doc**: add ChALkeR as collaborator (Сковорода Никита Андреевич) [#1927](https://github.com/nodejs/node/pull/1927) -* [[`5dfe0d5d61`](https://github.com/nodejs/node/commit/5dfe0d5d61)] - **doc**: remove irrelevant SEMVER-MINOR & MAJOR (Rod Vagg) -* [[`fb8811d95e`](https://github.com/nodejs/node/commit/fb8811d95e)] - **lib,test**: fix whitespace issues (Roman Reiss) [#1971](https://github.com/nodejs/node/pull/1971) -* [[`a4f4909f3d`](https://github.com/nodejs/node/commit/a4f4909f3d)] - **module**: fix stat with long paths on Windows (Michaël Zasso) [#2013](https://github.com/nodejs/node/pull/2013) -* [[`a71ee93afe`](https://github.com/nodejs/node/commit/a71ee93afe)] - **module**: reduce syscalls during require search (Pierre Inglebert) [#1920](https://github.com/nodejs/node/pull/1920) -* [[`671e64ac73`](https://github.com/nodejs/node/commit/671e64ac73)] - **module**: allow long paths for require on Windows (Michaël Zasso) -* [[`061342a500`](https://github.com/nodejs/node/commit/061342a500)] - **net**: Defer reading until listeners could be added (James Hartig) [#1496](https://github.com/nodejs/node/pull/1496) -* [[`5d2b846d11`](https://github.com/nodejs/node/commit/5d2b846d11)] - **test**: assert tmp and fixture dirs different (Rich Trott) [#2015](https://github.com/nodejs/node/pull/2015) -* [[`b0990ef45d`](https://github.com/nodejs/node/commit/b0990ef45d)] - **test**: confirm symlink (Rich Trott) [#2014](https://github.com/nodejs/node/pull/2014) -* [[`3ba4f71fc4`](https://github.com/nodejs/node/commit/3ba4f71fc4)] - **test**: check result as early as possible (Rich Trott) [#2007](https://github.com/nodejs/node/pull/2007) -* [[`0abcf44d6b`](https://github.com/nodejs/node/commit/0abcf44d6b)] - **test**: add Buffer slice UTF-8 test (Rich Trott) [#1989](https://github.com/nodejs/node/pull/1989) -* [[`88c1831ff4`](https://github.com/nodejs/node/commit/88c1831ff4)] - **test**: tmpdir creation failures should fail tests (Rich Trott) [#1976](https://github.com/nodejs/node/pull/1976) -* [[`52a822d944`](https://github.com/nodejs/node/commit/52a822d944)] - **test**: fix test-cluster-worker-disconnect (Santiago Gimeno) [#1919](https://github.com/nodejs/node/pull/1919) -* [[`7c79490bfb`](https://github.com/nodejs/node/commit/7c79490bfb)] - **test**: only refresh tmpDir for tests that need it (Rich Trott) [#1954](https://github.com/nodejs/node/pull/1954) -* [[`88d7904c0b`](https://github.com/nodejs/node/commit/88d7904c0b)] - **test**: remove test repetition (Rich Trott) [#1874](https://github.com/nodejs/node/pull/1874) -* [[`91dfb5e094`](https://github.com/nodejs/node/commit/91dfb5e094)] - **tools**: make test-npm work without global npm (Jeremiah Senkpiel) [#1926](https://github.com/nodejs/node/pull/1926) -* [[`3777f41562`](https://github.com/nodejs/node/commit/3777f41562)] - **tools**: enable whitespace related rules in eslint (Roman Reiss) [#1971](https://github.com/nodejs/node/pull/1971) -* [[`626432d843`](https://github.com/nodejs/node/commit/626432d843)] - **util**: dont repeat isBuffer (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) -* [[`1d79f572f1`](https://github.com/nodejs/node/commit/1d79f572f1)] - **util**: move deprecate() to internal module (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) -* [[`4b4b1760b5`](https://github.com/nodejs/node/commit/4b4b1760b5)] - **v8**: cherry-pick uclibc build patch from upstream (Ben Noordhuis) [#1974](https://github.com/nodejs/node/pull/1974) -* [[`5d0cee46bb`](https://github.com/nodejs/node/commit/5d0cee46bb)] - **vm**: remove unnecessary HandleScopes (Ben Noordhuis) [#2001](https://github.com/nodejs/node/pull/2001) -* [[`0ecf9457b5`](https://github.com/nodejs/node/commit/0ecf9457b5)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) -* [[`953b3e75e8`](https://github.com/nodejs/node/commit/953b3e75e8)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) -* [[`3806d875d3`](https://github.com/nodejs/node/commit/3806d875d3)] - **zlib**: prevent uncaught exception in zlibBuffer (Michaël Zasso) [#1811](https://github.com/nodejs/node/pull/1811) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.3.1. ## 2015-06-22, Version 0.12.5 (Stable) -### Commits - -* [[`456c22f63f`](https://github.com/nodejs/node/commit/456c22f63f)] - **openssl**: upgrade to 1.0.1o (Addressing multiple CVEs) [#25523](https://github.com/joyent/node/pull/25523) -* [[`20d8db1a42`](https://github.com/nodejs/node/commit/20d8db1a42)] - **npm**: upgrade to 2.11.2 [#25517](https://github.com/joyent/node/pull/25517) -* [[`50f961596d`](https://github.com/nodejs/node/commit/50f961596d)] - **uv**: upgrade to 1.6.1 [#25475](https://github.com/joyent/node/pull/25475) -* [[`b81a643f9a`](https://github.com/nodejs/node/commit/b81a643f9a)] - **V8**: avoid deadlock when profiling is active (Dmitri Melikyan) [#25309](https://github.com/joyent/node/pull/25309) -* [[`9d19dfbfdb`](https://github.com/nodejs/node/commit/9d19dfbfdb)] - **install**: fix source path for openssl headers (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) -* [[`4028669531`](https://github.com/nodejs/node/commit/4028669531)] - **install**: make sure opensslconf.h is overwritten (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) -* [[`d38e865fce`](https://github.com/nodejs/node/commit/d38e865fce)] - **timers**: fix timeout when added in timer's callback (Julien Gilli) [#17203](https://github.com/joyent/node/pull/17203) -* [[`e7c84f82c7`](https://github.com/nodejs/node/commit/e7c84f82c7)] - **windows**: broadcast WM_SETTINGCHANGE after install (Mathias Küsel) [#25100](https://github.com/joyent/node/pull/25100) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.5. ## 2015-06-18, Version 0.10.39 (Maintenance) -### Commits - -* [[`456c22f63f`](https://github.com/nodejs/node/commit/456c22f63f)] - **openssl**: upgrade to 1.0.1o (Addressing multiple CVEs) [#25523](https://github.com/joyent/node/pull/25523) -* [[`9d19dfbfdb`](https://github.com/nodejs/node/commit/9d19dfbfdb)] - **install**: fix source path for openssl headers (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) -* [[`4028669531`](https://github.com/nodejs/node/commit/4028669531)] - **install**: make sure opensslconf.h is overwritten (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) -* [[`d38e865fce`](https://github.com/nodejs/node/commit/d38e865fce)] - **timers**: fix timeout when added in timer's callback (Julien Gilli) [#17203](https://github.com/joyent/node/pull/17203) -* [[`e7c84f82c7`](https://github.com/nodejs/node/commit/e7c84f82c7)] - **windows**: broadcast WM_SETTINGCHANGE after install (Mathias Küsel) [#25100](https://github.com/joyent/node/pull/25100) +Moved to doc/changelogs/CHANGELOG_V010.md#0.10.39. ## 2015-06-13, Version 2.3.0, @rvagg -### Notable changes - -* **libuv**: Upgraded to 1.6.0 and 1.6.1, see [full ChangeLog](https://github.com/libuv/libuv/blob/60e515d9e6f3d86c0eedad583805201f32ea3aed/ChangeLog#L1-L36) for details. (Saúl Ibarra Corretgé) [#1905](https://github.com/nodejs/node/pull/1905) [#1889](https://github.com/nodejs/node/pull/1889). Highlights include: - - Fix TTY becoming blocked on OS X - - Fix UDP send callbacks to not to be synchronous - - Add `uv_os_homedir()` (exposed as `os.homedir()`, see below) -* **npm**: See full [release notes](https://github.com/npm/npm/releases/tag/v2.11.1) for details. (Kat Marchán) [#1899](https://github.com/nodejs/node/pull/1899). Highlight: - - Use GIT_SSH_COMMAND (available as of Git 2.3) -* **openssl**: - - Upgrade to 1.0.2b and 1.0.2c, introduces DHE man-in-the-middle protection (Logjam) and fixes malformed ECParameters causing infinite loop (CVE-2015-1788). See the [security advisory](https://www.openssl.org/news/secadv_20150611.txt) for full details. (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) [#1958](https://github.com/nodejs/node/pull/1958) - - Support [FIPS](https://en.wikipedia.org/wiki/Federal_Information_Processing_Standards) mode of OpenSSL, see [README](https://github.com/nodejs/node#building-iojs-with-fips-compliant-openssl) for instructions. (Fedor Indutny) [#1890](https://github.com/nodejs/node/pull/1890) -* **os**: Add `os.homedir()` method. (Colin Ihrig) [#1791](https://github.com/nodejs/node/pull/1791) -* **smalloc**: Deprecate whole module. (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) -* Add new collaborators: - - Alex Kocharin ([@rlidwka](https://github.com/rlidwka)) - - Christopher Monsanto ([@monsanto](https://github.com/monsanto)) - - Ali Ijaz Sheikh ([@ofrobots](https://github.com/ofrobots)) - - Oleg Elifantiev ([@Olegas](https://github.com/Olegas)) - - Domenic Denicola ([@domenic](https://github.com/domenic)) - - Rich Trott ([@Trott](https://github.com/Trott)) - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`9c0a1b8cfc`](https://github.com/nodejs/node/commit/9c0a1b8cfc)] - **cluster**: wait on servers closing before disconnect (Oleg Elifantiev) [#1400](https://github.com/nodejs/node/pull/1400) -* [[`0f68377f69`](https://github.com/nodejs/node/commit/0f68377f69)] - **crypto**: support FIPS mode of OpenSSL (Fedor Indutny) [#1890](https://github.com/nodejs/node/pull/1890) -* [[`38d1afc24d`](https://github.com/nodejs/node/commit/38d1afc24d)] - **(SEMVER-MINOR)** **crypto**: add getCurves() to get supported ECs (Brian White) [#1914](https://github.com/nodejs/node/pull/1914) -* [[`a4dbf45b59`](https://github.com/nodejs/node/commit/a4dbf45b59)] - **crypto**: update root certificates (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) -* [[`81029c639a`](https://github.com/nodejs/node/commit/81029c639a)] - **debugger**: improve ESRCH error message (Jackson Tian) [#1863](https://github.com/nodejs/node/pull/1863) -* [[`2a7fd0ad32`](https://github.com/nodejs/node/commit/2a7fd0ad32)] - **deps**: update UPGRADING.md doc to openssl-1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`6b3df929e0`](https://github.com/nodejs/node/commit/6b3df929e0)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`664a659696`](https://github.com/nodejs/node/commit/664a659696)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`42a8de2ac6`](https://github.com/nodejs/node/commit/42a8de2ac6)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`c66c3d9fa3`](https://github.com/nodejs/node/commit/c66c3d9fa3)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`86737cf0a0`](https://github.com/nodejs/node/commit/86737cf0a0)] - **deps**: upgrade openssl sources to 1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) -* [[`94804969b7`](https://github.com/nodejs/node/commit/94804969b7)] - **deps**: update asm files for openssl-1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`38444915e0`](https://github.com/nodejs/node/commit/38444915e0)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`f62b613252`](https://github.com/nodejs/node/commit/f62b613252)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`f624d0122c`](https://github.com/nodejs/node/commit/f624d0122c)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`dcd67cc8d7`](https://github.com/nodejs/node/commit/dcd67cc8d7)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`c21b24decf`](https://github.com/nodejs/node/commit/c21b24decf)] - **deps**: upgrade openssl sources to 1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) -* [[`2dc819b09a`](https://github.com/nodejs/node/commit/2dc819b09a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`f41b7f12b5`](https://github.com/nodejs/node/commit/f41b7f12b5)] - **deps**: upgrade to npm 2.11.1 (Kat Marchán) [#1899](https://github.com/nodejs/node/pull/1899) -* [[`a5bd466440`](https://github.com/nodejs/node/commit/a5bd466440)] - **deps**: update libuv to version 1.6.1 (Saúl Ibarra Corretgé) [#1905](https://github.com/nodejs/node/pull/1905) -* [[`aa33db3238`](https://github.com/nodejs/node/commit/aa33db3238)] - **deps**: update libuv to version 1.6.0 (Saúl Ibarra Corretgé) [#1889](https://github.com/nodejs/node/pull/1889) -* [[`0ee497f0b4`](https://github.com/nodejs/node/commit/0ee497f0b4)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`b5cd2f0986`](https://github.com/nodejs/node/commit/b5cd2f0986)] - **dgram**: partially revert 18d457b (Saúl Ibarra Corretgé) [#1889](https://github.com/nodejs/node/pull/1889) -* [[`a3cc43d0a4`](https://github.com/nodejs/node/commit/a3cc43d0a4)] - **doc**: add Trott as collaborator (Rich Trott) [#1962](https://github.com/nodejs/node/pull/1962) -* [[`cf5020fc02`](https://github.com/nodejs/node/commit/cf5020fc02)] - **doc**: add domenic as collaborator (Domenic Denicola) [#1942](https://github.com/nodejs/node/pull/1942) -* [[`11ed5f31ab`](https://github.com/nodejs/node/commit/11ed5f31ab)] - **doc**: add Olegas as collaborator (Oleg Elifantiev) [#1930](https://github.com/nodejs/node/pull/1930) -* [[`f500e1833b`](https://github.com/nodejs/node/commit/f500e1833b)] - **doc**: add ofrobots as collaborator (Ali Ijaz Sheikh) -* [[`717724611a`](https://github.com/nodejs/node/commit/717724611a)] - **doc**: add monsanto as collaborator (Christopher Monsanto) [#1932](https://github.com/nodejs/node/pull/1932) -* [[`7192b6688c`](https://github.com/nodejs/node/commit/7192b6688c)] - **doc**: add rlidwka as collaborator (Alex Kocharin) [#1929](https://github.com/nodejs/node/pull/1929) -* [[`9f3a03f0d4`](https://github.com/nodejs/node/commit/9f3a03f0d4)] - **doc**: add references to crypto.getCurves() (Roman Reiss) [#1918](https://github.com/nodejs/node/pull/1918) -* [[`ff39ecb914`](https://github.com/nodejs/node/commit/ff39ecb914)] - **doc**: remove comma splice (Rich Trott) [#1900](https://github.com/nodejs/node/pull/1900) -* [[`deb8b87dc9`](https://github.com/nodejs/node/commit/deb8b87dc9)] - **doc**: add note about available ECC curves (Ryan Petschek) [#1913](https://github.com/nodejs/node/pull/1913) -* [[`89a5b9040e`](https://github.com/nodejs/node/commit/89a5b9040e)] - **doc**: fix http.IncomingMessage.socket documentation (Сковорода Никита Андреевич) [#1867](https://github.com/nodejs/node/pull/1867) -* [[`d29034b34b`](https://github.com/nodejs/node/commit/d29034b34b)] - **doc**: adjust changelog to clarify `client` revert (Rod Vagg) [#1859](https://github.com/nodejs/node/pull/1859) -* [[`a79dece8ad`](https://github.com/nodejs/node/commit/a79dece8ad)] - **docs**: add return value for sync fs functions (Tyler Anton) [#1770](https://github.com/nodejs/node/pull/1770) -* [[`1cb72c14c4`](https://github.com/nodejs/node/commit/1cb72c14c4)] - **docs**: delete unused/duplicate css files (Robert Kowalski) [#1770](https://github.com/nodejs/node/pull/1770) -* [[`53a4eb3198`](https://github.com/nodejs/node/commit/53a4eb3198)] - **fs**: make SyncWriteStream non-enumerable (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) -* [[`a011c3243f`](https://github.com/nodejs/node/commit/a011c3243f)] - **fs**: minor refactoring (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) -* [[`8841132f30`](https://github.com/nodejs/node/commit/8841132f30)] - **fs**: remove inStatWatchers and use Map for lookup (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) -* [[`67a11b9bcc`](https://github.com/nodejs/node/commit/67a11b9bcc)] - **fs**: removing unnecessary nullCheckCallNT (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) -* [[`09f2a67bd8`](https://github.com/nodejs/node/commit/09f2a67bd8)] - **fs**: improve error message descriptions (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) -* [[`2dcef83b5f`](https://github.com/nodejs/node/commit/2dcef83b5f)] - **fs**: use `kMaxLength` from binding (Vladimir Kurchatkin) [#1903](https://github.com/nodejs/node/pull/1903) -* [[`353e26e3c7`](https://github.com/nodejs/node/commit/353e26e3c7)] - **(SEMVER-MINOR)** **fs**: Add string encoding option for Stream method (Yosuke Furukawa) [#1845](https://github.com/nodejs/node/pull/1845) -* [[`8357c5084b`](https://github.com/nodejs/node/commit/8357c5084b)] - **fs**: set encoding on fs.createWriteStream (Yosuke Furukawa) [#1844](https://github.com/nodejs/node/pull/1844) -* [[`02c345020a`](https://github.com/nodejs/node/commit/02c345020a)] - **gitignore**: don't ignore the debug npm module (Kat Marchán) [#1908](https://github.com/nodejs/node/pull/1908) -* [[`b5b8ff117c`](https://github.com/nodejs/node/commit/b5b8ff117c)] - **lib**: don't use global Buffer (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) -* [[`a251657058`](https://github.com/nodejs/node/commit/a251657058)] - **node**: mark promises as handled as soon as possible (Vladimir Kurchatkin) [#1952](https://github.com/nodejs/node/pull/1952) -* [[`2eb170874a`](https://github.com/nodejs/node/commit/2eb170874a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`a130132c8f`](https://github.com/nodejs/node/commit/a130132c8f)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) -* [[`6e78e5feaa`](https://github.com/nodejs/node/commit/6e78e5feaa)] - **(SEMVER-MINOR)** **os**: add homedir() (cjihrig) [#1791](https://github.com/nodejs/node/pull/1791) -* [[`d9e250295b`](https://github.com/nodejs/node/commit/d9e250295b)] - ***Revert*** "**readline**: allow tabs in input" (Jeremiah Senkpiel) [#1961](https://github.com/nodejs/node/pull/1961) -* [[`4b3d493c4b`](https://github.com/nodejs/node/commit/4b3d493c4b)] - **readline**: allow tabs in input (Rich Trott) [#1761](https://github.com/nodejs/node/pull/1761) -* [[`6d95f4ff92`](https://github.com/nodejs/node/commit/6d95f4ff92)] - **(SEMVER-MINOR)** **smalloc**: deprecate whole module (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) -* [[`8c71a9241d`](https://github.com/nodejs/node/commit/8c71a9241d)] - **src**: hide InitializeICUDirectory symbol (Ben Noordhuis) [#1815](https://github.com/nodejs/node/pull/1815) -* [[`5b6f575c1f`](https://github.com/nodejs/node/commit/5b6f575c1f)] - ***Revert*** "**src**: add getopt option parser" (Evan Lucas) [#1862](https://github.com/nodejs/node/pull/1862) -* [[`c0e7bf2d8c`](https://github.com/nodejs/node/commit/c0e7bf2d8c)] - **src**: add getopt option parser (Evan Lucas) [#1804](https://github.com/nodejs/node/pull/1804) -* [[`8ea6844d26`](https://github.com/nodejs/node/commit/8ea6844d26)] - **test**: add test for failed save in REPL (Rich Trott) [#1818](https://github.com/nodejs/node/pull/1818) -* [[`03ce84dfa1`](https://github.com/nodejs/node/commit/03ce84dfa1)] - **test**: fix cluster-worker-wait-server-close races (Sam Roberts) [#1953](https://github.com/nodejs/node/pull/1953) -* [[`a6b8ee19b8`](https://github.com/nodejs/node/commit/a6b8ee19b8)] - **test**: create temp dir in common.js (Rich Trott) [#1877](https://github.com/nodejs/node/pull/1877) -* [[`ff8202c6f4`](https://github.com/nodejs/node/commit/ff8202c6f4)] - **test**: fix undeclared variable access (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) -* [[`d9ddd7d345`](https://github.com/nodejs/node/commit/d9ddd7d345)] - **test**: remove TODO comment (Rich Trott) [#1820](https://github.com/nodejs/node/pull/1820) -* [[`6537fd4b55`](https://github.com/nodejs/node/commit/6537fd4b55)] - **test**: remove TODO (Rich Trott) [#1875](https://github.com/nodejs/node/pull/1875) -* [[`a804026c9b`](https://github.com/nodejs/node/commit/a804026c9b)] - **test**: fix broken FreeBSD test (Santiago Gimeno) [#1881](https://github.com/nodejs/node/pull/1881) -* [[`43a82f8a71`](https://github.com/nodejs/node/commit/43a82f8a71)] - **test**: fix test-sync-io-option (Evan Lucas) [#1840](https://github.com/nodejs/node/pull/1840) -* [[`4ed25f664d`](https://github.com/nodejs/node/commit/4ed25f664d)] - **test**: add -no_rand_screen for tls-server-verify (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`4cf323d23d`](https://github.com/nodejs/node/commit/4cf323d23d)] - **test**: kill child in tls-server-verify for speed up (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`e6ccdcc1fe`](https://github.com/nodejs/node/commit/e6ccdcc1fe)] - **test**: improve console output of tls-server-verify (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`975e5956f0`](https://github.com/nodejs/node/commit/975e5956f0)] - **test**: run tls-server-verify servers in parallel (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`b18604ba2c`](https://github.com/nodejs/node/commit/b18604ba2c)] - **test**: running tls-server-verify clients in parallel (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) -* [[`f78c722df5`](https://github.com/nodejs/node/commit/f78c722df5)] - **test**: remove hardwired references to 'iojs' (Rod Vagg) [#1882](https://github.com/nodejs/node/pull/1882) -* [[`bd99e8de8e`](https://github.com/nodejs/node/commit/bd99e8de8e)] - **test**: more test coverage for maxConnections (Rich Trott) [#1855](https://github.com/nodejs/node/pull/1855) -* [[`b9267189a5`](https://github.com/nodejs/node/commit/b9267189a5)] - **test**: fix test-child-process-stdout-flush-exit (Santiago Gimeno) [#1868](https://github.com/nodejs/node/pull/1868) -* [[`d20f018dcf`](https://github.com/nodejs/node/commit/d20f018dcf)] - **test**: loosen condition to detect infinite loop (Yosuke Furukawa) [#1857](https://github.com/nodejs/node/pull/1857) -* [[`e0e96acc6f`](https://github.com/nodejs/node/commit/e0e96acc6f)] - **test**: remove smalloc add-on test (Ben Noordhuis) [#1835](https://github.com/nodejs/node/pull/1835) -* [[`8704c58fc4`](https://github.com/nodejs/node/commit/8704c58fc4)] - **test**: remove unneeded comment task (Rich Trott) [#1858](https://github.com/nodejs/node/pull/1858) -* [[`8732977536`](https://github.com/nodejs/node/commit/8732977536)] - **tls**: fix references to undefined `cb` (Fedor Indutny) [#1951](https://github.com/nodejs/node/pull/1951) -* [[`75930bb38c`](https://github.com/nodejs/node/commit/75930bb38c)] - **tls**: prevent use-after-free (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) -* [[`5795e835a1`](https://github.com/nodejs/node/commit/5795e835a1)] - **tls**: emit errors on close whilst async action (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) -* [[`59d9734e21`](https://github.com/nodejs/node/commit/59d9734e21)] - **tls_wrap**: invoke queued callbacks in DestroySSL (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) -* [[`6e4d30286d`](https://github.com/nodejs/node/commit/6e4d30286d)] - **tools**: enable/add additional eslint rules (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) -* [[`098354a9f8`](https://github.com/nodejs/node/commit/098354a9f8)] - **tools**: update certdata.txt (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) -* [[`a2d921d6a0`](https://github.com/nodejs/node/commit/a2d921d6a0)] - **tools**: customize mk-ca-bundle.pl (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) -* [[`5be9efca40`](https://github.com/nodejs/node/commit/5be9efca40)] - **tools**: update mk-ca-bundle.pl to HEAD of upstream (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) -* [[`1baba0580d`](https://github.com/nodejs/node/commit/1baba0580d)] - **tools**: Fix copying contents of deps/npm (thefourtheye) [#1853](https://github.com/nodejs/node/pull/1853) -* [[`628845b816`](https://github.com/nodejs/node/commit/628845b816)] - **(SEMVER-MINOR)** **util**: introduce `printDeprecationMessage` function (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) -* [[`91d0a8b19c`](https://github.com/nodejs/node/commit/91d0a8b19c)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.3.0. ## 2015-06-01, Version 2.2.1, @rvagg -### Notable changes - -* **http**: Reverts the move of the `client` property of `IncomingMessage` to its prototype. Although undocumented, this property was used and assumed to be an "own property" in the wild, most notably by [request](https://github.com/request/request) which is used by npm. (Michaël Zasso) [#1852](https://github.com/nodejs/node/pull/1852). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`c5a1009903`](https://github.com/nodejs/node/commit/c5a1009903)] - **build**: avoid passing empty strings to build flags (Johan Bergström) [#1789](https://github.com/nodejs/node/pull/1789) -* [[`5d83401086`](https://github.com/nodejs/node/commit/5d83401086)] - **doc**: put SEMVER-MINOR on pre-load module fix 2.2.0 (Rod Vagg) -* [[`4d6b768e5d`](https://github.com/nodejs/node/commit/4d6b768e5d)] - **http**: revert deprecation of client property (Michaël Zasso) [#1852](https://github.com/nodejs/node/pull/1852) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.2.1. ## 2015-05-31, Version 2.2.0, @rvagg -### Notable changes - -* **node**: Speed-up `require()` by replacing usage of `fs.statSync()` and `fs.readFileSync()` with internal variants that are faster for this use-case and do not create as many objects for the garbage collector to clean up. The primary two benefits are: significant increase in application start-up time on typical applications and better start-up time for the debugger by eliminating almost all of the thousands of exception events. (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801). -* **node**: Resolution of pre-load modules (`-r` or `--require`) now follows the standard `require()` rules rather than just resolving paths, so you can now pre-load modules in node_modules. (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/node/pull/1812). -* **npm**: Upgraded npm to v2.11.0. New hooks for `preversion`, `version`, and `postversion` lifecycle events, some SPDX-related license changes and license file inclusions. See the [release notes](https://github.com/npm/npm/releases/tag/v2.11.0) for full details. - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`a77c330c32`](https://github.com/nodejs/node/commit/a77c330c32)] - **(SEMVER-MINOR)** **child_process**: expose ChildProcess constructor (Evan Lucas) [#1760](https://github.com/nodejs/node/pull/1760) -* [[`3a1bc067d4`](https://github.com/nodejs/node/commit/3a1bc067d4)] - ***Revert*** "**core**: set PROVIDER type as Persistent class id" (Ben Noordhuis) [#1827](https://github.com/nodejs/node/pull/1827) -* [[`f9fd554500`](https://github.com/nodejs/node/commit/f9fd554500)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`c1afa53648`](https://github.com/nodejs/node/commit/c1afa53648)] - **deps**: upgrade npm to 2.11.0 (Forrest L Norvell) [iojs/io.js#1829](https://github.com/iojs/io.js/pull/1829) -* [[`ff794498e7`](https://github.com/nodejs/node/commit/ff794498e7)] - **doc**: `fs.*File()` also accept encoding strings (Rich Trott) [#1806](https://github.com/nodejs/node/pull/1806) -* [[`98649fd31a`](https://github.com/nodejs/node/commit/98649fd31a)] - **doc**: add documentation for AtExit hook (Steve Sharp) [#1014](https://github.com/nodejs/node/pull/1014) -* [[`eb1856dfd1`](https://github.com/nodejs/node/commit/eb1856dfd1)] - **doc**: clarify stability of fs.watch and relatives (Rich Trott) [#1775](https://github.com/nodejs/node/pull/1775) -* [[`a74c2c9458`](https://github.com/nodejs/node/commit/a74c2c9458)] - **doc**: state url decoding behavior (Josh Gummersall) [#1731](https://github.com/nodejs/node/pull/1731) -* [[`ba76a9d872`](https://github.com/nodejs/node/commit/ba76a9d872)] - **doc**: remove bad semver-major entry from CHANGELOG (Rod Vagg) [#1782](https://github.com/nodejs/node/pull/1782) -* [[`a6a3f8c78d`](https://github.com/nodejs/node/commit/a6a3f8c78d)] - **doc**: fix changelog s/2.0.3/2.1.0 (Rod Vagg) -* [[`2c686fd3ce`](https://github.com/nodejs/node/commit/2c686fd3ce)] - **http**: flush stored header (Vladimir Kurchatkin) [#1695](https://github.com/nodejs/node/pull/1695) -* [[`1eec5f091a`](https://github.com/nodejs/node/commit/1eec5f091a)] - **http**: simplify code and remove unused properties (Brian White) [#1572](https://github.com/nodejs/node/pull/1572) -* [[`1bbf8d0720`](https://github.com/nodejs/node/commit/1bbf8d0720)] - **lib**: speed up require(), phase 2 (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801) -* [[`b14fd1a720`](https://github.com/nodejs/node/commit/b14fd1a720)] - **lib**: speed up require(), phase 1 (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801) -* [[`5abd4ac079`](https://github.com/nodejs/node/commit/5abd4ac079)] - **lib**: simplify nextTick() usage (Brian White) [#1612](https://github.com/nodejs/node/pull/1612) -* [[`5759722cfa`](https://github.com/nodejs/node/commit/5759722cfa)] - **(SEMVER-MINOR)** **src**: fix module search path for preload modules (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/node/pull/1812) -* [[`a65762cab6`](https://github.com/nodejs/node/commit/a65762cab6)] - **src**: remove old code (Brendan Ashworth) [#1819](https://github.com/nodejs/node/pull/1819) -* [[`93a44d5228`](https://github.com/nodejs/node/commit/93a44d5228)] - **src**: fix deferred events not working with -e (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) -* [[`8059393934`](https://github.com/nodejs/node/commit/8059393934)] - **test**: check error type from net.Server.listen() (Rich Trott) [#1821](https://github.com/nodejs/node/pull/1821) -* [[`4e90c82cdb`](https://github.com/nodejs/node/commit/4e90c82cdb)] - **test**: add heap profiler add-on regression test (Ben Noordhuis) [#1828](https://github.com/nodejs/node/pull/1828) -* [[`6dfca71af0`](https://github.com/nodejs/node/commit/6dfca71af0)] - **test**: don't lint autogenerated test/addons/doc-*/ (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) -* [[`c2b8b30836`](https://github.com/nodejs/node/commit/c2b8b30836)] - **test**: remove stray copyright notices (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) -* [[`280fb01daf`](https://github.com/nodejs/node/commit/280fb01daf)] - **test**: fix deprecation warning in addons test (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) -* [[`8606793999`](https://github.com/nodejs/node/commit/8606793999)] - **tools**: pass constant to logger instead of string (Johan Bergström) [#1842](https://github.com/nodejs/node/pull/1842) -* [[`fbd2b59716`](https://github.com/nodejs/node/commit/fbd2b59716)] - **tools**: add objectLiteralShorthandProperties to .eslintrc (Evan Lucas) [#1760](https://github.com/nodejs/node/pull/1760) -* [[`53e98cc1b4`](https://github.com/nodejs/node/commit/53e98cc1b4)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1763](https://github.com/nodejs/node/pull/1763) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.2.0. ## 2015-05-24, Version 2.1.0, @rvagg -### Notable changes - -* **crypto**: Diffie-Hellman key exchange (DHE) parameters (`'dhparams'`) must now be 1024 bits or longer or an error will be thrown. A warning will also be printed to the console if you supply less than 2048 bits. See https://weakdh.org/ for further context on this security concern. (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739). -* **node**: A new `--trace-sync-io` command line flag will print a warning and a stack trace whenever a synchronous API is used. This can be used to track down synchronous calls that may be slowing down an application. (Trevor Norris) [#1707](https://github.com/nodejs/node/pull/1707). -* **node**: To allow for chaining of methods, the `setTimeout()`, `setKeepAlive()`, `setNoDelay()`, `ref()` and `unref()` methods used in `'net'`, `'dgram'`, `'http'`, `'https'` and `'tls'` now return the current instance instead of `undefined` (Roman Reiss & Evan Lucas) [#1699](https://github.com/nodejs/node/pull/1699) [#1768](https://github.com/nodejs/node/pull/1768) [#1779](https://github.com/nodejs/node/pull/1779). -* **npm**: Upgraded to v2.10.1, release notes can be found in and . -* **util**: A significant speed-up (in the order of 35%) for the common-case of a single string argument to `util.format()`, used by `console.log()` (Сковорода Никита Андреевич) [#1749](https://github.com/nodejs/node/pull/1749). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`9da168b71f`](https://github.com/nodejs/node/commit/9da168b71f)] - **buffer**: optimize Buffer.byteLength (Brendan Ashworth) [#1713](https://github.com/nodejs/node/pull/1713) -* [[`2b1c01c2cc`](https://github.com/nodejs/node/commit/2b1c01c2cc)] - **build**: refactor pkg-config for shared libraries (Johan Bergström) [#1603](https://github.com/nodejs/node/pull/1603) -* [[`3c44100558`](https://github.com/nodejs/node/commit/3c44100558)] - **core**: set PROVIDER type as Persistent class id (Trevor Norris) [#1730](https://github.com/nodejs/node/pull/1730) -* [[`c1de6d249e`](https://github.com/nodejs/node/commit/c1de6d249e)] - **(SEMVER-MINOR)** **core**: implement runtime flag to trace sync io (Trevor Norris) [#1707](https://github.com/nodejs/node/pull/1707) -* [[`9e7099fa4e`](https://github.com/nodejs/node/commit/9e7099fa4e)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) -* [[`c54d057598`](https://github.com/nodejs/node/commit/c54d057598)] - **deps**: upgrade to npm 2.10.1 (Rebecca Turner) [#1763](https://github.com/nodejs/node/pull/1763) -* [[`367ffd167d`](https://github.com/nodejs/node/commit/367ffd167d)] - **doc**: update AUTHORS list (Rod Vagg) [#1776](https://github.com/nodejs/node/pull/1776) -* [[`2bb2f06b3e`](https://github.com/nodejs/node/commit/2bb2f06b3e)] - **doc**: fix typo in CONTRIBUTING.md (Rich Trott) [#1755](https://github.com/nodejs/node/pull/1755) -* [[`515afc6367`](https://github.com/nodejs/node/commit/515afc6367)] - **doc**: path is ignored in url.format (Maurice Butler) [#1753](https://github.com/nodejs/node/pull/1753) -* [[`f0a8bc3f84`](https://github.com/nodejs/node/commit/f0a8bc3f84)] - **doc**: fix spelling in CHANGELOG (Felipe Batista) -* [[`86dd244d9b`](https://github.com/nodejs/node/commit/86dd244d9b)] - **doc**: add notes to child_process.fork() and .exec() (Rich Trott) [#1718](https://github.com/nodejs/node/pull/1718) -* [[`066274794c`](https://github.com/nodejs/node/commit/066274794c)] - **doc**: update links from iojs/io.js to nodejs/io.js (Frederic Hemberger) [#1715](https://github.com/nodejs/node/pull/1715) -* [[`cb381fe3e0`](https://github.com/nodejs/node/commit/cb381fe3e0)] - **(SEMVER-MINOR)** **net**: return this from setNoDelay and setKeepAlive (Roman Reiss) [#1779](https://github.com/nodejs/node/pull/1779) -* [[`85d9983009`](https://github.com/nodejs/node/commit/85d9983009)] - **net**: persist net.Socket options before connect (Evan Lucas) [#1518](https://github.com/nodejs/node/pull/1518) -* [[`39dde3222e`](https://github.com/nodejs/node/commit/39dde3222e)] - **(SEMVER-MINOR)** **net,dgram**: return this from ref and unref methods (Roman Reiss) [#1768](https://github.com/nodejs/node/pull/1768) -* [[`5773438913`](https://github.com/nodejs/node/commit/5773438913)] - **test**: fix jslint error (Michaël Zasso) [#1743](https://github.com/nodejs/node/pull/1743) -* [[`867631986f`](https://github.com/nodejs/node/commit/867631986f)] - **test**: fix test-sync-io-option (Santiago Gimeno) [#1734](https://github.com/nodejs/node/pull/1734) -* [[`f29762f4dd`](https://github.com/nodejs/node/commit/f29762f4dd)] - **test**: enable linting for tests (Roman Reiss) [#1721](https://github.com/nodejs/node/pull/1721) -* [[`2a71f02988`](https://github.com/nodejs/node/commit/2a71f02988)] - **tls**: emit errors happening before handshake finish (Malte-Thorben Bruns) [#1769](https://github.com/nodejs/node/pull/1769) -* [[`80342f649d`](https://github.com/nodejs/node/commit/80342f649d)] - **tls**: use `.destroy(err)` instead of destroy+emit (Fedor Indutny) [#1711](https://github.com/nodejs/node/pull/1711) -* [[`9b35be5810`](https://github.com/nodejs/node/commit/9b35be5810)] - **tls**: make server not use DHE in less than 1024bits (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739) -* [[`214d02040e`](https://github.com/nodejs/node/commit/214d02040e)] - **util**: speed up common case of formatting string (Сковорода Никита Андреевич) [#1749](https://github.com/nodejs/node/pull/1749) -* [[`d144e96fbf`](https://github.com/nodejs/node/commit/d144e96fbf)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1763](https://github.com/nodejs/node/pull/1763) -* [[`0d6d3dda95`](https://github.com/nodejs/node/commit/0d6d3dda95)] - **win,node-gyp**: make delay-load hook C89 compliant (Sharat M R) [TooTallNate/node-gyp#616](https://github.com/TooTallNate/node-gyp/pull/616) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.1.0. ## 2015-05-22, Version 0.12.4 (Stable) -### Commits - -* [[`202c18bbc3`](https://github.com/nodejs/node/commit/202c18bbc3)] - **npm**: upgrade to 2.10.1 [#25364](https://github.com/joyent/node/pull/25364) -* [[`6157697bd5`](https://github.com/nodejs/node/commit/6157697bd5)] - **V8**: revert v8 Array.prototype.values() removal (cjihrig) [#25328](https://github.com/joyent/node/pull/25328) -* [[`3122052890`](https://github.com/nodejs/node/commit/3122052890)] - **win**: bring back xp/2k3 support (Bert Belder) [#25367](https://github.com/joyent/node/pull/25367) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.4. ## 2015-05-17, Version 1.8.2, @rvagg -**Maintenance release** - -## Notable changes - -* **crypto**: significantly reduced memory usage for TLS (Fedor Indutny & Сковорода Никита Андреевич) [#1529](https://github.com/nodejs/node/pull/1529) -* **npm**: Upgrade npm to 2.9.0. See the [v2.8.4](https://github.com/npm/npm/releases/tag/v2.8.4) and [v2.9.0](https://github.com/npm/npm/releases/tag/v2.9.0) release notes for details. Summary: - - 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/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9 - - 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) - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`5404cbc745`](https://github.com/nodejs/node/commit/5404cbc745)] - **buffer**: fix copy() segfault with zero arguments (Trevor Norris) [nodejs/node#1520](https://github.com/nodejs/node/pull/1520) -* [[`65dd10e9c0`](https://github.com/nodejs/node/commit/65dd10e9c0)] - **build**: remove -J from test-ci (Rod Vagg) [nodejs/node#1544](https://github.com/nodejs/node/pull/1544) -* [[`74060bb60e`](https://github.com/nodejs/node/commit/74060bb60e)] - **crypto**: track external memory for SSL structures (Fedor Indutny) [nodejs/node#1529](https://github.com/nodejs/node/pull/1529) -* [[`f10f379240`](https://github.com/nodejs/node/commit/f10f379240)] - **deps**: make node-gyp work with io.js (cjihrig) [nodejs/node#990](https://github.com/nodejs/node/pull/990) -* [[`ba0e744c2c`](https://github.com/nodejs/node/commit/ba0e744c2c)] - **deps**: upgrade npm to 2.9.0 (Forrest L Norvell) [nodejs/node#1583](https://github.com/nodejs/node/pull/1583) -* [[`b3a7da1091`](https://github.com/nodejs/node/commit/b3a7da1091)] - **deps**: update http_parser to 2.5.0 (Fedor Indutny) [nodejs/node#1517](https://github.com/nodejs/node/pull/1517) -* [[`4030545af6`](https://github.com/nodejs/node/commit/4030545af6)] - **fs**: validate fd on fs.write (Julian Duque) [#1553](https://github.com/nodejs/node/pull/1553) -* [[`898d423820`](https://github.com/nodejs/node/commit/898d423820)] - **string_decoder**: don't cache Buffer.isEncoding (Brian White) [nodejs/node#1548](https://github.com/nodejs/node/pull/1548) -* [[`32a6dbcf23`](https://github.com/nodejs/node/commit/32a6dbcf23)] - **test**: extend timeouts for ARMv6 (Rod Vagg) [nodejs/node#1554](https://github.com/nodejs/node/pull/1554) -* [[`5896fe5cd3`](https://github.com/nodejs/node/commit/5896fe5cd3)] - **test**: adjust Makefile/test-ci, add to vcbuild.bat (Rod Vagg) [nodejs/node#1530](https://github.com/nodejs/node/pull/1530) -* [[`b72e4bc596`](https://github.com/nodejs/node/commit/b72e4bc596)] - **tls**: destroy singleUse context immediately (Fedor Indutny) [nodejs/node#1529](https://github.com/nodejs/node/pull/1529) -* [[`1cfc455dc5`](https://github.com/nodejs/node/commit/1cfc455dc5)] - **tls**: zero SSL_CTX freelist for a singleUse socket (Fedor Indutny) [nodejs/node#1529](https://github.com/nodejs/node/pull/1529) -* [[`7ada680519`](https://github.com/nodejs/node/commit/7ada680519)] - **tls**: destroy SSL once it is out of use (Fedor Indutny) [nodejs/node#1529](https://github.com/nodejs/node/pull/1529) -* [[`71274b0263`](https://github.com/nodejs/node/commit/71274b0263)] - **tls_wrap**: use localhost if options.host is empty (Guilherme Souza) [nodejs/node#1493](https://github.com/nodejs/node/pull/1493) -* [[`0eb74a8b6c`](https://github.com/nodejs/node/commit/0eb74a8b6c)] - **win,node-gyp**: optionally allow node.exe/iojs.exe to be renamed (Bert Belder) [nodejs/node#1266](https://github.com/nodejs/node/pull/1266) +Moved to doc/changelogs/CHANGELOG_IOJS.md#1.8.2. ## 2015-05-15, Version 2.0.2, @Fishrock123 -### Notable changes - -* **win,node-gyp**: the delay-load hook for windows addons has now been correctly enabled by default, it had wrongly defaulted to off in the release version of 2.0.0 (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) -* **os**: `tmpdir()`'s trailing slash stripping has been refined to fix an issue when the temp directory is at '/'. Also considers which slash is used by the operating system. (cjihrig) [#1673](https://github.com/nodejs/node/pull/1673) -* **tls**: default ciphers have been updated to use gcm and aes128 (Mike MacCana) [#1660](https://github.com/nodejs/node/pull/1660) -* **build**: v8 snapshots have been re-enabled by default as suggested by the v8 team, since prior security issues have been resolved. This should give some perf improvements to both startup and vm context creation. (Trevor Norris) [#1663](https://github.com/nodejs/node/pull/1663) -* **src**: fixed preload modules not working when other flags were used before `--require` (Yosuke Furukawa) [#1694](https://github.com/nodejs/node/pull/1694) -* **dgram**: fixed `send()`'s callback not being asynchronous (Yosuke Furukawa) [#1313](https://github.com/nodejs/node/pull/1313) -* **readline**: emitKeys now keeps buffering data until it has enough to parse. This fixes an issue with parsing split escapes. (Alex Kocharin) [#1601](https://github.com/nodejs/node/pull/1601) -* **cluster**: works now properly emit 'disconnect' to `cluser.worker` (Oleg Elifantiev) [#1386](https://github.com/nodejs/node/pull/1386) -* **events**: uncaught errors now provide some context (Evan Lucas) [#1654](https://github.com/nodejs/node/pull/1654) - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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 - -* [[`8a0e5295b4`](https://github.com/nodejs/node/commit/8a0e5295b4)] - **build**: use backslashes for paths on windows (Johan Bergström) [#1698](https://github.com/nodejs/node/pull/1698) -* [[`20c9a52227`](https://github.com/nodejs/node/commit/20c9a52227)] - **build**: move --with-intl to intl optgroup (Johan Bergström) [#1680](https://github.com/nodejs/node/pull/1680) -* [[`36cdc7c8ac`](https://github.com/nodejs/node/commit/36cdc7c8ac)] - **build**: re-enable V8 snapshots (Trevor Norris) [#1663](https://github.com/nodejs/node/pull/1663) -* [[`5883a59b21`](https://github.com/nodejs/node/commit/5883a59b21)] - **cluster**: disconnect event not emitted correctly (Oleg Elifantiev) [#1386](https://github.com/nodejs/node/pull/1386) -* [[`0f850f7ae7`](https://github.com/nodejs/node/commit/0f850f7ae7)] - **deps**: provide TXT chunk info in c-ares (Fedor Indutny) -* [[`7e1c0e75ed`](https://github.com/nodejs/node/commit/7e1c0e75ed)] - **deps**: sync with upstream bagder/c-ares@bba4dc5 (Ben Noordhuis) [#1678](https://github.com/nodejs/node/pull/1678) -* [[`18d457bd34`](https://github.com/nodejs/node/commit/18d457bd34)] - **dgram**: call send callback asynchronously (Yosuke Furukawa) [#1313](https://github.com/nodejs/node/pull/1313) -* [[`8b9a1537ad`](https://github.com/nodejs/node/commit/8b9a1537ad)] - **events**: provide better error message for unhandled error (Evan Lucas) [#1654](https://github.com/nodejs/node/pull/1654) -* [[`19ffb5cf1c`](https://github.com/nodejs/node/commit/19ffb5cf1c)] - **lib**: fix eslint styles (Yosuke Furukawa) [#1539](https://github.com/nodejs/node/pull/1539) -* [[`76937051f8`](https://github.com/nodejs/node/commit/76937051f8)] - **os**: refine tmpdir() trailing slash stripping (cjihrig) [#1673](https://github.com/nodejs/node/pull/1673) -* [[`aed6bce906`](https://github.com/nodejs/node/commit/aed6bce906)] - **readline**: turn emitKeys into a streaming parser (Alex Kocharin) [#1601](https://github.com/nodejs/node/pull/1601) -* [[`0a461e5360`](https://github.com/nodejs/node/commit/0a461e5360)] - **src**: fix preload when used with prior flags (Yosuke Furukawa) [#1694](https://github.com/nodejs/node/pull/1694) -* [[`931a0d4634`](https://github.com/nodejs/node/commit/931a0d4634)] - **src**: add type check to v8.setFlagsFromString() (Roman Klauke) [#1652](https://github.com/nodejs/node/pull/1652) -* [[`08d08668c9`](https://github.com/nodejs/node/commit/08d08668c9)] - **src,deps**: replace LoadLibrary by LoadLibraryW (Cheng Zhao) [#226](https://github.com/nodejs/node/pull/226) -* [[`4e2f999a62`](https://github.com/nodejs/node/commit/4e2f999a62)] - **test**: fix infinite loop detection (Yosuke Furukawa) [#1681](https://github.com/nodejs/node/pull/1681) -* [[`5755fc099f`](https://github.com/nodejs/node/commit/5755fc099f)] - **tls**: update default ciphers to use gcm and aes128 (Mike MacCana) [#1660](https://github.com/nodejs/node/pull/1660) -* [[`966acb9916`](https://github.com/nodejs/node/commit/966acb9916)] - **tools**: remove closure_linter to eslint on windows (Yosuke Furukawa) [#1685](https://github.com/nodejs/node/pull/1685) -* [[`c58264e58b`](https://github.com/nodejs/node/commit/c58264e58b)] - **tools**: make eslint work on subdirectories (Roman Reiss) [#1686](https://github.com/nodejs/node/pull/1686) -* [[`0b21ab13b7`](https://github.com/nodejs/node/commit/0b21ab13b7)] - **tools**: refactor `make test-npm` into test-npm.sh (Jeremiah Senkpiel) [#1662](https://github.com/nodejs/node/pull/1662) -* [[`f07b3b600b`](https://github.com/nodejs/node/commit/f07b3b600b)] - **tools**: set eslint comma-spacing to 'warn' (Roman Reiss) [#1672](https://github.com/nodejs/node/pull/1672) -* [[`f9dd34d301`](https://github.com/nodejs/node/commit/f9dd34d301)] - **tools**: replace closure-linter with eslint (Yosuke Furukawa) [#1539](https://github.com/nodejs/node/pull/1539) -* [[`64d3210c98`](https://github.com/nodejs/node/commit/64d3210c98)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1667](https://github.com/nodejs/node/issues/1667) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.0.2. ## 2015-05-13, Version 0.12.3 (Stable) -### Commits - -* [[`32166a90cf`](https://github.com/nodejs/node/commit/32166a90cf)] - **V8**: update to 3.28.71.19 [#18206](https://github.com/joyent/node/pull/18206) -* [[`84f1ab6114`](https://github.com/nodejs/node/commit/84f1ab6114)] - **uv**: upgrade to 1.5.0 [#25141](https://github.com/joyent/node/pull/25141) -* [[`03cfbd65fb`](https://github.com/nodejs/node/commit/03cfbd65fb)] - **npm**: upgrade to 2.9.1 [#25289](https://github.com/joyent/node/pull/25289) -* [[`80cdae855f`](https://github.com/nodejs/node/commit/80cdae855f)] - **V8**: don't busy loop in v8 cpu profiler thread (Mike Tunnicliffe) [#25268](https://github.com/joyent/node/pull/25268) -* [[`2a5f4bd7ce`](https://github.com/nodejs/node/commit/2a5f4bd7ce)] - **V8**: fix issue with let bindings in for loops (adamk) [#23948](https://github.com/joyent/node/pull/23948) -* [[`f0ef597e09`](https://github.com/nodejs/node/commit/f0ef597e09)] - **debugger**: don't spawn child process in remote mode (Jackson Tian) [#14172](https://github.com/joyent/node/pull/14172) -* [[`0e392f3b68`](https://github.com/nodejs/node/commit/0e392f3b68)] - **net**: do not set V4MAPPED on FreeBSD (Julien Gilli) [#18204](https://github.com/joyent/node/pull/18204) -* [[`101e103e3b`](https://github.com/nodejs/node/commit/101e103e3b)] - **repl**: make 'Unexpected token' errors recoverable (Julien Gilli) [#8875](https://github.com/joyent/node/pull/8875) -* [[`d5b32246fb`](https://github.com/nodejs/node/commit/d5b32246fb)] - **src**: backport ignore ENOTCONN on shutdown race (Ben Noordhuis) [#14480](https://github.com/joyent/node/pull/14480) -* [[`f99eaefe75`](https://github.com/nodejs/node/commit/f99eaefe75)] - **src**: fix backport of SIGINT crash fix on FreeBSD (Julien Gilli) [#14819](https://github.com/joyent/node/pull/14819) +Moved to doc/changelogs/CHANGELOG_V012.md#0.12.3. ## 2015-05-07, Version 2.0.1, @rvagg -### Notable changes - -* **async_wrap**: (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) - - it is now possible to filter by providers - - bit flags have been removed and replaced with method calls on the binding object - - _note that this is an unstable API so feature additions and breaking changes won't change io.js semver_ -* **libuv**: resolves numerous io.js issues: - - [#862](https://github.com/nodejs/node/issues/862) prevent spawning child processes with invalid stdio file descriptors - - [#1397](https://github.com/nodejs/node/issues/1397) fix EPERM error with fs.access(W_OK) on Windows - - [#1621](https://github.com/nodejs/node/issues/1621) build errors associated with the bundled libuv - - [#1512](https://github.com/nodejs/node/issues/1512) should properly fix Windows termination errors -* **addons**: the `NODE_DEPRECATED` macro was causing problems when compiling addons with older compilers, this should now be resolved (Ben Noordhuis) [#1626](https://github.com/nodejs/node/pull/1626) -* **V8**: upgrade V8 from 4.2.77.18 to 4.2.77.20 with minor fixes, including a bug preventing builds on FreeBSD - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`7dde95a8bd`](https://github.com/nodejs/node/commit/7dde95a8bd)] - **async-wrap**: remove before/after calls in init (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) -* [[`bd42ba056a`](https://github.com/nodejs/node/commit/bd42ba056a)] - **async-wrap**: set flags using functions (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) -* [[`4b2c786449`](https://github.com/nodejs/node/commit/4b2c786449)] - **async-wrap**: pass PROVIDER as first arg to init (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) -* [[`84bf609fd2`](https://github.com/nodejs/node/commit/84bf609fd2)] - **async-wrap**: don't call init callback unnecessarily (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) -* [[`04cc03b029`](https://github.com/nodejs/node/commit/04cc03b029)] - **deps**: update libuv to 1.5.0 (Saúl Ibarra Corretgé) [#1646](https://github.com/nodejs/node/pull/1646) -* [[`b16d9c28e8`](https://github.com/nodejs/node/commit/b16d9c28e8)] - **deps**: upgrade v8 to 4.2.77.20 (Ben Noordhuis) [#1639](https://github.com/nodejs/node/pull/1639) -* [[`9ec3109272`](https://github.com/nodejs/node/commit/9ec3109272)] - **doc**: add TC meeting 2015-04-29 minutes (Rod Vagg) [#1585](https://github.com/nodejs/node/pull/1585) -* [[`2c7206254c`](https://github.com/nodejs/node/commit/2c7206254c)] - **doc**: fix typo in readme.md (AQNOUCH Mohammed) [#1643](https://github.com/nodejs/node/pull/1643) -* [[`71dc7152ee`](https://github.com/nodejs/node/commit/71dc7152ee)] - **doc**: fix PR link in CHANGELOG (Brian White) [#1624](https://github.com/nodejs/node/pull/1624) -* [[`b97b96d05a`](https://github.com/nodejs/node/commit/b97b96d05a)] - **install**: fix NameError (thefourtheye) [#1628](https://github.com/nodejs/node/pull/1628) -* [[`6ccbe75384`](https://github.com/nodejs/node/commit/6ccbe75384)] - **js_stream**: fix buffer index in DoWrite (Shigeki Ohtsu) [#1635](https://github.com/nodejs/node/pull/1635) -* [[`c43855c49c`](https://github.com/nodejs/node/commit/c43855c49c)] - **src**: export the ParseEncoding function on Windows (Ivan Kozik) [#1596](https://github.com/nodejs/node/pull/1596) -* [[`8315b22390`](https://github.com/nodejs/node/commit/8315b22390)] - **src**: fix pedantic cpplint whitespace warnings (Ben Noordhuis) [#1640](https://github.com/nodejs/node/pull/1640) -* [[`b712af79a7`](https://github.com/nodejs/node/commit/b712af79a7)] - **src**: fix NODE_DEPRECATED macro with old compilers (Ben Noordhuis) [#1626](https://github.com/nodejs/node/pull/1626) -* [[`2ed10f1349`](https://github.com/nodejs/node/commit/2ed10f1349)] - **src**: fix minor inefficiency in Buffer::New() call (Ben Noordhuis) [#1577](https://github.com/nodejs/node/pull/1577) -* [[`f696c9efab`](https://github.com/nodejs/node/commit/f696c9efab)] - **src**: fix deprecated use of Buffer::New() (Ben Noordhuis) [#1577](https://github.com/nodejs/node/pull/1577) -* [[`0c8f13df8f`](https://github.com/nodejs/node/commit/0c8f13df8f)] - **tools**: remove unused GuessWordSize function (thefourtheye) [#1638](https://github.com/nodejs/node/pull/1638) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.0.1. ## 2015-05-04, Version 2.0.0, @rvagg -### Breaking changes - -Full details at https://github.com/nodejs/node/wiki/Breaking-Changes#200-from-1x - -* V8 upgrade to 4.2, minor changes to C++ API -* `os.tmpdir()` is now cross-platform consistent and no longer returns a path with a trailing slash on any platform -* While not a *breaking change* the 'smalloc' module has been deprecated in anticipation of it becoming unsupportable with a future upgrade to V8 4.4. See [#1451](https://github.com/nodejs/node/issues/1451) for further information. - -_Note: a new version of the 'url' module was reverted prior to release as it was decided the potential for breakage across the npm ecosystem was too great and that more compatibility work needed to be done before releasing it. See [#1602](https://github.com/nodejs/node/pull/1602) for further information._ - -### Notable changes - -* **crypto**: significantly reduced memory usage for TLS (Fedor Indutny & Сковорода Никита Андреевич) [#1529](https://github.com/nodejs/node/pull/1529) -* **net**: `socket.connect()` now accepts a `'lookup'` option for a custom DNS resolution mechanism, defaults to `dns.lookup()` (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) -* **npm**: Upgrade npm to 2.9.0. See the [v2.8.4](https://github.com/npm/npm/releases/tag/v2.8.4) and [v2.9.0](https://github.com/npm/npm/releases/tag/v2.9.0) release notes for details. Notable items: - - 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 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) -* **repl**: - - REPL history can be persisted across sessions if the `NODE_REPL_HISTORY_FILE` environment variable is set to a user accessible file, `NODE_REPL_HISTORY_SIZE` can set the maximum history size and defaults to `1000` (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) - - The REPL can be placed in to one of three modes using the `NODE_REPL_MODE` environment variable: `sloppy`, `strict` or `magic` (default); the new `magic` mode will automatically run "strict mode only" statements in strict mode (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) -* **smalloc**: the 'smalloc' module has been deprecated due to changes coming in V8 4.4 that will render it unusable -* **util**: add Promise, Map and Set inspection support (Christopher Monsanto) [#1471](https://github.com/nodejs/node/pull/1471) -* **V8**: upgrade to 4.2.77.18, see the [ChangeLog](https://chromium.googlesource.com/v8/v8/+/refs/heads/4.2.77/ChangeLog) for full details. Notable items: - - Classes have moved out of staging; the `class` keyword is now usable in strict mode without flags - - Object literal enhancements have moved out of staging; shorthand method and property syntax is now usable (`{ method() { }, property }`) - - Rest parameters (`function(...args) {}`) are implemented in staging behind the `--harmony-rest-parameters` flag - - Computed property names (`{['foo'+'bar']:'bam'}`) are implemented in staging behind the `--harmony-computed-property-names` flag - - Unicode escapes (`'\u{xxxx}'`) are implemented in staging behind the `--harmony_unicode` flag and the `--harmony_unicode_regexps` flag for use in regular expressions -* **Windows**: - - Random process termination on Windows fixed (Fedor Indutny) [#1512](https://github.com/nodejs/node/issues/1512) / [#1563](https://github.com/nodejs/node/pull/1563) - - The delay-load hook introduced to fix issues with process naming (iojs.exe / node.exe) has been made opt-out for native add-ons. Native add-ons should include `'win_delay_load_hook': 'false'` in their binding.gyp to disable this feature if they experience problems . (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) -* **Governance**: - - Rod Vagg (@rvagg) was added to the Technical Committee (TC) - - Jeremiah Senkpiel (@Fishrock123) was added to the Technical Committee (TC) - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`5404cbc745`](https://github.com/nodejs/node/commit/5404cbc745)] - **buffer**: fix copy() segfault with zero arguments (Trevor Norris) [#1520](https://github.com/nodejs/node/pull/1520) -* [[`3d3083b91f`](https://github.com/nodejs/node/commit/3d3083b91f)] - **buffer**: little improve for Buffer.concat method (Jackson Tian) [#1437](https://github.com/nodejs/node/pull/1437) -* [[`e67542ae17`](https://github.com/nodejs/node/commit/e67542ae17)] - **build**: disable -Og when building with clang (Ben Noordhuis) [#1609](https://github.com/nodejs/node/pull/1609) -* [[`78f4b038f8`](https://github.com/nodejs/node/commit/78f4b038f8)] - **build**: turn on debug-safe optimizations with -Og (Ben Noordhuis) [#1569](https://github.com/nodejs/node/pull/1569) -* [[`a5dcff827a`](https://github.com/nodejs/node/commit/a5dcff827a)] - **build**: Use option groups in configure output (Johan Bergström) [#1533](https://github.com/nodejs/node/pull/1533) -* [[`2a3c8c187e`](https://github.com/nodejs/node/commit/2a3c8c187e)] - **build**: remove -J from test-ci (Rod Vagg) [#1544](https://github.com/nodejs/node/pull/1544) -* [[`e6874dd0f9`](https://github.com/nodejs/node/commit/e6874dd0f9)] - **crypto**: track external memory for SSL structures (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) -* [[`935c9d3fa7`](https://github.com/nodejs/node/commit/935c9d3fa7)] - **deps**: make node-gyp work with io.js (cjihrig) [#990](https://github.com/nodejs/node/pull/990) -* [[`56e4255382`](https://github.com/nodejs/node/commit/56e4255382)] - **deps**: upgrade npm to 2.9.0 (Forrest L Norvell) [#1573](https://github.com/nodejs/node/pull/1573) -* [[`509b59ea7c`](https://github.com/nodejs/node/commit/509b59ea7c)] - **deps**: enable v8 postmortem debugging again (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) -* [[`01652c7709`](https://github.com/nodejs/node/commit/01652c7709)] - **deps**: upgrade v8 to 4.2.77.18 (Chris Dickinson) [#1506](https://github.com/nodejs/node/pull/1506) -* [[`01e6632d70`](https://github.com/nodejs/node/commit/01e6632d70)] - **deps**: upgrade v8 to 4.2.77.15 (Ben Noordhuis) [#1399](https://github.com/nodejs/node/pull/1399) -* [[`db4ded5903`](https://github.com/nodejs/node/commit/db4ded5903)] - **deps**: enable v8 postmortem debugging again (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) -* [[`36cd5fb9d2`](https://github.com/nodejs/node/commit/36cd5fb9d2)] - **(SEMVER-MAJOR)** **deps**: upgrade v8 to 4.2.77.13 (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) -* [[`b3a7da1091`](https://github.com/nodejs/node/commit/b3a7da1091)] - **deps**: update http_parser to 2.5.0 (Fedor Indutny) [#1517](https://github.com/nodejs/node/pull/1517) -* [[`ac1fb39ce8`](https://github.com/nodejs/node/commit/ac1fb39ce8)] - **doc**: add rvagg to the TC (Rod Vagg) [#1613](https://github.com/nodejs/node/pull/1613) -* [[`dacc1fa35c`](https://github.com/nodejs/node/commit/dacc1fa35c)] - **doc**: update AUTHORS list (Rod Vagg) [#1586](https://github.com/nodejs/node/pull/1586) -* [[`2a3a1909ab`](https://github.com/nodejs/node/commit/2a3a1909ab)] - **doc**: add require() lines to child.stdio example (Nick Raienko) [#1504](https://github.com/nodejs/node/pull/1504) -* [[`02388dbf40`](https://github.com/nodejs/node/commit/02388dbf40)] - **doc**: fix some cross-references (Alexander Gromnitsky) [#1584](https://github.com/nodejs/node/pull/1584) -* [[`57c4cc26e2`](https://github.com/nodejs/node/commit/57c4cc26e2)] - **doc**: add TC meeting 2015-04-22 minutes (Rod Vagg) [#1556](https://github.com/nodejs/node/pull/1556) -* [[`b4ad5d7050`](https://github.com/nodejs/node/commit/b4ad5d7050)] - **doc**: improve http.request and https.request opts (Roman Reiss) [#1551](https://github.com/nodejs/node/pull/1551) -* [[`7dc8eec0a6`](https://github.com/nodejs/node/commit/7dc8eec0a6)] - **doc**: deprecate smalloc module (Ben Noordhuis) [#1566](https://github.com/nodejs/node/pull/1566) -* [[`1bcdf46ca7`](https://github.com/nodejs/node/commit/1bcdf46ca7)] - **doc**: add TC meeting 2015-04-15 minutes (Rod Vagg) [#1498](https://github.com/nodejs/node/pull/1498) -* [[`391cae3595`](https://github.com/nodejs/node/commit/391cae3595)] - **doc**: Add Known issues to v1.7.0/1.7.1 CHANGELOG (Yosuke Furukawa) [#1473](https://github.com/nodejs/node/pull/1473) -* [[`e55fdc47a7`](https://github.com/nodejs/node/commit/e55fdc47a7)] - **doc**: fix util.deprecate example (Nick Raienko) [#1535](https://github.com/nodejs/node/pull/1535) -* [[`5178f93bc0`](https://github.com/nodejs/node/commit/5178f93bc0)] - **doc**: Add Addon API (NAN) to working group list (Julian Duque) [#1523](https://github.com/nodejs/node/pull/1523) -* [[`f3cc50f811`](https://github.com/nodejs/node/commit/f3cc50f811)] - **doc**: add TC meeting 2015-04-08 minutes (Rod Vagg) [#1497](https://github.com/nodejs/node/pull/1497) -* [[`bb254b533b`](https://github.com/nodejs/node/commit/bb254b533b)] - **doc**: update branch to master (Roman Reiss) [#1511](https://github.com/nodejs/node/pull/1511) -* [[`22aafa5597`](https://github.com/nodejs/node/commit/22aafa5597)] - **doc**: add Fishrock123 to the TC (Jeremiah Senkpiel) [#1507](https://github.com/nodejs/node/pull/1507) -* [[`b16a328ede`](https://github.com/nodejs/node/commit/b16a328ede)] - **doc**: add spaces to child.kill example (Nick Raienko) [#1503](https://github.com/nodejs/node/pull/1503) -* [[`26327757f8`](https://github.com/nodejs/node/commit/26327757f8)] - **doc**: update AUTHORS list (Rod Vagg) [#1476](https://github.com/nodejs/node/pull/1476) -* [[`f9c681cf62`](https://github.com/nodejs/node/commit/f9c681cf62)] - **fs**: validate fd on fs.write (Julian Duque) [#1553](https://github.com/nodejs/node/pull/1553) -* [[`801b47acc5`](https://github.com/nodejs/node/commit/801b47acc5)] - **gitignore**: ignore xcode workspaces and projects (Roman Klauke) [#1562](https://github.com/nodejs/node/pull/1562) -* [[`d5ce47e433`](https://github.com/nodejs/node/commit/d5ce47e433)] - **(SEMVER-MINOR)** **lib**: deprecate the smalloc module (Ben Noordhuis) [#1564](https://github.com/nodejs/node/pull/1564) -* [[`7384ca83f9`](https://github.com/nodejs/node/commit/7384ca83f9)] - **module**: remove '' from Module.globalPaths (Chris Yip) [#1488](https://github.com/nodejs/node/pull/1488) -* [[`b4f5898395`](https://github.com/nodejs/node/commit/b4f5898395)] - **net**: ensure Write/ShutdownWrap references handle (Fedor Indutny) [#1590](https://github.com/nodejs/node/pull/1590) -* [[`4abe2fa1cf`](https://github.com/nodejs/node/commit/4abe2fa1cf)] - **(SEMVER-MINOR)** **net**: add lookup option to Socket.prototype.connect (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) -* [[`1bef717476`](https://github.com/nodejs/node/commit/1bef717476)] - **(SEMVER-MINOR)** **net**: cleanup connect logic (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) -* [[`c7782c0af8`](https://github.com/nodejs/node/commit/c7782c0af8)] - **node**: improve nextTick performance (Brian White) [#1571](https://github.com/nodejs/node/pull/1571) -* [[`b57cc51d8d`](https://github.com/nodejs/node/commit/b57cc51d8d)] - **(SEMVER-MAJOR)** **os**: remove trailing slash from os.tmpdir() (Christian Tellnes) [#747](https://github.com/nodejs/node/pull/747) -* [[`ca219b00d1`](https://github.com/nodejs/node/commit/ca219b00d1)] - **repl**: fix for a+ fd clearing the file on read (Chris Dickinson) [#1605](https://github.com/nodejs/node/pull/1605) -* [[`051d482b15`](https://github.com/nodejs/node/commit/051d482b15)] - **repl**: fix \_debugger by properly proxying repl (Chris Dickinson) [#1605](https://github.com/nodejs/node/pull/1605) -* [[`2e2fce0502`](https://github.com/nodejs/node/commit/2e2fce0502)] - **repl**: fix persistent history and env variable name (Roman Reiss) [#1593](https://github.com/nodejs/node/pull/1593) -* [[`ea5195ccaf`](https://github.com/nodejs/node/commit/ea5195ccaf)] - **repl**: do not save history for non-terminal repl (Fedor Indutny) [#1575](https://github.com/nodejs/node/pull/1575) -* [[`0450ce7db2`](https://github.com/nodejs/node/commit/0450ce7db2)] - **repl**: add mode detection, cli persistent history (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) -* [[`af9fe3bbc7`](https://github.com/nodejs/node/commit/af9fe3bbc7)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION due to V8 API (Rod Vagg) [#1532](https://github.com/nodejs/node/pull/1532) -* [[`279f6116aa`](https://github.com/nodejs/node/commit/279f6116aa)] - **src**: fix -Wmissing-field-initializers warning (Ben Noordhuis) [#1606](https://github.com/nodejs/node/pull/1606) -* [[`73062521a4`](https://github.com/nodejs/node/commit/73062521a4)] - **src**: deprecate smalloc public functions (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) -* [[`ccb199af17`](https://github.com/nodejs/node/commit/ccb199af17)] - **src**: fix deprecation warnings (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) -* [[`609fa0de03`](https://github.com/nodejs/node/commit/609fa0de03)] - **src**: fix NODE_DEPRECATED macro (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) -* [[`3c92ca2b5c`](https://github.com/nodejs/node/commit/3c92ca2b5c)] - **(SEMVER-MINOR)** **src**: add ability to get/set effective uid/gid (Evan Lucas) [#1536](https://github.com/nodejs/node/pull/1536) -* [[`30b7349176`](https://github.com/nodejs/node/commit/30b7349176)] - **stream_base**: dispatch reqs in the stream impl (Fedor Indutny) [#1563](https://github.com/nodejs/node/pull/1563) -* [[`0fa6c4a6fc`](https://github.com/nodejs/node/commit/0fa6c4a6fc)] - **string_decoder**: don't cache Buffer.isEncoding (Brian White) [#1548](https://github.com/nodejs/node/pull/1548) -* [[`f9b226c1c1`](https://github.com/nodejs/node/commit/f9b226c1c1)] - **test**: extend timeouts for ARMv6 (Rod Vagg) [#1554](https://github.com/nodejs/node/pull/1554) -* [[`bfae8236b1`](https://github.com/nodejs/node/commit/bfae8236b1)] - **test**: fix test-net-dns-custom-lookup test assertion (Evan Lucas) [#1531](https://github.com/nodejs/node/pull/1531) -* [[`547213913b`](https://github.com/nodejs/node/commit/547213913b)] - **test**: adjust Makefile/test-ci, add to vcbuild.bat (Rod Vagg) [#1530](https://github.com/nodejs/node/pull/1530) -* [[`550c2638c0`](https://github.com/nodejs/node/commit/550c2638c0)] - **tls**: use `SSL_set_cert_cb` for async SNI/OCSP (Fedor Indutny) [#1464](https://github.com/nodejs/node/pull/1464) -* [[`1787416376`](https://github.com/nodejs/node/commit/1787416376)] - **tls**: destroy singleUse context immediately (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) -* [[`2684c902c4`](https://github.com/nodejs/node/commit/2684c902c4)] - **tls**: zero SSL_CTX freelist for a singleUse socket (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) -* [[`2d241b3b82`](https://github.com/nodejs/node/commit/2d241b3b82)] - **tls**: destroy SSL once it is out of use (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) -* [[`f7620fb96d`](https://github.com/nodejs/node/commit/f7620fb96d)] - **tls_wrap**: Unlink TLSWrap and SecureContext objects (Сковорода Никита Андреевич) [#1580](https://github.com/nodejs/node/pull/1580) -* [[`a7d74633f2`](https://github.com/nodejs/node/commit/a7d74633f2)] - **tls_wrap**: use localhost if options.host is empty (Guilherme Souza) [#1493](https://github.com/nodejs/node/pull/1493) -* [[`702997c1f0`](https://github.com/nodejs/node/commit/702997c1f0)] - ***Revert*** "**url**: significantly improve the performance of the url module" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) -* [[`0daed24883`](https://github.com/nodejs/node/commit/0daed24883)] - ***Revert*** "**url**: delete href cache on all setter code paths" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) -* [[`0f39ef4ca1`](https://github.com/nodejs/node/commit/0f39ef4ca1)] - ***Revert*** "**url**: fix treatment of some values as non-empty" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) -* [[`66877216bd`](https://github.com/nodejs/node/commit/66877216bd)] - **url**: fix treatment of some values as non-empty (Petka Antonov) [#1589](https://github.com/nodejs/node/pull/1589) -* [[`dbdd81a91b`](https://github.com/nodejs/node/commit/dbdd81a91b)] - **url**: delete href cache on all setter code paths (Petka Antonov) [#1589](https://github.com/nodejs/node/pull/1589) -* [[`3fd7fc429c`](https://github.com/nodejs/node/commit/3fd7fc429c)] - **url**: significantly improve the performance of the url module (Petka Antonov) [#1561](https://github.com/nodejs/node/pull/1561) -* [[`bf7ac08dd0`](https://github.com/nodejs/node/commit/bf7ac08dd0)] - **util**: add Map and Set inspection support (Christopher Monsanto) [#1471](https://github.com/nodejs/node/pull/1471) -* [[`30e83d2e84`](https://github.com/nodejs/node/commit/30e83d2e84)] - **win,node-gyp**: optionally allow node.exe/iojs.exe to be renamed (Bert Belder) [#1266](https://github.com/nodejs/node/pull/1266) -* [[`3bda6cbfa4`](https://github.com/nodejs/node/commit/3bda6cbfa4)] - **(SEMVER-MAJOR)** **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) +Moved to doc/changelogs/CHANGELOG_IOJS.md#2.0.0. ## 2015-04-20, Version 1.8.1, @chrisdickinson -### Notable changes - -* **NOTICE**: Skipped v1.8.0 due to problems with release tooling. - See [#1436](https://github.com/nodejs/node/issues/1436) for details. -* **build**: Support for building io.js as a static library (Marat Abdullin) [#1341](https://github.com/nodejs/node/pull/1341) -* **deps**: Upgrade openssl to 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) - * Users should see performance improvements when using the crypto API. - See [here](https://github.com/nodejs/node/wiki/Crypto-Performance-Notes-for-OpenSSL-1.0.2a-on-iojs-v1.8.0) - for details. -* **npm**: Upgrade npm to 2.8.3. See the [release notes](https://github.com/npm/npm/releases/tag/v2.8.3) for details. Includes improved git support. Summary: - * [`387f889`](https://github.com/npm/npm/commit/387f889c0e8fb617d9cc9a42ed0a3ec49424ab5d) - [#7961](https://github.com/npm/npm/issues/7961) Ensure that hosted git SSH - URLs always have a valid protocol when stored in `resolved` fields in - `npm-shrinkwrap.json`. ([@othiym23](https://github.com/othiym23)) - * [`394c2f5`](https://github.com/npm/npm/commit/394c2f5a1227232c0baf42fbba1402aafe0d6ffb) - Switch the order in which hosted Git providers are checked to `git:`, - `git+https:`, then `git+ssh:` (from `git:`, `git+ssh:`, then `git+https:`) in - an effort to go from most to least likely to succeed, to make for less - confusing error message. ([@othiym23](https://github.com/othiym23)) - * [`431c3bf`](https://github.com/npm/npm/commit/431c3bf6cdec50f9f0c735f478cb2f3f337d3313) - [#7699](https://github.com/npm/npm/issues/7699) `npm-registry-client@6.3.2`: - Don't send body with HTTP GET requests when logging in. - ([@smikes](https://github.com/smikes)) - * [`15efe12`](https://github.com/npm/npm/commit/15efe124753257728a0ddc64074fa5a4b9c2eb30) - [#7872](https://github.com/npm/npm/issues/7872) Use the new version of - `hosted-git-info` to pass along credentials embedded in git URLs. Test it. - Test it a lot. ([@othiym23](https://github.com/othiym23)) - * [`b027319`](https://github.com/npm/npm/commit/b0273190c71eba14395ddfdd1d9f7ba625297523) - [#7920](https://github.com/npm/npm/issues/7920) Scoped packages with - `peerDependencies` were installing the `peerDependencies` into the wrong - directory. ([@ewie](https://github.com/ewie)) - * [`6b0f588`](https://github.com/npm/npm/commit/6b0f58877f37df9904490ffbaaad33862bd36dce) - [#7867](https://github.com/npm/npm/issues/7867) Use git shorthand and git - URLs as presented by user. Support new `hosted-git-info` shortcut syntax. - Save shorthand in `package.json`. Try cloning via `git:`, `git+ssh:`, and - `git+https:`, in that order, when supported by the underlying hosting - provider. ([@othiym23](https://github.com/othiym23)) -* **src**: Allow multiple arguments to be passed to process.nextTick (Trevor Norris) [#1077](https://github.com/nodejs/node/pull/1077) -* **module**: The interaction of `require('.')` with `NODE_PATH` has been restored and deprecated. This functionality -will be removed at a later point. (Roman Reiss) [#1363](https://github.com/nodejs/node/pull/1363) - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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). -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`53ed89d927`](https://github.com/nodejs/node/commit/53ed89d927)] - ***Revert*** "**build**: use %PYTHON% instead of python" (Rod Vagg) [#1475](https://github.com/nodejs/node/pull/1475) -* [[`2b744b0ab7`](https://github.com/nodejs/node/commit/2b744b0ab7)] - **src**: revert NODE_MODULE_VERSION to 43 (Chris Dickinson) [#1460](https://github.com/nodejs/node/pull/1460) -* [[`431673ebd1`](https://github.com/nodejs/node/commit/431673ebd1)] - **buffer**: fast-case for empty string in byteLength (Jackson Tian) [#1441](https://github.com/nodejs/node/pull/1441) -* [[`1b22bad35f`](https://github.com/nodejs/node/commit/1b22bad35f)] - **build**: fix logic for shared library flags (Jeremiah Senkpiel) [#1454](https://github.com/nodejs/node/pull/1454) -* [[`91943a99d5`](https://github.com/nodejs/node/commit/91943a99d5)] - **build**: use %PYTHON% instead of python (Rod Vagg) [#1444](https://github.com/nodejs/node/pull/1444) -* [[`c7769d417b`](https://github.com/nodejs/node/commit/c7769d417b)] - **build**: Expose xz compression level (Johan Bergström) [#1428](https://github.com/nodejs/node/pull/1428) -* [[`a530b2baf1`](https://github.com/nodejs/node/commit/a530b2baf1)] - **build**: fix error message in configure (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`92dfb794f9`](https://github.com/nodejs/node/commit/92dfb794f9)] - **build**: enable ssl support on arm64 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`7de0dcde83`](https://github.com/nodejs/node/commit/7de0dcde83)] - **deps**: make node-gyp work with io.js (cjihrig) [#990](https://github.com/nodejs/node/pull/990) -* [[`4870213f9e`](https://github.com/nodejs/node/commit/4870213f9e)] - **deps**: upgrade npm to 2.8.3 (Forrest L Norvell) -* [[`49bb7ded2c`](https://github.com/nodejs/node/commit/49bb7ded2c)] - **deps**: fix git case sensitivity issue in npm (Chris Dickinson) [#1456](https://github.com/nodejs/node/pull/1456) -* [[`4830b4bce8`](https://github.com/nodejs/node/commit/4830b4bce8)] - **deps**: add docs to upgrade openssl (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`11bec72c87`](https://github.com/nodejs/node/commit/11bec72c87)] - **deps**: update asm files for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`53924d8ebe`](https://github.com/nodejs/node/commit/53924d8ebe)] - **deps**: update asm Makefile for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`418e839456`](https://github.com/nodejs/node/commit/418e839456)] - **deps**: update openssl.gyp/gypi for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`02f12ab666`](https://github.com/nodejs/node/commit/02f12ab666)] - **deps**: update opensslconf.h for 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`eb7a23595f`](https://github.com/nodejs/node/commit/eb7a23595f)] - **deps**: add x32 and arm64 support for opensslconf.h (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`033a663127`](https://github.com/nodejs/node/commit/033a663127)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`ae8831f240`](https://github.com/nodejs/node/commit/ae8831f240)] - **deps**: backport openssl patch of alt cert chains 1 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`71316c46d9`](https://github.com/nodejs/node/commit/71316c46d9)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`d293a4f096`](https://github.com/nodejs/node/commit/d293a4f096)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`e4872d7405`](https://github.com/nodejs/node/commit/e4872d7405)] - **deps**: upgrade openssl to 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`a1c9ef3142`](https://github.com/nodejs/node/commit/a1c9ef3142)] - **deps, build**: add support older assembler (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`76f219c128`](https://github.com/nodejs/node/commit/76f219c128)] - **doc**: Document forced pushing with git (Johan Bergström) [#1420](https://github.com/nodejs/node/pull/1420) -* [[`12e51d56c1`](https://github.com/nodejs/node/commit/12e51d56c1)] - **doc**: add Addon API WG (Rod Vagg) [#1226](https://github.com/nodejs/node/pull/1226) -* [[`7956a13dad`](https://github.com/nodejs/node/commit/7956a13dad)] - **http**: logically respect maxSockets (fengmk2) [#1242](https://github.com/nodejs/node/pull/1242) -* [[`5b844e140b`](https://github.com/nodejs/node/commit/5b844e140b)] - **module**: fix style (Roman Reiss) [#1453](https://github.com/nodejs/node/pull/1453) -* [[`3ad82c335d`](https://github.com/nodejs/node/commit/3ad82c335d)] - **(SEMVER-MINOR)** **module**: handle NODE_PATH in require('.') (Roman Reiss) [#1363](https://github.com/nodejs/node/pull/1363) -* [[`cd60ff0328`](https://github.com/nodejs/node/commit/cd60ff0328)] - **net**: add fd into listen2 debug info (Jackson Tian) [#1442](https://github.com/nodejs/node/pull/1442) -* [[`10e31ba56c`](https://github.com/nodejs/node/commit/10e31ba56c)] - **(SEMVER-MINOR)** **node**: allow multiple arguments passed to nextTick (Trevor Norris) [#1077](https://github.com/nodejs/node/pull/1077) -* [[`116c54692a`](https://github.com/nodejs/node/commit/116c54692a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`62f5f4cec9`](https://github.com/nodejs/node/commit/62f5f4cec9)] - **src**: remove duplicate byteLength from Buffer (Jackson Tian) [#1438](https://github.com/nodejs/node/pull/1438) -* [[`51d0808c90`](https://github.com/nodejs/node/commit/51d0808c90)] - **stream**: remove duplicated expression (Yazhong Liu) [#1444](https://github.com/nodejs/node/pull/1444) -* [[`deb9d23d7b`](https://github.com/nodejs/node/commit/deb9d23d7b)] - **test**: fix error message check for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) -* [[`ca8c9ec2c8`](https://github.com/nodejs/node/commit/ca8c9ec2c8)] - **win,node-gyp**: optionally allow node.exe/iojs.exe to be renamed (Bert Belder) [#1266](https://github.com/nodejs/node/pull/1266) +Moved to doc/changelogs/CHANGELOG_IOJS.md#1.8.1. ## 2015-04-14, Version 1.7.1, @rvagg -### Notable changes - -* **build**: A syntax error in the Makefile for release builds caused 1.7.0 to be DOA and unreleased. (Rod Vagg) [#1421](https://github.com/nodejs/node/pull/1421). - -### 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) -* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) -* 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) -* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) - -### Commits - -* [[`aee86a21f2`](https://github.com/nodejs/node/commit/aee86a21f2)] - **build**: fix RELEASE check (Rod Vagg) [#1421](https://github.com/nodejs/node/pull/1421) +Moved to doc/changelogs/CHANGELOG_IOJS.md#1.7.1. ## 2015-04-14, Version 1.7.0, @rvagg -### Notable changes - -* **C++ API**: Fedor Indutny contributed a feature to V8 which has been backported to the V8 bundled in io.js. `SealHandleScope` allows a C++ add-on author to _seal_ a `HandleScope` to prevent further, unintended allocations within it. Currently only enabled for debug builds of io.js. This feature helped detect the leak in [#1075](https://github.com/nodejs/node/issues/1075) and is now activated on the root `HandleScope` in io.js. (Fedor Indutny) [#1395](https://github.com/nodejs/node/pull/1395). -* **ARM**: This release includes significant work to improve the state of ARM support for builds and tests. The io.js CI cluster's ARMv6, ARMv7 and ARMv8 build servers are now all (mostly) reporting passing builds and tests. - * ARMv8 64-bit (AARCH64) is now properly supported, including a backported fix in libuv that was mistakenly detecting the existence of `epoll_wait()`. (Ben Noordhuis) [#1365](https://github.com/nodejs/node/pull/1365). - * ARMv6: [#1376](https://github.com/nodejs/node/issues/1376) reported a problem with `Math.exp()` on ARMv6 (incl Raspberry Pi). The culprit is erroneous codegen for ARMv6 when using the "fast math" feature of V8. `--nofast_math` has been turned on for all ARMv6 variants by default to avoid this, fast math can be turned back on with `--fast_math`. (Ben Noordhuis) [#1398](https://github.com/nodejs/node/pull/1398). - * Tests: timeouts have been tuned specifically for slower platforms, detected as ARMv6 and ARMv7. (Roman Reiss) [#1366](https://github.com/nodejs/node/pull/1366). -* **npm**: Upgrade npm to 2.7.6. See the [release notes](https://github.com/npm/npm/releases/tag/v2.7.6) for details. Summary: - * [`b747593`](https://github.com/npm/npm/commit/b7475936f473f029e6a027ba1b16277523747d0b)[#7630](https://github.com/npm/npm/issues/7630) Don't automatically log all git failures as errors. `maybeGithub` needs to be able to fail without logging to support its fallback logic. ([@othiym23](https://github.com/othiym23)) - * [`78005eb`](https://github.com/npm/npm/commit/78005ebb6f4103c20f077669c3929b7ea46a4c0d)[#7743](https://github.com/npm/npm/issues/7743) Always quote arguments passed to `npm run-script`. This allows build systems and the like to safely escape glob patterns passed as arguments to `run-scripts` with `npm run-script + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_duplex.js.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_duplex.js.html new file mode 100644 index 00000000000000..a3f1208b4136a5 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_duplex.js.html @@ -0,0 +1,287 @@ + + + + Code coverage report for lib/_stream_duplex.js + + + + + + + +
+
+

+ all files / lib/ _stream_duplex.js +

+
+
+ 69.23% + Statements + 27/39 +
+
+ 68.18% + Branches + 15/22 +
+
+ 40% + Functions + 2/5 +
+
+ 75.76% + Lines + 25/33 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  +49× +  +  +  +  +  +  +  +49× +  +  +49× +  +  +  +49× +49× +  +  +49× +49× +  +49× +  +49× +49× +392× +392× +  +  +49× +25× +  +25× +25× +  +25× +  +25× +  +25× +25× +  +25× +  +  +  +49× +  +  +18× +  +  +  +  +  +  +49× +  +  +  +49× +  +  +  + 
// 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';
+ 
+/*<replacement>*/
+ 
+var objectKeys = Object.keys || function (obj) {
+  var keys = [];
+  for (var key in obj) {
+    keys.push(key);
+  }return keys;
+};
+/*</replacement>*/
+ 
+module.exports = Duplex;
+ 
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+ 
+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) {
+  Iif (!(this instanceof Duplex)) return new Duplex(options);
+ 
+  Readable.call(this, options);
+  Writable.call(this, options);
+ 
+  Iif (options && options.readable === false) this.readable = false;
+ 
+  Iif (options && options.writable === false) this.writable = false;
+ 
+  this.allowHalfOpen = true;
+  Iif (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.
+  Eif (this.allowHalfOpen || this._writableState.ended) return;
+ 
+  // no more data can be written.
+  // But allow more writes to happen in this tick.
+  processNextTick(onEndNT, this);
+}
+ 
+function onEndNT(self) {
+  self.end();
+}
+ 
+function forEach(xs, f) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    f(xs[i], i);
+  }
+}
+
+
+ + + + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_passthrough.js.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_passthrough.js.html new file mode 100644 index 00000000000000..3ca02ae767a09e --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_passthrough.js.html @@ -0,0 +1,140 @@ + + + + Code coverage report for lib/_stream_passthrough.js + + + + + + + +
+
+

+ all files / lib/ _stream_passthrough.js +

+
+
+ 90.91% + Statements + 10/11 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
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  +  +  +  +  +  +49× +  +49× +  +  +49× +49× +  +  +49× +  +49× + +  + +  +  +49× +59× + 
// 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');
+ 
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+ 
+util.inherits(PassThrough, Transform);
+ 
+function PassThrough(options) {
+  Iif (!(this instanceof PassThrough)) return new PassThrough(options);
+ 
+  Transform.call(this, options);
+}
+ 
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+  cb(null, chunk);
+};
+
+
+ + + + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_readable.js.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_readable.js.html new file mode 100644 index 00000000000000..fb9f1d0cbe6347 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_readable.js.html @@ -0,0 +1,2741 @@ + + + + Code coverage report for lib/_stream_readable.js + + + + + + + +
+
+

+ all files / lib/ _stream_readable.js +

+
+
+ 89.29% + Statements + 467/523 +
+
+ 87.22% + Branches + 307/352 +
+
+ 86.79% + Functions + 46/53 +
+
+ 90.73% + Lines + 411/453 +
+
+
+
+

+
+
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 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893  +  +49× +  +  +49× +  +  +  +49× +  +  +49× +  +  +49× +  +49× +269× +  +  +  +  +49× +49× +49× +49× +  +49× +  +  +  +  +49× +  +49× +  +  +  +49× +49× +  +  +  +49× +49× +49× +49× +  +  +  +  +  +49× +  +49× +  +49× +  +49× +38× +  +  +  +  +  +  +38× +  +  +49× +49× +82× +  +82× +  +  +  +82× +  +82× +  +  +  +82× +82× +82× +  +  +82× +  +82× +82× +82× +82× +82× +82× +82× +82× +  +  +  +  +  +82× +  +  +  +82× +82× +82× +82× +  +  +  +  +82× +  +  +  +82× +  +  +82× +  +  +82× +  +82× +82× +82× +10× +10× +10× +  +  +  +49× +49× +84× +  +84× +  +82× +  +  +82× +  +82× +  +82× +  +  +  +  +  +  +49× +276927× +  +276927× +37× +37× +10× +10× +  +  +  +276927× +  +  +  +49× +41× +41× +  +  +49× + +  +  +49× +276968× +276968× +  +276968× +67× +67× +276901× +276883× + + +276882× + + +  +276881× +276881× +23× +23× +  +  +276881× +  +  +  +276881× +  +276875× +108× +108× +  +  +276767× +276767× +  +276767× +  +  +  +276881× +  +18× + +  +  +276966× +  +  +  +  +  +  +  +  +  +49× +276966× +  +  +  +49× + + + + +  +  +  +49× +49× + +  +  +  + + + + + + + +  + +  +  +49× +554235× +  +553951× +  +553860× +  +421× +  +  +553439× +  +  +  +  +  +2087× +  +  +2087× +1711× +1697× +1697× +  +14× +  +  +  +376× +  +  +  +49× +277657× +277657× +277657× +  +277657× +  +  +  +  +277657× + + + +  +  +277651× +  +  +277651× +279× +279× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +277372× +277372× +  +  +277372× +277365× +277365× +  +  +  +  +277372× +556× +556× +  +  +277372× +276809× +276809× +276809× +  +276809× +  +276809× +276809× +  +  +  +  +277372× +  +277372× +277372× +  +277372× +276627× +276627× +  +  +277372× +  +  +  +277372× +  +  +277372× +  +277372× +  +277372× +  +  +49× +276968× +276968× +  +  +276968× +  +  +49× +67× +59× +14× +14× + + +  +  +59× +  +  +59× +  +  +  +  +  +49× +276722× +276722× +276722× +1123× +1123× +1123× +  +  +  +49× +1123× +1123× +1123× +  +  +  +  +  +  +  +  +49× +276881× +225× +225× +  +  +  +49× +225× +225× +275597× +275597× +275597× +  +275571× +  +225× +  +  +  +  +  +  +49× +  +  +  +49× +38× +38× +  +38× +  +37× +37× +  + + +  +  +  +  +38× +38× +  +38× +  +38× +38× +  +38× +49× +25× +25× +24× +  +  +  +49× +12× +12× +  +  +  +  +  +  +38× +38× +  +38× +49× +24× +  +24× +24× +24× +24× +24× +24× +24× +24× +  +24× +  +  +  +  +  +  +24× +  +  +38× +49× +395× +395× +395× +  +  +  +  +264× +263× +263× +  +264× +  +  +  +  +  +49× + + + + +  +  +  +38× +  +  +49× +  +  +  +38× +49× + + + +  +38× +  +49× +11× +11× +  +  +  +38× +  +  +38× +12× +12× +  +  +38× +  +  +49× +38× +265× +265× +265× +265× +263× +263× +  +  +  +  +49× +27× +  +  +27× +  +  +24× +  +24× +  +24× +  +  +24× +24× +24× +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +49× +226× +  +  +  +226× +36× +  +  +226× +38× +38× +28× +28× +28× +28× +25× + + +  +  +  +  +226× +  +49× +  +49× +25× +25× +  +  +  +  +49× +57× +57× +56× +56× +56× +  +57× +  +  +49× +56× +42× +42× +  +  +  +49× +42× +38× +38× +  +  +42× +42× +42× +42× +  +  +49× +272× +272× +270× +270× +270× +  +272× +  +  +49× +1428× +1428× +1428× +345× +395× +  +  +  +  +  +  +  +49× + + +  + + + + +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +16× +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +49× +  +  +  +49× +757× +757× +757× +757× +757× +  +  +757× +  +753× +  +280× +280× +  +  +434× +  +  +114× +114× +114× +320× +  +264× +  +  +  +56× +  +56× +56× +186× +186× +  +186× +  +186× +  +186× +  +  +  +  +753× +  +  +49× +316× +  +  +  +316× +  +316× +314× +314× +  +  +  +49× +  +314× +54× +54× +54× +  +  +  +49× + + +  +  +  +49× + + +  +  + 
'use strict';
+ 
+module.exports = Readable;
+ 
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+ 
+Readable.ReadableState = ReadableState;
+ 
+/*<replacement>*/
+var EE = require('events').EventEmitter;
+ 
+var EElistenerCount = function (emitter, type) {
+  return emitter.listeners(type).length;
+};
+/*</replacement>*/
+ 
+/*<replacement>*/
+var Stream;
+(function () {
+  try {
+    Stream = require('st' + 'ream');
+  } catch (_) {} finally {
+    Iif (!Stream) Stream = require('events').EventEmitter;
+  }
+})();
+/*</replacement>*/
+ 
+var Buffer = require('buffer').Buffer;
+/*<replacement>*/
+var bufferShim = require('buffer-shims');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var debugUtil = require('util');
+var debug = void 0;
+Eif (debugUtil && debugUtil.debuglog) {
+  debug = debugUtil.debuglog('stream');
+} else {
+  debug = function () {};
+}
+/*</replacement>*/
+ 
+var StringDecoder;
+ 
+util.inherits(Readable, Stream);
+ 
+var hasPrependListener = typeof EE.prototype.prependListener === 'function';
+ 
+function prependListener(emitter, event, fn) {
+  Iif (hasPrependListener) return emitter.prependListener(event, fn);
+ 
+  // This is a brutally ugly hack to make sure that our error handler
+  // is attached before any userland ones.  NEVER DO THIS. This is here
+  // only because this code needs to continue to work with older versions
+  // of Node.js that do not include the prependListener() method. The goal
+  // is to eventually remove this hack.
+  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else Iif (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+ 
+var Duplex;
+function ReadableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+ 
+  options = options || {};
+ 
+  // object stream flag. Used to make read(n) ignore n and to
+  // make all the buffer merging and length checks go away
+  this.objectMode = !!options.objectMode;
+ 
+  if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+ 
+  // the point at which it stops calling _read() to fill the buffer
+  // Note: 0 is a valid value, means "don't call _read preemptively ever"
+  var hwm = options.highWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+  this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
+ 
+  // cast to ints.
+  this.highWaterMark = ~ ~this.highWaterMark;
+ 
+  this.buffer = [];
+  this.length = 0;
+  this.pipes = null;
+  this.pipesCount = 0;
+  this.flowing = null;
+  this.ended = false;
+  this.endEmitted = false;
+  this.reading = false;
+ 
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, because any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+ 
+  // whenever we return null, then we set a flag to say
+  // that we're awaiting a 'readable' event emission.
+  this.needReadable = false;
+  this.emittedReadable = false;
+  this.readableListening = false;
+  this.resumeScheduled = false;
+ 
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+ 
+  // when piping, we only care about 'readable' events that happen
+  // after read()ing all the bytes and not getting any pushback.
+  this.ranOut = false;
+ 
+  // the number of writers that are awaiting a drain event in .pipe()s
+  this.awaitDrain = 0;
+ 
+  // if true, a maybeReadMore has been scheduled
+  this.readingMore = false;
+ 
+  this.decoder = null;
+  this.encoding = null;
+  if (options.encoding) {
+    if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+    this.decoder = new StringDecoder(options.encoding);
+    this.encoding = options.encoding;
+  }
+}
+ 
+var Duplex;
+function Readable(options) {
+  Duplex = Duplex || require('./_stream_duplex');
+ 
+  if (!(this instanceof Readable)) return new Readable(options);
+ 
+  this._readableState = new ReadableState(options, this);
+ 
+  // legacy
+  this.readable = true;
+ 
+  if (options && typeof options.read === 'function') this._read = options.read;
+ 
+  Stream.call(this);
+}
+ 
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+  var state = this._readableState;
+ 
+  if (!state.objectMode && typeof chunk === 'string') {
+    encoding = encoding || state.defaultEncoding;
+    if (encoding !== state.encoding) {
+      chunk = bufferShim.from(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);
+  Iif (er) {
+    stream.emit('error', er);
+  } else if (chunk === null) {
+    state.reading = false;
+    onEofChunk(stream, state);
+  } else if (state.objectMode || chunk && chunk.length > 0) {
+    if (state.ended && !addToFront) {
+      var e = new Error('stream.push() after EOF');
+      stream.emit('error', e);
+    } else if (state.endEmitted && addToFront) {
+      var _e = new Error('stream.unshift() after end event');
+      stream.emit('error', _e);
+    } else {
+      var skipAdd;
+      if (state.decoder && !addToFront && !encoding) {
+        chunk = state.decoder.write(chunk);
+        skipAdd = !state.objectMode && chunk.length === 0;
+      }
+ 
+      if (!addToFront) state.reading = false;
+ 
+      // Don't add to the buffer if we've decoded to an empty string chunk and
+      // we're not in object mode
+      if (!skipAdd) {
+        // if we want the data now, just emit it.
+        if (state.flowing && state.length === 0 && !state.sync) {
+          stream.emit('data', chunk);
+          stream.read(0);
+        } else {
+          // update the buffer info.
+          state.length += state.objectMode ? 1 : chunk.length;
+          if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+ 
+          if (state.needReadable) emitReadable(stream);
+        }
+      }
+ 
+      maybeReadMore(stream, state);
+    }
+  } else if (!addToFront) {
+    state.reading = false;
+  }
+ 
+  return needMoreData(state);
+}
+ 
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes.  This is to work around cases where hwm=0,
+// such as the repl.  Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+ 
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+  if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+  this._readableState.decoder = new StringDecoder(enc);
+  this._readableState.encoding = enc;
+  return this;
+};
+ 
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+  Iif (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;
+  Iif (!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.
+      // => Check whether `dest` is still a piping destination.
+      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -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);
+  }
+ 
+  // Make sure our error handler is attached before userland ones.
+  prependListener(dest, 'error', onerror);
+ 
+  // 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.
+  Eif (state.pipesCount === 1) {
+    // passed in one, but it's not the right one.
+    Iif (dest && dest !== state.pipes) return this;
+ 
+    Iif (!dest) dest = state.pipes;
+ 
+    // got a match.
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+    Eif (dest) dest.emit('unpipe', this);
+    return this;
+  }
+ 
+  // slow case. multiple pipe destinations.
+ 
+  if (!dest) {
+    // remove all.
+    var dests = state.pipes;
+    var len = state.pipesCount;
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+ 
+    for (var _i = 0; _i < len; _i++) {
+      dests[_i].emit('unpipe', this);
+    }return this;
+  }
+ 
+  // try to find the right one.
+  var i = indexOf(state.pipes, dest);
+  if (i === -1) return this;
+ 
+  state.pipes.splice(i, 1);
+  state.pipesCount -= 1;
+  if (state.pipesCount === 1) state.pipes = state.pipes[0];
+ 
+  dest.emit('unpipe', this);
+ 
+  return this;
+};
+ 
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+  var res = Stream.prototype.on.call(this, ev, fn);
+ 
+  // If listening to data, and it has not explicitly been paused,
+  // then call resume to start the flow of data on the next tick.
+  if (ev === 'data' && false !== this._readableState.flowing) {
+    this.resume();
+  }
+ 
+  if (ev === 'readable' && !this._readableState.endEmitted) {
+    var state = this._readableState;
+    if (!state.readableListening) {
+      state.readableListening = true;
+      state.emittedReadable = false;
+      state.needReadable = true;
+      if (!state.reading) {
+        processNextTick(nReadingNextTick, this);
+      } else if (state.length) {
+        emitReadable(this, state);
+      }
+    }
+  }
+ 
+  return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+ 
+function nReadingNextTick(self) {
+  debug('readable nexttick read 0');
+  self.read(0);
+}
+ 
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+  var state = this._readableState;
+  if (!state.flowing) {
+    debug('resume');
+    state.flowing = true;
+    resume(this, state);
+  }
+  return this;
+};
+ 
+function resume(stream, state) {
+  if (!state.resumeScheduled) {
+    state.resumeScheduled = true;
+    processNextTick(resume_, stream, state);
+  }
+}
+ 
+function resume_(stream, state) {
+  if (!state.reading) {
+    debug('resume read 0');
+    stream.read(0);
+  }
+ 
+  state.resumeScheduled = false;
+  stream.emit('resume');
+  flow(stream);
+  if (state.flowing && !state.reading) stream.read(0);
+}
+ 
+Readable.prototype.pause = function () {
+  debug('call pause flowing=%j', this._readableState.flowing);
+  if (false !== this._readableState.flowing) {
+    debug('pause');
+    this._readableState.flowing = false;
+    this.emit('pause');
+  }
+  return this;
+};
+ 
+function flow(stream) {
+  var state = stream._readableState;
+  debug('flow', state.flowing);
+  if (state.flowing) {
+    do {
+      var chunk = stream.read();
+    } while (null !== chunk && state.flowing);
+  }
+}
+ 
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+  var state = this._readableState;
+  var paused = false;
+ 
+  var self = this;
+  stream.on('end', function () {
+    debug('wrapped end');
+    Iif (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) {
+    Iif (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;
+ 
+  Iif (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 = bufferShim.allocUnsafe(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.
+  Iif (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+ 
+  if (!state.endEmitted) {
+    state.ended = true;
+    processNextTick(endReadableNT, state, stream);
+  }
+}
+ 
+function endReadableNT(state, stream) {
+  // Check that we didn't get one last unshift.
+  if (!state.endEmitted && state.length === 0) {
+    state.endEmitted = true;
+    stream.readable = false;
+    stream.emit('end');
+  }
+}
+ 
+function forEach(xs, f) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    f(xs[i], i);
+  }
+}
+ 
+function indexOf(xs, x) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    if (xs[i] === x) return i;
+  }
+  return -1;
+}
+
+
+ + + + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_transform.js.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_transform.js.html new file mode 100644 index 00000000000000..3542da4f637927 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_transform.js.html @@ -0,0 +1,602 @@ + + + + Code coverage report for lib/_stream_transform.js + + + + + + + +
+
+

+ all files / lib/ _stream_transform.js +

+
+
+ 92.11% + Statements + 70/76 +
+
+ 84.21% + Branches + 32/38 +
+
+ 90.91% + Functions + 10/11 +
+
+ 98.48% + Lines + 65/66 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +49× +  +49× +  +  +49× +49× +  +  +49× +  +49× +24× +116× +  +  +24× +24× +24× +24× +24× +  +  +49× +116× +116× +  +116× +  +116× +  +116× +116× +  +116× +  +116× +  +116× +116× +116× +113× +  +  +  +49× +24× +  +24× +  +24× +  +  +24× +  +  +24× +  +  +  +  +24× +  +24× +13× +  +13× +  +  +24× +19× + +17× +  +  +  +49× +127× +127× +  +  +  +  +  +  +  +  +  +  +  +  +49× +  +  +  +49× +117× +117× +117× +117× +117× +117× +117× +  +  +  +  +  +  +49× +310× +  +310× +116× +116× +  +  +  +194× +  +  +  +49× +19× +  +  +  +19× +19× +  +19× +  +19× +  +19× + 
// 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');
+ 
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+ 
+util.inherits(Transform, Duplex);
+ 
+function TransformState(stream) {
+  this.afterTransform = function (er, data) {
+    return afterTransform(stream, er, data);
+  };
+ 
+  this.needTransform = false;
+  this.transforming = false;
+  this.writecb = null;
+  this.writechunk = null;
+  this.writeencoding = null;
+}
+ 
+function afterTransform(stream, er, data) {
+  var ts = stream._transformState;
+  ts.transforming = false;
+ 
+  var cb = ts.writecb;
+ 
+  Iif (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
+ 
+  ts.writechunk = null;
+  ts.writecb = null;
+ 
+  if (data !== null && data !== undefined) stream.push(data);
+ 
+  cb(er);
+ 
+  var rs = stream._readableState;
+  rs.reading = false;
+  if (rs.needReadable || rs.length < rs.highWaterMark) {
+    stream._read(rs.highWaterMark);
+  }
+}
+ 
+function Transform(options) {
+  Iif (!(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;
+  Eif (!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) {
+  Iif (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;
+ 
+  Iif (ws.length) throw new Error('Calling transform done when ws.length != 0');
+ 
+  Iif (ts.transforming) throw new Error('Calling transform done when still transforming');
+ 
+  return stream.push(null);
+}
+
+
+ + + + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_writable.js.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_writable.js.html new file mode 100644 index 00000000000000..0b200c9e09744b --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/_stream_writable.js.html @@ -0,0 +1,1640 @@ + + + + Code coverage report for lib/_stream_writable.js + + + + + + + +
+
+

+ all files / lib/ _stream_writable.js +

+
+
+ 95.52% + Statements + 277/290 +
+
+ 94% + Branches + 141/150 +
+
+ 90.91% + Functions + 30/33 +
+
+ 96.58% + Lines + 254/263 +
+
+
+
+

+
+
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 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526  +  +  +  +  +  +49× +  +  +49× +  +  +  +49× +  +  +49× +  +  +49× +49× +  +  +  +49× +  +  +  +  +  +49× +49× +49× +49× +  +49× +  +  +  +  +49× +  +49× +  +  +49× +  +49× +  +49× +2305× +2305× +2305× +2305× +  +  +49× +49× +96× +  +96× +  +  +  +96× +  +96× +  +  +  +  +96× +96× +96× +  +  +96× +  +96× +  +96× +  +96× +  +96× +  +  +  +  +96× +96× +  +  +  +  +96× +  +  +  +  +96× +  +  +96× +  +  +96× +  +  +  +  +  +96× +  +  +  +  +96× +  +  +96× +4574× +  +  +  +96× +  +  +96× +  +96× +96× +  +  +  +96× +  +  +  +96× +  +  +96× +  +  +96× +  +  +  +96× +  +  +49× + + + + + +  + +  +  +49× +49× +49× +  +  +  +  +  +  +  +49× +49× +97× +  +  +  +97× +  +96× +  +  +96× +  +96× +50× +  +50× +  +  +96× +  +  +  +49× + +  +  +49× + +  + + +  +  +  +  +  +  +  +49× +4625× +4625× +  +  +  +4625× + +4623× + +  +4625× + + + +  +4623× +  +  +49× +4626× +4626× +  +4626× +59× +59× +  +  +4626× +  +4626× +  +4626× +4621× +4621× +  +  +4624× +  +  +49× +13× +  +13× +  +  +49× +13× +  +13× +13× +  +13× +  +  +  +49× +  + + + + +  +  +49× +4621× +2273× +  +4621× +  +  +  +  +  +49× +4621× +  +4621× +4621× +  +4621× +  +4621× +  +4621× +  +4621× +2305× +2305× +2305× +2265× +  +40× +  +2305× +  +2316× +  +  +4621× +  +  +49× +4582× +4582× +4582× +4582× +4582× +4582× +  +  +49× +  +  +  +  +  +  +  +49× +4574× +4574× +4574× +4574× +  +  +49× +4574× +4574× +4574× +  +4574× +  +4574× +  +4574× +  +4574× +2254× +  +  +4574× +  +2230× +  +  +2344× +  +  +  +  +49× +4574× +4574× +4574× +4574× +  +  +  +  +  +49× +4557× +27× +27× +  +  +  +  +49× +2263× +2263× +  +2263× +  + + + + +  + + +42× +42× +42× +  +  + +  +  +  + + + +  +  +  + +  +  +  +2254× +2257× +2257× +2257× +2257× +  +2257× +2257× +  +  +  +  +2257× +2252× +  +  +  +2254× +  +  +2263× +2263× +2263× +  +  +49× +  +  +  +49× +  +49× +65× +  +65× +11× +11× +11× +54× + + +  +  +65× +  +  +65× + + +  +  +  +65× +  +  +49× +9209× +  +  +49× +125× +57× +57× +  +  +  +49× +4635× +4635× +125× +57× +57× +57× +  +68× +  +  +4635× +  +  +49× +61× +61× +61× +13× +  +61× +61× +  +  +  +  +49× +105× +  +105× +105× +  +105× + + + +40× +40× +40× +40× +  + + +  +  +  +  + 
// 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;
+ 
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
+/*</replacement>*/
+ 
+Writable.WritableState = WritableState;
+ 
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+ 
+/*<replacement>*/
+var internalUtil = {
+  deprecate: require('util-deprecate')
+};
+/*</replacement>*/
+ 
+/*<replacement>*/
+var Stream;
+(function () {
+  try {
+    Stream = require('st' + 'ream');
+  } catch (_) {} finally {
+    Iif (!Stream) Stream = require('events').EventEmitter;
+  }
+})();
+/*</replacement>*/
+ 
+var Buffer = require('buffer').Buffer;
+/*<replacement>*/
+var bufferShim = require('buffer-shims');
+/*</replacement>*/
+ 
+util.inherits(Writable, Stream);
+ 
+function nop() {}
+ 
+function WriteReq(chunk, encoding, cb) {
+  this.chunk = chunk;
+  this.encoding = encoding;
+  this.callback = cb;
+  this.next = null;
+}
+ 
+var Duplex;
+function WritableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+ 
+  options = options || {};
+ 
+  // object stream flag to indicate whether or not this stream
+  // contains buffers or objects.
+  this.objectMode = !!options.objectMode;
+ 
+  if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+ 
+  // the point at which write() starts returning false
+  // Note: 0 is a valid value, means that we always return false if
+  // the entire buffer is not flushed immediately on write()
+  var hwm = options.highWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+  this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
+ 
+  // cast to ints.
+  this.highWaterMark = ~ ~this.highWaterMark;
+ 
+  this.needDrain = false;
+  // at the start of calling end()
+  this.ending = false;
+  // when end() has been called, and returned
+  this.ended = false;
+  // when 'finish' is emitted
+  this.finished = false;
+ 
+  // should we decode strings into buffers before passing to _write?
+  // this is here so that some node-core streams can optimize string
+  // handling at a lower level.
+  var noDecode = options.decodeStrings === false;
+  this.decodeStrings = !noDecode;
+ 
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+ 
+  // not an actual buffer we keep track of, but a measurement
+  // of how much we're waiting to get pushed to some underlying
+  // socket or file.
+  this.length = 0;
+ 
+  // a flag to see when we're in the middle of a write.
+  this.writing = false;
+ 
+  // when true all writes will be buffered until .uncork() call
+  this.corked = 0;
+ 
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, because any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+ 
+  // a flag to know if we're processing previously buffered items, which
+  // may call the _write() callback in the same tick, so that we don't
+  // end up in an overlapped onwrite situation.
+  this.bufferProcessing = false;
+ 
+  // the callback that's passed to _write(chunk,cb)
+  this.onwrite = function (er) {
+    onwrite(stream, er);
+  };
+ 
+  // the callback that the user supplies to write(chunk,encoding,cb)
+  this.writecb = null;
+ 
+  // the amount that is being written when _write is called.
+  this.writelen = 0;
+ 
+  this.bufferedRequest = null;
+  this.lastBufferedRequest = null;
+ 
+  // number of pending user-supplied write callbacks
+  // this must be 0 before 'finish' can be emitted
+  this.pendingcb = 0;
+ 
+  // emit prefinish if the only thing we're waiting for is _write cbs
+  // This is relevant for synchronous Transform streams
+  this.prefinished = false;
+ 
+  // True if the error was already emitted and should not be thrown again
+  this.errorEmitted = false;
+ 
+  // count buffered requests
+  this.bufferedRequestCount = 0;
+ 
+  // allocate the first CorkedRequest, there is always
+  // one allocated and free to use, and we maintain at most two
+  this.corkedRequestsFree = new CorkedRequest(this);
+}
+ 
+WritableState.prototype.getBuffer = function writableStateGetBuffer() {
+  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;
+  var er = false;
+  // Always throw error if a null is written
+  // if we are not in object mode then throw
+  // if it is not a buffer, string, or undefined.
+  if (chunk === null) {
+    er = new TypeError('May not write null values to stream');
+  } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  if (er) {
+    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;
+ 
+  Eif (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;
+  return this;
+};
+ 
+function decodeChunk(state, chunk, encoding) {
+  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+    chunk = bufferShim.from(chunk, encoding);
+  }
+  return chunk;
+}
+ 
+// if we're already writing something, then just put this
+// in the queue, and wait our turn.  Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+  chunk = decodeChunk(state, chunk, encoding);
+ 
+  if (Buffer.isBuffer(chunk)) encoding = 'buffer';
+  var len = state.objectMode ? 1 : chunk.length;
+ 
+  state.length += len;
+ 
+  var ret = state.length < state.highWaterMark;
+  // we must ensure that previous needDrain will not be reset to false.
+  if (!ret) state.needDrain = true;
+ 
+  if (state.writing || state.corked) {
+    var last = state.lastBufferedRequest;
+    state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
+    if (last) {
+      last.next = state.lastBufferedRequest;
+    } else {
+      state.bufferedRequest = state.lastBufferedRequest;
+    }
+    state.bufferedRequestCount += 1;
+  } else {
+    doWrite(stream, state, false, len, chunk, encoding, cb);
+  }
+ 
+  return ret;
+}
+ 
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+  state.writelen = len;
+  state.writecb = cb;
+  state.writing = true;
+  state.sync = true;
+  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+  state.sync = false;
+}
+ 
+function onwriteError(stream, state, sync, er, cb) {
+  --state.pendingcb;
+  if (sync) processNextTick(cb, er);else cb(er);
+ 
+  stream._writableState.errorEmitted = true;
+  stream.emit('error', er);
+}
+ 
+function onwriteStateUpdate(state) {
+  state.writing = false;
+  state.writecb = null;
+  state.length -= state.writelen;
+  state.writelen = 0;
+}
+ 
+function onwrite(stream, er) {
+  var state = stream._writableState;
+  var sync = state.sync;
+  var cb = state.writecb;
+ 
+  onwriteStateUpdate(state);
+ 
+  Iif (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) {
+      /*<replacement>*/
+      asyncWrite(afterWrite, stream, state, finished, cb);
+      /*</replacement>*/
+    } else {
+        afterWrite(stream, state, finished, cb);
+      }
+  }
+}
+ 
+function afterWrite(stream, state, finished, cb) {
+  if (!finished) onwriteDrain(stream, state);
+  state.pendingcb--;
+  cb();
+  finishMaybe(stream, state);
+}
+ 
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+  if (state.length === 0 && state.needDrain) {
+    state.needDrain = false;
+    stream.emit('drain');
+  }
+}
+ 
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+  state.bufferProcessing = true;
+  var entry = state.bufferedRequest;
+ 
+  if (stream._writev && entry && entry.next) {
+    // Fast case, write everything using _writev()
+    var l = state.bufferedRequestCount;
+    var buffer = new Array(l);
+    var holder = state.corkedRequestsFree;
+    holder.entry = entry;
+ 
+    var count = 0;
+    while (entry) {
+      buffer[count] = entry;
+      entry = entry.next;
+      count += 1;
+    }
+ 
+    doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+ 
+    // doWrite is almost always async, defer these to save a bit of time
+    // as the hot path ends with doWrite
+    state.pendingcb++;
+    state.lastBufferedRequest = null;
+    Iif (holder.next) {
+      state.corkedRequestsFree = holder.next;
+      holder.next = null;
+    } else {
+      state.corkedRequestsFree = new CorkedRequest(state);
+    }
+  } else {
+    // Slow case, write chunks one-by-one
+    while (entry) {
+      var chunk = entry.chunk;
+      var encoding = entry.encoding;
+      var cb = entry.callback;
+      var len = state.objectMode ? 1 : chunk.length;
+ 
+      doWrite(stream, state, false, len, chunk, encoding, cb);
+      entry = entry.next;
+      // if we didn't call the onwrite immediately, then
+      // it means that we need to wait until it does.
+      // also, that means that the chunk and cb are currently
+      // being processed, so move the buffer counter past them.
+      if (state.writing) {
+        break;
+      }
+    }
+ 
+    if (entry === null) state.lastBufferedRequest = null;
+  }
+ 
+  state.bufferedRequestCount = 0;
+  state.bufferedRequest = entry;
+  state.bufferProcessing = false;
+}
+ 
+Writable.prototype._write = function (chunk, encoding, cb) {
+  cb(new Error('not implemented'));
+};
+ 
+Writable.prototype._writev = null;
+ 
+Writable.prototype.end = function (chunk, encoding, cb) {
+  var state = this._writableState;
+ 
+  if (typeof chunk === 'function') {
+    cb = chunk;
+    chunk = null;
+    encoding = null;
+  } else if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+ 
+  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+ 
+  // .end() fully uncorks
+  if (state.corked) {
+    state.corked = 1;
+    this.uncork();
+  }
+ 
+  // ignore unnecessary end() calls.
+  if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+ 
+function needFinish(state) {
+  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+ 
+function prefinish(stream, state) {
+  if (!state.prefinished) {
+    state.prefinished = true;
+    stream.emit('prefinish');
+  }
+}
+ 
+function finishMaybe(stream, state) {
+  var need = needFinish(state);
+  if (need) {
+    if (state.pendingcb === 0) {
+      prefinish(stream, state);
+      state.finished = true;
+      stream.emit('finish');
+    } else {
+      prefinish(stream, state);
+    }
+  }
+  return need;
+}
+ 
+function endWritable(stream, state, cb) {
+  state.ending = true;
+  finishMaybe(stream, state);
+  if (cb) {
+    if (state.finished) processNextTick(cb);else stream.once('finish', cb);
+  }
+  state.ended = true;
+  stream.writable = false;
+}
+ 
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+  var _this = this;
+ 
+  this.next = null;
+  this.entry = null;
+ 
+  this.finish = function (err) {
+    var entry = _this.entry;
+    _this.entry = null;
+    while (entry) {
+      var cb = entry.callback;
+      state.pendingcb--;
+      cb(err);
+      entry = entry.next;
+    }
+    Eif (state.corkedRequestsFree) {
+      state.corkedRequestsFree.next = _this;
+    } else {
+      state.corkedRequestsFree = _this;
+    }
+  };
+}
+
+
+ + + + + + + diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/index.html b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/index.html new file mode 100644 index 00000000000000..5240d877ea3b9e --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/lib/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for lib/ + + + + + + + +
+
+

+ all files lib/ +

+
+
+ 90.63% + Statements + 851/939 +
+
+ 87.94% + Branches + 496/564 +
+
+ 86.54% + Functions + 90/104 +
+
+ 92.73% + Lines + 765/825 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
_stream_duplex.js
69.23%27/3968.18%15/2240%2/575.76%25/33
_stream_passthrough.js
90.91%10/1150%1/2100%2/2100%10/10
_stream_readable.js
89.29%467/52387.22%307/35286.79%46/5390.73%411/453
_stream_transform.js
92.11%70/7684.21%32/3890.91%10/1198.48%65/66
_stream_writable.js
95.52%277/29094%141/15090.91%30/3396.58%254/263
+
+
+ + + + + + + diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/prettify.css b/deps/npm/node_modules/readable-stream/coverage/lcov-report/prettify.css similarity index 100% rename from tools/eslint/node_modules/cli-width/coverage/lcov-report/prettify.css rename to deps/npm/node_modules/readable-stream/coverage/lcov-report/prettify.css diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/prettify.js b/deps/npm/node_modules/readable-stream/coverage/lcov-report/prettify.js similarity index 100% rename from tools/eslint/node_modules/cli-width/coverage/lcov-report/prettify.js rename to deps/npm/node_modules/readable-stream/coverage/lcov-report/prettify.js diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/sort-arrow-sprite.png b/deps/npm/node_modules/readable-stream/coverage/lcov-report/sort-arrow-sprite.png similarity index 100% rename from tools/eslint/node_modules/cli-width/coverage/lcov-report/sort-arrow-sprite.png rename to deps/npm/node_modules/readable-stream/coverage/lcov-report/sort-arrow-sprite.png diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/sorter.js b/deps/npm/node_modules/readable-stream/coverage/lcov-report/sorter.js similarity index 95% rename from tools/eslint/node_modules/cli-width/coverage/lcov-report/sorter.js rename to deps/npm/node_modules/readable-stream/coverage/lcov-report/sorter.js index 6afb736c39fb15..6c5034e403c709 100644 --- a/tools/eslint/node_modules/cli-width/coverage/lcov-report/sorter.js +++ b/deps/npm/node_modules/readable-stream/coverage/lcov-report/sorter.js @@ -7,7 +7,7 @@ var addSorting = (function () { }; // returns the summary table element - function getTable() { return document.querySelector('.coverage-summary table'); } + function getTable() { return document.querySelector('.coverage-summary'); } // returns the thead element of the summary table function getTableHeader() { return getTable().querySelector('thead tr'); } // returns the tbody element of the summary table @@ -132,7 +132,9 @@ var addSorting = (function () { }; for (i =0 ; i < cols.length; i += 1) { if (cols[i].sortable) { - el = getNthColumn(i).querySelector('.sorter'); + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; if (el.addEventListener) { el.addEventListener('click', ithSorter(i)); } else { diff --git a/deps/npm/node_modules/readable-stream/coverage/lcov.info b/deps/npm/node_modules/readable-stream/coverage/lcov.info new file mode 100644 index 00000000000000..d0012ea3cb9dac --- /dev/null +++ b/deps/npm/node_modules/readable-stream/coverage/lcov.info @@ -0,0 +1,1642 @@ +TN: +SF:/Users/cmetcalf/projects/readable-stream/lib/_stream_readable.js +FN:18,(anonymous_1) +FN:25,(anonymous_2) +FN:50,(anonymous_3) +FN:60,prependListener +FN:72,ReadableState +FN:139,Readable +FN:158,(anonymous_7) +FN:173,(anonymous_8) +FN:178,(anonymous_9) +FN:182,readableAddChunk +FN:237,needMoreData +FN:242,(anonymous_12) +FN:251,computeNewHighWaterMark +FN:267,howMuchToRead +FN:299,(anonymous_15) +FN:399,chunkInvalid +FN:407,onEofChunk +FN:425,emitReadable +FN:435,emitReadable_ +FN:447,maybeReadMore +FN:454,maybeReadMore_ +FN:470,(anonymous_22) +FN:474,(anonymous_23) +FN:498,onunpipe +FN:505,onend +FN:518,cleanup +FN:541,ondata +FN:559,onerror +FN:570,onclose +FN:575,onfinish +FN:582,unpipe +FN:599,pipeOnDrain +FN:600,(anonymous_33) +FN:611,(anonymous_34) +FN:662,(anonymous_35) +FN:689,nReadingNextTick +FN:696,(anonymous_37) +FN:706,resume +FN:713,resume_ +FN:725,(anonymous_40) +FN:735,flow +FN:748,(anonymous_42) +FN:753,(anonymous_43) +FN:763,(anonymous_44) +FN:781,(anonymous_45) +FN:782,(anonymous_46) +FN:791,(anonymous_47) +FN:797,(anonymous_48) +FN:813,fromList +FN:860,endReadable +FN:873,endReadableNT +FN:882,forEach +FN:888,indexOf +FNF:53 +FNH:46 +FNDA:269,(anonymous_1) +FNDA:49,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:38,prependListener +FNDA:82,ReadableState +FNDA:84,Readable +FNDA:276927,(anonymous_7) +FNDA:41,(anonymous_8) +FNDA:4,(anonymous_9) +FNDA:276968,readableAddChunk +FNDA:276966,needMoreData +FNDA:5,(anonymous_12) +FNDA:4,computeNewHighWaterMark +FNDA:554235,howMuchToRead +FNDA:277657,(anonymous_15) +FNDA:276968,chunkInvalid +FNDA:67,onEofChunk +FNDA:276722,emitReadable +FNDA:1123,emitReadable_ +FNDA:276881,maybeReadMore +FNDA:225,maybeReadMore_ +FNDA:0,(anonymous_22) +FNDA:38,(anonymous_23) +FNDA:25,onunpipe +FNDA:12,onend +FNDA:24,cleanup +FNDA:395,ondata +FNDA:5,onerror +FNDA:0,onclose +FNDA:6,onfinish +FNDA:11,unpipe +FNDA:38,pipeOnDrain +FNDA:265,(anonymous_33) +FNDA:27,(anonymous_34) +FNDA:226,(anonymous_35) +FNDA:25,nReadingNextTick +FNDA:57,(anonymous_37) +FNDA:56,resume +FNDA:42,resume_ +FNDA:272,(anonymous_40) +FNDA:1428,flow +FNDA:1,(anonymous_42) +FNDA:1,(anonymous_43) +FNDA:0,(anonymous_44) +FNDA:0,(anonymous_45) +FNDA:0,(anonymous_46) +FNDA:5,(anonymous_47) +FNDA:0,(anonymous_48) +FNDA:757,fromList +FNDA:316,endReadable +FNDA:314,endReadableNT +FNDA:1,forEach +FNDA:2,indexOf +DA:3,49 +DA:6,49 +DA:10,49 +DA:13,49 +DA:16,49 +DA:18,49 +DA:19,269 +DA:24,49 +DA:25,49 +DA:26,49 +DA:27,49 +DA:29,49 +DA:34,49 +DA:36,49 +DA:40,49 +DA:41,49 +DA:45,49 +DA:46,49 +DA:47,49 +DA:48,49 +DA:50,0 +DA:54,49 +DA:56,49 +DA:58,49 +DA:60,49 +DA:61,38 +DA:68,38 +DA:71,49 +DA:72,49 +DA:73,82 +DA:75,82 +DA:79,82 +DA:81,82 +DA:85,82 +DA:86,82 +DA:87,82 +DA:90,82 +DA:92,82 +DA:93,82 +DA:94,82 +DA:95,82 +DA:96,82 +DA:97,82 +DA:98,82 +DA:99,82 +DA:105,82 +DA:109,82 +DA:110,82 +DA:111,82 +DA:112,82 +DA:117,82 +DA:121,82 +DA:124,82 +DA:127,82 +DA:129,82 +DA:130,82 +DA:131,82 +DA:132,10 +DA:133,10 +DA:134,10 +DA:138,49 +DA:139,49 +DA:140,84 +DA:142,84 +DA:144,82 +DA:147,82 +DA:149,82 +DA:151,82 +DA:158,49 +DA:159,276927 +DA:161,276927 +DA:162,37 +DA:163,37 +DA:164,10 +DA:165,10 +DA:169,276927 +DA:173,49 +DA:174,41 +DA:175,41 +DA:178,49 +DA:179,4 +DA:182,49 +DA:183,276968 +DA:184,276968 +DA:185,0 +DA:186,276968 +DA:187,67 +DA:188,67 +DA:189,276901 +DA:190,276883 +DA:191,1 +DA:192,1 +DA:193,276882 +DA:194,1 +DA:195,1 +DA:197,276881 +DA:198,276881 +DA:199,23 +DA:200,23 +DA:203,276881 +DA:207,276881 +DA:209,276875 +DA:210,108 +DA:211,108 +DA:214,276767 +DA:215,276767 +DA:217,276767 +DA:221,276881 +DA:223,18 +DA:224,9 +DA:227,276966 +DA:237,49 +DA:238,276966 +DA:242,49 +DA:243,5 +DA:244,5 +DA:245,5 +DA:246,5 +DA:250,49 +DA:251,49 +DA:252,4 +DA:253,0 +DA:256,4 +DA:257,4 +DA:258,4 +DA:259,4 +DA:260,4 +DA:261,4 +DA:262,4 +DA:264,4 +DA:267,49 +DA:268,554235 +DA:270,553951 +DA:272,553860 +DA:274,421 +DA:277,553439 +DA:283,2087 +DA:286,2087 +DA:287,1711 +DA:288,1697 +DA:289,1697 +DA:291,14 +DA:295,376 +DA:299,49 +DA:300,277657 +DA:301,277657 +DA:302,277657 +DA:304,277657 +DA:309,277657 +DA:310,6 +DA:311,6 +DA:312,6 +DA:315,277651 +DA:318,277651 +DA:319,279 +DA:320,279 +DA:346,277372 +DA:347,277372 +DA:350,277372 +DA:351,277365 +DA:352,277365 +DA:357,277372 +DA:358,556 +DA:359,556 +DA:362,277372 +DA:363,276809 +DA:364,276809 +DA:365,276809 +DA:367,276809 +DA:369,276809 +DA:370,276809 +DA:375,277372 +DA:377,277372 +DA:378,277372 +DA:380,277372 +DA:381,276627 +DA:382,276627 +DA:385,277372 +DA:389,277372 +DA:392,277372 +DA:394,277372 +DA:396,277372 +DA:399,49 +DA:400,276968 +DA:401,276968 +DA:402,0 +DA:404,276968 +DA:407,49 +DA:408,67 +DA:409,59 +DA:410,14 +DA:411,14 +DA:412,4 +DA:413,4 +DA:416,59 +DA:419,59 +DA:425,49 +DA:426,276722 +DA:427,276722 +DA:428,276722 +DA:429,1123 +DA:430,1123 +DA:431,1123 +DA:435,49 +DA:436,1123 +DA:437,1123 +DA:438,1123 +DA:447,49 +DA:448,276881 +DA:449,225 +DA:450,225 +DA:454,49 +DA:455,225 +DA:456,225 +DA:457,275597 +DA:458,275597 +DA:459,275597 +DA:461,275571 +DA:463,225 +DA:470,49 +DA:471,0 +DA:474,49 +DA:475,38 +DA:476,38 +DA:478,38 +DA:480,37 +DA:481,37 +DA:483,1 +DA:484,1 +DA:486,0 +DA:487,0 +DA:489,38 +DA:490,38 +DA:492,38 +DA:494,38 +DA:495,38 +DA:497,38 +DA:498,49 +DA:499,25 +DA:500,25 +DA:501,24 +DA:505,49 +DA:506,12 +DA:507,12 +DA:514,38 +DA:515,38 +DA:517,38 +DA:518,49 +DA:519,24 +DA:521,24 +DA:522,24 +DA:523,24 +DA:524,24 +DA:525,24 +DA:526,24 +DA:527,24 +DA:528,24 +DA:530,24 +DA:537,24 +DA:540,38 +DA:541,49 +DA:542,395 +DA:543,395 +DA:544,395 +DA:549,264 +DA:550,263 +DA:551,263 +DA:553,264 +DA:559,49 +DA:560,5 +DA:561,5 +DA:562,5 +DA:563,5 +DA:567,38 +DA:570,49 +DA:571,0 +DA:572,0 +DA:574,38 +DA:575,49 +DA:576,6 +DA:577,6 +DA:578,6 +DA:580,38 +DA:582,49 +DA:583,11 +DA:584,11 +DA:588,38 +DA:591,38 +DA:592,12 +DA:593,12 +DA:596,38 +DA:599,49 +DA:600,38 +DA:601,265 +DA:602,265 +DA:603,265 +DA:604,265 +DA:605,263 +DA:606,263 +DA:611,49 +DA:612,27 +DA:615,27 +DA:618,24 +DA:620,24 +DA:622,24 +DA:625,24 +DA:626,24 +DA:627,24 +DA:628,24 +DA:629,24 +DA:634,0 +DA:636,0 +DA:637,0 +DA:638,0 +DA:639,0 +DA:640,0 +DA:642,0 +DA:643,0 +DA:644,0 +DA:648,0 +DA:649,0 +DA:651,0 +DA:652,0 +DA:653,0 +DA:655,0 +DA:657,0 +DA:662,49 +DA:663,226 +DA:667,226 +DA:668,36 +DA:671,226 +DA:672,38 +DA:673,38 +DA:674,28 +DA:675,28 +DA:676,28 +DA:677,28 +DA:678,25 +DA:679,3 +DA:680,1 +DA:685,226 +DA:687,49 +DA:689,49 +DA:690,25 +DA:691,25 +DA:696,49 +DA:697,57 +DA:698,57 +DA:699,56 +DA:700,56 +DA:701,56 +DA:703,57 +DA:706,49 +DA:707,56 +DA:708,42 +DA:709,42 +DA:713,49 +DA:714,42 +DA:715,38 +DA:716,38 +DA:719,42 +DA:720,42 +DA:721,42 +DA:722,42 +DA:725,49 +DA:726,272 +DA:727,272 +DA:728,270 +DA:729,270 +DA:730,270 +DA:732,272 +DA:735,49 +DA:736,1428 +DA:737,1428 +DA:738,1428 +DA:739,345 +DA:740,395 +DA:748,49 +DA:749,1 +DA:750,1 +DA:752,1 +DA:753,1 +DA:754,1 +DA:755,1 +DA:756,0 +DA:757,0 +DA:760,1 +DA:763,1 +DA:764,0 +DA:765,0 +DA:768,0 +DA:770,0 +DA:771,0 +DA:772,0 +DA:773,0 +DA:779,1 +DA:780,16 +DA:781,0 +DA:782,0 +DA:783,0 +DA:790,1 +DA:791,1 +DA:792,5 +DA:797,1 +DA:798,0 +DA:799,0 +DA:800,0 +DA:801,0 +DA:805,1 +DA:809,49 +DA:813,49 +DA:814,757 +DA:815,757 +DA:816,757 +DA:817,757 +DA:818,757 +DA:821,757 +DA:823,753 +DA:825,280 +DA:826,280 +DA:829,434 +DA:832,114 +DA:833,114 +DA:834,114 +DA:835,320 +DA:837,264 +DA:841,56 +DA:843,56 +DA:844,56 +DA:845,186 +DA:846,186 +DA:848,186 +DA:850,186 +DA:852,186 +DA:857,753 +DA:860,49 +DA:861,316 +DA:865,316 +DA:867,316 +DA:868,314 +DA:869,314 +DA:873,49 +DA:875,314 +DA:876,54 +DA:877,54 +DA:878,54 +DA:882,49 +DA:883,1 +DA:884,5 +DA:888,49 +DA:889,2 +DA:890,3 +DA:892,0 +LF:453 +LH:411 +BRDA:29,1,0,0 +BRDA:29,1,1,49 +BRDA:47,2,0,49 +BRDA:47,2,1,0 +BRDA:47,3,0,49 +BRDA:47,3,1,49 +BRDA:61,4,0,0 +BRDA:61,4,1,38 +BRDA:68,5,0,33 +BRDA:68,5,1,5 +BRDA:68,6,0,38 +BRDA:68,6,1,38 +BRDA:68,7,0,0 +BRDA:68,7,1,5 +BRDA:73,8,0,82 +BRDA:73,8,1,0 +BRDA:75,9,0,82 +BRDA:75,9,1,40 +BRDA:81,10,0,25 +BRDA:81,10,1,57 +BRDA:81,11,0,25 +BRDA:81,11,1,17 +BRDA:86,12,0,19 +BRDA:86,12,1,63 +BRDA:87,13,0,15 +BRDA:87,13,1,67 +BRDA:87,14,0,82 +BRDA:87,14,1,67 +BRDA:117,15,0,82 +BRDA:117,15,1,82 +BRDA:131,16,0,10 +BRDA:131,16,1,72 +BRDA:132,17,0,6 +BRDA:132,17,1,4 +BRDA:140,18,0,84 +BRDA:140,18,1,39 +BRDA:142,19,0,2 +BRDA:142,19,1,82 +BRDA:149,20,0,1 +BRDA:149,20,1,81 +BRDA:149,21,0,82 +BRDA:149,21,1,42 +BRDA:161,22,0,37 +BRDA:161,22,1,276890 +BRDA:161,23,0,276927 +BRDA:161,23,1,276819 +BRDA:162,24,0,37 +BRDA:162,24,1,37 +BRDA:163,25,0,10 +BRDA:163,25,1,27 +BRDA:184,26,0,0 +BRDA:184,26,1,276968 +BRDA:186,27,0,67 +BRDA:186,27,1,276901 +BRDA:189,28,0,276883 +BRDA:189,28,1,18 +BRDA:189,29,0,276901 +BRDA:189,29,1,276810 +BRDA:189,29,2,276810 +BRDA:190,30,0,1 +BRDA:190,30,1,276882 +BRDA:190,31,0,276883 +BRDA:190,31,1,3 +BRDA:193,32,0,1 +BRDA:193,32,1,276881 +BRDA:193,33,0,276882 +BRDA:193,33,1,1 +BRDA:198,34,0,23 +BRDA:198,34,1,276858 +BRDA:198,35,0,276881 +BRDA:198,35,1,50 +BRDA:198,35,2,50 +BRDA:200,36,0,23 +BRDA:200,36,1,23 +BRDA:203,37,0,276850 +BRDA:203,37,1,31 +BRDA:207,38,0,276875 +BRDA:207,38,1,6 +BRDA:209,39,0,108 +BRDA:209,39,1,276767 +BRDA:209,40,0,276875 +BRDA:209,40,1,152 +BRDA:209,40,2,143 +BRDA:214,41,0,51 +BRDA:214,41,1,276716 +BRDA:215,42,0,31 +BRDA:215,42,1,276736 +BRDA:217,43,0,276660 +BRDA:217,43,1,107 +BRDA:223,44,0,9 +BRDA:223,44,1,9 +BRDA:238,45,0,276966 +BRDA:238,45,1,276896 +BRDA:238,45,2,276704 +BRDA:238,45,3,64 +BRDA:243,46,0,1 +BRDA:243,46,1,4 +BRDA:252,47,0,0 +BRDA:252,47,1,4 +BRDA:268,48,0,284 +BRDA:268,48,1,553951 +BRDA:268,49,0,554235 +BRDA:268,49,1,715 +BRDA:270,50,0,91 +BRDA:270,50,1,553860 +BRDA:270,51,0,46 +BRDA:270,51,1,45 +BRDA:272,52,0,421 +BRDA:272,52,1,553439 +BRDA:272,53,0,553860 +BRDA:272,53,1,553860 +BRDA:274,54,0,304 +BRDA:274,54,1,117 +BRDA:274,55,0,421 +BRDA:274,55,1,353 +BRDA:277,56,0,551352 +BRDA:277,56,1,2087 +BRDA:283,57,0,4 +BRDA:283,57,1,2083 +BRDA:286,58,0,1711 +BRDA:286,58,1,376 +BRDA:287,59,0,1697 +BRDA:287,59,1,14 +BRDA:304,60,0,1859 +BRDA:304,60,1,275798 +BRDA:304,61,0,277657 +BRDA:304,61,1,277162 +BRDA:309,62,0,6 +BRDA:309,62,1,277651 +BRDA:309,63,0,277657 +BRDA:309,63,1,275798 +BRDA:309,63,2,275735 +BRDA:309,63,3,275734 +BRDA:311,64,0,4 +BRDA:311,64,1,2 +BRDA:311,65,0,6 +BRDA:311,65,1,4 +BRDA:318,66,0,279 +BRDA:318,66,1,277372 +BRDA:318,67,0,277651 +BRDA:318,67,1,277088 +BRDA:319,68,0,277 +BRDA:319,68,1,2 +BRDA:350,69,0,277365 +BRDA:350,69,1,7 +BRDA:350,70,0,277372 +BRDA:350,70,1,276947 +BRDA:357,71,0,556 +BRDA:357,71,1,276816 +BRDA:357,72,0,277372 +BRDA:357,72,1,277056 +BRDA:362,73,0,276809 +BRDA:362,73,1,563 +BRDA:367,74,0,349 +BRDA:367,74,1,276460 +BRDA:375,75,0,276584 +BRDA:375,75,1,788 +BRDA:375,76,0,277372 +BRDA:375,76,1,276809 +BRDA:378,77,0,749 +BRDA:378,77,1,276623 +BRDA:380,78,0,276627 +BRDA:380,78,1,745 +BRDA:389,79,0,454 +BRDA:389,79,1,276918 +BRDA:389,80,0,277372 +BRDA:389,80,1,492 +BRDA:392,81,0,35 +BRDA:392,81,1,277337 +BRDA:392,82,0,277372 +BRDA:392,82,1,1242 +BRDA:392,82,2,307 +BRDA:394,83,0,745 +BRDA:394,83,1,276627 +BRDA:401,84,0,0 +BRDA:401,84,1,276968 +BRDA:401,85,0,276968 +BRDA:401,85,1,185 +BRDA:401,85,2,131 +BRDA:401,85,3,64 +BRDA:401,85,4,64 +BRDA:408,86,0,8 +BRDA:408,86,1,59 +BRDA:409,87,0,14 +BRDA:409,87,1,45 +BRDA:411,88,0,4 +BRDA:411,88,1,10 +BRDA:411,89,0,14 +BRDA:411,89,1,4 +BRDA:413,90,0,0 +BRDA:413,90,1,4 +BRDA:428,91,0,1123 +BRDA:428,91,1,275599 +BRDA:431,92,0,1003 +BRDA:431,92,1,120 +BRDA:448,93,0,225 +BRDA:448,93,1,276656 +BRDA:456,94,0,275796 +BRDA:456,94,1,275697 +BRDA:456,94,2,275647 +BRDA:456,94,3,275626 +BRDA:459,95,0,26 +BRDA:459,95,1,275571 +BRDA:478,96,0,37 +BRDA:478,96,1,1 +BRDA:478,96,2,0 +BRDA:492,97,0,38 +BRDA:492,97,1,1 +BRDA:492,97,2,37 +BRDA:492,97,3,36 +BRDA:494,98,0,36 +BRDA:494,98,1,2 +BRDA:495,99,0,1 +BRDA:495,99,1,37 +BRDA:500,100,0,24 +BRDA:500,100,1,1 +BRDA:537,101,0,1 +BRDA:537,101,1,23 +BRDA:537,102,0,24 +BRDA:537,102,1,1 +BRDA:537,102,2,1 +BRDA:544,103,0,264 +BRDA:544,103,1,131 +BRDA:549,104,0,263 +BRDA:549,104,1,1 +BRDA:549,105,0,264 +BRDA:549,105,1,262 +BRDA:549,105,2,3 +BRDA:549,105,3,2 +BRDA:549,105,4,263 +BRDA:563,106,0,2 +BRDA:563,106,1,3 +BRDA:591,107,0,12 +BRDA:591,107,1,26 +BRDA:603,108,0,261 +BRDA:603,108,1,4 +BRDA:604,109,0,263 +BRDA:604,109,1,2 +BRDA:604,110,0,265 +BRDA:604,110,1,264 +BRDA:615,111,0,3 +BRDA:615,111,1,24 +BRDA:618,112,0,24 +BRDA:618,112,1,0 +BRDA:620,113,0,0 +BRDA:620,113,1,24 +BRDA:620,114,0,24 +BRDA:620,114,1,24 +BRDA:622,115,0,0 +BRDA:622,115,1,24 +BRDA:628,116,0,24 +BRDA:628,116,1,0 +BRDA:634,117,0,0 +BRDA:634,117,1,0 +BRDA:649,118,0,0 +BRDA:649,118,1,0 +BRDA:653,119,0,0 +BRDA:653,119,1,0 +BRDA:667,120,0,36 +BRDA:667,120,1,190 +BRDA:667,121,0,226 +BRDA:667,121,1,48 +BRDA:671,122,0,38 +BRDA:671,122,1,188 +BRDA:671,123,0,226 +BRDA:671,123,1,38 +BRDA:673,124,0,28 +BRDA:673,124,1,10 +BRDA:677,125,0,25 +BRDA:677,125,1,3 +BRDA:679,126,0,1 +BRDA:679,126,1,2 +BRDA:698,127,0,56 +BRDA:698,127,1,1 +BRDA:707,128,0,42 +BRDA:707,128,1,14 +BRDA:714,129,0,38 +BRDA:714,129,1,4 +BRDA:722,130,0,12 +BRDA:722,130,1,30 +BRDA:722,131,0,42 +BRDA:722,131,1,27 +BRDA:727,132,0,270 +BRDA:727,132,1,2 +BRDA:738,133,0,345 +BRDA:738,133,1,1083 +BRDA:741,134,0,395 +BRDA:741,134,1,310 +BRDA:755,135,0,0 +BRDA:755,135,1,1 +BRDA:755,136,0,1 +BRDA:755,136,1,0 +BRDA:757,137,0,0 +BRDA:757,137,1,0 +BRDA:757,138,0,0 +BRDA:757,138,1,0 +BRDA:765,139,0,0 +BRDA:765,139,1,0 +BRDA:768,140,0,0 +BRDA:768,140,1,0 +BRDA:768,141,0,0 +BRDA:768,141,1,0 +BRDA:768,141,2,0 +BRDA:768,142,0,0 +BRDA:768,142,1,0 +BRDA:768,143,0,0 +BRDA:768,143,1,0 +BRDA:768,143,2,0 +BRDA:771,144,0,0 +BRDA:771,144,1,0 +BRDA:780,145,0,0 +BRDA:780,145,1,16 +BRDA:780,146,0,16 +BRDA:780,146,1,1 +BRDA:799,147,0,0 +BRDA:799,147,1,0 +BRDA:821,148,0,4 +BRDA:821,148,1,753 +BRDA:823,149,0,0 +BRDA:823,149,1,753 +BRDA:823,150,0,39 +BRDA:823,150,1,714 +BRDA:823,151,0,280 +BRDA:823,151,1,434 +BRDA:823,152,0,714 +BRDA:823,152,1,714 +BRDA:825,153,0,21 +BRDA:825,153,1,259 +BRDA:825,154,0,66 +BRDA:825,154,1,193 +BRDA:829,155,0,114 +BRDA:829,155,1,320 +BRDA:835,156,0,264 +BRDA:835,156,1,56 +BRDA:841,157,0,1 +BRDA:841,157,1,55 +BRDA:844,158,0,242 +BRDA:844,158,1,219 +BRDA:848,159,0,2 +BRDA:848,159,1,184 +BRDA:850,160,0,39 +BRDA:850,160,1,147 +BRDA:865,161,0,0 +BRDA:865,161,1,316 +BRDA:867,162,0,314 +BRDA:867,162,1,2 +BRDA:875,163,0,54 +BRDA:875,163,1,260 +BRDA:875,164,0,314 +BRDA:875,164,1,54 +BRDA:890,165,0,2 +BRDA:890,165,1,1 +BRF:352 +BRH:307 +end_of_record +TN: +SF:/Users/cmetcalf/projects/readable-stream/lib/_stream_writable.js +FN:32,(anonymous_1) +FN:48,nop +FN:50,WriteReq +FN:58,WritableState +FN:121,(anonymous_5) +FN:153,writableStateGetBuffer +FN:163,(anonymous_7) +FN:166,(anonymous_8) +FN:174,Writable +FN:196,(anonymous_10) +FN:200,writeAfterEnd +FN:212,validChunk +FN:231,(anonymous_13) +FN:252,(anonymous_14) +FN:258,(anonymous_15) +FN:268,setDefaultEncoding +FN:276,decodeChunk +FN:286,writeOrBuffer +FN:314,doWrite +FN:323,onwriteError +FN:331,onwriteStateUpdate +FN:338,onwrite +FN:363,afterWrite +FN:373,onwriteDrain +FN:381,clearBuffer +FN:438,(anonymous_26) +FN:444,(anonymous_27) +FN:468,needFinish +FN:472,prefinish +FN:479,finishMaybe +FN:493,endWritable +FN:505,CorkedRequest +FN:511,(anonymous_33) +FNF:33 +FNH:30 +FNDA:49,(anonymous_1) +FNDA:2512,nop +FNDA:2305,WriteReq +FNDA:96,WritableState +FNDA:4574,(anonymous_5) +FNDA:1,writableStateGetBuffer +FNDA:49,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:97,Writable +FNDA:1,(anonymous_10) +FNDA:1,writeAfterEnd +FNDA:4625,validChunk +FNDA:4626,(anonymous_13) +FNDA:13,(anonymous_14) +FNDA:13,(anonymous_15) +FNDA:3,setDefaultEncoding +FNDA:4621,decodeChunk +FNDA:4621,writeOrBuffer +FNDA:4582,doWrite +FNDA:0,onwriteError +FNDA:4574,onwriteStateUpdate +FNDA:4574,onwrite +FNDA:4574,afterWrite +FNDA:4557,onwriteDrain +FNDA:2263,clearBuffer +FNDA:0,(anonymous_26) +FNDA:65,(anonymous_27) +FNDA:9209,needFinish +FNDA:125,prefinish +FNDA:4635,finishMaybe +FNDA:61,endWritable +FNDA:105,CorkedRequest +FNDA:8,(anonymous_33) +DA:7,49 +DA:10,49 +DA:14,49 +DA:17,49 +DA:20,49 +DA:21,49 +DA:25,49 +DA:31,49 +DA:32,49 +DA:33,49 +DA:34,49 +DA:36,49 +DA:41,49 +DA:43,49 +DA:46,49 +DA:48,49 +DA:50,49 +DA:51,2305 +DA:52,2305 +DA:53,2305 +DA:54,2305 +DA:57,49 +DA:58,49 +DA:59,96 +DA:61,96 +DA:65,96 +DA:67,96 +DA:72,96 +DA:73,96 +DA:74,96 +DA:77,96 +DA:79,96 +DA:81,96 +DA:83,96 +DA:85,96 +DA:90,96 +DA:91,96 +DA:96,96 +DA:101,96 +DA:104,96 +DA:107,96 +DA:113,96 +DA:118,96 +DA:121,96 +DA:122,4574 +DA:126,96 +DA:129,96 +DA:131,96 +DA:132,96 +DA:136,96 +DA:140,96 +DA:143,96 +DA:146,96 +DA:150,96 +DA:153,49 +DA:154,1 +DA:155,1 +DA:156,1 +DA:157,5 +DA:158,5 +DA:160,1 +DA:163,49 +DA:164,49 +DA:165,49 +DA:167,0 +DA:173,49 +DA:174,49 +DA:175,97 +DA:179,97 +DA:181,96 +DA:184,96 +DA:186,96 +DA:187,50 +DA:189,50 +DA:192,96 +DA:196,49 +DA:197,1 +DA:200,49 +DA:201,1 +DA:203,1 +DA:204,1 +DA:212,49 +DA:213,4625 +DA:214,4625 +DA:218,4625 +DA:219,2 +DA:220,4623 +DA:221,2 +DA:223,4625 +DA:224,4 +DA:225,2 +DA:226,2 +DA:228,4623 +DA:231,49 +DA:232,4626 +DA:233,4626 +DA:235,4626 +DA:236,59 +DA:237,59 +DA:240,4626 +DA:242,4626 +DA:244,4626 +DA:245,4621 +DA:246,4621 +DA:249,4624 +DA:252,49 +DA:253,13 +DA:255,13 +DA:258,49 +DA:259,13 +DA:261,13 +DA:262,13 +DA:264,13 +DA:268,49 +DA:270,3 +DA:271,3 +DA:272,2 +DA:273,2 +DA:276,49 +DA:277,4621 +DA:278,2273 +DA:280,4621 +DA:286,49 +DA:287,4621 +DA:289,4621 +DA:290,4621 +DA:292,4621 +DA:294,4621 +DA:296,4621 +DA:298,4621 +DA:299,2305 +DA:300,2305 +DA:301,2305 +DA:302,2265 +DA:304,40 +DA:306,2305 +DA:308,2316 +DA:311,4621 +DA:314,49 +DA:315,4582 +DA:316,4582 +DA:317,4582 +DA:318,4582 +DA:319,4582 +DA:320,4582 +DA:323,49 +DA:324,0 +DA:325,0 +DA:327,0 +DA:328,0 +DA:331,49 +DA:332,4574 +DA:333,4574 +DA:334,4574 +DA:335,4574 +DA:338,49 +DA:339,4574 +DA:340,4574 +DA:341,4574 +DA:343,4574 +DA:345,4574 +DA:347,4574 +DA:349,4574 +DA:350,2254 +DA:353,4574 +DA:355,2230 +DA:358,2344 +DA:363,49 +DA:364,4574 +DA:365,4574 +DA:366,4574 +DA:367,4574 +DA:373,49 +DA:374,4557 +DA:375,27 +DA:376,27 +DA:381,49 +DA:382,2263 +DA:383,2263 +DA:385,2263 +DA:387,9 +DA:388,9 +DA:389,9 +DA:390,9 +DA:392,9 +DA:393,9 +DA:394,42 +DA:395,42 +DA:396,42 +DA:399,9 +DA:403,9 +DA:404,9 +DA:405,9 +DA:406,0 +DA:407,0 +DA:409,9 +DA:413,2254 +DA:414,2257 +DA:415,2257 +DA:416,2257 +DA:417,2257 +DA:419,2257 +DA:420,2257 +DA:425,2257 +DA:426,2252 +DA:430,2254 +DA:433,2263 +DA:434,2263 +DA:435,2263 +DA:438,49 +DA:439,0 +DA:442,49 +DA:444,49 +DA:445,65 +DA:447,65 +DA:448,11 +DA:449,11 +DA:450,11 +DA:451,54 +DA:452,1 +DA:453,1 +DA:456,65 +DA:459,65 +DA:460,5 +DA:461,5 +DA:465,65 +DA:468,49 +DA:469,9209 +DA:472,49 +DA:473,125 +DA:474,57 +DA:475,57 +DA:479,49 +DA:480,4635 +DA:481,4635 +DA:482,125 +DA:483,57 +DA:484,57 +DA:485,57 +DA:487,68 +DA:490,4635 +DA:493,49 +DA:494,61 +DA:495,61 +DA:496,61 +DA:497,13 +DA:499,61 +DA:500,61 +DA:505,49 +DA:506,105 +DA:508,105 +DA:509,105 +DA:511,105 +DA:512,8 +DA:513,8 +DA:514,8 +DA:515,40 +DA:516,40 +DA:517,40 +DA:518,40 +DA:520,8 +DA:521,8 +DA:523,0 +LF:263 +LH:254 +BRDA:14,1,0,0 +BRDA:14,1,1,49 +BRDA:14,2,0,49 +BRDA:14,2,1,49 +BRDA:36,3,0,0 +BRDA:36,3,1,49 +BRDA:59,4,0,96 +BRDA:59,4,1,0 +BRDA:61,5,0,96 +BRDA:61,5,1,46 +BRDA:67,6,0,25 +BRDA:67,6,1,71 +BRDA:67,7,0,25 +BRDA:67,7,1,17 +BRDA:73,8,0,23 +BRDA:73,8,1,73 +BRDA:74,9,0,8 +BRDA:74,9,1,88 +BRDA:74,10,0,96 +BRDA:74,10,1,88 +BRDA:96,11,0,96 +BRDA:96,11,1,96 +BRDA:175,12,0,97 +BRDA:175,12,1,28 +BRDA:179,13,0,1 +BRDA:179,13,1,96 +BRDA:179,14,0,97 +BRDA:179,14,1,26 +BRDA:186,15,0,50 +BRDA:186,15,1,46 +BRDA:187,16,0,1 +BRDA:187,16,1,49 +BRDA:189,17,0,1 +BRDA:189,17,1,49 +BRDA:218,18,0,2 +BRDA:218,18,1,4623 +BRDA:220,19,0,2 +BRDA:220,19,1,4621 +BRDA:220,20,0,4623 +BRDA:220,20,1,2425 +BRDA:220,20,2,61 +BRDA:220,20,3,61 +BRDA:223,21,0,4 +BRDA:223,21,1,4621 +BRDA:235,22,0,59 +BRDA:235,22,1,4567 +BRDA:240,23,0,2198 +BRDA:240,23,1,2428 +BRDA:240,24,0,2301 +BRDA:240,24,1,127 +BRDA:242,25,0,2527 +BRDA:242,25,1,2099 +BRDA:244,26,0,1 +BRDA:244,26,1,4625 +BRDA:244,27,0,4621 +BRDA:244,27,1,2 +BRDA:261,28,0,13 +BRDA:261,28,1,0 +BRDA:264,29,0,9 +BRDA:264,29,1,4 +BRDA:264,30,0,13 +BRDA:264,30,1,13 +BRDA:264,30,2,9 +BRDA:264,30,3,9 +BRDA:264,30,4,9 +BRDA:270,31,0,2 +BRDA:270,31,1,1 +BRDA:271,32,0,1 +BRDA:271,32,1,2 +BRDA:277,33,0,2273 +BRDA:277,33,1,2348 +BRDA:277,34,0,4621 +BRDA:277,34,1,4547 +BRDA:277,34,2,4467 +BRDA:289,35,0,4471 +BRDA:289,35,1,150 +BRDA:290,36,0,74 +BRDA:290,36,1,4547 +BRDA:296,37,0,177 +BRDA:296,37,1,4444 +BRDA:298,38,0,2305 +BRDA:298,38,1,2316 +BRDA:298,39,0,4621 +BRDA:298,39,1,2358 +BRDA:301,40,0,2265 +BRDA:301,40,1,40 +BRDA:319,41,0,9 +BRDA:319,41,1,4573 +BRDA:325,42,0,0 +BRDA:325,42,1,0 +BRDA:345,43,0,0 +BRDA:345,43,1,4574 +BRDA:349,44,0,2254 +BRDA:349,44,1,2320 +BRDA:349,45,0,4574 +BRDA:349,45,1,4557 +BRDA:349,45,2,4557 +BRDA:349,45,3,4544 +BRDA:353,46,0,2230 +BRDA:353,46,1,2344 +BRDA:364,47,0,4557 +BRDA:364,47,1,17 +BRDA:374,48,0,27 +BRDA:374,48,1,4530 +BRDA:374,49,0,4557 +BRDA:374,49,1,2302 +BRDA:385,50,0,9 +BRDA:385,50,1,2254 +BRDA:385,51,0,2263 +BRDA:385,51,1,9 +BRDA:385,51,2,9 +BRDA:405,52,0,0 +BRDA:405,52,1,9 +BRDA:417,53,0,4 +BRDA:417,53,1,2253 +BRDA:425,54,0,2252 +BRDA:425,54,1,5 +BRDA:430,55,0,29 +BRDA:430,55,1,2225 +BRDA:447,56,0,11 +BRDA:447,56,1,54 +BRDA:451,57,0,1 +BRDA:451,57,1,53 +BRDA:456,58,0,10 +BRDA:456,58,1,55 +BRDA:456,59,0,65 +BRDA:456,59,1,54 +BRDA:459,60,0,5 +BRDA:459,60,1,60 +BRDA:465,61,0,61 +BRDA:465,61,1,4 +BRDA:465,62,0,65 +BRDA:465,62,1,61 +BRDA:469,63,0,9209 +BRDA:469,63,1,420 +BRDA:469,63,2,149 +BRDA:469,63,3,146 +BRDA:469,63,4,145 +BRDA:473,64,0,57 +BRDA:473,64,1,68 +BRDA:481,65,0,125 +BRDA:481,65,1,4510 +BRDA:482,66,0,57 +BRDA:482,66,1,68 +BRDA:496,67,0,13 +BRDA:496,67,1,48 +BRDA:497,68,0,1 +BRDA:497,68,1,12 +BRDA:520,69,0,8 +BRDA:520,69,1,0 +BRF:150 +BRH:141 +end_of_record +TN: +SF:/Users/cmetcalf/projects/readable-stream/lib/_stream_duplex.js +FN:10,(anonymous_1) +FN:40,Duplex +FN:57,onend +FN:67,onEndNT +FN:71,forEach +FNF:5 +FNH:2 +FNDA:0,(anonymous_1) +FNDA:25,Duplex +FNDA:18,onend +FNDA:0,onEndNT +FNDA:0,forEach +DA:10,49 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:18,49 +DA:21,49 +DA:25,49 +DA:26,49 +DA:29,49 +DA:30,49 +DA:32,49 +DA:34,49 +DA:35,49 +DA:36,392 +DA:37,392 +DA:40,49 +DA:41,25 +DA:43,25 +DA:44,25 +DA:46,25 +DA:48,25 +DA:50,25 +DA:51,25 +DA:53,25 +DA:57,49 +DA:60,18 +DA:64,0 +DA:67,49 +DA:68,0 +DA:71,49 +DA:72,0 +DA:73,0 +LF:33 +LH:25 +BRDA:10,1,0,49 +BRDA:10,1,1,0 +BRDA:37,2,0,343 +BRDA:37,2,1,49 +BRDA:41,3,0,0 +BRDA:41,3,1,25 +BRDA:46,4,0,0 +BRDA:46,4,1,25 +BRDA:46,5,0,25 +BRDA:46,5,1,13 +BRDA:48,6,0,0 +BRDA:48,6,1,25 +BRDA:48,7,0,25 +BRDA:48,7,1,13 +BRDA:51,8,0,0 +BRDA:51,8,1,25 +BRDA:51,9,0,25 +BRDA:51,9,1,13 +BRDA:60,10,0,18 +BRDA:60,10,1,0 +BRDA:60,11,0,18 +BRDA:60,11,1,0 +BRF:22 +BRH:15 +end_of_record +TN: +SF:/Users/cmetcalf/projects/readable-stream/lib/_stream_transform.js +FN:56,TransformState +FN:57,(anonymous_2) +FN:68,afterTransform +FN:90,Transform +FN:114,(anonymous_5) +FN:115,(anonymous_6) +FN:121,(anonymous_7) +FN:136,(anonymous_8) +FN:140,(anonymous_9) +FN:154,(anonymous_10) +FN:167,done +FNF:11 +FNH:10 +FNDA:24,TransformState +FNDA:116,(anonymous_2) +FNDA:116,afterTransform +FNDA:24,Transform +FNDA:19,(anonymous_5) +FNDA:2,(anonymous_6) +FNDA:127,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:117,(anonymous_9) +FNDA:310,(anonymous_10) +FNDA:19,done +DA:45,49 +DA:47,49 +DA:50,49 +DA:51,49 +DA:54,49 +DA:56,49 +DA:57,24 +DA:58,116 +DA:61,24 +DA:62,24 +DA:63,24 +DA:64,24 +DA:65,24 +DA:68,49 +DA:69,116 +DA:70,116 +DA:72,116 +DA:74,116 +DA:76,116 +DA:77,116 +DA:79,116 +DA:81,116 +DA:83,116 +DA:84,116 +DA:85,116 +DA:86,113 +DA:90,49 +DA:91,24 +DA:93,24 +DA:95,24 +DA:98,24 +DA:101,24 +DA:106,24 +DA:108,24 +DA:109,13 +DA:111,13 +DA:114,24 +DA:115,19 +DA:116,2 +DA:117,17 +DA:121,49 +DA:122,127 +DA:123,127 +DA:136,49 +DA:137,0 +DA:140,49 +DA:141,117 +DA:142,117 +DA:143,117 +DA:144,117 +DA:145,117 +DA:146,117 +DA:147,117 +DA:154,49 +DA:155,310 +DA:157,310 +DA:158,116 +DA:159,116 +DA:163,194 +DA:167,49 +DA:168,19 +DA:172,19 +DA:173,19 +DA:175,19 +DA:177,19 +DA:179,19 +LF:66 +LH:65 +BRDA:74,1,0,0 +BRDA:74,1,1,116 +BRDA:79,2,0,61 +BRDA:79,2,1,55 +BRDA:79,3,0,116 +BRDA:79,3,1,116 +BRDA:85,4,0,113 +BRDA:85,4,1,3 +BRDA:85,5,0,116 +BRDA:85,5,1,55 +BRDA:91,6,0,0 +BRDA:91,6,1,24 +BRDA:108,7,0,13 +BRDA:108,7,1,11 +BRDA:109,8,0,1 +BRDA:109,8,1,12 +BRDA:111,9,0,1 +BRDA:111,9,1,12 +BRDA:115,10,0,2 +BRDA:115,10,1,17 +BRDA:145,11,0,117 +BRDA:145,11,1,0 +BRDA:147,12,0,116 +BRDA:147,12,1,1 +BRDA:147,13,0,117 +BRDA:147,13,1,33 +BRDA:147,13,2,11 +BRDA:157,14,0,116 +BRDA:157,14,1,194 +BRDA:157,15,0,310 +BRDA:157,15,1,152 +BRDA:157,15,2,152 +BRDA:168,16,0,0 +BRDA:168,16,1,19 +BRDA:175,17,0,0 +BRDA:175,17,1,19 +BRDA:177,18,0,0 +BRDA:177,18,1,19 +BRF:38 +BRH:32 +end_of_record +TN: +SF:/Users/cmetcalf/projects/readable-stream/lib/_stream_passthrough.js +FN:18,PassThrough +FN:24,(anonymous_2) +FNF:2 +FNH:2 +FNDA:8,PassThrough +FNDA:59,(anonymous_2) +DA:7,49 +DA:9,49 +DA:12,49 +DA:13,49 +DA:16,49 +DA:18,49 +DA:19,8 +DA:21,8 +DA:24,49 +DA:25,59 +LF:10 +LH:10 +BRDA:19,1,0,0 +BRDA:19,1,1,8 +BRF:2 +BRH:1 +end_of_record diff --git a/deps/npm/node_modules/readable-stream/doc/stream.md b/deps/npm/node_modules/readable-stream/doc/stream.md new file mode 100644 index 00000000000000..c907ca0e7b726a --- /dev/null +++ b/deps/npm/node_modules/readable-stream/doc/stream.md @@ -0,0 +1,1772 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event as the `'close'` event is +optional. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = Buffer.from(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: '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 as the `'close'` event is +optional. + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding +* Return: `this` + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. If an error +occurs, the callback may or may not be called with the error as its +first argument. To detect write errors, listen for the `'error'` event. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the [`'drain'`][] event before writing more data. + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits()`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Use-case

+
+

Class

+
+

Method(s) to implement

+
+

Reading only

+
+

[Readable](#stream_class_stream_readable_1)

+
+

[_read][stream-_read]

+
+

Writing only

+
+

[Writable](#stream_class_stream_writable_1)

+
+

[_write][stream-_write], [_writev][stream-_writev]

+
+

Reading and writing

+
+

[Duplex](#stream_class_stream_duplex_1)

+
+

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

+
+

Operate on written data, then read the result

+
+

[Transform](#stream_class_stream_transform_1)

+
+

[_transform][stream-_transform], [_flush][stream-_flush]

+
+ +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; +const util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = Buffer.from(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; +const util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + source.on('end', () => { + this.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + this.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const util = require('util'); +const Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const util = require('util'); +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: https://nodejs.org/docs/v6.1.0/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v6.1.0/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: https://nodejs.org/docs/v6.1.0/api/tls.html#tls_class_cryptostream +[`util.inherits()`]: https://nodejs.org/docs/v6.1.0/api/util.html#util_util_inherits_constructor_superconstructor +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: https://nodejs.org/docs/v6.1.0/api/net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 54a9d5c553d69e..79914fa684cbb1 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -10,15 +10,11 @@ var processNextTick = require('process-nextick-args'); var isArray = require('isarray'); /**/ -/**/ -var Buffer = require('buffer').Buffer; -/**/ - Readable.ReadableState = ReadableState; -var EE = require('events'); - /**/ +var EE = require('events').EventEmitter; + var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; @@ -36,6 +32,9 @@ var Stream; /**/ var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ /**/ var util = require('core-util-is'); @@ -44,7 +43,7 @@ util.inherits = require('inherits'); /**/ var debugUtil = require('util'); -var debug = undefined; +var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { @@ -56,6 +55,19 @@ var StringDecoder; util.inherits(Readable, Stream); +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; + +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); + + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + var Duplex; function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); @@ -149,7 +161,7 @@ Readable.prototype.push = function (chunk, encoding) { if (!state.objectMode && typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); + chunk = bufferShim.from(chunk, encoding); encoding = ''; } } @@ -179,8 +191,8 @@ function readableAddChunk(stream, state, chunk, encoding, 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); + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); } else { var skipAdd; if (state.decoder && !addToFront && !encoding) { @@ -533,7 +545,8 @@ Readable.prototype.pipe = function (dest, pipeOpts) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. - if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; } @@ -549,9 +562,9 @@ Readable.prototype.pipe = function (dest, pipeOpts) { 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]; + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { @@ -825,16 +838,16 @@ function fromList(n, state) { } else { // complex case. // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = new Buffer(n); + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(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); + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); - if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); - if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); c += cpy; } @@ -849,7 +862,7 @@ function endReadable(stream) { // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. - if (state.length > 0) throw new Error('endReadable called on non-empty stream'); + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js index 625cdc17698059..dbc996ede62363 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js @@ -134,7 +134,7 @@ Transform.prototype.push = function (chunk, encoding) { // 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'); + throw new Error('Not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { @@ -172,9 +172,9 @@ function done(stream, er) { var ws = stream._writableState; var ts = stream._transformState; - if (ws.length) throw new Error('calling transform done when ws.length != 0'); + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); - if (ts.transforming) throw new Error('calling transform done when still transforming'); + if (ts.transforming) throw new Error('Calling transform done when still transforming'); return stream.push(null); } \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js index 95916c992a9507..ed5efcbd203208 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js @@ -14,10 +14,6 @@ var processNextTick = require('process-nextick-args'); var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; /**/ -/**/ -var Buffer = require('buffer').Buffer; -/**/ - Writable.WritableState = WritableState; /**/ @@ -43,6 +39,9 @@ var Stream; /**/ var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ util.inherits(Writable, Stream); @@ -146,10 +145,9 @@ function WritableState(options, stream) { // 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 + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); - this.corkedRequestsFree.next = new CorkedRequest(this); } WritableState.prototype.getBuffer = function writableStateGetBuffer() { @@ -196,7 +194,7 @@ function Writable(options) { // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe. Not readable.')); + this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { @@ -213,9 +211,16 @@ function writeAfterEnd(stream, cb) { // 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'); + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { stream.emit('error', er); processNextTick(cb, er); valid = false; @@ -265,11 +270,12 @@ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { 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; + return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); + chunk = bufferShim.from(chunk, encoding); } return chunk; } @@ -392,12 +398,16 @@ function clearBuffer(stream, state) { doWrite(stream, state, true, state.length, buffer, '', holder.finish); - // doWrite is always async, defer these to save a bit of time + // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; - state.corkedRequestsFree = holder.next; - holder.next = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } } else { // Slow case, write chunks one-by-one while (entry) { diff --git a/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/index.js b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/index.js new file mode 100644 index 00000000000000..1cab4c05e1ac2a --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/index.js @@ -0,0 +1,108 @@ +'use strict'; + +var buffer = require('buffer'); +var Buffer = buffer.Buffer; +var SlowBuffer = buffer.SlowBuffer; +var MAX_LEN = buffer.kMaxLength || 2147483647; +exports.alloc = function alloc(size, fill, encoding) { + if (typeof Buffer.alloc === 'function') { + return Buffer.alloc(size, fill, encoding); + } + if (typeof encoding === 'number') { + throw new TypeError('encoding must not be number'); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + var enc = encoding; + var _fill = fill; + if (_fill === undefined) { + enc = undefined; + _fill = 0; + } + var buf = new Buffer(size); + if (typeof _fill === 'string') { + var fillBuf = new Buffer(_fill, enc); + var flen = fillBuf.length; + var i = -1; + while (++i < size) { + buf[i] = fillBuf[i % flen]; + } + } else { + buf.fill(_fill); + } + return buf; +} +exports.allocUnsafe = function allocUnsafe(size) { + if (typeof Buffer.allocUnsafe === 'function') { + return Buffer.allocUnsafe(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + return new Buffer(size); +} +exports.from = function from(value, encodingOrOffset, length) { + if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) { + return Buffer.from(value, encodingOrOffset, length); + } + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number'); + } + if (typeof value === 'string') { + return new Buffer(value, encodingOrOffset); + } + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + var offset = encodingOrOffset; + if (arguments.length === 1) { + return new Buffer(value); + } + if (typeof offset === 'undefined') { + offset = 0; + } + var len = length; + if (typeof len === 'undefined') { + len = value.byteLength - offset; + } + if (offset >= value.byteLength) { + throw new RangeError('\'offset\' is out of bounds'); + } + if (len > value.byteLength - offset) { + throw new RangeError('\'length\' is out of bounds'); + } + return new Buffer(value.slice(offset, offset + len)); + } + if (Buffer.isBuffer(value)) { + var out = new Buffer(value.length); + value.copy(out, 0, 0, value.length); + return out; + } + if (value) { + if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) { + return new Buffer(value); + } + if (value.type === 'Buffer' && Array.isArray(value.data)) { + return new Buffer(value.data); + } + } + + throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.'); +} +exports.allocUnsafeSlow = function allocUnsafeSlow(size) { + if (typeof Buffer.allocUnsafeSlow === 'function') { + return Buffer.allocUnsafeSlow(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size >= MAX_LEN) { + throw new RangeError('size is too large'); + } + return new SlowBuffer(size); +} diff --git a/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/license.md b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/license.md new file mode 100644 index 00000000000000..01cfaefe2fcaff --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2016 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/readable-stream/node_modules/buffer-shims/package.json b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/package.json new file mode 100644 index 00000000000000..1a9a8e0aee26fb --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + { + "name": "buffer-shims", + "raw": "buffer-shims@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/readable-stream" + ] + ], + "_from": "buffer-shims@>=1.0.0 <2.0.0", + "_id": "buffer-shims@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/buffer-shims", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/buffer-shims-1.0.0.tgz_1462560889323_0.8640750856138766" + }, + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "name": "buffer-shims", + "raw": "buffer-shims@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "_shasum": "9978ce317388c649ad8793028c3477ef044a8b51", + "_shrinkwrap": null, + "_spec": "buffer-shims@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/calvinmetcalf/buffer-shims/issues" + }, + "dependencies": {}, + "description": "some shims for node buffers", + "devDependencies": { + "tape": "^4.5.1" + }, + "directories": {}, + "dist": { + "shasum": "9978ce317388c649ad8793028c3477ef044a8b51", + "tarball": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "ea89b3857ab5b8203957922a84e9a48cf4c47e0a", + "homepage": "https://github.com/calvinmetcalf/buffer-shims#readme", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + } + ], + "name": "buffer-shims", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/calvinmetcalf/buffer-shims.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/readme.md b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/readme.md new file mode 100644 index 00000000000000..7ea6475e284e8e --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/buffer-shims/readme.md @@ -0,0 +1,21 @@ +buffer-shims +=== + +functions to make sure the new buffer methods work in older browsers. + +```js +var bufferShim = require('buffer-shims'); +bufferShim.from('foo'); +bufferShim.alloc(9, 'cafeface', 'hex'); +bufferShim.allocUnsafe(15); +bufferShim.allocUnsafeSlow(21); +``` + +should just use the original in newer nodes and on older nodes uses fallbacks. + +Known Issues +=== +- this does not patch the buffer object, only the constructor stuff +- it's actually a polyfill + +![](https://i.imgur.com/zxII3jJ.gif) diff --git a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js index 571c276783c779..a4f40f845faa65 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -8,13 +8,36 @@ if (!process.version || 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]; +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); } diff --git a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json index 2d1862b791dbfb..a0d2aaaebc517e 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -1,37 +1,41 @@ { "_args": [ [ - "process-nextick-args@~1.0.0", + "process-nextick-args@~1.0.6", "/Users/rebecca/code/npm/node_modules/readable-stream" ] ], - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_id": "process-nextick-args@1.0.6", + "_from": "process-nextick-args@>=1.0.6 <1.1.0", + "_id": "process-nextick-args@1.0.7", "_inCache": true, "_installable": true, "_location": "/readable-stream/process-nextick-args", - "_nodeVersion": "4.1.1", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, "_npmUser": { "email": "calvin.metcalf@gmail.com", "name": "cwmma" }, - "_npmVersion": "2.14.4", + "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { "name": "process-nextick-args", - "raw": "process-nextick-args@~1.0.0", - "rawSpec": "~1.0.0", + "raw": "process-nextick-args@~1.0.6", + "rawSpec": "~1.0.6", "scope": null, - "spec": ">=1.0.0 <1.1.0", + "spec": ">=1.0.6 <1.1.0", "type": "range" }, "_requiredBy": [ "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz", - "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", "_shrinkwrap": null, - "_spec": "process-nextick-args@~1.0.0", + "_spec": "process-nextick-args@~1.0.6", "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", "author": "", "bugs": { @@ -44,17 +48,17 @@ }, "directories": {}, "dist": { - "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, - "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", "homepage": "https://github.com/calvinmetcalf/process-nextick-args", "license": "MIT", "main": "index.js", "maintainers": [ { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" } ], "name": "process-nextick-args", @@ -67,5 +71,5 @@ "scripts": { "test": "node test.js" }, - "version": "1.0.6" + "version": "1.0.7" } diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index eca885b9a7dbb6..ef5ff11b1d33f2 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -1,52 +1,54 @@ { "_args": [ [ - "readable-stream@~2.0.5", - "/Users/rebecca/code/npm" + { + "name": "readable-stream", + "raw": "readable-stream@2.1.3", + "rawSpec": "2.1.3", + "scope": null, + "spec": "2.1.3", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "readable-stream@>=2.0.5 <2.1.0", - "_id": "readable-stream@2.0.6", + "_from": "readable-stream@2.1.3", + "_id": "readable-stream@2.1.3", "_inCache": true, "_installable": true, "_location": "/readable-stream", - "_nodeVersion": "5.7.0", + "_nodeVersion": "5.11.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.1.3.tgz_1463587875388_0.811288726516068" }, "_npmUser": { "email": "calvin.metcalf@gmail.com", "name": "cwmma" }, - "_npmVersion": "3.6.0", + "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { "name": "readable-stream", - "raw": "readable-stream@~2.0.5", - "rawSpec": "~2.0.5", + "raw": "readable-stream@2.1.3", + "rawSpec": "2.1.3", "scope": null, - "spec": ">=2.0.5 <2.1.0", - "type": "range" + "spec": "2.1.3", + "type": "version" }, "_requiredBy": [ "/", "/fs-write-stream-atomic", - "/npm-registry-client/concat-stream", "/npmlog/are-we-there-yet", - "/request/bl", "/sha", - "/standard/standard-engine/eslint/concat-stream", - "/standard/standard-format/esformatter/npm-run/spawn-sync/concat-stream", "/tap", - "/tap/coveralls/request/bl", "/tap/tap-parser" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.3.tgz", + "_shasum": "9db8ec4025b4c71e69aec60b453b590c8afeb0df", "_shrinkwrap": null, - "_spec": "readable-stream@~2.0.5", - "_where": "/Users/rebecca/code/npm", + "_spec": "readable-stream@2.1.3", + "_where": "/Users/zkat/Documents/code/npm", "browser": { "util": false }, @@ -54,6 +56,7 @@ "url": "https://github.com/nodejs/readable-stream/issues" }, "dependencies": { + "buffer-shims": "^1.0.0", "core-util-is": "~1.0.0", "inherits": "~2.0.1", "isarray": "~1.0.0", @@ -63,16 +66,18 @@ }, "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { - "tap": "~0.2.6", + "assert": "~1.4.0", + "nyc": "^6.4.0", + "tap": "~0.7.1", "tape": "~4.5.1", "zuul": "~3.9.0" }, "directories": {}, "dist": { - "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + "shasum": "9db8ec4025b4c71e69aec60b453b590c8afeb0df", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.3.tgz" }, - "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "gitHead": "abcff84645534aaedaed4192c4ce788af9112bc2", "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", @@ -100,6 +105,11 @@ } ], "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, "optionalDependencies": {}, "readme": "ERROR: No README data found!", "repository": { @@ -108,8 +118,11 @@ }, "scripts": { "browser": "npm run write-zuul && zuul -- test/browser.js", + "cover": "nyc npm test", + "local": "zuul --local -- test/browser.js", + "report": "nyc report --reporter=lcov", "test": "tap test/parallel/*.js test/ours/*.js", "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, - "version": "2.0.6" + "version": "2.1.3" } diff --git a/deps/npm/node_modules/readable-stream/readable.js b/deps/npm/node_modules/readable-stream/readable.js index 6222a579864dd2..be2688a071dd18 100644 --- a/deps/npm/node_modules/readable-stream/readable.js +++ b/deps/npm/node_modules/readable-stream/readable.js @@ -10,3 +10,7 @@ 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'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} diff --git a/deps/npm/node_modules/realize-package-specifier/index.js b/deps/npm/node_modules/realize-package-specifier/index.js index 30214b2da37a4d..eae8fbaf82f316 100644 --- a/deps/npm/node_modules/realize-package-specifier/index.js +++ b/deps/npm/node_modules/realize-package-specifier/index.js @@ -17,7 +17,7 @@ module.exports = function (spec, where, cb) { if ((dep.type == "range" || dep.type == "version") && dep.name != dep.raw) return cb(null, dep) var specpath = dep.type == "local" ? path.resolve(where, dep.spec) - : path.resolve(dep.rawSpec? dep.rawSpec: dep.name) + : path.resolve(where, dep.rawSpec? dep.rawSpec: dep.name) fs.stat(specpath, function (er, s) { if (er) return finalize() if (!s.isDirectory()) return finalize("local") @@ -33,7 +33,9 @@ module.exports = function (spec, where, cb) { dep.name = null } } - if (dep.type == "local" || dep.type == "directory") dep.spec = specpath + if (dep.type == "local" || dep.type == "directory") { + dep.spec = path.resolve(specpath) + } cb(null, dep) } } diff --git a/deps/npm/node_modules/realize-package-specifier/package.json b/deps/npm/node_modules/realize-package-specifier/package.json index 6f08eef5be88cc..d2fb6da2f77e7d 100644 --- a/deps/npm/node_modules/realize-package-specifier/package.json +++ b/deps/npm/node_modules/realize-package-specifier/package.json @@ -1,37 +1,90 @@ { - "name": "realize-package-specifier", - "version": "3.0.1", - "description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" + "_args": [ + [ + "realize-package-specifier@~3.0.2", + "/Users/rebecca/code/npm" + ] + ], + "_from": "realize-package-specifier@>=3.0.2 <3.1.0", + "_id": "realize-package-specifier@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/realize-package-specifier", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/realize-package-specifier-3.0.3.tgz_1461233015050_0.3224435243755579" }, - "license": "ISC", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/realize-package-specifier.git" + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" }, + "_npmVersion": "3.8.7", + "_phantomChildren": {}, + "_requested": { + "name": "realize-package-specifier", + "raw": "realize-package-specifier@~3.0.2", + "rawSpec": "~3.0.2", + "scope": null, + "spec": ">=3.0.2 <3.1.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_shasum": "d0def882952b8de3f67eba5e91199661271f41f4", + "_shrinkwrap": null, + "_spec": "realize-package-specifier@~3.0.2", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Rebecca Turner", "email": "me@re-becca.org", + "name": "Rebecca Turner", "url": "http://re-becca.org" }, - "homepage": "https://github.com/npm/realize-package-specifier", + "bugs": { + "url": "https://github.com/npm/realize-package-specifier/issues" + }, "dependencies": { "dezalgo": "^1.0.1", - "npm-package-arg": "^4.0.0" + "npm-package-arg": "^4.1.1" }, + "description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.", "devDependencies": { "require-inject": "^1.1.0", - "tap": "^0.4.12" + "tap": "^5.7.1" }, - "readme": "realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules. This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n …\n})\n```\n\n## Using\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory. Stats are done relative\nto *where*. If it does then the local module is loaded. If it doesn't then\ntarget is left as a remote package specifier. Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is. The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`. 2) The `local` type only refers to tarballs. 2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Object\n\nThe full definition of the result object is:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file path\n * `directory` - A local package directory\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshurl` - The ssh URL for this git repo\n * `https` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n\n", - "readmeFilename": "README.md", - "gitHead": "4f50130fa6b5e80954a90ea12bab382f53d890b1", - "bugs": { - "url": "https://github.com/npm/realize-package-specifier/issues" + "directories": {}, + "dist": { + "shasum": "d0def882952b8de3f67eba5e91199661271f41f4", + "tarball": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.3.tgz" + }, + "gitHead": "388221ee8e5b586932372949091aa2ee3ee7ab78", + "homepage": "https://github.com/npm/realize-package-specifier", + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "email": "me@re-becca.org", + "name": "iarna" + }, + { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + { + "email": "kat@sykosomatic.org", + "name": "zkat" + } + ], + "name": "realize-package-specifier", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/realize-package-specifier.git" + }, + "scripts": { + "test": "tap test/*.js" }, - "_id": "realize-package-specifier@3.0.1", - "_shasum": "fde32e926448e38f99334d95b7b08d51e3a98d9f", - "_from": "realize-package-specifier@>=3.0.1 <3.1.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/realize-package-specifier/test/basic.js b/deps/npm/node_modules/realize-package-specifier/test/basic.js index 7fe659fbf6255f..692ca07d5af202 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/basic.js +++ b/deps/npm/node_modules/realize-package-specifier/test/basic.js @@ -69,10 +69,10 @@ test("realize-package-specifier", function (t) { t.is(result.type, "directory", "local package directory") }) rps("c", function (err, result) { - t.is(result.type, "range", "remote package, non-package local directory") + t.is(result.type, "tag", "remote package, non-package local directory") }) rps("d", function (err, result) { - t.is(result.type, "range", "remote package, no local directory") + t.is(result.type, "tag", "remote package, no local directory") }) rps("file:./a.tar.gz", function (err, result) { t.is(result.type, "local", "local tarball") diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js b/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js index bd7ab4aec37da5..1155911789b2c3 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js @@ -19,8 +19,8 @@ test("npa-basic", function (t) { name: "@foo/bar", scope: "@foo", rawSpec: "", - spec: "*", - type: "range" + spec: "latest", + type: "tag" }, "@foo/bar@": { @@ -28,8 +28,8 @@ test("npa-basic", function (t) { name: "@foo/bar", scope: "@foo", rawSpec: "", - spec: "*", - type: "range" + spec: "latest", + type: "tag" }, "@foo/bar@baz": { @@ -134,8 +134,8 @@ test("npa-basic", function (t) { "foo": { name: "foo", - type: "range", - spec: "*", + type: "tag", + spec: "latest", raw: "foo" } } diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js b/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js index 4381e6c401e206..2bef724b9e6651 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js @@ -58,7 +58,7 @@ test("npa-bitbucket", function (t) { name: null, type: "hosted", hosted: { type: "bitbucket" }, - spec: "https://bitbucket.org/user/foo.git", + spec: "git+https://bitbucket.org/user/foo.git", raw: "https://bitbucket.org/user/foo.git" }, diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-github.js b/deps/npm/node_modules/realize-package-specifier/test/npa-github.js index b0c405e7deff97..7ae6b254ac852b 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/npa-github.js +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-github.js @@ -74,7 +74,7 @@ test("npa-github", function (t) { name: null, type: "hosted", hosted: { type: "github" }, - spec: "https://github.com/user/foo.git", + spec: "git+https://github.com/user/foo.git", raw: "https://github.com/user/foo.git" }, diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js b/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js index cb1a625bc25bef..c7b45c2f8adf9a 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js @@ -58,7 +58,7 @@ test("npa-gitlab", function (t) { name: null, type: "hosted", hosted: { type: "gitlab" }, - spec: "https://gitlab.com/user/foo.git", + spec: "git+https://gitlab.com/user/foo.git", raw: "https://gitlab.com/user/foo.git" }, diff --git a/deps/npm/node_modules/request/.eslintrc b/deps/npm/node_modules/request/.eslintrc deleted file mode 100644 index 6ebc53601d7ba5..00000000000000 --- a/deps/npm/node_modules/request/.eslintrc +++ /dev/null @@ -1,45 +0,0 @@ -{ - "env": { - "node": true - }, - "rules": { - // 2-space indentation - "indent": [2, 2, {"SwitchCase": 1}], - // Disallow semi-colons, unless needed to disambiguate statement - "semi": [2, "never"], - // Require strings to use single quotes - "quotes": [2, "single"], - // Require curly braces for all control statements - "curly": 2, - // Disallow using variables and functions before they've been defined - "no-use-before-define": 2, - // Allow any case for variable naming - "camelcase": 0, - // Disallow unused variables, except as function arguments - "no-unused-vars": [2, {"args":"none"}], - // Allow leading underscores for method names - // REASON: we use underscores to denote private methods - "no-underscore-dangle": 0, - // Allow multi spaces around operators since they are - // used for alignment. This is not consistent in the - // code. - "no-multi-spaces": 0, - // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses: - // - // { - // beforeColon : true, - // afterColon : true - // } - // - // eslint can't handle this, so the check is disabled. - "key-spacing": 0, - // Allow shadowing vars in outer scope (needs discussion) - "no-shadow": 0, - // Use if () { } - // ^ space - "space-after-keywords": [2, "always"], - // Use if () { } - // ^ space - "space-before-blocks": [2, "always"] - } -} diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml index c24c59b5d5b4fa..e5d9bde26263c5 100644 --- a/deps/npm/node_modules/request/.travis.yml +++ b/deps/npm/node_modules/request/.travis.yml @@ -1,15 +1,19 @@ language: node_js + node_js: - node - - io.js - 0.12 - 0.10 -sudo: false -after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls" +after_script: + - npm run test-cov + - cat ./coverage/lcov.info | codecov + - cat ./coverage/lcov.info | coveralls webhooks: urls: https://webhooks.gitter.im/e/237280ed4796c19cc626 on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: false # default: false + +sudo: false diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index 86386a9ae5cba4..ce6826f2f65228 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,34 @@ ## Change Log +### v2.72.0 (2016/04/17) +- [#2176](https://github.com/request/request/pull/2176) Do not try to pipe Gzip responses with no body (@simov) +- [#2175](https://github.com/request/request/pull/2175) Add 'delete' alias for the 'del' API method (@simov, @MuhanZou) +- [#2172](https://github.com/request/request/pull/2172) Add support for deflate content encoding (@czardoz) +- [#2169](https://github.com/request/request/pull/2169) Add callback option (@simov) +- [#2165](https://github.com/request/request/pull/2165) Check for self.req existence inside the write method (@simov) +- [#2167](https://github.com/request/request/pull/2167) Fix TravisCI badge reference master branch (@a0viedo) + +### v2.71.0 (2016/04/12) +- [#2164](https://github.com/request/request/pull/2164) Catch errors from the underlying http module (@simov) + +### v2.70.0 (2016/04/05) +- [#2147](https://github.com/request/request/pull/2147) Update eslint to version 2.5.3 🚀 (@simov, @greenkeeperio-bot) +- [#2009](https://github.com/request/request/pull/2009) Support JSON stringify replacer argument. (@elyobo) +- [#2142](https://github.com/request/request/pull/2142) Update eslint to version 2.5.1 🚀 (@greenkeeperio-bot) +- [#2128](https://github.com/request/request/pull/2128) Update browserify-istanbul to version 2.0.0 🚀 (@greenkeeperio-bot) +- [#2115](https://github.com/request/request/pull/2115) Update eslint to version 2.3.0 🚀 (@simov, @greenkeeperio-bot) +- [#2089](https://github.com/request/request/pull/2089) Fix badges (@simov) +- [#2092](https://github.com/request/request/pull/2092) Update browserify-istanbul to version 1.0.0 🚀 (@greenkeeperio-bot) +- [#2079](https://github.com/request/request/pull/2079) Accept read stream as body option (@simov) +- [#2070](https://github.com/request/request/pull/2070) Update bl to version 1.1.2 🚀 (@greenkeeperio-bot) +- [#2063](https://github.com/request/request/pull/2063) Up bluebird and oauth-sign (@simov) +- [#2058](https://github.com/request/request/pull/2058) Karma fixes for latest versions (@eiriksm) +- [#2057](https://github.com/request/request/pull/2057) Update contributing guidelines (@simov) +- [#2054](https://github.com/request/request/pull/2054) Update qs to version 6.1.0 🚀 (@greenkeeperio-bot) + +### v2.69.0 (2016/01/27) +- [#2041](https://github.com/request/request/pull/2041) restore aws4 as regular dependency (@rmg) + ### v2.68.0 (2016/01/27) - [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods) - [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross) @@ -85,7 +114,8 @@ - [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews) ### v2.59.0 (2015/07/20) -- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov) +- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. + Forever option defaults to using http(s).Agent in node 0.12+ (@simov) - [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman) - [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme) - [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov) @@ -470,7 +500,7 @@ - [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) -### v2.18.0 (2013/04/22) +### v2.20.0 (2013/04/22) - [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) diff --git a/deps/npm/node_modules/request/CONTRIBUTING.md b/deps/npm/node_modules/request/CONTRIBUTING.md index 06b1968d974b7e..8aa6999acd820e 100644 --- a/deps/npm/node_modules/request/CONTRIBUTING.md +++ b/deps/npm/node_modules/request/CONTRIBUTING.md @@ -1,19 +1,57 @@ -# This is an OPEN Open Source Project + +# Contributing to Request + +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +The following is a set of guidelines for contributing to Request and its packages, which are hosted in the [Request Organization](https://github.com/request) on GitHub. +These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request. + + +## Submitting an Issue + +1. Provide a small self **sufficient** code example to **reproduce** the issue. +2. Run your test code using [request-debug](https://github.com/request/request-debug) and copy/paste the results inside the issue. +3. You should **always** use fenced code blocks when submitting code examples or any other formatted output: +
+  ```js
+  put your javascript code here
+  ```
+
+  ```
+  put any other formatted output here,
+  like for example the one returned from using request-debug
+  ```
+  
+ +If the problem cannot be reliably reproduced, the issue will be marked as `Not enough info (see CONTRIBUTING.md)`. + +If the problem is not related to request the issue will be marked as `Help (please use Stackoverflow)`. + + +## Submitting a Pull Request + +1. In almost all of the cases your PR **needs tests**. Make sure you have any. +2. Run `npm test` locally. Fix any errors before pushing to GitHub. +3. After submitting the PR a build will be triggered on TravisCI. Wait for it to ends and make sure all jobs are passing. + ----------------------------------------- -## What? + +## Becoming a Contributor Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + ## Rules There are a few basic ground-rules for contributors: 1. **No `--force` pushes** or modifying the Git history in any way. 1. **Non-master branches** ought to be used for ongoing work. +1. **Any** change should be added through Pull Request. 1. **External API changes and significant modifications** ought to be subject to an **internal pull-request** to solicit feedback from other contributors. 1. Internal pull-requests to solicit feedback are *encouraged* for any other @@ -35,10 +73,9 @@ There are a few basic ground-rules for contributors: Declaring formal releases remains the prerogative of the project maintainer. + ## Changes to this arrangement This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change. - ------------------------------------------ diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index 6ee45b205d5473..cf9072a21a229a 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -3,10 +3,11 @@ [![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/) -[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request) +[![Build status](https://img.shields.io/travis/request/request/master.svg?style=flat-square)](https://travis-ci.org/request/request) [![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master) [![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request) [![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request) +[![Known Vulnerabilities](https://snyk.io/test/npm/request/badge.svg?style=flat-square)](https://snyk.io/test/npm/request) [![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge) @@ -733,7 +734,7 @@ The first argument can be either a `url` or an `options` object. The only requir --- -- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object. +- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object. - `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above. - `formData` - Data to pass for a `multipart/form-data` request. See [Forms](#forms) section above. @@ -748,6 +749,7 @@ The first argument can be either a `url` or an `options` object. The only requir - `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. - `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. - `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. +- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body. --- @@ -812,6 +814,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). - `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property. - `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)* +- `callback` - alternatively pass the request's callback in the options object The callback argument gets 3 arguments: @@ -886,12 +889,13 @@ Same as `request()`, but defaults to `method: "HEAD"`. request.head(url) ``` -### request.del +### request.del / request.delete Same as `request()`, but defaults to `method: "DELETE"`. ```js request.del(url) +request.delete(url) ``` ### request.get diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js index 4d0c748da585ea..911a90dbb5a5cb 100755 --- a/deps/npm/node_modules/request/index.js +++ b/deps/npm/node_modules/request/index.js @@ -37,7 +37,7 @@ function initParams(uri, options, callback) { extend(params, uri) } - params.callback = callback + params.callback = callback || params.callback return params } @@ -56,7 +56,7 @@ function request (uri, options, callback) { } function verbFunc (verb) { - var method = verb === 'del' ? 'DELETE' : verb.toUpperCase() + var method = verb.toUpperCase() return function (uri, options, callback) { var params = initParams(uri, options, callback) params.method = method @@ -70,7 +70,8 @@ request.head = verbFunc('head') request.post = verbFunc('post') request.put = verbFunc('put') request.patch = verbFunc('patch') -request.del = verbFunc('del') +request.del = verbFunc('delete') +request['delete'] = verbFunc('delete') request.jar = function (store) { return cookies.jar(store) @@ -91,7 +92,7 @@ function wrapRequestMethod (method, options, requester, verb) { target.pool = params.pool || options.pool if (verb) { - target.method = (verb === 'del' ? 'DELETE' : verb.toUpperCase()) + target.method = verb.toUpperCase() } if (isFunction(requester)) { @@ -114,7 +115,7 @@ request.defaults = function (options, requester) { var defaults = wrapRequestMethod(self, options, requester) - var verbs = ['get', 'head', 'post', 'put', 'patch', 'del'] + var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] verbs.forEach(function(verb) { defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) }) diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js index 5e8594606f9f4e..356ff748e2f941 100644 --- a/deps/npm/node_modules/request/lib/helpers.js +++ b/deps/npm/node_modules/request/lib/helpers.js @@ -24,12 +24,12 @@ function paramsHaveRequestBody(params) { ) } -function safeStringify (obj) { +function safeStringify (obj, replacer) { var ret try { - ret = JSON.stringify(obj) + ret = JSON.stringify(obj, replacer) } catch (e) { - ret = jsonSafeStringify(obj) + ret = jsonSafeStringify(obj, replacer) } return ret } diff --git a/deps/npm/node_modules/request/node_modules/aws4/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/.npmignore index ccafa6b412bff2..6c6ade6ff0135c 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/.npmignore +++ b/deps/npm/node_modules/request/node_modules/aws4/.npmignore @@ -1,3 +1,4 @@ test -coverage examples +example.js +browser diff --git a/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md index 068a07a8359617..ec663e9237ec5e 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/README.md +++ b/deps/npm/node_modules/request/node_modules/aws4/README.md @@ -6,6 +6,8 @@ aws4 A small utility to sign vanilla node.js http(s) request options using Amazon's [AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). +Can also be used [in the browser](./browser). + This signature is supported by nearly all Amazon services, including [S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), [EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), @@ -497,6 +499,8 @@ With [npm](http://npmjs.org/) do: npm install aws4 ``` +Can also be used [in the browser](./browser). + Thanks ------ diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js index 3ef54a468fc904..71e08bbc17c9d1 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/aws4.js +++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js @@ -43,8 +43,13 @@ function RequestSigner(request, credentials) { if (!request.method && request.body) request.method = 'POST' - if (!headers.Host && !headers.host) + if (!headers.Host && !headers.host) { headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host } @@ -210,8 +215,7 @@ RequestSigner.prototype.canonicalString = function() { } if (pathStr !== '/') { if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') - if (pathStr[0] === '/') pathStr = pathStr.slice(1) - pathStr = '/' + pathStr.split('/').reduce(function(path, piece) { + pathStr = pathStr.split('/').reduce(function(path, piece) { if (normalizePath && piece === '..') { path.pop() } else if (!normalizePath || piece !== '.') { @@ -220,6 +224,7 @@ RequestSigner.prototype.canonicalString = function() { } return path }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') } diff --git a/deps/npm/node_modules/request/node_modules/aws4/example.js b/deps/npm/node_modules/request/node_modules/aws4/example.js deleted file mode 100644 index 5d075409d5de95..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/example.js +++ /dev/null @@ -1,371 +0,0 @@ -var http = require('http'), - https = require('https'), - aws4 = require('aws4') - -// given an options object you could pass to http.request -var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} - -// alternatively (as aws4 can infer the host): -opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} - -// alternatively (as us-east-1 is default): -opts = {service: 'sqs', path: '/?Action=ListQueues'} - -aws4.sign(opts) // assumes AWS credentials are available in process.env - -console.log(opts) -/* -{ - host: 'sqs.us-east-1.amazonaws.com', - path: '/?Action=ListQueues', - headers: { - Host: 'sqs.us-east-1.amazonaws.com', - 'X-Amz-Date': '20121226T061030Z', - Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' - } -} -*/ - -// we can now use this to query AWS using the standard node.js http API -http.request(opts, function(res) { res.pipe(process.stdout) }).end() -/* - - -... -*/ - -// you can also pass AWS credentials in explicitly (otherwise taken from process.env) -aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) - -// can also add the signature to query strings -aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) - -// create a utility function to pipe to stdout (with https this time) -function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } - -// aws4 can infer the HTTP method if a body is passed in -// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' -request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) -/* - -... -*/ - -// can specify any custom option or header as per usual -request(aws4.sign({ - service: 'dynamodb', - region: 'ap-southeast-2', - method: 'POST', - path: '/', - headers: { - 'Content-Type': 'application/x-amz-json-1.0', - 'X-Amz-Target': 'DynamoDB_20120810.ListTables' - }, - body: '{}' -})) -/* -{"TableNames":[]} -... -*/ - -// works with all other services that support Signature Version 4 - -request(aws4.sign({service: 's3', path: '/', signQuery: true})) -/* - -... -*/ - -request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) -/* - -... -*/ - -request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) -/* - -... -*/ - -request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) -/* - -... -*/ - -request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) -/* - -... -*/ - -request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) -/* - -... -*/ - -request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) -/* - -... -*/ - -request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) -/* - -... -*/ - -request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) -/* - -... -*/ - -request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) -/* - -... -*/ - -request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) -/* - -... -*/ - -request(aws4.sign({service: 'appstream', path: '/applications'})) -/* -{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... -... -*/ - -request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) -/* -{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} -... -*/ - -request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) -/* -{"NextPageToken":null,"Pipelines":[]} -... -*/ - -request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) -/* -{"Functions":[],"NextMarker":null} -... -*/ - -request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) -/* - -... -*/ - -request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) -/* -{"Marker":null,"VaultList":[]} -... -*/ - -request(aws4.sign({service: 'storagegateway', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' -}})) -/* -{"Gateways":[]} -... -*/ - -request(aws4.sign({service: 'datapipeline', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'DataPipeline.ListPipelines' -}})) -/* -{"hasMoreResults":false,"pipelineIdList":[]} -... -*/ - -request(aws4.sign({service: 'opsworks', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' -}})) -/* -{"Stacks":[]} -... -*/ - -request(aws4.sign({service: 'route53domains', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' -}})) -/* -{"Domains":[]} -... -*/ - -request(aws4.sign({service: 'kinesis', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Kinesis_20131202.ListStreams' -}})) -/* -{"HasMoreStreams":false,"StreamNames":[]} -... -*/ - -request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' -}})) -/* -{"trailList":[]} -... -*/ - -request(aws4.sign({service: 'logs', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' -}})) -/* -{"logGroups":[]} -... -*/ - -request(aws4.sign({service: 'codedeploy', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' -}})) -/* -{"applications":[]} -... -*/ - -request(aws4.sign({service: 'directconnect', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'OvertureService.DescribeConnections' -}})) -/* -{"connections":[]} -... -*/ - -request(aws4.sign({service: 'kms', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'TrentService.ListKeys' -}})) -/* -{"Keys":[],"Truncated":false} -... -*/ - -request(aws4.sign({service: 'config', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' -}})) -/* -{"DeliveryChannels":[]} -... -*/ - -request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' -}})) -/* -{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} -... -*/ - -request(aws4.sign({ - service: 'swf', - body: '{"registrationStatus":"REGISTERED"}', - headers: { - 'Content-Type': 'application/x-amz-json-1.0', - 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' - } -})) -/* -{"domainInfos":[]} -... -*/ - -request(aws4.sign({ - service: 'cognito-identity', - body: '{"MaxResults": 1}', - headers: { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' - } -})) -/* -{"IdentityPools":[]} -... -*/ - -request(aws4.sign({ - service: 'mobileanalytics', - path: '/2014-06-05/events', - body: JSON.stringify({events:[{ - eventType: 'a', - timestamp: new Date().toISOString(), - session: {}, - }]}), - headers: { - 'Content-Type': 'application/json', - 'X-Amz-Client-Context': JSON.stringify({ - client: {client_id: 'a', app_title: 'a'}, - custom: {}, - env: {platform: 'a'}, - services: {}, - }), - } -})) -/* -(HTTP 202, empty response) -*/ - -// Still not updated to v4... - -//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'})) - -//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'})) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e472cc75fa..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml deleted file mode 100644 index 4af02b3d17e64c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' -before_install: - - npm install -g npm@latest diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS deleted file mode 100644 index 4a0bc5033a06e7..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS +++ /dev/null @@ -1,14 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Brian Cottingham -Carlos Brito Lage -Jesse Dailey -Kevin O'Hara -Marco Rogers -Mark Cavage -Marko Mikulicic -Nathan Rajlich -Satheesh Natesan -Trent Mick -ashleybrener -n4kz diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md index c06814e0414d56..1bc7b03f3ea731 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md @@ -2,12 +2,14 @@ A cache object that deletes the least-recently-used items. +[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) + ## Usage: ```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 +18,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 ``` @@ -24,24 +32,6 @@ 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 @@ -53,9 +43,10 @@ console.log(cache.get(a)) // prints: 'this is b' 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. + 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 @@ -76,8 +67,12 @@ console.log(cache.get(a)) // prints: 'this is b' * `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. + They do what you think. `maxAge` is optional and overrides the + cache `maxAge` option if provided. + + If the key is not found, `get()` will return `undefined`. + + The key and val can be any value. * `peek(key)` @@ -107,6 +102,12 @@ console.log(cache.get(a)) // prints: 'this is b' 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. @@ -115,7 +116,7 @@ console.log(cache.get(a)) // prints: 'this is b' Return an array of the values in the cache. -* `length()` +* `length` Return total length of objects in cache taking into account `length` options function. @@ -135,3 +136,7 @@ console.log(cache.get(a)) // prints: 'this is b' Loads another cache entries array, obtained with `sourceCache.dump()`, into the cache. The destination cache is reset before loading new entries + +* `prune()` + + Manually iterates over the entire cache proactively pruning old entries diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js index 2bbe653be8ad08..e98ef78a53dc79 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js @@ -1,225 +1,353 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache +module.exports = LRUCache + +// This will be a proper iterable 'Map' in engines that support it, +// or a fakey-fake PseudoMap in older versions. +var Map = require('pseudomap') +var util = require('util') + +// A linked list to keep track of recently-used-ness +var Yallist = require('yallist') + +// use symbols if possible, otherwise just _props +var symbols = {} +var hasSymbol = typeof Symbol === 'function' +var makeSymbol +/* istanbul ignore if */ +if (hasSymbol) { + makeSymbol = function (key) { + return Symbol.for(key) + } } else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache + makeSymbol = function (key) { + return '_' + key + } } -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) +function priv (obj, key, val) { + var sym + if (symbols[key]) { + sym = symbols[key] + } else { + sym = makeSymbol(key) + symbols[key] = sym + } + if (arguments.length === 2) { + return obj[sym] + } else { + obj[sym] = val + return val + } } 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) - } -} - +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. function LRUCache (options) { - if (!(this instanceof LRUCache)) + if (!(this instanceof LRUCache)) { return new LRUCache(options) + } - if (typeof options === 'number') + if (typeof options === 'number') { options = { max: options } + } - if (!options) + if (!options) { options = {} + } - this._max = options.max + var max = priv(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 + if (!max || + !(typeof max === 'number') || + max <= 0) { + priv(this, 'max', Infinity) + } - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength + var lc = options.length || naiveLength + if (typeof lc !== 'function') { + lc = naiveLength + } + priv(this, 'lengthCalculator', lc) - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose + priv(this, 'allowStale', options.stale || false) + priv(this, 'maxAge', options.maxAge || 0) + priv(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) +Object.defineProperty(LRUCache.prototype, 'max', { + set: function (mL) { + if (!mL || !(typeof mL === 'number') || mL <= 0) { + mL = Infinity } - , get : function () { return this._max } - , enumerable : true - }) + priv(this, 'max', mL) + trim(this) + }, + get: function () { + return priv(this, 'max') + }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'allowStale', { + set: function (allowStale) { + priv(this, 'allowStale', !!allowStale) + }, + get: function () { + return priv(this, 'allowStale') + }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'maxAge', { + set: function (mA) { + if (!mA || !(typeof mA === 'number') || mA < 0) { + mA = 0 + } + priv(this, 'maxAge', mA) + trim(this) + }, + get: function () { + return priv(this, 'maxAge') + }, + 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) +Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { + set: function (lC) { + if (typeof lC !== 'function') { + lC = naiveLength } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - + if (lC !== priv(this, 'lengthCalculator')) { + priv(this, 'lengthCalculator', lC) + priv(this, 'length', 0) + priv(this, 'lruList').forEach(function (hit) { + hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key) + priv(this, 'length', priv(this, 'length') + hit.length) + }, this) + } + trim(this) + }, + get: function () { return priv(this, 'lengthCalculator') }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'length', { + get: function () { return priv(this, 'length') }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'itemCount', { + get: function () { return priv(this, 'lruList').length }, + enumerable: true +}) + +LRUCache.prototype.rforEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = priv(this, 'lruList').tail; walker !== null;) { + var prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } +} -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) +function forEachStep (self, fn, node, thisp) { + var hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!priv(self, 'allowStale')) { + hit = undefined + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self) + } +} 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) - } + for (var walker = priv(this, 'lruList').head; walker !== null;) { + var next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next } } 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 + return priv(this, 'lruList').toArray().map(function (k) { + return 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 priv(this, 'lruList').toArray().map(function (k) { + return 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) - } + if (priv(this, 'dispose') && + priv(this, 'lruList') && + priv(this, 'lruList').length) { + priv(this, 'lruList').forEach(function (hit) { + priv(this, 'dispose').call(this, hit.key, hit.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._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 + priv(this, 'cache', new Map()) // hash of items by key + priv(this, 'lruList', new Yallist()) // list of items in order of use recency + priv(this, 'length', 0) // length of items in the list } 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] + return priv(this, 'lruList').map(function (hit) { if (!isStale(this, hit)) { - //Do not store staled hits - ++i - arr.push({ + return { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) - }); + } } - } - //arr has the most read first - return arr + }, this).toArray().filter(function (h) { + return h + }) } LRUCache.prototype.dumpLru = function () { - return this._lruList + return priv(this, 'lruList') +} + +LRUCache.prototype.inspect = function (n, opts) { + var str = 'LRUCache {' + var extras = false + + var as = priv(this, 'allowStale') + if (as) { + str += '\n allowStale: true' + extras = true + } + + var max = priv(this, 'max') + if (max && max !== Infinity) { + if (extras) { + str += ',' + } + str += '\n max: ' + util.inspect(max, opts) + extras = true + } + + var maxAge = priv(this, 'maxAge') + if (maxAge) { + if (extras) { + str += ',' + } + str += '\n maxAge: ' + util.inspect(maxAge, opts) + extras = true + } + + var lc = priv(this, 'lengthCalculator') + if (lc && lc !== naiveLength) { + if (extras) { + str += ',' + } + str += '\n length: ' + util.inspect(priv(this, 'length'), opts) + extras = true + } + + var didFirst = false + priv(this, 'lruList').forEach(function (item) { + if (didFirst) { + str += ',\n ' + } else { + if (extras) { + str += ',\n' + } + didFirst = true + str += '\n ' + } + var key = util.inspect(item.key).split('\n').join('\n ') + var val = { value: item.value } + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge + } + if (lc !== naiveLength) { + val.length = item.length + } + if (isStale(this, item)) { + val.stale = true + } + + val = util.inspect(val, opts).split('\n').join('\n ') + str += key + ' => ' + val + }) + + if (didFirst || extras) { + str += '\n' + } + str += '}' + + return str } LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this._maxAge - typeCheckKey(key) + maxAge = maxAge || priv(this, 'maxAge') var now = maxAge ? Date.now() : 0 - var len = this._lengthCalculator(value) + var len = priv(this, 'lengthCalculator').call(this, value, key) - if (hOP(this._cache, key)) { - if (len > this._max) { - del(this, this._cache[key]) + if (priv(this, 'cache').has(key)) { + if (len > priv(this, 'max')) { + del(this, priv(this, 'cache').get(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) + var node = priv(this, 'cache').get(key) + var item = node.value + + // dispose of the old one before overwriting + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, key, item.value) + } + item.now = now + item.maxAge = maxAge + item.value = value + priv(this, 'length', priv(this, 'length') + (len - item.length)) + item.length = len + this.get(key) + trim(this) return true } - var hit = new Entry(key, value, this._mru++, len, now, maxAge) + var hit = new Entry(key, value, len, now, maxAge) // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) + if (hit.length > priv(this, 'max')) { + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, 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) - + priv(this, 'length', priv(this, 'length') + hit.length) + priv(this, 'lruList').unshift(hit) + priv(this, 'cache').set(key, priv(this, 'lruList').head) + trim(this) return true } LRUCache.prototype.has = function (key) { - typeCheckKey(key) - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] + if (!priv(this, 'cache').has(key)) return false + var hit = priv(this, 'cache').get(key).value if (isStale(this, hit)) { return false } @@ -227,108 +355,115 @@ LRUCache.prototype.has = function (key) { } 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 + var node = priv(this, 'lruList').tail + if (!node) return null + del(this, node) + return node.value } LRUCache.prototype.del = function (key) { - typeCheckKey(key) - del(this, this._cache[key]) + del(this, priv(this, 'cache').get(key)) } LRUCache.prototype.load = function (arr) { - //reset the cache - this.reset(); + // 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-- ) { + // 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 + // 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) + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } } } } +LRUCache.prototype.prune = function () { + var self = this + priv(this, 'cache').forEach(function (value, key) { + get(self, key, false) + }) +} + function get (self, key, doUse) { - typeCheckKey(key) - var hit = self._cache[key] - if (hit) { + var node = priv(self, 'cache').get(key) + if (node) { + var hit = node.value if (isStale(self, hit)) { - del(self, hit) - if (!self._allowStale) hit = undefined + del(self, node) + if (!priv(self, 'allowStale')) hit = undefined } else { - if (doUse) use(self, hit) + if (doUse) { + priv(self, 'lruList').unshiftNode(node) + } } if (hit) hit = hit.value } return hit } -function isStale(self, hit) { - if (!hit || (!hit.maxAge && !self._maxAge)) return false - var stale = false; +function isStale (self, hit) { + if (!hit || (!hit.maxAge && !priv(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) + stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge')) } - return stale; -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit + return stale } 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 ++ + if (priv(self, 'length') > priv(self, 'max')) { + for (var walker = priv(self, 'lruList').tail; + priv(self, 'length') > priv(self, 'max') && walker !== null;) { + // 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. + var prev = walker.prev + del(self, walker) + walker = prev + } + } } -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) +function del (self, node) { + if (node) { + var hit = node.value + if (priv(self, 'dispose')) { + priv(self, 'dispose').call(this, hit.key, hit.value) + } + priv(self, 'length', priv(self, 'length') - hit.length) + priv(self, 'cache').delete(hit.key) + priv(self, 'lruList').removeNode(node) } } // classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now, maxAge) { +function Entry (key, value, length, now, maxAge) { this.key = key this.value = value - this.lu = lu this.length = length this.now = now - if (maxAge) this.maxAge = maxAge + this.maxAge = maxAge || 0 } - -})() diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE similarity index 100% rename from tools/eslint/node_modules/rimraf/node_modules/glob/LICENSE rename to deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md new file mode 100644 index 00000000000000..778bf01dfaaf9f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js new file mode 100644 index 00000000000000..7db15994612fd9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js @@ -0,0 +1,9 @@ +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 +} else { + module.exports = require('./pseudomap') +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json new file mode 100644 index 00000000000000..8e1129b8d3bd5f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + "pseudomap@^1.0.1", + "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" + ] + ], + "_from": "pseudomap@>=1.0.1 <2.0.0", + "_id": "pseudomap@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/request/aws4/lru-cache/pseudomap", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "pseudomap", + "raw": "pseudomap@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/aws4/lru-cache" + ], + "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", + "_shrinkwrap": null, + "_spec": "pseudomap@^1.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/pseudomap/issues" + }, + "dependencies": {}, + "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.", + "devDependencies": { + "tap": "^2.3.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", + "tarball": "http://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" + }, + "gitHead": "b6dc728207a0321ede6479e34506d3e0e13a940b", + "homepage": "https://github.com/isaacs/pseudomap#readme", + "license": "ISC", + "main": "map.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "pseudomap", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/pseudomap.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js new file mode 100644 index 00000000000000..25a21d829e8b3f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js @@ -0,0 +1,113 @@ +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/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js new file mode 100644 index 00000000000000..4378e4541e9a14 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore new file mode 100644 index 00000000000000..534108e3f481cf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore @@ -0,0 +1,4 @@ +node_modules/ +coverage/ +.nyc_output/ +nyc_output/ diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml new file mode 100644 index 00000000000000..9c1a7b6ccd2c9e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml @@ -0,0 +1,7 @@ +sudo: false +language: node_js +node_js: + - '0.10' + - '0.12' + - '4' + - '5' diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md new file mode 100644 index 00000000000000..5f51e6f1e53405 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md @@ -0,0 +1,4 @@ +1. The whole API is public. No underscore-prefixed pretend-private + things or hidden Object.create magic mumbo jumbo here. Plain old + objects that are created from constructors. +2. 100% test coverage must be maintained. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md new file mode 100644 index 00000000000000..f5861018696688 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json new file mode 100644 index 00000000000000..a1c290b52f3392 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + "yallist@^2.0.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" + ] + ], + "_from": "yallist@>=2.0.0 <3.0.0", + "_id": "yallist@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/aws4/lru-cache/yallist", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "yallist", + "raw": "yallist@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/aws4/lru-cache" + ], + "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", + "_shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", + "_shrinkwrap": null, + "_spec": "yallist@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/yallist/issues" + }, + "dependencies": {}, + "description": "Yet Another Linked List", + "devDependencies": { + "tap": "^2.3.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", + "tarball": "http://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + }, + "gitHead": "702eaba87deefa9f8fc2f8e36cb225bc2141fdc3", + "homepage": "https://github.com/isaacs/yallist#readme", + "license": "ISC", + "main": "yallist.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "yallist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js new file mode 100644 index 00000000000000..3c8d1f48d904a2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js @@ -0,0 +1,188 @@ +var t = require('tap') +var Yallist = require('../yallist.js') + +var y = new Yallist(1,2,3,4,5) +var z = new Yallist([1,2,3,4,5]) +t.similar(y, z, 'build from single list or args') + +function add10 (i) { + return i + 10 +} +t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15]) +t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11]) + +t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11]) +t.isa(Yallist(1,2,3), 'Yallist') +t.equal(y.push(6, 7, 8), 8) +t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8]) +y.pop() +y.shift() +y.unshift(100) + +var expect = [100, 2, 3, 4, 5, 6, 7] +var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ] + +t.similar(y.toArray(), expect) +t.equal(y.length, y.toArray().length) + +t.test(function forEach (t) { + t.plan(y.length * 2) + y.forEach(function (item, i, list) { + t.equal(item, expect[i]) + t.equal(list, y) + }) +}) + +t.test(function forEach (t) { + t.plan(y.length * 5) + var n = 0 + y.forEachReverse(function (item, i, list) { + t.equal(item, expectReverse[n]) + t.equal(item, expect[i]) + t.equal(item, y.get(i)) + t.equal(item, y.getReverse(n)) + n += 1 + t.equal(list, y) + }) +}) + +t.equal(y.getReverse(100), undefined) + +t.equal(y.get(9999), undefined) + + +function sum (a, b) { return a + b } +t.equal(y.reduce(sum), 127) +t.equal(y.reduce(sum, 100), 227) +t.equal(y.reduceReverse(sum), 127) +t.equal(y.reduceReverse(sum, 100), 227) + +t.equal(Yallist().pop(), undefined) +t.equal(Yallist().shift(), undefined) + +var x = Yallist() +x.unshift(1) +t.equal(x.length, 1) +t.similar(x.toArray(), [1]) + +// verify that y.toArray() returns an array and if we create a +// new Yallist from that array, we get a list matching +t.similar(Yallist(y.toArray()), y) +t.similar(Yallist.apply(null, y.toArray()), y) + +t.throws(function () { + new Yallist().reduce(function () {}) +}, {}, new TypeError('Reduce of empty list with no initial value')) +t.throws(function () { + new Yallist().reduceReverse(function () {}) +}, {}, new TypeError('Reduce of empty list with no initial value')) + +var z = y.reverse() +t.equal(z, y) +t.similar(y.toArray(), expectReverse) +y.reverse() +t.similar(y.toArray(), expect) + +var a = Yallist(1,2,3,4,5,6) +var cases = [ + [ [2, 4], [3, 4] ], + [ [2, -4], [] ], + [ [2, -2], [3, 4] ], + [ [1, -2], [2, 3, 4] ], + [ [-1, -2], [] ], + [ [-5, -2], [2, 3, 4] ], + [ [-99, 2], [1, 2] ], + [ [5, 99], [6] ], + [ [], [1,2,3,4,5,6] ] +] +t.test('slice', function (t) { + t.plan(cases.length) + cases.forEach(function (c) { + t.test(JSON.stringify(c), function (t) { + t.similar(a.slice.apply(a, c[0]), Yallist(c[1])) + t.similar([].slice.apply(a.toArray(), c[0]), c[1]) + t.end() + }) + }) +}) + +t.test('sliceReverse', function (t) { + t.plan(cases.length) + cases.forEach(function (c) { + var rev = c[1].slice().reverse() + t.test(JSON.stringify([c[0], rev]), function (t) { + t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev)) + t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev) + t.end() + }) + }) +}) + +var inserter = Yallist(1,2,3,4,5) +inserter.unshiftNode(inserter.head.next) +t.similar(inserter.toArray(), [2,1,3,4,5]) +inserter.unshiftNode(inserter.tail) +t.similar(inserter.toArray(), [5,2,1,3,4]) +inserter.unshiftNode(inserter.head) +t.similar(inserter.toArray(), [5,2,1,3,4]) + +var single = Yallist(1) +single.unshiftNode(single.head) +t.similar(single.toArray(), [1]) + +inserter = Yallist(1,2,3,4,5) +inserter.pushNode(inserter.tail.prev) +t.similar(inserter.toArray(), [1,2,3,5,4]) +inserter.pushNode(inserter.head) +t.similar(inserter.toArray(), [2,3,5,4,1]) +inserter.unshiftNode(inserter.head) +t.similar(inserter.toArray(), [2,3,5,4,1]) + +single = Yallist(1) +single.pushNode(single.tail) +t.similar(single.toArray(), [1]) + +var swiped = Yallist(9,8,7) +inserter.unshiftNode(swiped.head.next) +t.similar(inserter.toArray(), [8,2,3,5,4,1]) +t.similar(swiped.toArray(), [9,7]) + +swiped = Yallist(9,8,7) +inserter.pushNode(swiped.head.next) +t.similar(inserter.toArray(), [8,2,3,5,4,1,8]) +t.similar(swiped.toArray(), [9,7]) + +swiped.unshiftNode(Yallist.Node(99)) +t.similar(swiped.toArray(), [99,9,7]) +swiped.pushNode(Yallist.Node(66)) +t.similar(swiped.toArray(), [99,9,7,66]) + +var e = Yallist() +e.unshiftNode(Yallist.Node(1)) +t.same(e.toArray(), [1]) +e = Yallist() +e.pushNode(Yallist.Node(1)) +t.same(e.toArray(), [1]) + +// steal them back, don't break the lists +swiped.unshiftNode(inserter.head) +t.same(swiped, Yallist(8,99,9,7,66)) +t.same(inserter, Yallist(2,3,5,4,1,8)) +swiped.unshiftNode(inserter.tail) +t.same(inserter, Yallist(2,3,5,4,1)) +t.same(swiped, Yallist(8,8,99,9,7,66)) + + +t.throws(function remove_foreign_node () { + e.removeNode(swiped.head) +}, {}, new Error('removing node which does not belong to this list')) +t.throws(function remove_unlisted_node () { + e.removeNode(Yallist.Node('nope')) +}, {}, new Error('removing node which does not belong to this list')) + +e = Yallist(1,2) +e.removeNode(e.head) +t.same(e, Yallist(2)) +e = Yallist(1,2) +e.removeNode(e.tail) +t.same(e, Yallist(1)) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js new file mode 100644 index 00000000000000..fb60fc2878b438 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js @@ -0,0 +1,360 @@ +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length -- + node.next = null + node.prev = null + node.list = null +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length ++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length ++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) + return undefined + + var res = this.tail.value + this.tail = this.tail.prev + this.tail.next = null + this.length -- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) + return undefined + + var res = this.head.value + this.head = this.head.next + this.head.prev = null + this.length -- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length ++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length ++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json index 501c3e735fa4d3..fafc088e725c0c 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json @@ -1,37 +1,41 @@ { "_args": [ [ - "lru-cache@^2.6.5", + "lru-cache@^4.0.0", "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4" ] ], - "_from": "lru-cache@>=2.6.5 <3.0.0", - "_id": "lru-cache@2.7.3", + "_from": "lru-cache@>=4.0.0 <5.0.0", + "_id": "lru-cache@4.0.1", "_inCache": true, "_installable": true, "_location": "/request/aws4/lru-cache", - "_nodeVersion": "4.0.0", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lru-cache-4.0.1.tgz_1458667372415_0.8005518841091543" + }, "_npmUser": { "email": "i@izs.me", "name": "isaacs" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.7.3", "_phantomChildren": {}, "_requested": { "name": "lru-cache", - "raw": "lru-cache@^2.6.5", - "rawSpec": "^2.6.5", + "raw": "lru-cache@^4.0.0", + "rawSpec": "^4.0.0", "scope": null, - "spec": ">=2.6.5 <3.0.0", + "spec": ">=4.0.0 <5.0.0", "type": "range" }, "_requiredBy": [ "/request/aws4" ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", + "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", "_shrinkwrap": null, - "_spec": "lru-cache@^2.6.5", + "_spec": "lru-cache@^4.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4", "author": { "email": "i@izs.me", @@ -40,34 +44,40 @@ "bugs": { "url": "https://github.com/isaacs/node-lru-cache/issues" }, - "dependencies": {}, + "dependencies": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + }, "description": "A cache object that deletes the least-recently-used items.", "devDependencies": { - "tap": "^1.2.0", - "weak": "" + "standard": "^5.4.1", + "tap": "^5.1.1" }, "directories": {}, "dist": { - "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" + "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", + "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz" }, - "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", + "files": [ + "lib/lru-cache.js" + ], + "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28", "homepage": "https://github.com/isaacs/node-lru-cache#readme", "keywords": [ - "cache", + "mru", "lru", - "mru" + "cache" ], "license": "ISC", "main": "lib/lru-cache.js", "maintainers": [ { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "isaacs@npmjs.com", + "name": "isaacs" }, { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" } ], "name": "lru-cache", @@ -78,7 +88,8 @@ "url": "git://github.com/isaacs/node-lru-cache.git" }, "scripts": { - "test": "tap test --gc" + "posttest": "standard test/*.js lib/*.js", + "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100" }, - "version": "2.7.3" + "version": "4.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js deleted file mode 100644 index b47225f109891f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,396 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("lru recently updated with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - t.equal(cache.length, 6) //CCC BB A - cache.set("a", "+A") - t.equal(cache.length, 7) //+A CCC BB - cache.set("b", "++BB") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("c", "oversized") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("a", "oversized") - t.equal(cache.length, 4) //++BB - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "++BB") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60 + 25) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("individual item can have it's own maxAge", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A", 20) - setTimeout(function () { - t.notOk(cache.get("a")) - t.end() - }, 25) -}) - -test("individual item can have it's own maxAge > cache's", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 20 - }) - - cache.set("a", "A", 50) - setTimeout(function () { - t.equal(cache.get("a"), "A") - t.end() - }, 25) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("pop the least used item", function (t) { - var cache = new LRU(3) - , last - - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - - t.equal(cache.length, 3) - t.equal(cache.max, 3) - - // Ensure we pop a, c, b - cache.get("b", "B") - - last = cache.pop() - t.equal(last.key, "a") - t.equal(last.value, "A") - t.equal(cache.length, 2) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "c") - t.equal(last.value, "C") - t.equal(cache.length, 1) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "b") - t.equal(last.value, "B") - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last, null) - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - t.end() -}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index 4190417cbc61d8..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,120 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) - -test('all entries are iterated over', function(t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function (val, key, cache) { - if (i > 0) { - cache.del(key) - } - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 1) - - t.end() -}) - -test('all stale entries are removed', function(t) { - var l = new LRU({ max: 5, maxAge: -5, stale: true }) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function () { - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 0) - - t.end() -}) - -test('expires', function (t) { - var l = new LRU({ - max: 10, - maxAge: 50 - }) - for (var i = 0; i < 10; i++) { - l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined)) - } - - var i = 0 - var order = [ 8, 6, 4, 2, 0 ] - setTimeout(function () { - l.forEach(function (val, key, cache) { - var j = order[i++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - setTimeout(function () { - var count = 0; - l.forEach(function (val, key, cache) { count++; }) - t.equal(0, count); - t.end() - }, 25) - - }, 26) -}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index b5912f6f168e5e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node --expose_gc - - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js deleted file mode 100644 index 5fe5dc3d371f1e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js +++ /dev/null @@ -1,215 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('dump', function (t) { - var cache = new LRU() - - t.equal(cache.dump().length, 0, "nothing in dump for empty cache") - - cache.set("a", "A") - cache.set("b", "B") - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.set("a", "A"); - t.deepEqual(cache.dump(), [ - { k: "a", v: "A", e: 0 }, - { k: "b", v: "B", e: 0 } - ]) - - cache.get("b"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.del("a"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 } - ]) - - t.end() -}) - -test("do not dump stale items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - //expires at 50 - cache.set("a", "A") - - setTimeout(function () { - //expires at 75 - cache.set("b", "B") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "b") - t.equal(s[1].k, "a") - }, 25) - - setTimeout(function () { - //expires at 110 - cache.set("c", "C") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "c") - t.equal(s[1].k, "b") - }, 60) - - setTimeout(function () { - //expires at 130 - cache.set("d", "D", 40) - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "d") - t.equal(s[1].k, "c") - }, 90) - - setTimeout(function () { - var s = cache.dump() - t.equal(s.length, 1) - t.equal(s[0].k, "d") - }, 120) - - setTimeout(function () { - var s = cache.dump() - t.deepEqual(s, []) - t.end() - }, 155) -}) - -test("load basic cache", function(t) { - var cache = new LRU(), - copy = new LRU() - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.deepEquals(cache.dump(), copy.dump()) - - t.end() -}) - - -test("load staled cache", function(t) { - var cache = new LRU({maxAge: 50}), - copy = new LRU({maxAge: 50}), - arr - - //expires at 50 - cache.set("a", "A") - setTimeout(function () { - //expires at 80 - cache.set("b", "B") - arr = cache.dump() - t.equal(arr.length, 2) - }, 30) - - setTimeout(function () { - copy.load(arr) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - }, 60) - - setTimeout(function () { - t.equal(copy.get("b"), undefined) - t.end() - }, 90) -}) - -test("load to other size cache", function(t) { - var cache = new LRU({max: 2}), - copy = new LRU({max: 1}) - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - - //update the last read from original cache - cache.get("a") - copy.load(cache.dump()) - t.equal(copy.get("a"), "A") - t.equal(copy.get("b"), undefined) - - t.end() -}) - - -test("load to other age cache", function(t) { - var cache = new LRU({maxAge: 50}), - aged = new LRU({maxAge: 100}), - simple = new LRU(), - arr, - expired - - //created at 0 - //a would be valid till 0 + 50 - cache.set("a", "A") - setTimeout(function () { - //created at 20 - //b would be valid till 20 + 50 - cache.set("b", "B") - //b would be valid till 20 + 70 - cache.set("c", "C", 70) - arr = cache.dump() - t.equal(arr.length, 3) - }, 20) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "B") - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), "B") - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), "B") - t.equal(simple.get("c"), "C") - }, 60) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), "C") - }, 80) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), undefined) - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), undefined) - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), undefined) - t.end() - }, 100) - -}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json index 31de63b47c1dc4..5e7ae9de2d0e92 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/package.json +++ b/deps/npm/node_modules/request/node_modules/aws4/package.json @@ -6,16 +6,20 @@ ] ], "_from": "aws4@>=1.2.1 <2.0.0", - "_id": "aws4@1.2.1", + "_id": "aws4@1.3.2", "_inCache": true, "_installable": true, "_location": "/request/aws4", - "_nodeVersion": "4.2.4", + "_nodeVersion": "4.3.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842" + }, "_npmUser": { "email": "michael.hart.au@gmail.com", "name": "hichaelmart" }, - "_npmVersion": "2.14.15", + "_npmVersion": "2.14.21", "_phantomChildren": {}, "_requested": { "name": "aws4", @@ -28,8 +32,8 @@ "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz", - "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz", + "_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", "_shrinkwrap": null, "_spec": "aws4@^1.2.1", "_where": "/Users/rebecca/code/npm/node_modules/request", @@ -42,78 +46,78 @@ "url": "https://github.com/mhart/aws4/issues" }, "dependencies": { - "lru-cache": "^2.6.5" + "lru-cache": "^4.0.0" }, "description": "Signs and prepares requests using AWS Signature Version 4", "devDependencies": { - "mocha": "^2.2.5", - "should": "^7.0.1" + "mocha": "^2.4.5", + "should": "^8.2.2" }, "directories": {}, "dist": { - "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac", - "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz" + "shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", + "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz" }, - "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c", + "gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72", "homepage": "https://github.com/mhart/aws4#readme", "keywords": [ "amazon", - "appstream", - "autoscaling", "aws", + "signature", + "s3", + "ec2", + "autoscaling", "cloudformation", - "cloudfront", - "cloudhsm", + "elasticloadbalancing", + "elb", + "elasticbeanstalk", "cloudsearch", - "cloudtrail", - "cloudwatch", - "codedeploy", - "cognito", - "cognitoidentity", - "cognitosync", - "config", - "containerservice", + "dynamodb", + "kinesis", + "lambda", + "glacier", + "sqs", + "sns", + "iam", + "sts", + "ses", + "swf", + "storagegateway", "datapipeline", "directconnect", - "dynamodb", - "ec2", - "ecs", + "redshift", + "opsworks", + "rds", + "monitoring", + "cloudtrail", + "cloudfront", + "codedeploy", "elasticache", - "elasticbeanstalk", - "elasticloadbalancing", "elasticmapreduce", "elastictranscoder", - "elb", "emr", - "glacier", - "iam", + "cloudwatch", + "mobileanalytics", + "cognitoidentity", + "cognitosync", + "cognito", + "containerservice", + "ecs", + "appstream", "keymanagementservice", - "kinesis", "kms", - "lambda", - "logs", - "mobileanalytics", - "monitoring", - "opsworks", - "rds", - "redshift", + "config", + "cloudhsm", "route53", "route53domains", - "s3", - "ses", - "signature", - "sns", - "sqs", - "storagegateway", - "sts", - "swf" + "logs" ], "license": "MIT", "main": "aws4.js", "maintainers": [ { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" + "email": "michael.hart.au@gmail.com", + "name": "hichaelmart" } ], "name": "aws4", @@ -126,5 +130,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.2.1" + "version": "1.3.2" } diff --git a/deps/npm/node_modules/request/node_modules/bl/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/.travis.yml index e431a1bd0c3d34..5cb0480b45457a 100644 --- a/deps/npm/node_modules/request/node_modules/bl/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/bl/.travis.yml @@ -2,8 +2,9 @@ sudo: false language: node_js node_js: - '0.10' - - node - - iojs + - '0.12' + - '4' + - '5' branches: only: - master diff --git a/deps/npm/node_modules/request/node_modules/bl/README.md b/deps/npm/node_modules/request/node_modules/bl/README.md index 4d87866aa19525..f7044db26e8659 100644 --- a/deps/npm/node_modules/request/node_modules/bl/README.md +++ b/deps/npm/node_modules/request/node_modules/bl/README.md @@ -96,7 +96,7 @@ bl.pipe(fs.createWriteStream('gibberish.txt')) -------------------------------------------------------- -### new BufferList([ callback | buffer | buffer array ]) +### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. @@ -120,8 +120,8 @@ Get the length of the list in bytes. This is the sum of the lengths of all of th -------------------------------------------------------- -### bl.append(buffer) -`append(buffer)` adds an additional buffer or BufferList to the internal list. +### bl.append(Buffer | Buffer array | BufferList | BufferList array | String) +`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained. -------------------------------------------------------- diff --git a/deps/npm/node_modules/request/node_modules/bl/bl.js b/deps/npm/node_modules/request/node_modules/bl/bl.js index b979ba82e434d2..f585df1721798f 100644 --- a/deps/npm/node_modules/request/node_modules/bl/bl.js +++ b/deps/npm/node_modules/request/node_modules/bl/bl.js @@ -1,6 +1,7 @@ var DuplexStream = require('readable-stream/duplex') , util = require('util') + function BufferList (callback) { if (!(this instanceof BufferList)) return new BufferList(callback) @@ -11,34 +12,31 @@ function BufferList (callback) { if (typeof callback == 'function') { this._callback = callback - var piper = function (err) { + var piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null } }.bind(this) - this.on('pipe', function (src) { + this.on('pipe', function onPipe (src) { src.on('error', piper) }) - this.on('unpipe', function (src) { + this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) - } - else if (Buffer.isBuffer(callback)) + } else { this.append(callback) - else if (Array.isArray(callback)) { - callback.forEach(function (b) { - Buffer.isBuffer(b) && this.append(b) - }.bind(this)) } DuplexStream.call(this) } + util.inherits(BufferList, DuplexStream) -BufferList.prototype._offset = function (offset) { + +BufferList.prototype._offset = function _offset (offset) { var tot = 0, i = 0, _t for (; i < this._bufs.length; i++) { _t = tot + this._bufs[i].length @@ -48,35 +46,52 @@ BufferList.prototype._offset = function (offset) { } } -BufferList.prototype.append = function (buf) { - var isBuffer = Buffer.isBuffer(buf) || - buf instanceof BufferList - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf == 'number') - buf = buf.toString() +BufferList.prototype.append = function append (buf) { + var i = 0 + , newBuf + + if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + newBuf = Buffer.isBuffer(buf) ? buf : new Buffer(buf) + this._bufs.push(newBuf) + this.length += newBuf.length + } - this._bufs.push(isBuffer ? buf : new Buffer(buf)) - this.length += buf.length return this } -BufferList.prototype._write = function (buf, encoding, callback) { + +BufferList.prototype._write = function _write (buf, encoding, callback) { this.append(buf) - if (callback) + + if (typeof callback == 'function') callback() } -BufferList.prototype._read = function (size) { + +BufferList.prototype._read = function _read (size) { if (!this.length) return this.push(null) + size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } -BufferList.prototype.end = function (chunk) { + +BufferList.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { @@ -85,15 +100,18 @@ BufferList.prototype.end = function (chunk) { } } -BufferList.prototype.get = function (index) { + +BufferList.prototype.get = function get (index) { return this.slice(index, index + 1)[0] } -BufferList.prototype.slice = function (start, end) { + +BufferList.prototype.slice = function slice (start, end) { return this.copy(null, 0, start, end) } -BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { if (typeof srcStart != 'number' || srcStart < 0) srcStart = 0 if (typeof srcEnd != 'number' || srcEnd > this.length) @@ -156,13 +174,13 @@ BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { return dst } -BufferList.prototype.toString = function (encoding, start, end) { +BufferList.prototype.toString = function toString (encoding, start, end) { return this.slice(start, end).toString(encoding) } -BufferList.prototype.consume = function (bytes) { +BufferList.prototype.consume = function consume (bytes) { while (this._bufs.length) { - if (bytes > this._bufs[0].length) { + if (bytes >= this._bufs[0].length) { bytes -= this._bufs[0].length this.length -= this._bufs[0].length this._bufs.shift() @@ -175,7 +193,8 @@ BufferList.prototype.consume = function (bytes) { return this } -BufferList.prototype.duplicate = function () { + +BufferList.prototype.duplicate = function duplicate () { var i = 0 , copy = new BufferList() @@ -185,12 +204,14 @@ BufferList.prototype.duplicate = function () { return copy } -BufferList.prototype.destroy = function () { - this._bufs.length = 0; - this.length = 0; - this.push(null); + +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) } + ;(function () { var methods = { 'readDoubleBE' : 8 @@ -218,4 +239,5 @@ BufferList.prototype.destroy = function () { } }()) + module.exports = BufferList diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000000000..38344f87a62766 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..1b82118460cfe4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml @@ -0,0 +1,52 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - npm install -g npm +notifications: + email: false +matrix: + fast_finish: true + allow_failures: + - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 1 + env: TASK=test + - node_js: 2 + env: TASK=test + - node_js: 3 + env: TASK=test + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 5 + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000000000..96d9cfbd38662f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..e3d4e695a4cff2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..1a67c48cd031b5 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000000000..0bc3819e63b025 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1760 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the [`'drain'`][] event before writing more data. + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits()`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Use-case

+
+

Class

+
+

Method(s) to implement

+
+

Reading only

+
+

[Readable](#stream_class_stream_readable_1)

+
+

[_read][stream-_read]

+
+

Writing only

+
+

[Writable](#stream_class_stream_writable_1)

+
+

[_write][stream-_write], [_writev][stream-_writev]

+
+

Reading and writing

+
+

[Duplex](#stream_class_stream_duplex_1)

+
+

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

+
+

Operate on written data, then read the result

+
+

[Transform](#stream_class_stream_transform_1)

+
+

[_transform][stream-_transform], [_flush][stream-_flush]

+
+ +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; +const util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; +const util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', () => { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const util = require('util'); +const Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const util = require('util'); +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream +[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..ca807af87620dd --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..736693b8400fed --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,75 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..d06f71f1868d77 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,26 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..54a9d5c553d69e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,880 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events'); + +/**/ +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = undefined; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; + + if (state.objectMode) return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } + + if (n <= 0) return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) return null; + + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..625cdc17698059 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,180 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +function done(stream, er) { + if (er) return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..95916c992a9507 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,516 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // create the two objects needed to store the corked requests + // they are not a linked list, as no new elements are inserted in there + this.corkedRequestsFree = new CorkedRequest(this); + this.corkedRequestsFree.next = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000000000..d8d7f9437dbf5a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000000000..5a76b4149c5eb5 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000000000..a06d5c05f75fd5 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000000000..ff4c851c075a2f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000000000..1be49d90f5f82a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "core-util-is@~1.0.0", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ], + [ + "core-util-is@~1.0.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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": "/request/bl/readable-stream/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": [ + "/request/bl/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "core-util-is@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/request/node_modules/bl/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/request/node_modules/bl/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/tools/eslint/node_modules/deep-is/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore similarity index 100% rename from tools/eslint/node_modules/deep-is/.npmignore rename to deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore diff --git a/tools/eslint/node_modules/minimist/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml similarity index 100% rename from tools/eslint/node_modules/minimist/.travis.yml rename to deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile new file mode 100644 index 00000000000000..0ecc29c402c243 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000000000..16d2c59c6195f9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000000000..9e31b683889015 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000000000..a57f63495943a0 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000000000..b8f76c40e4102d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "isarray@~1.0.0", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ], + [ + "isarray@~1.0.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" + ] + ], + "_from": "isarray@>=1.0.0 <1.1.0", + "_id": "isarray@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/bl/readable-stream/isarray", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "isarray", + "raw": "isarray@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/bl/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "isarray@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "dependencies": {}, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "directories": {}, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "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": "tape test.js" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js new file mode 100644 index 00000000000000..f7f7bcd19fec56 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js @@ -0,0 +1,19 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000000000..36201b10017a5e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000000000..571c276783c779 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,20 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn) { + var args = new Array(arguments.length - 1); + var i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + process.nextTick(function afterTick() { + fn.apply(null, args); + }); +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/request/node_modules/bl/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/request/node_modules/bl/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/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000000000..bae43acf21c1ba --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,73 @@ +{ + "_args": [ + [ + "process-nextick-args@~1.0.6", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ], + [ + "process-nextick-args@~1.0.6", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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": "/request/bl/readable-stream/process-nextick-args", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "process-nextick-args", + "raw": "process-nextick-args@~1.0.6", + "rawSpec": "~1.0.6", + "scope": null, + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/bl/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "process-nextick-args@~1.0.6", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/request/node_modules/bl/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/request/node_modules/bl/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/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000000000..ef15721584ac99 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000000000..206320cc1d21b9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..6de584a48f5c89 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..4d2aa001501107 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000000000..b00e54fb790982 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..977e5976d64923 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + "string_decoder@~0.10.x", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ], + [ + "string_decoder@~0.10.x", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" + ] + ], + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_id": "string_decoder@0.10.31", + "_inCache": true, + "_installable": true, + "_location": "/request/bl/readable-stream/string_decoder", + "_npmUser": { + "email": "rod@vagg.org", + "name": "rvagg" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "name": "string_decoder", + "raw": "string_decoder@~0.10.x", + "rawSpec": "~0.10.x", + "scope": null, + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/request/bl/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "string_decoder@~0.10.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000000000..acc8675372e980 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000000000..6a60e8c225c9ba --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md new file mode 100644 index 00000000000000..75622fa7c250a6 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000000000..549ae2f065ea5a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js new file mode 100644 index 00000000000000..5e6fcff5ddd3fb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000000000..63869c0e04c12b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,83 @@ +{ + "_args": [ + [ + "util-deprecate@~1.0.1", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ], + [ + "util-deprecate@~1.0.1", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" + ] + ], + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_id": "util-deprecate@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/request/bl/readable-stream/util-deprecate", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "util-deprecate", + "raw": "util-deprecate@~1.0.1", + "rawSpec": "~1.0.1", + "scope": null, + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/bl/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "util-deprecate@~1.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..f818ebf1b62108 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "readable-stream@~2.0.5", + "/Users/rebecca/code/npm/node_modules/request/node_modules/bl" + ] + ], + "_from": "readable-stream@>=2.0.5 <2.1.0", + "_id": "readable-stream@2.0.6", + "_inCache": true, + "_installable": true, + "_location": "/request/bl/readable-stream", + "_nodeVersion": "5.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "readable-stream", + "raw": "readable-stream@~2.0.5", + "rawSpec": "~2.0.5", + "scope": null, + "spec": ">=2.0.5 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/bl" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_shrinkwrap": null, + "_spec": "readable-stream@~2.0.5", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl", + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.5.1", + "zuul": "~3.9.0" + }, + "directories": {}, + "dist": { + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + }, + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "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 test/ours/*.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "version": "2.0.6" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..27e8d8a55165f9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..6222a579864dd2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..5d482f0780e993 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..e1e9efdf3c12e9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 61b85c1393794e..09ebb7b7413344 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -1,16 +1,20 @@ { "_args": [ [ - "bl@~1.0.0", + "bl@~1.1.2", "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "bl@>=1.0.0 <1.1.0", - "_id": "bl@1.0.1", + "_from": "bl@>=1.1.2 <1.2.0", + "_id": "bl@1.1.2", "_inCache": true, "_installable": true, "_location": "/request/bl", - "_nodeVersion": "6.0.0-nightly2016011666b9c0d8bd", + "_nodeVersion": "5.3.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066" + }, "_npmUser": { "email": "rod@vagg.org", "name": "rvagg" @@ -19,24 +23,24 @@ "_phantomChildren": {}, "_requested": { "name": "bl", - "raw": "bl@~1.0.0", - "rawSpec": "~1.0.0", + "raw": "bl@~1.1.2", + "rawSpec": "~1.1.2", "scope": null, - "spec": ">=1.0.0 <1.1.0", + "spec": ">=1.1.2 <1.2.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.1.tgz", - "_shasum": "0e6df7330308c46515751676cafa7334dc9852fd", + "_resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", + "_shasum": "fdca871a99713aa00d19e3bbba41c44787a65398", "_shrinkwrap": null, - "_spec": "bl@~1.0.0", + "_spec": "bl@~1.1.2", "_where": "/Users/rebecca/code/npm/node_modules/request", "authors": [ - "Jarett Cruger (https://github.com/jcrugzz)", + "Rod Vagg (https://github.com/rvagg)", "Matteo Collina (https://github.com/mcollina)", - "Rod Vagg (https://github.com/rvagg)" + "Jarett Cruger (https://github.com/jcrugzz)" ], "bugs": { "url": "https://github.com/rvagg/bl/issues" @@ -46,30 +50,29 @@ }, "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", "devDependencies": { - "brtapsauce": "~0.3.0", - "faucet": "~0.0.1", + "faucet": "0.0.1", "hash_file": "~0.1.1", - "tape": "~2.12.3" + "tape": "~4.4.0" }, "directories": {}, "dist": { - "shasum": "0e6df7330308c46515751676cafa7334dc9852fd", - "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.1.tgz" + "shasum": "fdca871a99713aa00d19e3bbba41c44787a65398", + "tarball": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz" }, - "gitHead": "9eced07e8c4f4b44b42e6e99ac33d4c390b4e74a", + "gitHead": "ea42021059dc65fc60d7f4b9217c73431f09d23d", "homepage": "https://github.com/rvagg/bl", "keywords": [ - "awesomesauce", "buffer", "buffers", - "stream" + "stream", + "awesomesauce" ], "license": "MIT", "main": "bl.js", "maintainers": [ { - "name": "rvagg", - "email": "rod@vagg.org" + "email": "rod@vagg.org", + "name": "rvagg" } ], "name": "bl", @@ -80,8 +83,7 @@ "url": "git+https://github.com/rvagg/bl.git" }, "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" + "test": "node test/test.js | faucet" }, - "version": "1.0.1" + "version": "1.1.2" } diff --git a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js deleted file mode 100644 index 92572642ff7c65..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js +++ /dev/null @@ -1,557 +0,0 @@ -var tape = require('tape') - , crypto = require('crypto') - , fs = require('fs') - , hash = require('hash_file') - , BufferList = require('../') - - , encodings = - ('hex utf8 utf-8 ascii binary base64' - + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') - -tape('single bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - - t.end() -}) - -tape('single bytes from multiple buffers', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - t.equal(bl.get(4), 101) - t.equal(bl.get(5), 102) - t.equal(bl.get(6), 103) - t.equal(bl.get(7), 104) - t.equal(bl.get(8), 105) - t.equal(bl.get(9), 106) - t.end() -}) - -tape('multi bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') - t.equal(bl.slice(0, 3).toString('ascii'), 'abc') - t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') - - t.end() -}) - -tape('multiple bytes from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('multiple bytes from multiple buffer lists', function (t) { - var bl = new BufferList() - - bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')])) - bl.append(new BufferList([new Buffer('hi'), new Buffer('j')])) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('consuming from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - bl.consume(3) - t.equal(bl.length, 7) - t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') - - bl.consume(2) - t.equal(bl.length, 5) - t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') - - bl.consume(1) - t.equal(bl.length, 4) - t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') - - bl.consume(1) - t.equal(bl.length, 3) - t.equal(bl.slice(0, 3).toString('ascii'), 'hij') - - bl.consume(2) - t.equal(bl.length, 1) - t.equal(bl.slice(0, 1).toString('ascii'), 'j') - - t.end() -}) - -tape('test readUInt8 / readInt8', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt8(2), 0x3) - t.equal(bl.readInt8(2), 0x3) - t.equal(bl.readUInt8(3), 0x4) - t.equal(bl.readInt8(3), 0x4) - t.equal(bl.readUInt8(4), 0x23) - t.equal(bl.readInt8(4), 0x23) - t.equal(bl.readUInt8(5), 0x42) - t.equal(bl.readInt8(5), 0x42) - t.end() -}) - -tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt16BE(2), 0x0304) - t.equal(bl.readUInt16LE(2), 0x0403) - t.equal(bl.readInt16BE(2), 0x0304) - t.equal(bl.readInt16LE(2), 0x0403) - t.equal(bl.readUInt16BE(3), 0x0423) - t.equal(bl.readUInt16LE(3), 0x2304) - t.equal(bl.readInt16BE(3), 0x0423) - t.equal(bl.readInt16LE(3), 0x2304) - t.equal(bl.readUInt16BE(4), 0x2342) - t.equal(bl.readUInt16LE(4), 0x4223) - t.equal(bl.readInt16BE(4), 0x2342) - t.equal(bl.readInt16LE(4), 0x4223) - t.end() -}) - -tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt32BE(2), 0x03042342) - t.equal(bl.readUInt32LE(2), 0x42230403) - t.equal(bl.readInt32BE(2), 0x03042342) - t.equal(bl.readInt32LE(2), 0x42230403) - t.end() -}) - -tape('test readFloatLE / readFloatBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x00 - buf2[2] = 0x00 - buf3[0] = 0x80 - buf3[1] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readFloatLE(2), 0x01) - t.end() -}) - -tape('test readDoubleLE / readDoubleBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(10) - , bl = new BufferList() - - buf2[1] = 0x55 - buf2[2] = 0x55 - buf3[0] = 0x55 - buf3[1] = 0x55 - buf3[2] = 0x55 - buf3[3] = 0x55 - buf3[4] = 0xd5 - buf3[5] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readDoubleLE(2), 0.3333333333333333) - t.end() -}) - -tape('test toString', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') - t.equal(bl.toString('ascii', 3, 10), 'defghij') - t.equal(bl.toString('ascii', 3, 6), 'def') - t.equal(bl.toString('ascii', 3, 8), 'defgh') - t.equal(bl.toString('ascii', 5, 10), 'fghij') - - t.end() -}) - -tape('test toString encoding', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - bl.append(new Buffer('\xff\x00')) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc), enc) - }) - - t.end() -}) - -!process.browser && tape('test stream', function (t) { - var random = crypto.randomBytes(65534) - , rndhash = hash(random, 'md5') - , md5sum = crypto.createHash('md5') - , bl = new BufferList(function (err, buf) { - t.ok(Buffer.isBuffer(buf)) - t.ok(err === null) - t.equal(rndhash, hash(bl.slice(), 'md5')) - t.equal(rndhash, hash(buf, 'md5')) - - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) - .on('close', function () { - var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') - s.on('data', md5sum.update.bind(md5sum)) - s.on('end', function() { - t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') - t.end() - }) - }) - - }) - - fs.writeFileSync('/tmp/bl_test_rnd.dat', random) - fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) -}) - -tape('instantiation with Buffer', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = crypto.randomBytes(1024) - , b = BufferList(buf) - - t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') - b = BufferList([ buf, buf2 ]) - t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') - t.end() -}) - -tape('test String appendage', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append('abcd') - bl.append('efg') - bl.append('hi') - bl.append('j') - bl.append('\xff\x00') - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('test Number appendage', function (t) { - var bl = new BufferList() - , b = new Buffer('1234567890') - - bl.append(1234) - bl.append(567) - bl.append(89) - bl.append(0) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('write nothing, should get empty buffer', function (t) { - t.plan(3) - BufferList(function (err, data) { - t.notOk(err, 'no error') - t.ok(Buffer.isBuffer(data), 'got a buffer') - t.equal(0, data.length, 'got a zero-length buffer') - t.end() - }).end() -}) - -tape('unicode string', function (t) { - t.plan(2) - var inp1 = '\u2600' - , inp2 = '\u2603' - , exp = inp1 + ' and ' + inp2 - , bl = BufferList() - bl.write(inp1) - bl.write(' and ') - bl.write(inp2) - t.equal(exp, bl.toString()) - t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) -}) - -tape('should emit finish', function (t) { - var source = BufferList() - , dest = BufferList() - - source.write('hello') - source.pipe(dest) - - dest.on('finish', function () { - t.equal(dest.toString('utf8'), 'hello') - t.end() - }) -}) - -tape('basic copy', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy after many appends', function (t) { - var buf = crypto.randomBytes(512) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy at a precise position', function (t) { - var buf = crypto.randomBytes(1004) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2, 20) - t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') - t.end() -}) - -tape('copy starting from a precise location', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(5) - , b = BufferList(buf) - - b.copy(buf2, 0, 5) - t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy in an interval', function (t) { - var rnd = crypto.randomBytes(10) - , b = BufferList(rnd) // put the random bytes there - , actual = new Buffer(3) - , expected = new Buffer(3) - - rnd.copy(expected, 0, 5, 8) - b.copy(actual, 0, 5, 8) - - t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy an interval between two buffers', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(10) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2, 0, 5, 15) - - t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('duplicate', function (t) { - t.plan(2) - - var bl = new BufferList('abcdefghij\xff\x00') - , dup = bl.duplicate() - - t.equal(bl.prototype, dup.prototype) - t.equal(bl.toString('hex'), dup.toString('hex')) -}) - -tape('destroy no pipe', function (t) { - t.plan(2) - - var bl = new BufferList('alsdkfja;lsdkfja;lsdk') - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -!process.browser && tape('destroy with pipe before read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .pipe(bl) - - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - -}) - -!process.browser && tape('destroy with pipe before read end with race', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .pipe(bl) - - setTimeout(function () { - bl.destroy() - setTimeout(function () { - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - }, 500) - }, 500) -}) - -!process.browser && tape('destroy with pipe after read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/sauce.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - } -}) - -!process.browser && tape('destroy with pipe while writing to a destination', function (t) { - t.plan(4) - - var bl = new BufferList() - , ds = new BufferList() - - fs.createReadStream(__dirname + '/sauce.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.pipe(ds) - - setTimeout(function () { - bl.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - ds.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - }, 100) - } -}) - -!process.browser && tape('handle error', function (t) { - t.plan(2) - fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { - t.ok(err instanceof Error, 'has error') - t.notOk(data, 'no data') - })) -}) diff --git a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js b/deps/npm/node_modules/request/node_modules/bl/test/sauce.js deleted file mode 100644 index a6d28625fbfeaf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -const user = process.env.SAUCE_USER - , key = process.env.SAUCE_KEY - , path = require('path') - , brtapsauce = require('brtapsauce') - , testFile = path.join(__dirname, 'basic-test.js') - - , capabilities = [ - { browserName: 'chrome' , platform: 'Windows XP', version: '' } - , { browserName: 'firefox' , platform: 'Windows 8' , version: '' } - , { browserName: 'firefox' , platform: 'Windows XP', version: '4' } - , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' } - , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' } - , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' } - , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' } - , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' } - , { browserName: 'safari' , platform: 'Windows 7' , version: '5' } - , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' } - , { browserName: 'opera' , platform: 'Windows 7' , version: '' } - , { browserName: 'opera' , platform: 'Windows 7' , version: '11' } - , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' } - , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' } - ] - -if (!user) - throw new Error('Must set a SAUCE_USER env var') -if (!key) - throw new Error('Must set a SAUCE_KEY env var') - -brtapsauce({ - name : 'Traversty' - , user : user - , key : key - , brsrc : testFile - , capabilities : capabilities - , options : { timeout: 60 * 6 } -}) \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/test/test.js b/deps/npm/node_modules/request/node_modules/bl/test/test.js index aa9b48771a2e9b..c95b1ba4844ef7 100644 --- a/deps/npm/node_modules/request/node_modules/bl/test/test.js +++ b/deps/npm/node_modules/request/node_modules/bl/test/test.js @@ -1,9 +1,640 @@ -require('./basic-test') +var tape = require('tape') + , crypto = require('crypto') + , fs = require('fs') + , hash = require('hash_file') + , BufferList = require('../') -if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER) - return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests') + , encodings = + ('hex utf8 utf-8 ascii binary base64' + + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') -if (!/v0\.10/.test(process.version)) - return console.log('Not Node v0.10.x, not running sauce tests') +tape('single bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) -require('./sauce.js') \ No newline at end of file + t.equal(bl.length, 4) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + + t.end() +}) + +tape('single bytes from multiple buffers', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + t.equal(bl.get(4), 101) + t.equal(bl.get(5), 102) + t.equal(bl.get(6), 103) + t.equal(bl.get(7), 104) + t.equal(bl.get(8), 105) + t.equal(bl.get(9), 106) + t.end() +}) + +tape('multi bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') + t.equal(bl.slice(0, 3).toString('ascii'), 'abc') + t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') + + t.end() +}) + +tape('multiple bytes from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('multiple bytes from multiple buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ new Buffer('abcd'), new Buffer('efg') ])) + bl.append(new BufferList([ new Buffer('hi'), new Buffer('j') ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +// same data as previous test, just using nested constructors +tape('multiple bytes from crazy nested buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ + new BufferList([ + new BufferList(new Buffer('abc')) + , new Buffer('d') + , new BufferList(new Buffer('efg')) + ]) + , new BufferList([ new Buffer('hi') ]) + , new BufferList(new Buffer('j')) + ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('append accepts arrays of Buffers', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abc')) + bl.append([ new Buffer('def') ]) + bl.append([ new Buffer('ghi'), new Buffer('jkl') ]) + bl.append([ new Buffer('mnop'), new Buffer('qrstu'), new Buffer('vwxyz') ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append accepts arrays of BufferLists', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abc')) + bl.append([ new BufferList('def') ]) + bl.append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ])) + bl.append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append chainable', function (t) { + var bl = new BufferList() + t.ok(bl.append(new Buffer('abcd')) === bl) + t.ok(bl.append([ new Buffer('abcd') ]) === bl) + t.ok(bl.append(new BufferList(new Buffer('abcd'))) === bl) + t.ok(bl.append([ new BufferList(new Buffer('abcd')) ]) === bl) + t.end() +}) + +tape('append chainable (test results)', function (t) { + var bl = new BufferList('abc') + .append([ new BufferList('def') ]) + .append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ])) + .append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ]) + + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('consuming from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + bl.consume(3) + t.equal(bl.length, 7) + t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') + + bl.consume(2) + t.equal(bl.length, 5) + t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') + + bl.consume(1) + t.equal(bl.length, 4) + t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') + + bl.consume(1) + t.equal(bl.length, 3) + t.equal(bl.slice(0, 3).toString('ascii'), 'hij') + + bl.consume(2) + t.equal(bl.length, 1) + t.equal(bl.slice(0, 1).toString('ascii'), 'j') + + t.end() +}) + +tape('complete consumption', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('a')) + bl.append(new Buffer('b')) + + bl.consume(2) + + t.equal(bl.length, 0) + t.equal(bl._bufs.length, 0) + + t.end() +}) + +tape('test readUInt8 / readInt8', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt8(2), 0x3) + t.equal(bl.readInt8(2), 0x3) + t.equal(bl.readUInt8(3), 0x4) + t.equal(bl.readInt8(3), 0x4) + t.equal(bl.readUInt8(4), 0x23) + t.equal(bl.readInt8(4), 0x23) + t.equal(bl.readUInt8(5), 0x42) + t.equal(bl.readInt8(5), 0x42) + t.end() +}) + +tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt16BE(2), 0x0304) + t.equal(bl.readUInt16LE(2), 0x0403) + t.equal(bl.readInt16BE(2), 0x0304) + t.equal(bl.readInt16LE(2), 0x0403) + t.equal(bl.readUInt16BE(3), 0x0423) + t.equal(bl.readUInt16LE(3), 0x2304) + t.equal(bl.readInt16BE(3), 0x0423) + t.equal(bl.readInt16LE(3), 0x2304) + t.equal(bl.readUInt16BE(4), 0x2342) + t.equal(bl.readUInt16LE(4), 0x4223) + t.equal(bl.readInt16BE(4), 0x2342) + t.equal(bl.readInt16LE(4), 0x4223) + t.end() +}) + +tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt32BE(2), 0x03042342) + t.equal(bl.readUInt32LE(2), 0x42230403) + t.equal(bl.readInt32BE(2), 0x03042342) + t.equal(bl.readInt32LE(2), 0x42230403) + t.end() +}) + +tape('test readFloatLE / readFloatBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x00 + buf2[2] = 0x00 + buf3[0] = 0x80 + buf3[1] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readFloatLE(2), 0x01) + t.end() +}) + +tape('test readDoubleLE / readDoubleBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(10) + , bl = new BufferList() + + buf2[1] = 0x55 + buf2[2] = 0x55 + buf3[0] = 0x55 + buf3[1] = 0x55 + buf3[2] = 0x55 + buf3[3] = 0x55 + buf3[4] = 0xd5 + buf3[5] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readDoubleLE(2), 0.3333333333333333) + t.end() +}) + +tape('test toString', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') + t.equal(bl.toString('ascii', 3, 10), 'defghij') + t.equal(bl.toString('ascii', 3, 6), 'def') + t.equal(bl.toString('ascii', 3, 8), 'defgh') + t.equal(bl.toString('ascii', 5, 10), 'fghij') + + t.end() +}) + +tape('test toString encoding', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + bl.append(new Buffer('\xff\x00')) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc), enc) + }) + + t.end() +}) + +!process.browser && tape('test stream', function (t) { + var random = crypto.randomBytes(65534) + , rndhash = hash(random, 'md5') + , md5sum = crypto.createHash('md5') + , bl = new BufferList(function (err, buf) { + t.ok(Buffer.isBuffer(buf)) + t.ok(err === null) + t.equal(rndhash, hash(bl.slice(), 'md5')) + t.equal(rndhash, hash(buf, 'md5')) + + bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + .on('close', function () { + var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + s.on('data', md5sum.update.bind(md5sum)) + s.on('end', function() { + t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') + t.end() + }) + }) + + }) + + fs.writeFileSync('/tmp/bl_test_rnd.dat', random) + fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) +}) + +tape('instantiation with Buffer', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = crypto.randomBytes(1024) + , b = BufferList(buf) + + t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') + b = BufferList([ buf, buf2 ]) + t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') + t.end() +}) + +tape('test String appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append('abcd') + bl.append('efg') + bl.append('hi') + bl.append('j') + bl.append('\xff\x00') + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('test Number appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('1234567890') + + bl.append(1234) + bl.append(567) + bl.append(89) + bl.append(0) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('write nothing, should get empty buffer', function (t) { + t.plan(3) + BufferList(function (err, data) { + t.notOk(err, 'no error') + t.ok(Buffer.isBuffer(data), 'got a buffer') + t.equal(0, data.length, 'got a zero-length buffer') + t.end() + }).end() +}) + +tape('unicode string', function (t) { + t.plan(2) + var inp1 = '\u2600' + , inp2 = '\u2603' + , exp = inp1 + ' and ' + inp2 + , bl = BufferList() + bl.write(inp1) + bl.write(' and ') + bl.write(inp2) + t.equal(exp, bl.toString()) + t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) +}) + +tape('should emit finish', function (t) { + var source = BufferList() + , dest = BufferList() + + source.write('hello') + source.pipe(dest) + + dest.on('finish', function () { + t.equal(dest.toString('utf8'), 'hello') + t.end() + }) +}) + +tape('basic copy', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy after many appends', function (t) { + var buf = crypto.randomBytes(512) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy at a precise position', function (t) { + var buf = crypto.randomBytes(1004) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2, 20) + t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') + t.end() +}) + +tape('copy starting from a precise location', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(5) + , b = BufferList(buf) + + b.copy(buf2, 0, 5) + t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy in an interval', function (t) { + var rnd = crypto.randomBytes(10) + , b = BufferList(rnd) // put the random bytes there + , actual = new Buffer(3) + , expected = new Buffer(3) + + rnd.copy(expected, 0, 5, 8) + b.copy(actual, 0, 5, 8) + + t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy an interval between two buffers', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(10) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2, 0, 5, 15) + + t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('duplicate', function (t) { + t.plan(2) + + var bl = new BufferList('abcdefghij\xff\x00') + , dup = bl.duplicate() + + t.equal(bl.prototype, dup.prototype) + t.equal(bl.toString('hex'), dup.toString('hex')) +}) + +tape('destroy no pipe', function (t) { + t.plan(2) + + var bl = new BufferList('alsdkfja;lsdkfja;lsdk') + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) +}) + +!process.browser && tape('destroy with pipe before read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + +}) + +!process.browser && tape('destroy with pipe before read end with race', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + setTimeout(function () { + bl.destroy() + setTimeout(function () { + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + }, 500) + }, 500) +}) + +!process.browser && tape('destroy with pipe after read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + } +}) + +!process.browser && tape('destroy with pipe while writing to a destination', function (t) { + t.plan(4) + + var bl = new BufferList() + , ds = new BufferList() + + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.pipe(ds) + + setTimeout(function () { + bl.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + ds.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + }, 100) + } +}) + +!process.browser && tape('handle error', function (t) { + t.plan(2) + fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { + t.ok(err instanceof Error, 'has error') + t.notOk(data, 'no data') + })) +}) diff --git a/deps/npm/node_modules/request/node_modules/form-data/.dockerignore b/deps/npm/node_modules/request/node_modules/form-data/.dockerignore new file mode 100644 index 00000000000000..c67305cf96976e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/.dockerignore @@ -0,0 +1,7 @@ +*.iml +*.sublime-* +*.un~ +.idea +sftp-config.json +node_modules/ +test/tmp/ diff --git a/deps/npm/node_modules/request/node_modules/form-data/.editorconfig b/deps/npm/node_modules/request/node_modules/form-data/.editorconfig new file mode 100644 index 00000000000000..0f099897b15f2f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/deps/npm/node_modules/request/node_modules/form-data/.eslintignore b/deps/npm/node_modules/request/node_modules/form-data/.eslintignore new file mode 100644 index 00000000000000..8d87b1d267eabc --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/.eslintignore @@ -0,0 +1 @@ +node_modules/* diff --git a/deps/npm/node_modules/request/node_modules/form-data/Readme.md b/deps/npm/node_modules/request/node_modules/form-data/Readme.md index 492773231f6673..e857db6e2ea8e1 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/Readme.md +++ b/deps/npm/node_modules/request/node_modules/form-data/Readme.md @@ -1,4 +1,4 @@ -# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. @@ -7,6 +7,14 @@ The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface] [xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface [streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions +[![Linux Build](https://img.shields.io/travis/form-data/form-data/master.svg?label=linux:0.10-5.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/master.svg?label=windows:0.10-5.x)](https://ci.appveyor.com/project/alexindigo/form-data) +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/master.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) + +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) +[![Codacy Badge](https://img.shields.io/codacy/43ece80331c246179695e41f81eeffe2.svg)](https://www.codacy.com/app/form-data/form-data) +[![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data) + ## Install ``` diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js index 1e7717d5641c60..8141d6589ddacc 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js @@ -1 +1,2 @@ -module.exports = FormData; \ No newline at end of file +/* eslint-env browser */ +module.exports = FormData; diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js index 0cbb2e8331a871..55328b463b3bf3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js @@ -7,29 +7,51 @@ var parseUrl = require('url').parse; var fs = require('fs'); var mime = require('mime-types'); var async = require('async'); +var populate = require('./populate.js'); +// Public API module.exports = FormData; + +// make it a Stream +util.inherits(FormData, CombinedStream); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + */ function FormData() { + if (!(this instanceof FormData)) { + throw new TypeError('Failed to construct FormData: Please use the _new_ operator, this object constructor cannot be called as a function.'); + } + this._overheadLength = 0; this._valueLength = 0; this._lengthRetrievers = []; CombinedStream.call(this); } -util.inherits(FormData, CombinedStream); FormData.LINE_BREAK = '\r\n'; FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; FormData.prototype.append = function(field, value, options) { - options = (typeof options === 'string') - ? { filename: options } - : options || {}; + + options = options || {}; + + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } var append = CombinedStream.prototype.append.bind(this); // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; + if (typeof value == 'number') { + value = '' + value; + } // https://github.com/felixge/node-form-data/issues/38 if (util.isArray(value)) { @@ -40,7 +62,7 @@ FormData.prototype.append = function(field, value, options) { } var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); + var footer = this._multiPartFooter(); append(header); append(value); @@ -78,108 +100,83 @@ FormData.prototype._trackLength = function(header, value, options) { } // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - - // when end specified - // no need to calculate range - // inclusive, starts with 0 - next(null, value.end+1 - (value.start ? value.start : 0)); - - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { - - var fileSize; - - if (err) { - next(err); - return; - } - - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - next(null, fileSize); + if (!options.knownLength) { + this._lengthRetrievers.push(function(next) { + + if (value.hasOwnProperty('fd')) { + + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + next(null, value.end + 1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + next(err); + return; + } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + next(null, fileSize); + }); + } + + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + next(null, +value.headers['content-length']); + + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + next(null, +response.headers['content-length']); }); - } + value.resume(); - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); + // something else + } else { + next('Unknown stream'); + } + }); + } }; FormData.prototype._multiPartHeader = function(field, value, options) { // custom header specified (as string)? // it becomes responsible for boundary // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { + if (options.header) { return options.header; } + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + var contents = ''; var headers = { - 'Content-Disposition': ['form-data', 'name="' + field + '"'], - 'Content-Type': [] + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) }; - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - headers['Content-Disposition'].push( - 'filename="' + path.basename(options.filename || value.path) + '"' - ); - headers['Content-Type'].push( - options.contentType || - mime.lookup(options.filename || value.path) || - FormData.DEFAULT_CONTENT_TYPE - ); - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - headers['Content-Disposition'].push( - 'filename="' + path.basename(value.client._httpMessage.path) + '"' - ); - headers['Content-Type'].push( - options.contentType || - value.headers['content-type'] || - FormData.DEFAULT_CONTENT_TYPE - ); - } else if (Buffer.isBuffer(value)) { - headers['Content-Type'].push( - options.contentType || - FormData.DEFAULT_CONTENT_TYPE - ); - } else if (options.contentType) { - headers['Content-Type'].push(options.contentType); - } - for (var prop in headers) { if (headers[prop].length) { contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK; @@ -189,7 +186,55 @@ FormData.prototype._multiPartHeader = function(field, value, options) { return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }; -FormData.prototype._multiPartFooter = function(field, value, options) { +FormData.prototype._getContentDisposition = function(value, options) { + + var contentDisposition; + + // custom filename takes precedence + // fs- and request- streams have path property + var filename = options.filename || value.path; + + // or try http response + if (!filename && value.readable && value.hasOwnProperty('httpVersion')) { + filename = value.client._httpMessage.path; + } + + if (filename) { + contentDisposition = 'filename="' + path.basename(filename) + '"'; + } + + return contentDisposition; +}; + +FormData.prototype._getContentType = function(value, options) { + + // use custom content-type above all + var contentType = options.contentType; + + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filename + if (!contentType && options.filename) { + contentType = mime.lookup(options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function() { return function(next) { var footer = FormData.LINE_BREAK; @@ -207,27 +252,30 @@ FormData.prototype._lastBoundary = function() { }; FormData.prototype.getHeaders = function(userHeaders) { + var header; var formHeaders = { 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() }; - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } } return formHeaders; -} +}; FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; + contentType = contentType ? contentType : 'multipart/form-data'; - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; + var formHeaders = { + 'content-type': contentType + '; boundary=' + this.getBoundary(), + 'content-length': this.getLengthSync() + }; - return formHeaders; -} + return formHeaders; +}; FormData.prototype.getBoundary = function() { if (!this._boundary) { @@ -251,7 +299,7 @@ FormData.prototype._generateBoundary = function() { // Note: getLengthSync DOESN'T calculate streams length // As workaround one can calculate file size manually // and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { +FormData.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; // Don't get confused, there are 3 "internal" streams for each keyval pair @@ -260,9 +308,9 @@ FormData.prototype.getLengthSync = function(debug) { knownLength += this._lastBoundary().length; } - // https://github.com/felixge/node-form-data/issues/40 + // https://github.com/form-data/form-data/issues/40 if (this._lengthRetrievers.length) { - // Some async length retrivers are present + // Some async length retrievers are present // therefore synchronous length calculation is false. // Please use getLength(callback) to get proper length this._error(new Error('Cannot calculate proper length in synchronous way.')); @@ -298,26 +346,25 @@ FormData.prototype.getLength = function(cb) { }; FormData.prototype.submit = function(params, cb) { - var request , options - , defaults = { - method : 'post' - }; + , defaults = {method: 'post'} + ; // parse provided url if it's string // or treat it as options object if (typeof params == 'string') { - params = parseUrl(params); + params = parseUrl(params); options = populate({ port: params.port, path: params.pathname, host: params.hostname }, defaults); - } - else // use custom params - { + + // use custom params + } else { + options = populate(params, defaults); // if no port provided use default one if (!options.port) { @@ -337,8 +384,10 @@ FormData.prototype.submit = function(params, cb) { // get content length and fire away this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) + if (err) { + this._error(err); + return; + } // add content length request.setHeader('Content-Length', length); @@ -354,21 +403,9 @@ FormData.prototype.submit = function(params, cb) { }; FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); } - return dst; -} +}; diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js new file mode 100644 index 00000000000000..6f64a6d32cf186 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js @@ -0,0 +1,9 @@ +// populates missing values +module.exports = function(dst, src) { + for (var prop in src) { + if (src.hasOwnProperty(prop) && !dst[prop]) { + dst[prop] = src[prop]; + } + } + return dst; +}; diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index 662e628b206630..8977f984e81a7e 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json @@ -1,85 +1,129 @@ { + "_args": [ + [ + "form-data@~1.0.0-rc3", + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "form-data@>=1.0.0-rc3 <1.1.0", + "_id": "form-data@1.0.0-rc4", + "_inCache": true, + "_installable": true, + "_location": "/request/form-data", + "_nodeVersion": "0.12.11", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548" + }, + "_npmUser": { + "email": "iam@alexindigo.com", + "name": "alexindigo" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "form-data", + "raw": "form-data@~1.0.0-rc3", + "rawSpec": "~1.0.0-rc3", + "scope": null, + "spec": ">=1.0.0-rc3 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "_shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", + "_shrinkwrap": null, + "_spec": "form-data@~1.0.0-rc3", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "name": "Felix Geisendörfer", "email": "felix@debuggable.com", + "name": "Felix Geisendörfer", "url": "http://debuggable.com/" }, - "name": "form-data", - "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "1.0.0-rc3", - "repository": { - "type": "git", - "url": "git://github.com/form-data/form-data.git" - }, - "main": "./lib/form_data", "browser": "./lib/browser", - "scripts": { - "test": "./test/run.js" - }, - "pre-commit": [ - "test" - ], - "engines": { - "node": ">= 0.10" + "bugs": { + "url": "https://github.com/form-data/form-data/issues" }, "dependencies": { - "async": "^1.4.0", + "async": "^1.5.2", "combined-stream": "^1.0.5", - "mime-types": "^2.1.3" + "mime-types": "^2.1.10" }, - "license": "MIT", + "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", "devDependencies": { + "codacy-coverage": "^1.1.3", + "coveralls": "^2.11.8", + "cross-spawn": "^2.1.5", + "eslint": "^2.4.0", "fake": "^0.2.2", "far": "^0.0.7", "formidable": "^1.0.17", - "pre-commit": "^1.0.10", - "request": "^2.60.0" - }, - "gitHead": "c174f1b7f3a78a00ec5af0360469280445e37804", - "bugs": { - "url": "https://github.com/form-data/form-data/issues" - }, - "homepage": "https://github.com/form-data/form-data#readme", - "_id": "form-data@1.0.0-rc3", - "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577", - "_from": "form-data@>=1.0.0-rc3 <1.1.0", - "_npmVersion": "2.11.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "dylanpiercey", - "email": "pierceydylan@gmail.com" + "istanbul": "^0.4.2", + "pre-commit": "^1.1.2", + "request": "^2.69.0", + "rimraf": "^2.5.2" }, + "directories": {}, "dist": { - "shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577", - "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz" + "shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", + "tarball": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz" + }, + "engines": { + "node": ">= 0.10" }, + "gitHead": "f73996e0508ee2d4b2b376276adfac1de4188ac2", + "homepage": "https://github.com/form-data/form-data#readme", + "license": "MIT", + "main": "./lib/form_data", "maintainers": [ { - "name": "felixge", - "email": "felix@debuggable.com" + "email": "felix@debuggable.com", + "name": "felixge" }, { - "name": "idralyuk", - "email": "igor@buran.us" + "email": "igor@buran.us", + "name": "idralyuk" }, { - "name": "alexindigo", - "email": "iam@alexindigo.com" + "email": "iam@alexindigo.com", + "name": "alexindigo" }, { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" + "email": "mikeal.rogers@gmail.com", + "name": "mikeal" }, { - "name": "celer", - "email": "dtyree77@gmail.com" + "email": "dtyree77@gmail.com", + "name": "celer" }, { - "name": "dylanpiercey", - "email": "pierceydylan@gmail.com" + "email": "pierceydylan@gmail.com", + "name": "dylanpiercey" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz", - "readme": "ERROR: No README data found!" + "name": "form-data", + "optionalDependencies": {}, + "pre-commit": [ + "lint", + "test", + "check" + ], + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/form-data/form-data.git" + }, + "scripts": { + "check": "istanbul check-coverage coverage/coverage*.json", + "coverage": "codacy-coverage < ./coverage/lcov.info; true", + "debug": "verbose=1 ./test/run.js", + "lint": "eslint lib/*.js test/*.js test/**/*.js", + "posttest": "istanbul report", + "predebug": "rimraf coverage test/tmp", + "pretest": "rimraf coverage test/tmp", + "test": "istanbul cover --report none test/run.js" + }, + "version": "1.0.0-rc4" } diff --git a/deps/npm/node_modules/request/node_modules/form-data/wercker.yml b/deps/npm/node_modules/request/node_modules/form-data/wercker.yml new file mode 100644 index 00000000000000..6b118d1e31aa73 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/wercker.yml @@ -0,0 +1,36 @@ +# This references the default nodejs container from +# the Docker Hub: https://registry.hub.docker.com/_/node/ +# If you want Nodesource's container you would reference nodesource/node +# Read more about containers on our dev center +# http://devcenter.wercker.com/docs/containers/index.html +box: node +# This is the build pipeline. Pipelines are the core of wercker +# Read more about pipelines on our dev center +# http://devcenter.wercker.com/docs/pipelines/index.html + +# You can also use services such as databases. Read more on our dev center: +# http://devcenter.wercker.com/docs/services/index.html +# services: + # - postgres + # http://devcenter.wercker.com/docs/services/postgresql.html + + # - mongodb + # http://devcenter.wercker.com/docs/services/mongodb.html +build: + # The steps that will be executed on build + # Steps make up the actions in your pipeline + # Read more about steps on our dev center: + # http://devcenter.wercker.com/docs/steps/index.html + steps: + # A step that executes `npm install` command + - npm-install + # A step that executes `npm test` command + - npm-test + + # A custom script step, name value is used in the UI + # and the code value contains the command that get executed + - script: + name: echo nodejs information + code: | + echo "node version $(node -v) running" + echo "npm version $(npm -v) running" diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json index f2e9595b8b5eb2..98f45803886225 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json @@ -1,38 +1,68 @@ { - "name": "ansi-styles", - "version": "2.1.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" + "_args": [ + [ + "ansi-styles@^2.2.1", + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" + ] + ], + "_from": "ansi-styles@>=2.2.1 <3.0.0", + "_id": "ansi-styles@2.2.1", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk/ansi-styles", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" + }, + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, + "_npmVersion": "3.8.3", + "_phantomChildren": {}, + "_requested": { + "name": "ansi-styles", + "raw": "ansi-styles@^2.2.1", + "rawSpec": "^2.2.1", + "scope": null, + "spec": ">=2.2.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "_shrinkwrap": null, + "_spec": "ansi-styles@^2.2.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { - "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", "url": "sindresorhus.com" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "dependencies": {}, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "mocha" - }, "files": [ "index.js" ], + "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", + "homepage": "https://github.com/chalk/ansi-styles#readme", "keywords": [ "ansi", "styles", @@ -55,17 +85,22 @@ "command-line", "text" ], - "devDependencies": { - "mocha": "*" + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "ansi-styles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" }, - "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" + "scripts": { + "test": "mocha" }, - "homepage": "https://github.com/chalk/ansi-styles#readme", - "_id": "ansi-styles@2.1.0", - "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", - "_from": "ansi-styles@>=2.1.0 <3.0.0" + "version": "2.2.1" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json index 5811067aca37d4..13999335413ffb 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -6,16 +6,20 @@ ] ], "_from": "escape-string-regexp@>=1.0.2 <2.0.0", - "_id": "escape-string-regexp@1.0.4", + "_id": "escape-string-regexp@1.0.5", "_inCache": true, "_installable": true, "_location": "/request/har-validator/chalk/escape-string-regexp", - "_nodeVersion": "4.2.1", + "_nodeVersion": "4.2.6", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "email": "jappelman@xebia.com", + "name": "jbnicolai" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { "name": "escape-string-regexp", @@ -28,8 +32,8 @@ "_requiredBy": [ "/request/har-validator/chalk" ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz", - "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", "_shrinkwrap": null, "_spec": "escape-string-regexp@^1.0.2", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", @@ -49,8 +53,8 @@ }, "directories": {}, "dist": { - "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz" + "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" }, "engines": { "node": ">=0.8.0" @@ -58,29 +62,29 @@ "files": [ "index.js" ], - "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97", + "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", "homepage": "https://github.com/sindresorhus/escape-string-regexp", "keywords": [ - "characters", "escape", - "expression", - "re", "regex", "regexp", + "re", "regular", - "special", + "expression", + "string", "str", - "string" + "special", + "characters" ], "license": "MIT", "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "email": "jappelman@xebia.com", + "name": "jbnicolai" } ], "name": "escape-string-regexp", @@ -93,5 +97,5 @@ "scripts": { "test": "xo && ava" }, - "version": "1.0.4" + "version": "1.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json index 2ad36d4d983cab..cf2ae5bd38d3b4 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json @@ -1,41 +1,78 @@ { - "name": "chalk", - "version": "1.1.1", - "description": "Terminal string styling done right. Much color.", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" + "_args": [ + [ + "chalk@^1.1.1", + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" + ] + ], + "_from": "chalk@>=1.1.1 <2.0.0", + "_id": "chalk@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk", + "_nodeVersion": "0.10.32", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - }, - { - "name": "JD Ballard", - "email": "i.am.qix@gmail.com", - "url": "github.com/qix-" - } + "_npmUser": { + "email": "i.am.qix@gmail.com", + "name": "qix" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": { + "ansi-regex": "2.0.0" + }, + "_requested": { + "name": "chalk", + "raw": "chalk@^1.1.1", + "rawSpec": "^1.1.1", + "scope": null, + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator" ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "_shrinkwrap": null, + "_spec": "chalk@^1.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "description": "Terminal string styling done right. Much color.", + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "xo && mocha", - "bench": "matcha benchmark.js", - "coverage": "nyc npm test && nyc report", - "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" - }, "files": [ "index.js" ], + "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", + "homepage": "https://github.com/chalk/chalk#readme", "keywords": [ "color", "colour", @@ -59,37 +96,39 @@ "command-line", "text" ], - "dependencies": { - "ansi-styles": "^2.1.0", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "license": "MIT", + "maintainers": [ + { + "email": "i.am.qix@gmail.com", + "name": "qix" + }, + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + { + "email": "sindresorhus+unicorn@gmail.com", + "name": "unicorn" + } + ], + "name": "chalk", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" }, - "devDependencies": { - "coveralls": "^2.11.2", - "matcha": "^0.6.0", - "mocha": "*", - "nyc": "^3.0.0", - "require-uncached": "^1.0.2", - "resolve-from": "^1.0.0", - "semver": "^4.3.3", - "xo": "*" + "scripts": { + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", + "test": "xo && mocha" }, + "version": "1.1.3", "xo": { "envs": [ "node", "mocha" ] - }, - "readme": "

\n\t
\n\t
\n\t\"chalk\"\n\t
\n\t
\n\t
\n

\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.` + + + +

+ I + C + E +

+ Your IC-Explorer. +

Usage

+ Run your script with --trace_ic and upload on this page:
+ /path/to/d8 --trace_ic your_script.js > trace.txt +

Data

+
+

+ + trace entries: 0 +

+
+

Result

+

+ Group-Key: + +

+

+ + + +
+

+ + diff --git a/deps/v8/tools/jsfunfuzz/download_jsfunfuzz.py b/deps/v8/tools/jsfunfuzz/download_jsfunfuzz.py new file mode 100644 index 00000000000000..19eff02438feae --- /dev/null +++ b/deps/v8/tools/jsfunfuzz/download_jsfunfuzz.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import re +import subprocess + +FUZZ_PATH = os.path.dirname(os.path.abspath(__file__)) +SHA1_PATH = os.path.join(FUZZ_PATH, 'jsfunfuzz.tar.gz.sha1') + +if re.search(r'\bjsfunfuzz=1', os.environ.get('GYP_DEFINES', '')): + subprocess.check_call([ + 'download_from_google_storage', + '-b', 'chrome-v8-jsfunfuzz', + '-u', '--no_resume', + '-s', SHA1_PATH, + '--platform=linux*' + ]) +else: + print 'Skipping jsfunfuzz download as jsfunfuzz is not set in gyp flags.' diff --git a/deps/v8/tools/jsfunfuzz/fuzz-harness.sh b/deps/v8/tools/jsfunfuzz/fuzz-harness.sh new file mode 100755 index 00000000000000..205a61b33516a4 --- /dev/null +++ b/deps/v8/tools/jsfunfuzz/fuzz-harness.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# A simple harness that downloads and runs 'jsfunfuzz' against d8. This +# takes a long time because it runs many iterations and is intended for +# automated usage. The package containing 'jsfunfuzz' can be found as an +# attachment to this bug: +# https://bugzilla.mozilla.org/show_bug.cgi?id=jsfunfuzz + +JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631" +JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32" + +v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../../) +jsfunfuzz_dir="$v8_root/tools/jsfunfuzz" +cd "$jsfunfuzz_dir" + +if [ -n "$1" ]; then + d8="${v8_root}/$1" +else + d8="${v8_root}/d8" +fi + +if [ ! -f "$d8" ]; then + echo "Failed to find d8 binary: $d8" + exit 1 +fi + +# Deprecated download method. A prepatched archive is downloaded as a hook +# if jsfunfuzz=1 is specified as a gyp flag. Requires google.com authentication +# for google storage. +if [ "$3" == "--download" ]; then + + jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip" + if [ ! -f "$jsfunfuzz_file" ]; then + echo "Downloading $jsfunfuzz_file ..." + wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1 + fi + + jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }') + if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then + echo "Failed to verify checksum!" + exit 1 + fi + + if [ ! -d "$jsfunfuzz_dir" ]; then + echo "Unpacking into $jsfunfuzz_dir ..." + unzip "$jsfunfuzz_file" -d "$jsfunfuzz_dir" || exit 1 + echo "Patching runner ..." + cat << EOF | patch -s -p0 -d "$v8_root" +--- tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py~ ++++ tools/jsfunfuzz/jsfunfuzz/multi_timed_run.py +@@ -125,7 +125,7 @@ + + def many_timed_runs(): + iteration = 0 +- while True: ++ while iteration < 100: + iteration += 1 + logfilename = "w%d" % iteration + one_timed_run(logfilename) +EOF + fi + +fi + +flags='--debug-code --expose-gc --verify-gc' +python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \ + "$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js" +exit_code=$(cat w* | grep " looking good" -c) +exit_code=$((100-exit_code)) + +if [ -n "$2" ]; then + archive="$2" +else + archive=fuzz-results-$(date +%Y%m%d%H%M%S).tar.bz2 +fi +echo "Creating archive $archive" +tar -cjf $archive err-* w* +rm -f err-* w* + +echo "Total failures: $exit_code" +exit $exit_code diff --git a/deps/v8/tools/jsfunfuzz/jsfunfuzz.gyp b/deps/v8/tools/jsfunfuzz/jsfunfuzz.gyp new file mode 100644 index 00000000000000..fb0e5f4949c1b3 --- /dev/null +++ b/deps/v8/tools/jsfunfuzz/jsfunfuzz.gyp @@ -0,0 +1,26 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'conditions': [ + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'jsfunfuzz_run', + 'type': 'none', + 'dependencies': [ + '../../src/d8.gyp:d8_run', + ], + 'includes': [ + '../../build/features.gypi', + '../../build/isolate.gypi', + ], + 'sources': [ + 'jsfunfuzz.isolate', + ], + }, + ], + }], + ], +} diff --git a/deps/v8/tools/jsfunfuzz/jsfunfuzz.isolate b/deps/v8/tools/jsfunfuzz/jsfunfuzz.isolate new file mode 100644 index 00000000000000..56cb4a733f3052 --- /dev/null +++ b/deps/v8/tools/jsfunfuzz/jsfunfuzz.isolate @@ -0,0 +1,18 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'variables': { + 'command': [ + 'fuzz-harness.sh', + ], + 'files': [ + # Grab current directory. This avoids adding logic for checking the + # existence of the jsfunfuzz subdirectory. + './', + ], + }, + 'includes': [ + '../../src/d8.isolate', + ], +} diff --git a/deps/v8/tools/jsfunfuzz/jsfunfuzz.tar.gz.sha1 b/deps/v8/tools/jsfunfuzz/jsfunfuzz.tar.gz.sha1 new file mode 100644 index 00000000000000..449996007df062 --- /dev/null +++ b/deps/v8/tools/jsfunfuzz/jsfunfuzz.tar.gz.sha1 @@ -0,0 +1 @@ +d92e66273ea2a0da89456a977edd0224a8e837e9 \ No newline at end of file diff --git a/deps/v8/tools/ll_prof.py b/deps/v8/tools/ll_prof.py index 7dac2e05eba77e..e65796145e807d 100755 --- a/deps/v8/tools/ll_prof.py +++ b/deps/v8/tools/ll_prof.py @@ -173,11 +173,19 @@ def PrintAnnotated(self, arch, options): break count += cnt total_count += count - count = 100.0 * count / self.self_ticks - if count >= 0.01: - print "%15.2f %x: %s" % (count, lines[i][0], lines[i][1]) + percent = 100.0 * count / self.self_ticks + offset = lines[i][0] + if percent >= 0.01: + # 5 spaces for tick count + # 1 space following + # 1 for '|' + # 1 space following + # 6 for the percentage number, incl. the '.' + # 1 for the '%' sign + # => 15 + print "%5d | %6.2f%% %x(%d): %s" % (count, percent, offset, offset, lines[i][1]) else: - print "%s %x: %s" % (" " * 15, lines[i][0], lines[i][1]) + print "%s %x(%d): %s" % (" " * 15, offset, offset, lines[i][1]) print assert total_count == self.self_ticks, \ "Lost ticks (%d != %d) in %s" % (total_count, self.self_ticks, self) diff --git a/deps/v8/tools/luci-go/linux64/isolate.sha1 b/deps/v8/tools/luci-go/linux64/isolate.sha1 index c2821fca105d39..41d0add7969780 100644 --- a/deps/v8/tools/luci-go/linux64/isolate.sha1 +++ b/deps/v8/tools/luci-go/linux64/isolate.sha1 @@ -1 +1 @@ -32a3d49a4f7279ad022f346f7d960b2d58e2a0fe \ No newline at end of file +cf7c1fac12790056ac393774827a5720c7590bac diff --git a/deps/v8/tools/luci-go/mac64/isolate.sha1 b/deps/v8/tools/luci-go/mac64/isolate.sha1 index fcb6c8fa9e2be0..15744d663a3116 100644 --- a/deps/v8/tools/luci-go/mac64/isolate.sha1 +++ b/deps/v8/tools/luci-go/mac64/isolate.sha1 @@ -1 +1 @@ -83306c575904ec92c1af9ccc67240d26069df337 \ No newline at end of file +4678a9332ef5a7b90b184763afee1c100981f710 diff --git a/deps/v8/tools/luci-go/win64/isolate.exe.sha1 b/deps/v8/tools/luci-go/win64/isolate.exe.sha1 index 032483cba745cc..7c5b7ebf6e2cf7 100644 --- a/deps/v8/tools/luci-go/win64/isolate.exe.sha1 +++ b/deps/v8/tools/luci-go/win64/isolate.exe.sha1 @@ -1 +1 @@ -da358c2666ef9b89022e0eadf363cc6e123384e2 \ No newline at end of file +98457ff4fc79d05661fea53d2b3aff70fac90022 diff --git a/deps/v8/tools/perf/statistics-for-json.R b/deps/v8/tools/perf/statistics-for-json.R new file mode 100644 index 00000000000000..fde2cd75db128e --- /dev/null +++ b/deps/v8/tools/perf/statistics-for-json.R @@ -0,0 +1,113 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Do statistical tests on benchmark results +# This script requires the libraries rjson, R.utils, ggplot2 and data.table +# Install them prior to running + +# To use the script, first get some benchmark results, for example via +# tools/run_perf.py ../v8-perf/benchmarks/Octane2.1/Octane2.1-TF.json +# --outdir=out/x64.release-on --outdir-no-patch=out/x64.release-off +# --json-test-results=results-on.json +# --json-test-results-no-patch=results-off.json +# then run this script +# Rscript statistics-for-json.R results-on.json results-off.json ~/SVG +# to produce graphs (and get stdio output of statistical tests). + + +suppressMessages(library("rjson")) # for fromJson +suppressMessages(library("R.utils")) # for printf +suppressMessages(library("ggplot2")) # for plotting +suppressMessages(library("data.table")) # less broken than data.frame + +# Clear all variables from environment +rm(list=ls()) + +args <- commandArgs(TRUE) +if (length(args) != 3) { + printf(paste("usage: Rscript %%this_script patched-results.json", + "unpatched-results.json\n")) +} else { + patch <- fromJSON(file=args[1]) + nopatch <- fromJSON(file=args[2]) + outputPath <- args[3] + df <- data.table(L = numeric(), R = numeric(), E = numeric(), + p.value = numeric(), yL = character(), + p.value.sig = logical()) + + for (i in seq(1, length(patch$traces))) { + testName <- patch$traces[[i]]$graphs[[2]] + printf("%s\n", testName) + + nopatch_res <- as.integer(nopatch$traces[[i]]$results) + patch_res <- as.integer(patch$traces[[i]]$results) + if (length(nopatch_res) > 0) { + patch_norm <- shapiro.test(patch_res); + nopatch_norm <- shapiro.test(nopatch_res); + + # Shaprio-Wilk test indicates whether data is not likely to + # come from a normal distribution. The p-value is the probability + # to obtain the sample from a normal distribution. This means, the + # smaller p, the more likely the sample was not drawn from a normal + # distribution. See [wikipedia:Shapiro-Wilk-Test]. + printf(" Patched scores look %s distributed (W=%.4f, p=%.4f)\n", + ifelse(patch_norm$p.value < 0.05, "not normally", "normally"), + patch_norm$statistic, patch_norm$p.value); + printf(" Unpatched scores look %s distributed (W=%.4f, p=%.4f)\n", + ifelse(nopatch_norm$p.value < 0.05, "not normally", "normally"), + nopatch_norm$statistic, nopatch_norm$p.value); + + hist <- ggplot(data=data.frame(x=as.integer(patch_res)), aes(x)) + + theme_bw() + + geom_histogram(bins=50) + + ylab("Points") + + xlab(patch$traces[[i]]$graphs[[2]]) + ggsave(filename=sprintf("%s/%s.svg", outputPath, testName), + plot=hist, width=7, height=7) + + hist <- ggplot(data=data.frame(x=as.integer(nopatch_res)), aes(x)) + + theme_bw() + + geom_histogram(bins=50) + + ylab("Points") + + xlab(patch$traces[[i]]$graphs[[2]]) + ggsave(filename=sprintf("%s/%s-before.svg", outputPath, testName), + plot=hist, width=7, height=7) + + # The Wilcoxon rank-sum test + mww <- wilcox.test(patch_res, nopatch_res, conf.int = TRUE, exact=TRUE) + printf(paste(" Wilcoxon U-test W=%.4f, p=%.4f,", + "confidence interval [%.1f, %.1f],", + "est. effect size %.1f \n"), + mww$statistic, mww$p.value, + mww$conf.int[1], mww$conf.int[2], mww$estimate); + df <-rbind(df, list(mww$conf.int[1], mww$conf.int[2], + unname(mww$estimate), unname(mww$p.value), + testName, ifelse(mww$p.value < 0.05, TRUE, FALSE))) + # t-test + t <- t.test(patch_res, nopatch_res, paired=FALSE) + printf(paste(" Welch t-test t=%.4f, df = %.2f, p=%.4f,", + "confidence interval [%.1f, %.1f], mean diff %.1f \n"), + t$statistic, t$parameter, t$p.value, + t$conf.int[1], t$conf.int[2], t$estimate[1]-t$estimate[2]); + } + } + df2 <- cbind(x=1:nrow(df), df[order(E),]) + speedup <- ggplot(df2, aes(x = x, y = E, colour=p.value.sig)) + + geom_errorbar(aes(ymax = L, ymin = R), colour="black") + + geom_point(size = 4) + + scale_x_discrete(limits=df2$yL, + name=paste("Benchmark, n=", length(patch_res))) + + theme_bw() + + geom_hline(yintercept = 0) + + ylab("Est. Effect Size in Points") + + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=0.5)) + + theme(legend.position = "bottom") + + scale_colour_manual(name="Statistical Significance (MWW, p < 0.05)", + values=c("red", "green"), + labels=c("not significant", "significant")) + + theme(legend.justification=c(0,1), legend.position=c(0,1)) + print(speedup) + ggsave(filename=sprintf("%s/speedup-estimates.svg", outputPath), + plot=speedup, width=7, height=7) +} diff --git a/deps/v8/tools/presubmit.py b/deps/v8/tools/presubmit.py index 998656908dd674..23940bb6861cf8 100755 --- a/deps/v8/tools/presubmit.py +++ b/deps/v8/tools/presubmit.py @@ -354,30 +354,6 @@ def ProcessContents(self, name, contents): if not contents.endswith('\n') or contents.endswith('\n\n'): print "%s does not end with a single new line." % name result = False - # Check two empty lines between declarations. - if name.endswith(".cc"): - line = 0 - lines = [] - parts = contents.split('\n') - while line < len(parts) - 2: - if self.EndOfDeclaration(parts[line]): - if self.StartOfDeclaration(parts[line + 1]): - lines.append(str(line + 1)) - line += 1 - elif parts[line + 1] == "" and \ - self.StartOfDeclaration(parts[line + 2]): - lines.append(str(line + 1)) - line += 2 - line += 1 - if len(lines) >= 1: - linenumbers = ', '.join(lines) - if len(lines) > 1: - print "%s does not have two empty lines between declarations " \ - "in lines %s." % (name, linenumbers) - else: - print "%s does not have two empty lines between declarations " \ - "in line %s." % (name, linenumbers) - result = False # Sanitize flags for fuzzer. if "mjsunit" in name: match = FLAGS_LINE.search(contents) diff --git a/deps/v8/tools/release/auto_roll.py b/deps/v8/tools/release/auto_roll.py index 27fd3709716933..fc9aeee461ea34 100755 --- a/deps/v8/tools/release/auto_roll.py +++ b/deps/v8/tools/release/auto_roll.py @@ -123,7 +123,6 @@ def RunStep(self): cwd = self._options.chromium self.GitCheckout("master", cwd=cwd) self.DeleteBranch("work-branch", cwd=cwd) - self.Command("gclient", "sync --nohooks", cwd=cwd) self.GitPull(cwd=cwd) # Update v8 remotes. diff --git a/deps/v8/tools/release/common_includes.py b/deps/v8/tools/release/common_includes.py index c2b64c38ec8594..c3a216c66416c1 100644 --- a/deps/v8/tools/release/common_includes.py +++ b/deps/v8/tools/release/common_includes.py @@ -50,6 +50,7 @@ PUSH_MSG_GIT_RE = re.compile(r".* \(based on (?P[a-fA-F0-9]+)\)$") PUSH_MSG_NEW_RE = re.compile(r"^Version \d+\.\d+\.\d+$") VERSION_FILE = os.path.join("include", "v8-version.h") +WATCHLISTS_FILE = "WATCHLISTS" # V8 base directory. V8_BASE = os.path.dirname( @@ -381,7 +382,7 @@ def Tag(self, tag, remote, message): # is the case for all automated merge and push commits - also no title is # the prefix of another title). commit = None - for wait_interval in [3, 7, 15, 35, 45, 60]: + for wait_interval in [5, 10, 20, 40, 60, 60]: self.step.Git("fetch") commit = self.step.GitLog(n=1, format="%H", grep=message, branch=remote) if commit: diff --git a/deps/v8/tools/release/create_release.py b/deps/v8/tools/release/create_release.py index 3bbb50e491aa5b..7477ea1461f5eb 100755 --- a/deps/v8/tools/release/create_release.py +++ b/deps/v8/tools/release/create_release.py @@ -11,7 +11,6 @@ from common_includes import * - class Preparation(Step): MESSAGE = "Preparation." @@ -164,6 +163,7 @@ def RunStep(self): self.Git("checkout -b work-branch %s" % self["push_hash"]) self.GitCheckoutFile(CHANGELOG_FILE, self["latest_version"]) self.GitCheckoutFile(VERSION_FILE, self["latest_version"]) + self.GitCheckoutFile(WATCHLISTS_FILE, self["latest_version"]) class AddChangeLog(Step): @@ -183,6 +183,19 @@ def RunStep(self): self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_") +class EnableMergeWatchlist(Step): + MESSAGE = "Enable watchlist entry for merge notifications." + + def RunStep(self): + old_watchlist_content = FileToText(os.path.join(self.default_cwd, + WATCHLISTS_FILE)) + new_watchlist_content = re.sub("(# 'v8-merges@googlegroups\.com',)", + "'v8-merges@googlegroups.com',", + old_watchlist_content) + TextToFile(new_watchlist_content, os.path.join(self.default_cwd, + WATCHLISTS_FILE)) + + class CommitBranch(Step): MESSAGE = "Commit version and changelog to new branch." @@ -288,6 +301,7 @@ def _Steps(self): MakeBranch, AddChangeLog, SetVersion, + EnableMergeWatchlist, CommitBranch, PushBranch, TagRevision, diff --git a/deps/v8/tools/release/test_scripts.py b/deps/v8/tools/release/test_scripts.py index 4a3cb5b24a1f04..4f133ac28acba3 100644 --- a/deps/v8/tools/release/test_scripts.py +++ b/deps/v8/tools/release/test_scripts.py @@ -43,8 +43,6 @@ from merge_to_branch import * import push_to_candidates from push_to_candidates import * -import chromium_roll -from chromium_roll import ChromiumRoll import releases from releases import Releases from auto_tag import AutoTag @@ -391,6 +389,20 @@ def WriteFakeVersionFile(self, major=3, minor=22, build=4, patch=0): f.write(" // Some line...\n") f.write("#define V8_IS_CANDIDATE_VERSION 0\n") + def WriteFakeWatchlistsFile(self): + watchlists_file = os.path.join(TEST_CONFIG["DEFAULT_CWD"], WATCHLISTS_FILE) + if not os.path.exists(os.path.dirname(watchlists_file)): + os.makedirs(os.path.dirname(watchlists_file)) + with open(watchlists_file, "w") as f: + + content = """ + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + # 'v8-merges@googlegroups.com', + ], +""" + f.write(content) + def MakeStep(self): """Convenience wrapper.""" options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) @@ -954,6 +966,8 @@ def CheckVersionCommit(): Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", cb=self.WriteFakeVersionFile), + Cmd("git checkout -f 3.22.4 -- WATCHLISTS", "", + cb=self.WriteFakeWatchlistsFile), Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", cb=CheckVersionCommit), Cmd("git push origin " @@ -985,6 +999,18 @@ def CheckVersionCommit(): # Note: The version file is on build number 5 again in the end of this test # since the git command that merges to master is mocked out. + # Check for correct content of the WATCHLISTS file + + watchlists_content = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], + WATCHLISTS_FILE)) + expected_watchlists_content = """ + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + 'v8-merges@googlegroups.com', + ], +""" + self.assertEqual(watchlists_content, expected_watchlists_content) + C_V8_22624_LOG = """V8 CL. git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 @@ -1086,7 +1112,6 @@ def WriteDeps(): Cmd("git status -s -uno", "", cwd=chrome_dir), Cmd("git checkout -f master", "", cwd=chrome_dir), Cmd("git branch", "", cwd=chrome_dir), - Cmd("gclient sync --nohooks", "syncing...", cwd=chrome_dir), Cmd("git pull", "", cwd=chrome_dir), Cmd("git fetch origin", ""), Cmd("git new-branch work-branch", "", cwd=chrome_dir), diff --git a/deps/v8/tools/run-deopt-fuzzer.gyp b/deps/v8/tools/run-deopt-fuzzer.gyp new file mode 100644 index 00000000000000..73f0aaf7a521cd --- /dev/null +++ b/deps/v8/tools/run-deopt-fuzzer.gyp @@ -0,0 +1,26 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'conditions': [ + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'run_deopt_fuzzer_run', + 'type': 'none', + 'dependencies': [ + '../src/d8.gyp:d8_run', + ], + 'includes': [ + '../build/features.gypi', + '../build/isolate.gypi', + ], + 'sources': [ + 'run-deopt-fuzzer.isolate', + ], + }, + ], + }], + ], +} diff --git a/deps/v8/tools/run-deopt-fuzzer.isolate b/deps/v8/tools/run-deopt-fuzzer.isolate new file mode 100644 index 00000000000000..196fb5dbbc2f4f --- /dev/null +++ b/deps/v8/tools/run-deopt-fuzzer.isolate @@ -0,0 +1,19 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'variables': { + 'command': [ + 'run-deopt-fuzzer.py', + ], + 'files': [ + 'run-deopt-fuzzer.py', + ], + }, + 'includes': [ + 'testrunner/testrunner.isolate', + '../src/d8.isolate', + '../test/mjsunit/mjsunit.isolate', + '../test/webkit/webkit.isolate', + ], +} diff --git a/deps/v8/tools/run-deopt-fuzzer.py b/deps/v8/tools/run-deopt-fuzzer.py index 70e106ec1bf547..e4d8f16b4ffd79 100755 --- a/deps/v8/tools/run-deopt-fuzzer.py +++ b/deps/v8/tools/run-deopt-fuzzer.py @@ -48,6 +48,9 @@ from testrunner.objects import context +# Base dir of the v8 checkout to be used as cwd. +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + ARCH_GUESS = utils.DefaultArch() DEFAULT_TESTS = ["mjsunit", "webkit"] TIMEOUT_DEFAULT = 60 @@ -290,6 +293,9 @@ def ShardTests(tests, shard_count, shard_run): def Main(): + # Use the v8 root as cwd as some test cases use "load" with relative paths. + os.chdir(BASE_DIR) + parser = BuildOptions() (options, args) = parser.parse_args() if not ProcessOptions(options): @@ -297,9 +303,8 @@ def Main(): return 1 exit_code = 0 - workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), "..")) - suite_paths = utils.GetSuitePaths(join(workspace, "test")) + suite_paths = utils.GetSuitePaths(join(BASE_DIR, "test")) if len(args) == 0: suite_paths = [ s for s in suite_paths if s in DEFAULT_TESTS ] @@ -314,7 +319,7 @@ def Main(): suites = [] for root in suite_paths: suite = testsuite.TestSuite.LoadTestSuite( - os.path.join(workspace, "test", root)) + os.path.join(BASE_DIR, "test", root)) if suite: suite.SetupWorkingDirectory() suites.append(suite) @@ -326,7 +331,7 @@ def Main(): for mode in options.mode: for arch in options.arch: try: - code = Execute(arch, mode, args, options, suites, workspace) + code = Execute(arch, mode, args, options, suites, BASE_DIR) exit_code = exit_code or code except KeyboardInterrupt: return 2 diff --git a/deps/v8/tools/run-tests.py b/deps/v8/tools/run-tests.py index fe8091efb36ed1..c94457fe6d2964 100755 --- a/deps/v8/tools/run-tests.py +++ b/deps/v8/tools/run-tests.py @@ -60,27 +60,33 @@ # expected runtimes (suites with slow test cases first). These groups are # invoked in seperate steps on the bots. TEST_MAP = { + # This needs to stay in sync with test/bot_default.isolate. "bot_default": [ "mjsunit", "cctest", "webkit", + "fuzzer", "message", "preparser", "intl", "unittests", ], + # This needs to stay in sync with test/default.isolate. "default": [ "mjsunit", "cctest", + "fuzzer", "message", "preparser", "intl", "unittests", ], + # This needs to stay in sync with test/ignition.isolate. "ignition": [ "mjsunit", "cctest", ], + # This needs to stay in sync with test/optimize_for_size.isolate. "optimize_for_size": [ "mjsunit", "cctest", diff --git a/deps/v8/tools/run-valgrind.gyp b/deps/v8/tools/run-valgrind.gyp new file mode 100644 index 00000000000000..d06be933a9d3ab --- /dev/null +++ b/deps/v8/tools/run-valgrind.gyp @@ -0,0 +1,26 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'conditions': [ + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'run_valgrind_run', + 'type': 'none', + 'dependencies': [ + '../src/d8.gyp:d8_run', + ], + 'includes': [ + '../build/features.gypi', + '../build/isolate.gypi', + ], + 'sources': [ + 'run-valgrind.isolate', + ], + }, + ], + }], + ], +} diff --git a/deps/v8/tools/run-valgrind.isolate b/deps/v8/tools/run-valgrind.isolate new file mode 100644 index 00000000000000..5947409e17541d --- /dev/null +++ b/deps/v8/tools/run-valgrind.isolate @@ -0,0 +1,29 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'variables': { + 'command': [ + 'run-valgrind.py', + ], + 'files': [ + 'run-valgrind.py', + ], + }, + 'conditions': [ + ['has_valgrind==1', { + 'variables': { + 'files': [ + # This assumes vagrind binaries have been fetched as a custom deps + # into v8/third_party/valgrind. It is not clear on which target + # machine this will run, but grabbing both is cheap. + '../third_party/valgrind/linux_x86/', + '../third_party/valgrind/linux_x64/', + ], + }, + }], + ], + 'includes': [ + '../src/d8.isolate', + ], +} diff --git a/deps/v8/tools/run_perf.py b/deps/v8/tools/run_perf.py index a8cc3fab715820..db4245f499fc07 100755 --- a/deps/v8/tools/run_perf.py +++ b/deps/v8/tools/run_perf.py @@ -350,9 +350,9 @@ def AppendChild(self, child): class DefaultSentinel(Node): """Fake parent node with all default values.""" - def __init__(self): + def __init__(self, binary = "d8"): super(DefaultSentinel, self).__init__() - self.binary = "d8" + self.binary = binary self.run_count = 10 self.timeout = 60 self.path = [] @@ -543,11 +543,10 @@ def MakeGraphConfig(suite, arch, parent): raise Exception("Invalid suite configuration.") -def BuildGraphConfigs(suite, arch, parent=None): +def BuildGraphConfigs(suite, arch, parent): """Builds a tree structure of graph objects that corresponds to the suite configuration. """ - parent = parent or DefaultSentinel() # TODO(machenbach): Implement notion of cpu type? if arch not in suite.get("archs", SUPPORTED_ARCHS): @@ -732,6 +731,12 @@ def _PushExecutable(self, shell_dir, target_dir, binary): target_dir, skip_if_missing=True, ) + self._PushFile( + shell_dir, + "snapshot_blob_ignition.bin", + target_dir, + skip_if_missing=True, + ) def PreTests(self, node, path): suite_dir = os.path.abspath(os.path.dirname(path)) @@ -813,6 +818,11 @@ def Main(args): default="out") parser.add_option("--outdir-no-patch", help="Base directory with compile output without patch") + parser.add_option("--binary-override-path", + help="JavaScript engine binary. By default, d8 under " + "architecture-specific build dir. " + "Not supported in conjunction with outdir-no-patch.") + (options, args) = parser.parse_args(args) if len(args) == 0: # pragma: no cover @@ -843,7 +853,18 @@ def Main(args): else: build_config = "%s.release" % options.arch - options.shell_dir = os.path.join(workspace, options.outdir, build_config) + if options.binary_override_path == None: + options.shell_dir = os.path.join(workspace, options.outdir, build_config) + default_binary_name = "d8" + else: + if not os.path.isfile(options.binary_override_path): + print "binary-override-path must be a file name" + return 1 + if options.outdir_no_patch: + print "specify either binary-override-path or outdir-no-patch" + return 1 + options.shell_dir = os.path.dirname(options.binary_override_path) + default_binary_name = os.path.basename(options.binary_override_path) if options.outdir_no_patch: options.shell_dir_no_patch = os.path.join( @@ -872,7 +893,8 @@ def Main(args): platform.PreExecution() # Build the graph/trace tree structure. - root = BuildGraphConfigs(suite, options.arch) + default_parent = DefaultSentinel(default_binary_name) + root = BuildGraphConfigs(suite, options.arch, default_parent) # Callback to be called on each node on traversal. def NodeCB(node): diff --git a/deps/v8/tools/testrunner/local/execution.py b/deps/v8/tools/testrunner/local/execution.py index c9fe54175a3ddd..0d90ab8d0de17a 100644 --- a/deps/v8/tools/testrunner/local/execution.py +++ b/deps/v8/tools/testrunner/local/execution.py @@ -28,6 +28,7 @@ import collections import os +import re import shutil import sys import time @@ -38,6 +39,7 @@ from . import statusfile from . import testsuite from . import utils +from ..objects import output # Base dir of the v8 checkout. @@ -82,7 +84,7 @@ def MakeProcessContext(context): def GetCommand(test, context): d8testflag = [] - shell = test.suite.shell() + shell = test.shell() if shell == "d8": d8testflag = ["--test"] if utils.IsWindows(): @@ -134,15 +136,28 @@ def Run(self, process_context): raise NotImplementedError() +def SetupProblem(exception, test): + stderr = ">>> EXCEPTION: %s\n" % exception + match = re.match(r"^.*No such file or directory: '(.*)'$", str(exception)) + if match: + # Extra debuging information when files are claimed missing. + f = match.group(1) + stderr += ">>> File %s exists? -> %s\n" % (f, os.path.exists(f)) + return test.id, output.Output(1, False, "", stderr), 0 + + class TestJob(Job): def __init__(self, test): self.test = test def Run(self, process_context): - # Retrieve a new suite object on the worker-process side. The original - # suite object isn't pickled. - self.test.SetSuiteObject(process_context.suites) - instr = _GetInstructions(self.test, process_context.context) + try: + # Retrieve a new suite object on the worker-process side. The original + # suite object isn't pickled. + self.test.SetSuiteObject(process_context.suites) + instr = _GetInstructions(self.test, process_context.context) + except Exception, e: + return SetupProblem(e, self.test) start_time = time.time() if instr.dep_command is not None: diff --git a/deps/v8/tools/testrunner/local/pool.py b/deps/v8/tools/testrunner/local/pool.py index 6d123fd4e5e7fb..99996ee3ce49cc 100644 --- a/deps/v8/tools/testrunner/local/pool.py +++ b/deps/v8/tools/testrunner/local/pool.py @@ -109,6 +109,7 @@ def imap_unordered(self, fn, gen, process boundary. """ try: + internal_error = False gen = iter(gen) self.advance = self._advance_more @@ -134,7 +135,9 @@ def imap_unordered(self, fn, gen, yield MaybeResult.create_heartbeat() self.count -= 1 if result.exception: - # Ignore items with unexpected exceptions. + # TODO(machenbach): Handle a few known types of internal errors + # gracefully, e.g. missing test files. + internal_error = True continue elif result.break_now: # A keyboard interrupt happened in one of the worker processes. @@ -144,6 +147,8 @@ def imap_unordered(self, fn, gen, self.advance(gen) finally: self.terminate() + if internal_error: + raise Exception("Internal error in a worker process.") def _advance_more(self, gen): while self.count < self.num_workers * self.BUFFER_FACTOR: diff --git a/deps/v8/tools/testrunner/local/testsuite.py b/deps/v8/tools/testrunner/local/testsuite.py index e3d1e232e80eb9..55e0eb21ae02ff 100644 --- a/deps/v8/tools/testrunner/local/testsuite.py +++ b/deps/v8/tools/testrunner/local/testsuite.py @@ -41,8 +41,7 @@ "turbofan": [["--turbo"]], "turbofan_opt": [["--turbo", "--always-opt"]], "nocrankshaft": [["--nocrankshaft"]], - "ignition": [["--ignition", "--turbo", "--ignition-fake-try-catch", - "--ignition-fallback-on-eval-and-catch"]], + "ignition": [["--ignition", "--turbo"]], "preparser": [["--min-preparse-length=0"]], } @@ -52,8 +51,7 @@ "stress": [["--stress-opt"]], "turbofan": [["--turbo"]], "nocrankshaft": [["--nocrankshaft"]], - "ignition": [["--ignition", "--turbo", "--ignition-fake-try-catch", - "--ignition-fallback-on-eval-and-catch"]], + "ignition": [["--ignition", "--turbo"]], "preparser": [["--min-preparse-length=0"]], } diff --git a/deps/v8/tools/testrunner/objects/testcase.py b/deps/v8/tools/testrunner/objects/testcase.py index fa2265c0703f1f..b91f8b4b562de5 100644 --- a/deps/v8/tools/testrunner/objects/testcase.py +++ b/deps/v8/tools/testrunner/objects/testcase.py @@ -30,12 +30,13 @@ class TestCase(object): def __init__(self, suite, path, variant='default', flags=None, - dependency=None): + dependency=None, override_shell=None): self.suite = suite # TestSuite object self.path = path # string, e.g. 'div-mod', 'test-api/foo' self.flags = flags or [] # list of strings, flags specific to this test self.variant = variant # name of the used testing variant self.dependency = dependency # |path| for testcase that must be run first + self.override_shell = override_shell self.outcomes = set([]) self.output = None self.id = None # int, used to map result back to TestCase instance @@ -44,7 +45,7 @@ def __init__(self, suite, path, variant='default', flags=None, def CopyAddingFlags(self, variant, flags): copy = TestCase(self.suite, self.path, variant, self.flags + flags, - self.dependency) + self.dependency, self.override_shell) copy.outcomes = self.outcomes return copy @@ -55,15 +56,16 @@ def PackTask(self): """ assert self.id is not None return [self.suitename(), self.path, self.variant, self.flags, - self.dependency, list(self.outcomes or []), self.id] + self.dependency, self.override_shell, list(self.outcomes or []), + self.id] @staticmethod def UnpackTask(task): """Creates a new TestCase object based on packed task data.""" # For the order of the fields, refer to PackTask() above. - test = TestCase(str(task[0]), task[1], task[2], task[3], task[4]) - test.outcomes = set(task[5]) - test.id = task[6] + test = TestCase(str(task[0]), task[1], task[2], task[3], task[4], task[5]) + test.outcomes = set(task[6]) + test.id = task[7] test.run = 1 return test @@ -87,6 +89,11 @@ def suitename(self): def GetLabel(self): return self.suitename() + "/" + self.suite.CommonTestName(self) + def shell(self): + if self.override_shell: + return self.override_shell + return self.suite.shell() + def __getstate__(self): """Representation to pickle test cases. diff --git a/deps/v8/tools/tickprocessor.js b/deps/v8/tools/tickprocessor.js index 600d2eeb7b79dc..e62720bd8a0fe3 100644 --- a/deps/v8/tools/tickprocessor.js +++ b/deps/v8/tools/tickprocessor.js @@ -757,8 +757,11 @@ inherits(MacCppEntriesProvider, UnixCppEntriesProvider); MacCppEntriesProvider.prototype.loadSymbols = function(libName) { this.parsePos = 0; libName = this.targetRootFS + libName; + + // It seems that in OS X `nm` thinks that `-f` is a format option, not a + // "flat" display option flag. try { - this.symbols = [os.system(this.nmExec, ['-n', '-f', libName], -1, -1), '']; + this.symbols = [os.system(this.nmExec, ['-n', libName], -1, -1), '']; } catch (e) { // If the library cannot be found on this system let's not panic. this.symbols = ''; diff --git a/deps/v8/tools/try_perf.py b/deps/v8/tools/try_perf.py index 2403f7d782ddf6..fbd4036dadb49c 100755 --- a/deps/v8/tools/try_perf.py +++ b/deps/v8/tools/try_perf.py @@ -53,6 +53,10 @@ def main(): parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.') parser.add_argument('--extra-flags', default='', help='Extra flags to be passed to the executable.') + parser.add_argument('-r', '--revision', type=str, default=None, + help='Revision (use full hash!) to use for the try job; ' + 'default: the revision will be determined by the ' + 'try server; see its waterfall for more info') for option in sorted(BOTS): parser.add_argument( option, dest='bots', action='append_const', const=BOTS[option], @@ -85,6 +89,7 @@ def main(): cmd = ['git cl try -m internal.client.v8'] cmd += ['-b %s' % bot for bot in options.bots] + if options.revision: cmd += ['-r %s' % options.revision] benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] if options.extra_flags: diff --git a/deps/v8/tools/v8heapconst.py b/deps/v8/tools/v8heapconst.py index 0461bcbb66fde1..39cfeb1707322b 100644 --- a/deps/v8/tools/v8heapconst.py +++ b/deps/v8/tools/v8heapconst.py @@ -55,8 +55,8 @@ 132: "MAP_TYPE", 133: "CODE_TYPE", 131: "ODDBALL_TYPE", - 173: "CELL_TYPE", - 176: "PROPERTY_CELL_TYPE", + 171: "CELL_TYPE", + 174: "PROPERTY_CELL_TYPE", 129: "HEAP_NUMBER_TYPE", 134: "MUTABLE_HEAP_NUMBER_TYPE", 135: "FOREIGN_TYPE", @@ -73,59 +73,57 @@ 146: "FIXED_FLOAT64_ARRAY_TYPE", 147: "FIXED_UINT8_CLAMPED_ARRAY_TYPE", 149: "FILLER_TYPE", - 150: "DECLARED_ACCESSOR_DESCRIPTOR_TYPE", - 151: "DECLARED_ACCESSOR_INFO_TYPE", - 152: "EXECUTABLE_ACCESSOR_INFO_TYPE", - 153: "ACCESSOR_PAIR_TYPE", - 154: "ACCESS_CHECK_INFO_TYPE", - 155: "INTERCEPTOR_INFO_TYPE", - 156: "CALL_HANDLER_INFO_TYPE", - 157: "FUNCTION_TEMPLATE_INFO_TYPE", - 158: "OBJECT_TEMPLATE_INFO_TYPE", - 159: "SIGNATURE_INFO_TYPE", - 160: "TYPE_SWITCH_INFO_TYPE", - 162: "ALLOCATION_MEMENTO_TYPE", - 161: "ALLOCATION_SITE_TYPE", - 163: "SCRIPT_TYPE", - 164: "CODE_CACHE_TYPE", - 165: "POLYMORPHIC_CODE_CACHE_TYPE", - 166: "TYPE_FEEDBACK_INFO_TYPE", - 167: "ALIASED_ARGUMENTS_ENTRY_TYPE", - 168: "BOX_TYPE", - 177: "PROTOTYPE_INFO_TYPE", - 178: "SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE", - 171: "FIXED_ARRAY_TYPE", + 150: "ACCESSOR_INFO_TYPE", + 151: "ACCESSOR_PAIR_TYPE", + 152: "ACCESS_CHECK_INFO_TYPE", + 153: "INTERCEPTOR_INFO_TYPE", + 154: "CALL_HANDLER_INFO_TYPE", + 155: "FUNCTION_TEMPLATE_INFO_TYPE", + 156: "OBJECT_TEMPLATE_INFO_TYPE", + 157: "SIGNATURE_INFO_TYPE", + 158: "TYPE_SWITCH_INFO_TYPE", + 160: "ALLOCATION_MEMENTO_TYPE", + 159: "ALLOCATION_SITE_TYPE", + 161: "SCRIPT_TYPE", + 162: "CODE_CACHE_TYPE", + 163: "POLYMORPHIC_CODE_CACHE_TYPE", + 164: "TYPE_FEEDBACK_INFO_TYPE", + 165: "ALIASED_ARGUMENTS_ENTRY_TYPE", + 166: "BOX_TYPE", + 175: "PROTOTYPE_INFO_TYPE", + 176: "SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE", + 169: "FIXED_ARRAY_TYPE", 148: "FIXED_DOUBLE_ARRAY_TYPE", - 172: "SHARED_FUNCTION_INFO_TYPE", - 174: "WEAK_CELL_TYPE", - 175: "TRANSITION_ARRAY_TYPE", - 181: "JS_MESSAGE_OBJECT_TYPE", - 180: "JS_VALUE_TYPE", - 182: "JS_DATE_TYPE", - 183: "JS_OBJECT_TYPE", - 184: "JS_CONTEXT_EXTENSION_OBJECT_TYPE", - 185: "JS_GENERATOR_OBJECT_TYPE", - 186: "JS_MODULE_TYPE", - 187: "JS_GLOBAL_OBJECT_TYPE", - 188: "JS_GLOBAL_PROXY_TYPE", - 189: "JS_ARRAY_TYPE", - 190: "JS_ARRAY_BUFFER_TYPE", - 191: "JS_TYPED_ARRAY_TYPE", - 192: "JS_DATA_VIEW_TYPE", - 179: "JS_PROXY_TYPE", - 193: "JS_SET_TYPE", - 194: "JS_MAP_TYPE", - 195: "JS_SET_ITERATOR_TYPE", - 196: "JS_MAP_ITERATOR_TYPE", - 197: "JS_ITERATOR_RESULT_TYPE", - 198: "JS_WEAK_MAP_TYPE", - 199: "JS_WEAK_SET_TYPE", - 200: "JS_PROMISE_TYPE", - 201: "JS_REGEXP_TYPE", - 202: "JS_BOUND_FUNCTION_TYPE", - 203: "JS_FUNCTION_TYPE", - 169: "DEBUG_INFO_TYPE", - 170: "BREAK_POINT_INFO_TYPE", + 170: "SHARED_FUNCTION_INFO_TYPE", + 172: "WEAK_CELL_TYPE", + 173: "TRANSITION_ARRAY_TYPE", + 179: "JS_MESSAGE_OBJECT_TYPE", + 178: "JS_VALUE_TYPE", + 180: "JS_DATE_TYPE", + 181: "JS_OBJECT_TYPE", + 182: "JS_CONTEXT_EXTENSION_OBJECT_TYPE", + 183: "JS_GENERATOR_OBJECT_TYPE", + 184: "JS_MODULE_TYPE", + 185: "JS_GLOBAL_OBJECT_TYPE", + 186: "JS_GLOBAL_PROXY_TYPE", + 187: "JS_ARRAY_TYPE", + 188: "JS_ARRAY_BUFFER_TYPE", + 189: "JS_TYPED_ARRAY_TYPE", + 190: "JS_DATA_VIEW_TYPE", + 177: "JS_PROXY_TYPE", + 191: "JS_SET_TYPE", + 192: "JS_MAP_TYPE", + 193: "JS_SET_ITERATOR_TYPE", + 194: "JS_MAP_ITERATOR_TYPE", + 195: "JS_ITERATOR_RESULT_TYPE", + 196: "JS_WEAK_MAP_TYPE", + 197: "JS_WEAK_SET_TYPE", + 198: "JS_PROMISE_TYPE", + 199: "JS_REGEXP_TYPE", + 200: "JS_BOUND_FUNCTION_TYPE", + 201: "JS_FUNCTION_TYPE", + 167: "DEBUG_INFO_TYPE", + 168: "BREAK_POINT_INFO_TYPE", } # List of known V8 maps. @@ -133,7 +131,7 @@ 0x08081: (136, "ByteArrayMap"), 0x080ad: (132, "MetaMap"), 0x080d9: (131, "NullMap"), - 0x08105: (171, "FixedArrayMap"), + 0x08105: (169, "FixedArrayMap"), 0x08131: (4, "OneByteInternalizedStringMap"), 0x0815d: (138, "FreeSpaceMap"), 0x08189: (149, "OnePointerFillerMap"), @@ -143,9 +141,9 @@ 0x08239: (131, "TheHoleMap"), 0x08265: (131, "BooleanMap"), 0x08291: (131, "UninitializedMap"), - 0x082bd: (173, "CellMap"), - 0x082e9: (176, "GlobalPropertyCellMap"), - 0x08315: (172, "SharedFunctionInfoMap"), + 0x082bd: (171, "CellMap"), + 0x082e9: (174, "GlobalPropertyCellMap"), + 0x08315: (170, "SharedFunctionInfoMap"), 0x08341: (134, "MutableHeapNumberMap"), 0x0836d: (130, "Float32x4Map"), 0x08399: (130, "Int32x4Map"), @@ -157,21 +155,21 @@ 0x084a1: (130, "Int8x16Map"), 0x084cd: (130, "Uint8x16Map"), 0x084f9: (130, "Bool8x16Map"), - 0x08525: (171, "NativeContextMap"), + 0x08525: (169, "NativeContextMap"), 0x08551: (133, "CodeMap"), - 0x0857d: (171, "ScopeInfoMap"), - 0x085a9: (171, "FixedCOWArrayMap"), + 0x0857d: (169, "ScopeInfoMap"), + 0x085a9: (169, "FixedCOWArrayMap"), 0x085d5: (148, "FixedDoubleArrayMap"), - 0x08601: (174, "WeakCellMap"), - 0x0862d: (175, "TransitionArrayMap"), + 0x08601: (172, "WeakCellMap"), + 0x0862d: (173, "TransitionArrayMap"), 0x08659: (68, "OneByteStringMap"), - 0x08685: (171, "FunctionContextMap"), + 0x08685: (169, "FunctionContextMap"), 0x086b1: (131, "NoInterceptorResultSentinelMap"), 0x086dd: (131, "ArgumentsMarkerMap"), 0x08709: (131, "ExceptionMap"), 0x08735: (131, "TerminationExceptionMap"), - 0x08761: (171, "HashTableMap"), - 0x0878d: (171, "OrderedHashTableMap"), + 0x08761: (169, "HashTableMap"), + 0x0878d: (169, "OrderedHashTableMap"), 0x087b9: (128, "SymbolMap"), 0x087e5: (64, "StringMap"), 0x08811: (69, "ConsOneByteStringMap"), @@ -201,37 +199,37 @@ 0x08c31: (145, "FixedFloat32ArrayMap"), 0x08c5d: (146, "FixedFloat64ArrayMap"), 0x08c89: (147, "FixedUint8ClampedArrayMap"), - 0x08cb5: (171, "SloppyArgumentsElementsMap"), - 0x08ce1: (171, "CatchContextMap"), - 0x08d0d: (171, "WithContextMap"), - 0x08d39: (171, "BlockContextMap"), - 0x08d65: (171, "ModuleContextMap"), - 0x08d91: (171, "ScriptContextMap"), - 0x08dbd: (171, "ScriptContextTableMap"), - 0x08de9: (181, "JSMessageObjectMap"), + 0x08cb5: (169, "SloppyArgumentsElementsMap"), + 0x08ce1: (169, "CatchContextMap"), + 0x08d0d: (169, "WithContextMap"), + 0x08d39: (169, "BlockContextMap"), + 0x08d65: (169, "ModuleContextMap"), + 0x08d91: (169, "ScriptContextMap"), + 0x08dbd: (169, "ScriptContextTableMap"), + 0x08de9: (179, "JSMessageObjectMap"), 0x08e15: (135, "ForeignMap"), - 0x08e41: (183, "NeanderMap"), - 0x08e6d: (183, "ExternalMap"), - 0x08e99: (162, "AllocationMementoMap"), - 0x08ec5: (161, "AllocationSiteMap"), - 0x08ef1: (165, "PolymorphicCodeCacheMap"), - 0x08f1d: (163, "ScriptMap"), + 0x08e41: (181, "NeanderMap"), + 0x08e6d: (181, "ExternalMap"), + 0x08e99: (160, "AllocationMementoMap"), + 0x08ec5: (159, "AllocationSiteMap"), + 0x08ef1: (163, "PolymorphicCodeCacheMap"), + 0x08f1d: (161, "ScriptMap"), 0x08f75: (137, "BytecodeArrayMap"), - 0x08fa1: (168, "BoxMap"), - 0x08fcd: (152, "ExecutableAccessorInfoMap"), - 0x08ff9: (153, "AccessorPairMap"), - 0x09025: (154, "AccessCheckInfoMap"), - 0x09051: (155, "InterceptorInfoMap"), - 0x0907d: (156, "CallHandlerInfoMap"), - 0x090a9: (157, "FunctionTemplateInfoMap"), - 0x090d5: (158, "ObjectTemplateInfoMap"), - 0x09101: (164, "CodeCacheMap"), - 0x0912d: (166, "TypeFeedbackInfoMap"), - 0x09159: (167, "AliasedArgumentsEntryMap"), - 0x09185: (169, "DebugInfoMap"), - 0x091b1: (170, "BreakPointInfoMap"), - 0x091dd: (177, "PrototypeInfoMap"), - 0x09209: (178, "SloppyBlockWithEvalContextExtensionMap"), + 0x08fa1: (166, "BoxMap"), + 0x08fcd: (150, "AccessorInfoMap"), + 0x08ff9: (151, "AccessorPairMap"), + 0x09025: (152, "AccessCheckInfoMap"), + 0x09051: (153, "InterceptorInfoMap"), + 0x0907d: (154, "CallHandlerInfoMap"), + 0x090a9: (155, "FunctionTemplateInfoMap"), + 0x090d5: (156, "ObjectTemplateInfoMap"), + 0x09101: (162, "CodeCacheMap"), + 0x0912d: (164, "TypeFeedbackInfoMap"), + 0x09159: (165, "AliasedArgumentsEntryMap"), + 0x09185: (167, "DebugInfoMap"), + 0x091b1: (168, "BreakPointInfoMap"), + 0x091dd: (175, "PrototypeInfoMap"), + 0x09209: (176, "SloppyBlockWithEvalContextExtensionMap"), } # List of known V8 objects. @@ -270,28 +268,27 @@ ("OLD_SPACE", 0x0980d): "MinusInfinityValue", ("OLD_SPACE", 0x0981d): "MessageListeners", ("OLD_SPACE", 0x09839): "CodeStubs", - ("OLD_SPACE", 0x10201): "DummyVector", - ("OLD_SPACE", 0x1403d): "NonMonomorphicCache", - ("OLD_SPACE", 0x14651): "PolymorphicCodeCache", - ("OLD_SPACE", 0x14659): "NativesSourceCache", - ("OLD_SPACE", 0x148f5): "ExperimentalNativesSourceCache", - ("OLD_SPACE", 0x14929): "ExtraNativesSourceCache", - ("OLD_SPACE", 0x14949): "ExperimentalExtraNativesSourceCache", - ("OLD_SPACE", 0x14955): "EmptyScript", - ("OLD_SPACE", 0x14995): "IntrinsicFunctionNames", - ("OLD_SPACE", 0x2e73d): "UndefinedCell", - ("OLD_SPACE", 0x2e745): "ObservationState", - ("OLD_SPACE", 0x2e751): "ScriptList", - ("OLD_SPACE", 0x2e8d9): "ClearedOptimizedCodeMap", - ("OLD_SPACE", 0x2e8e5): "EmptyWeakCell", - ("OLD_SPACE", 0x54715): "EmptySlowElementDictionary", - ("OLD_SPACE", 0x54761): "WeakObjectToCodeTable", - ("OLD_SPACE", 0x54875): "ArrayProtector", - ("OLD_SPACE", 0x54885): "EmptyPropertyCell", - ("OLD_SPACE", 0x54895): "NoScriptSharedFunctionInfos", - ("OLD_SPACE", 0x5711d): "InterpreterTable", - ("OLD_SPACE", 0x57325): "EmptyBytecodeArray", - ("OLD_SPACE", 0x5a2d1): "StringTable", - ("CODE_SPACE", 0x1a2a1): "JsEntryCode", - ("CODE_SPACE", 0x1f081): "JsConstructEntryCode", + ("OLD_SPACE", 0x0feb9): "DummyVector", + ("OLD_SPACE", 0x13fed): "NonMonomorphicCache", + ("OLD_SPACE", 0x14601): "PolymorphicCodeCache", + ("OLD_SPACE", 0x14609): "NativesSourceCache", + ("OLD_SPACE", 0x1488d): "ExperimentalNativesSourceCache", + ("OLD_SPACE", 0x148c1): "ExtraNativesSourceCache", + ("OLD_SPACE", 0x148e1): "ExperimentalExtraNativesSourceCache", + ("OLD_SPACE", 0x148ed): "EmptyScript", + ("OLD_SPACE", 0x1492d): "IntrinsicFunctionNames", + ("OLD_SPACE", 0x2e919): "EmptyPropertiesDictionary", + ("OLD_SPACE", 0x2e965): "UndefinedCell", + ("OLD_SPACE", 0x2e96d): "ObservationState", + ("OLD_SPACE", 0x2e979): "ScriptList", + ("OLD_SPACE", 0x2eb01): "ClearedOptimizedCodeMap", + ("OLD_SPACE", 0x2eb0d): "EmptyWeakCell", + ("OLD_SPACE", 0x534d1): "EmptySlowElementDictionary", + ("OLD_SPACE", 0x5351d): "WeakObjectToCodeTable", + ("OLD_SPACE", 0x53631): "ArrayProtector", + ("OLD_SPACE", 0x53641): "EmptyPropertyCell", + ("OLD_SPACE", 0x53651): "NoScriptSharedFunctionInfos", + ("OLD_SPACE", 0x59cf1): "StringTable", + ("CODE_SPACE", 0x1a001): "JsEntryCode", + ("CODE_SPACE", 0x1e721): "JsConstructEntryCode", } diff --git a/deps/v8/tools/whitespace.txt b/deps/v8/tools/whitespace.txt index 687be113dd4898..d1395f5d9132ac 100644 --- a/deps/v8/tools/whitespace.txt +++ b/deps/v8/tools/whitespace.txt @@ -5,4 +5,4 @@ Try to write something funny. And please don't add trailing whitespace. A Smi balks into a war and says: "I'm so deoptimized today!" The doubles heard this and started to unbox. -The Smi looked at them when a crazy v8-autoroll account showed up..... +The Smi looked at them when a crazy v8-autoroll account showed up.. diff --git a/doc/api/_toc.markdown b/doc/api/_toc.markdown deleted file mode 100644 index 5c8fbdd7901e20..00000000000000 --- a/doc/api/_toc.markdown +++ /dev/null @@ -1,41 +0,0 @@ -@// NB(chrisdickinson): if you move this file, be sure to update tools/doc/html.js to -@// point at the new location. -* [About these Docs](documentation.html) -* [Synopsis](synopsis.html) -* [Assertion Testing](assert.html) -* [Buffer](buffer.html) -* [C/C++ Addons](addons.html) -* [Child Processes](child_process.html) -* [Cluster](cluster.html) -* [Command Line Options](cli.html) -* [Console](console.html) -* [Crypto](crypto.html) -* [Debugger](debugger.html) -* [DNS](dns.html) -* [Domain](domain.html) -* [Errors](errors.html) -* [Events](events.html) -* [File System](fs.html) -* [Globals](globals.html) -* [HTTP](http.html) -* [HTTPS](https.html) -* [Modules](modules.html) -* [Net](net.html) -* [OS](os.html) -* [Path](path.html) -* [Process](process.html) -* [Punycode](punycode.html) -* [Query Strings](querystring.html) -* [Readline](readline.html) -* [REPL](repl.html) -* [Stream](stream.html) -* [String Decoder](string_decoder.html) -* [Timers](timers.html) -* [TLS/SSL](tls.html) -* [TTY](tty.html) -* [UDP/Datagram](dgram.html) -* [URL](url.html) -* [Utilities](util.html) -* [V8](v8.html) -* [VM](vm.html) -* [ZLIB](zlib.html) diff --git a/doc/api/_toc.md b/doc/api/_toc.md new file mode 100644 index 00000000000000..2527ad84e2e360 --- /dev/null +++ b/doc/api/_toc.md @@ -0,0 +1,49 @@ +@// NB(chrisdickinson): if you move this file, be sure to update tools/doc/html.js to +@// point at the new location. +* [About these Docs](documentation.html) +* [Usage & Example](synopsis.html) + +
+ +* [Assertion Testing](assert.html) +* [Buffer](buffer.html) +* [C/C++ Addons](addons.html) +* [Child Processes](child_process.html) +* [Cluster](cluster.html) +* [Command Line Options](cli.html) +* [Console](console.html) +* [Crypto](crypto.html) +* [Debugger](debugger.html) +* [DNS](dns.html) +* [Domain](domain.html) +* [Errors](errors.html) +* [Events](events.html) +* [File System](fs.html) +* [Globals](globals.html) +* [HTTP](http.html) +* [HTTPS](https.html) +* [Modules](modules.html) +* [Net](net.html) +* [OS](os.html) +* [Path](path.html) +* [Process](process.html) +* [Punycode](punycode.html) +* [Query Strings](querystring.html) +* [Readline](readline.html) +* [REPL](repl.html) +* [Stream](stream.html) +* [String Decoder](string_decoder.html) +* [Timers](timers.html) +* [TLS/SSL](tls.html) +* [TTY](tty.html) +* [UDP/Datagram](dgram.html) +* [URL](url.html) +* [Utilities](util.html) +* [V8](v8.html) +* [VM](vm.html) +* [ZLIB](zlib.html) + +
+ +* [GitHub Repo & Issue Tracker](https://github.com/nodejs/node) +* [Mailing List](http://groups.google.com/group/nodejs) diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown deleted file mode 100644 index c330217beffa4d..00000000000000 --- a/doc/api/addons.markdown +++ /dev/null @@ -1,1091 +0,0 @@ -# Addons - -Node.js Addons are dynamically-linked shared objects, written in C or C++, that -can be loaded into Node.js using the [`require()`][require] function, and used -just as if they were an ordinary Node.js module. They are used primarily to -provide an interface between JavaScript running in Node.js and C/C++ libraries. - -At the moment, the method for implementing Addons is rather complicated, -involving knowledge of several components and APIs : - - - V8: the C++ library Node.js currently uses to provide the - JavaScript implementation. V8 provides the mechanisms for creating objects, - calling functions, etc. V8's API is documented mostly in the - `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source - tree), which is also available [online][v8-docs]. - - - [libuv][]: The C library that implements the Node.js event loop, its worker - threads and all of the asynchronous behaviors of the platform. It also - serves as a cross-platform abstraction library, giving easy, POSIX-like - access across all major operating systems to many common system tasks, such - as interacting with the filesystem, sockets, timers and system events. libuv - also provides a pthreads-like threading abstraction that may be used to - power more sophisticated asynchronous Addons that need to move beyond the - standard event loop. Addon authors are encouraged to think about how to - avoid blocking the event loop with I/O or other time-intensive tasks by - off-loading work via libuv to non-blocking system operations, worker threads - or a custom use of libuv's threads. - - - Internal Node.js libraries. Node.js itself exports a number of C/C++ APIs - that Addons can use — the most important of which is the - `node::ObjectWrap` class. - - - Node.js includes a number of other statically linked libraries including - OpenSSL. These other libraries are located in the `deps/` directory in the - Node.js source tree. Only the V8 and OpenSSL symbols are purposefully - re-exported by Node.js and may be used to various extents by Addons. - See [Linking to Node.js' own dependencies][] for additional information. - -All of the following examples are available for [download][] and may -be used as a starting-point for your own Addon. - -## Hello world - -This "Hello world" example is a simple Addon, written in C++, that is the -equivalent of the following JavaScript code: - -```js -module.exports.hello = () => 'world'; -``` - -First, create the file `hello.cc`: - -```cpp -// hello.cc -#include - -namespace demo { - -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Object; -using v8::String; -using v8::Value; - -void Method(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world")); -} - -void init(Local exports) { - NODE_SET_METHOD(exports, "hello", Method); -} - -NODE_MODULE(addon, init) - -} // namespace demo -``` - -Note that all Node.js Addons must export an initialization function following -the pattern: - -```cpp -void Initialize(Local exports); -NODE_MODULE(module_name, Initialize) -``` - -There is no semi-colon after `NODE_MODULE` as it's not a function (see -`node.h`). - -The `module_name` must match the filename of the final binary (excluding -the .node suffix). - -In the `hello.cc` example, then, the initialization function is `init` and the -Addon module name is `addon`. - -### Building - -Once the source code has been written, it must be compiled into the binary -`addon.node` file. To do so, create a file called `binding.gyp` in the -top-level of the project describing the build configuration of your module -using a JSON-like format. This file is used by [node-gyp][] -- a tool written -specifically to compile Node.js Addons. - -``` -{ - "targets": [ - { - "target_name": "addon", - "sources": [ "hello.cc" ] - } - ] -} -``` - -*Note: A version of the `node-gyp` utility is bundled and distributed with -Node.js as part of `npm`. This version is not made directly available for -developers to use and is intended only to support the ability to use the -`npm install` command to compile and install Addons. Developers who wish to -use `node-gyp` directly can install it using the command -`npm install -g node-gyp`. See the `node-gyp` [installation instructions][] for -more information, including platform-specific requirements.* - -Once the `binding.gyp` file has been created, use `node-gyp configure` to -generate the appropriate project build files for the current platform. This -will generate either a `Makefile` (on Unix platforms) or a `vcxproj` file -(on Windows) in the `build/` directory. - -Next, invoke the `node-gyp build` command to generate the compiled `addon.node` -file. This will be put into the `build/Release/` directory. - -When using `npm install` to install a Node.js Addon, npm uses its own bundled -version of `node-gyp` to perform this same set of actions, generating a -compiled version of the Addon for the user's platform on demand. - -Once built, the binary Addon can be used from within Node.js by pointing -[`require()`][require] to the built `addon.node` module: - -```js -// hello.js -const addon = require('./build/Release/addon'); - -console.log(addon.hello()); // 'world' -``` - -Please see the examples below for further information or - for an example in production. - -Because the exact path to the compiled Addon binary can vary depending on how -it is compiled (i.e. sometimes it may be in `./build/Debug/`), Addons can use -the [bindings][] package to load the compiled module. - -Note that while the `bindings` package implementation is more sophisticated -in how it locates Addon modules, it is essentially using a try-catch pattern -similar to: - -```js -try { - return require('./build/Release/addon.node'); -} catch (err) { - return require('./build/Debug/addon.node'); -} -``` - -### Linking to Node.js' own dependencies - -Node.js uses a number of statically linked libraries such as V8, libuv and -OpenSSL. All Addons are required to link to V8 and may link to any of the -other dependencies as well. Typically, this is as simple as including -the appropriate `#include <...>` statements (e.g. `#include `) and -`node-gyp` will locate the appropriate headers automatically. However, there -are a few caveats to be aware of: - -* When `node-gyp` runs, it will detect the specific release version of Node.js -and download either the full source tarball or just the headers. If the full -source is downloaded, Addons will have complete access to the full set of -Node.js dependencies. However, if only the Node.js headers are downloaded, then -only the symbols exported by Node.js will be available. - -* `node-gyp` can be run using the `--nodedir` flag pointing at a local Node.js -source image. Using this option, the Addon will have access to the full set of -dependencies. - -### Loading Addons using require() - -The filename extension of the compiled Addon binary is `.node` (as opposed -to `.dll` or `.so`). The [`require()`][require] function is written to look for -files with the `.node` file extension and initialize those as dynamically-linked -libraries. - -When calling [`require()`][require], the `.node` extension can usually be -omitted and Node.js will still find and initialize the Addon. One caveat, -however, is that Node.js will first attempt to locate and load modules or -JavaScript files that happen to share the same base name. For instance, if -there is a file `addon.js` in the same directory as the binary `addon.node`, -then [`require('addon')`][require] will give precedence to the `addon.js` file -and load it instead. - -## Native Abstractions for Node.js - -Each of the examples illustrated in this document make direct use of the -Node.js and V8 APIs for implementing Addons. It is important to understand -that the V8 API can, and has, changed dramatically from one V8 release to the -next (and one major Node.js release to the next). With each change, Addons may -need to be updated and recompiled in order to continue functioning. The Node.js -release schedule is designed to minimize the frequency and impact of such -changes but there is little that Node.js can do currently to ensure stability -of the V8 APIs. - -The [Native Abstractions for Node.js][] (or `nan`) provide a set of tools that -Addon developers are recommended to use to keep compatibility between past and -future releases of V8 and Node.js. See the `nan` [examples][] for an -illustration of how it can be used. - -## Addon examples - -Following are some example Addons intended to help developers get started. The -examples make use of the V8 APIs. Refer to the online [V8 reference][v8-docs] -for help with the various V8 calls, and V8's [Embedder's Guide][] for an -explanation of several concepts used such as handles, scopes, function -templates, etc. - -Each of these examples using the following `binding.gyp` file: - -``` -{ - "targets": [ - { - "target_name": "addon", - "sources": [ "addon.cc" ] - } - ] -} -``` - -In cases where there is more than one `.cc` file, simply add the additional -filename to the `sources` array. For example: - -``` -"sources": ["addon.cc", "myexample.cc"] -``` - -Once the `binding.gyp` file is ready, the example Addons can be configured and -built using `node-gyp`: - -``` -$ node-gyp configure build -``` - - -### Function arguments - -Addons will typically expose objects and functions that can be accessed from -JavaScript running within Node.js. When functions are invoked from JavaScript, -the input arguments and return value must be mapped to and from the C/C++ -code. - -The following example illustrates how to read function arguments passed from -JavaScript and how to return a result: - -```cpp -// addon.cc -#include - -namespace demo { - -using v8::Exception; -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Number; -using v8::Object; -using v8::String; -using v8::Value; - -// This is the implementation of the "add" method -// Input arguments are passed using the -// const FunctionCallbackInfo& args struct -void Add(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - // Check the number of arguments passed. - if (args.Length() < 2) { - // Throw an Error that is passed back to JavaScript - isolate->ThrowException(Exception::TypeError( - String::NewFromUtf8(isolate, "Wrong number of arguments"))); - return; - } - - // Check the argument types - if (!args[0]->IsNumber() || !args[1]->IsNumber()) { - isolate->ThrowException(Exception::TypeError( - String::NewFromUtf8(isolate, "Wrong arguments"))); - return; - } - - // Perform the operation - double value = args[0]->NumberValue() + args[1]->NumberValue(); - Local num = Number::New(isolate, value); - - // Set the return value (using the passed in - // FunctionCallbackInfo&) - args.GetReturnValue().Set(num); -} - -void Init(Local exports) { - NODE_SET_METHOD(exports, "add", Add); -} - -NODE_MODULE(addon, Init) - -} // namespace demo -``` - -Once compiled, the example Addon can be required and used from within Node.js: - -```js -// test.js -const addon = require('./build/Release/addon'); - -console.log('This should be eight:', addon.add(3, 5)); -``` - - -### Callbacks - -It is common practice within Addons to pass JavaScript functions to a C++ -function and execute them from there. The following example illustrates how -to invoke such callbacks: - -```cpp -// addon.cc -#include - -namespace demo { - -using v8::Function; -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Null; -using v8::Object; -using v8::String; -using v8::Value; - -void RunCallback(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - Local cb = Local::Cast(args[0]); - const unsigned argc = 1; - Local argv[argc] = { String::NewFromUtf8(isolate, "hello world") }; - cb->Call(Null(isolate), argc, argv); -} - -void Init(Local exports, Local module) { - NODE_SET_METHOD(module, "exports", RunCallback); -} - -NODE_MODULE(addon, Init) - -} // namespace demo -``` - -Note that this example uses a two-argument form of `Init()` that receives -the full `module` object as the second argument. This allows the Addon -to completely overwrite `exports` with a single function instead of -adding the function as a property of `exports`. - -To test it, run the following JavaScript: - -```js -// test.js -const addon = require('./build/Release/addon'); - -addon((msg) => { - console.log(msg); // 'hello world' -}); -``` - -Note that, in this example, the callback function is invoked synchronously. - -### Object factory - -Addons can create and return new objects from within a C++ function as -illustrated in the following example. An object is created and returned with a -property `msg` that echoes the string passed to `createObject()`: - -```cpp -// addon.cc -#include - -namespace demo { - -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Object; -using v8::String; -using v8::Value; - -void CreateObject(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - Local obj = Object::New(isolate); - obj->Set(String::NewFromUtf8(isolate, "msg"), args[0]->ToString()); - - args.GetReturnValue().Set(obj); -} - -void Init(Local exports, Local module) { - NODE_SET_METHOD(module, "exports", CreateObject); -} - -NODE_MODULE(addon, Init) - -} // namespace demo -``` - -To test it in JavaScript: - -```js -// test.js -const addon = require('./build/Release/addon'); - -var obj1 = addon('hello'); -var obj2 = addon('world'); -console.log(obj1.msg + ' ' + obj2.msg); // 'hello world' -``` - - -### Function factory - -Another common scenario is creating JavaScript functions that wrap C++ -functions and returning those back to JavaScript: - -```cpp -// addon.cc -#include - -namespace demo { - -using v8::Function; -using v8::FunctionCallbackInfo; -using v8::FunctionTemplate; -using v8::Isolate; -using v8::Local; -using v8::Object; -using v8::String; -using v8::Value; - -void MyFunction(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, "hello world")); -} - -void CreateFunction(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - Local tpl = FunctionTemplate::New(isolate, MyFunction); - Local fn = tpl->GetFunction(); - - // omit this to make it anonymous - fn->SetName(String::NewFromUtf8(isolate, "theFunction")); - - args.GetReturnValue().Set(fn); -} - -void Init(Local exports, Local module) { - NODE_SET_METHOD(module, "exports", CreateFunction); -} - -NODE_MODULE(addon, Init) - -} // namespace demo -``` - -To test: - -```js -// test.js -const addon = require('./build/Release/addon'); - -var fn = addon(); -console.log(fn()); // 'hello world' -``` - - -### Wrapping C++ objects - -It is also possible to wrap C++ objects/classes in a way that allows new -instances to be created using the JavaScript `new` operator: - -```cpp -// addon.cc -#include -#include "myobject.h" - -namespace demo { - -using v8::Local; -using v8::Object; - -void InitAll(Local exports) { - MyObject::Init(exports); -} - -NODE_MODULE(addon, InitAll) - -} // namespace demo -``` - -Then, in `myobject.h`, the wrapper class inherits from `node::ObjectWrap`: - -```cpp -// myobject.h -#ifndef MYOBJECT_H -#define MYOBJECT_H - -#include -#include - -namespace demo { - -class MyObject : public node::ObjectWrap { - public: - static void Init(v8::Local exports); - - private: - explicit MyObject(double value = 0); - ~MyObject(); - - static void New(const v8::FunctionCallbackInfo& args); - static void PlusOne(const v8::FunctionCallbackInfo& args); - static v8::Persistent constructor; - double value_; -}; - -} // namespace demo - -#endif -``` - -In `myobject.cc`, implement the various methods that are to be exposed. -Below, the method `plusOne()` is exposed by adding it to the constructor's -prototype: - -```cpp -// myobject.cc -#include "myobject.h" - -namespace demo { - -using v8::Function; -using v8::FunctionCallbackInfo; -using v8::FunctionTemplate; -using v8::Isolate; -using v8::Local; -using v8::Number; -using v8::Object; -using v8::Persistent; -using v8::String; -using v8::Value; - -Persistent MyObject::constructor; - -MyObject::MyObject(double value) : value_(value) { -} - -MyObject::~MyObject() { -} - -void MyObject::Init(Local exports) { - Isolate* isolate = exports->GetIsolate(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "plusOne", PlusOne); - - constructor.Reset(isolate, tpl->GetFunction()); - exports->Set(String::NewFromUtf8(isolate, "MyObject"), - tpl->GetFunction()); -} - -void MyObject::New(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - if (args.IsConstructCall()) { - // Invoked as constructor: `new MyObject(...)` - double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); - MyObject* obj = new MyObject(value); - obj->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - // Invoked as plain function `MyObject(...)`, turn into construct call. - const int argc = 1; - Local argv[argc] = { args[0] }; - Local cons = Local::New(isolate, constructor); - args.GetReturnValue().Set(cons->NewInstance(argc, argv)); - } -} - -void MyObject::PlusOne(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - MyObject* obj = ObjectWrap::Unwrap(args.Holder()); - obj->value_ += 1; - - args.GetReturnValue().Set(Number::New(isolate, obj->value_)); -} - -} // namespace demo -``` - -To build this example, the `myobject.cc` file must be added to the -`binding.gyp`: - -``` -{ - "targets": [ - { - "target_name": "addon", - "sources": [ - "addon.cc", - "myobject.cc" - ] - } - ] -} -``` - -Test it with: - -```js -// test.js -const addon = require('./build/Release/addon'); - -var obj = new addon.MyObject(10); -console.log(obj.plusOne()); // 11 -console.log(obj.plusOne()); // 12 -console.log(obj.plusOne()); // 13 -``` - -### Factory of wrapped objects - -Alternatively, it is possible to use a factory pattern to avoid explicitly -creating object instances using the JavaScript `new` operator: - -```js -var obj = addon.createObject(); -// instead of: -// var obj = new addon.Object(); -``` - -First, the `createObject()` method is implemented in `addon.cc`: - -```cpp -// addon.cc -#include -#include "myobject.h" - -namespace demo { - -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Object; -using v8::String; -using v8::Value; - -void CreateObject(const FunctionCallbackInfo& args) { - MyObject::NewInstance(args); -} - -void InitAll(Local exports, Local module) { - MyObject::Init(exports->GetIsolate()); - - NODE_SET_METHOD(module, "exports", CreateObject); -} - -NODE_MODULE(addon, InitAll) - -} // namespace demo -``` - -In `myobject.h`, the static method `NewInstance()` is added to handle -instantiating the object. This method takes the place of using `new` in -JavaScript: - -```cpp -// myobject.h -#ifndef MYOBJECT_H -#define MYOBJECT_H - -#include -#include - -namespace demo { - -class MyObject : public node::ObjectWrap { - public: - static void Init(v8::Isolate* isolate); - static void NewInstance(const v8::FunctionCallbackInfo& args); - - private: - explicit MyObject(double value = 0); - ~MyObject(); - - static void New(const v8::FunctionCallbackInfo& args); - static void PlusOne(const v8::FunctionCallbackInfo& args); - static v8::Persistent constructor; - double value_; -}; - -} // namespace demo - -#endif -``` - -The implementation in `myobject.cc` is similar to the previous example: - -```cpp -// myobject.cc -#include -#include "myobject.h" - -namespace demo { - -using v8::Function; -using v8::FunctionCallbackInfo; -using v8::FunctionTemplate; -using v8::Isolate; -using v8::Local; -using v8::Number; -using v8::Object; -using v8::Persistent; -using v8::String; -using v8::Value; - -Persistent MyObject::constructor; - -MyObject::MyObject(double value) : value_(value) { -} - -MyObject::~MyObject() { -} - -void MyObject::Init(Isolate* isolate) { - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "plusOne", PlusOne); - - constructor.Reset(isolate, tpl->GetFunction()); -} - -void MyObject::New(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - if (args.IsConstructCall()) { - // Invoked as constructor: `new MyObject(...)` - double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); - MyObject* obj = new MyObject(value); - obj->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - // Invoked as plain function `MyObject(...)`, turn into construct call. - const int argc = 1; - Local argv[argc] = { args[0] }; - Local cons = Local::New(isolate, constructor); - args.GetReturnValue().Set(cons->NewInstance(argc, argv)); - } -} - -void MyObject::NewInstance(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - const unsigned argc = 1; - Local argv[argc] = { args[0] }; - Local cons = Local::New(isolate, constructor); - Local instance = cons->NewInstance(argc, argv); - - args.GetReturnValue().Set(instance); -} - -void MyObject::PlusOne(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - MyObject* obj = ObjectWrap::Unwrap(args.Holder()); - obj->value_ += 1; - - args.GetReturnValue().Set(Number::New(isolate, obj->value_)); -} - -} // namespace demo -``` - -Once again, to build this example, the `myobject.cc` file must be added to the -`binding.gyp`: - -``` -{ - "targets": [ - { - "target_name": "addon", - "sources": [ - "addon.cc", - "myobject.cc" - ] - } - ] -} -``` - -Test it with: - -```js -// test.js -const createObject = require('./build/Release/addon'); - -var obj = createObject(10); -console.log(obj.plusOne()); // 11 -console.log(obj.plusOne()); // 12 -console.log(obj.plusOne()); // 13 - -var obj2 = createObject(20); -console.log(obj2.plusOne()); // 21 -console.log(obj2.plusOne()); // 22 -console.log(obj2.plusOne()); // 23 -``` - - -### Passing wrapped objects around - -In addition to wrapping and returning C++ objects, it is possible to pass -wrapped objects around by unwrapping them with the Node.js helper function -`node::ObjectWrap::Unwrap`. The following examples shows a function `add()` -that can take two `MyObject` objects as input arguments: - -```cpp -// addon.cc -#include -#include -#include "myobject.h" - -namespace demo { - -using v8::FunctionCallbackInfo; -using v8::Isolate; -using v8::Local; -using v8::Number; -using v8::Object; -using v8::String; -using v8::Value; - -void CreateObject(const FunctionCallbackInfo& args) { - MyObject::NewInstance(args); -} - -void Add(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - MyObject* obj1 = node::ObjectWrap::Unwrap( - args[0]->ToObject()); - MyObject* obj2 = node::ObjectWrap::Unwrap( - args[1]->ToObject()); - - double sum = obj1->value() + obj2->value(); - args.GetReturnValue().Set(Number::New(isolate, sum)); -} - -void InitAll(Local exports) { - MyObject::Init(exports->GetIsolate()); - - NODE_SET_METHOD(exports, "createObject", CreateObject); - NODE_SET_METHOD(exports, "add", Add); -} - -NODE_MODULE(addon, InitAll) - -} // namespace demo -``` - -In `myobject.h`, a new public method is added to allow access to private values -after unwrapping the object. - -```cpp -// myobject.h -#ifndef MYOBJECT_H -#define MYOBJECT_H - -#include -#include - -namespace demo { - -class MyObject : public node::ObjectWrap { - public: - static void Init(v8::Isolate* isolate); - static void NewInstance(const v8::FunctionCallbackInfo& args); - inline double value() const { return value_; } - - private: - explicit MyObject(double value = 0); - ~MyObject(); - - static void New(const v8::FunctionCallbackInfo& args); - static v8::Persistent constructor; - double value_; -}; - -} // namespace demo - -#endif -``` - -The implementation of `myobject.cc` is similar to before: - -```cpp -// myobject.cc -#include -#include "myobject.h" - -namespace demo { - -using v8::Function; -using v8::FunctionCallbackInfo; -using v8::FunctionTemplate; -using v8::Isolate; -using v8::Local; -using v8::Object; -using v8::Persistent; -using v8::String; -using v8::Value; - -Persistent MyObject::constructor; - -MyObject::MyObject(double value) : value_(value) { -} - -MyObject::~MyObject() { -} - -void MyObject::Init(Isolate* isolate) { - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - - constructor.Reset(isolate, tpl->GetFunction()); -} - -void MyObject::New(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - if (args.IsConstructCall()) { - // Invoked as constructor: `new MyObject(...)` - double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); - MyObject* obj = new MyObject(value); - obj->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - // Invoked as plain function `MyObject(...)`, turn into construct call. - const int argc = 1; - Local argv[argc] = { args[0] }; - Local cons = Local::New(isolate, constructor); - args.GetReturnValue().Set(cons->NewInstance(argc, argv)); - } -} - -void MyObject::NewInstance(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - const unsigned argc = 1; - Local argv[argc] = { args[0] }; - Local cons = Local::New(isolate, constructor); - Local instance = cons->NewInstance(argc, argv); - - args.GetReturnValue().Set(instance); -} - -} // namespace demo -``` - -Test it with: - -```js -// test.js -const addon = require('./build/Release/addon'); - -var obj1 = addon.createObject(10); -var obj2 = addon.createObject(20); -var result = addon.add(obj1, obj2); - -console.log(result); // 30 -``` - -### AtExit hooks - -An "AtExit" hook is a function that is invoked after the Node.js event loop -has ended by before the JavaScript VM is terminated and Node.js shuts down. -"AtExit" hooks are registered using the `node::AtExit` API. - -#### void AtExit(callback, args) - -* `callback`: `void (*)(void*)` - A pointer to the function to call at exit. -* `args`: `void*` - A pointer to pass to the callback at exit. - -Registers exit hooks that run after the event loop has ended but before the VM -is killed. - -AtExit takes two parameters: a pointer to a callback function to run at exit, -and a pointer to untyped context data to be passed to that callback. - -Callbacks are run in last-in first-out order. - -The following `addon.cc` implements AtExit: - -```cpp -// addon.cc -#undef NDEBUG -#include -#include -#include - -namespace demo { - -using node::AtExit; -using v8::HandleScope; -using v8::Isolate; -using v8::Local; -using v8::Object; - -static char cookie[] = "yum yum"; -static int at_exit_cb1_called = 0; -static int at_exit_cb2_called = 0; - -static void at_exit_cb1(void* arg) { - Isolate* isolate = static_cast(arg); - HandleScope scope(isolate); - Local obj = Object::New(isolate); - assert(!obj.IsEmpty()); // assert VM is still alive - assert(obj->IsObject()); - at_exit_cb1_called++; -} - -static void at_exit_cb2(void* arg) { - assert(arg == static_cast(cookie)); - at_exit_cb2_called++; -} - -static void sanity_check(void*) { - assert(at_exit_cb1_called == 1); - assert(at_exit_cb2_called == 2); -} - -void init(Local exports) { - AtExit(sanity_check); - AtExit(at_exit_cb2, cookie); - AtExit(at_exit_cb2, cookie); - AtExit(at_exit_cb1, exports->GetIsolate()); -} - -NODE_MODULE(addon, init); - -} // namespace demo -``` - -Test in JavaScript by running: - -```js -// test.js -const addon = require('./build/Release/addon'); -``` - -[bindings]: https://github.com/TooTallNate/node-bindings -[download]: https://github.com/nodejs/node-addon-examples -[Embedder's Guide]: https://developers.google.com/v8/embed -[examples]: https://github.com/nodejs/nan/tree/master/examples/ -[installation instructions]: https://github.com/nodejs/node-gyp#installation -[libuv]: https://github.com/libuv/libuv -[Linking to Node.js' own dependencies]: #linking-to-nodejs-own-dependencies -[Native Abstractions for Node.js]: https://github.com/nodejs/nan -[node-gyp]: https://github.com/nodejs/node-gyp -[require]: globals.html#globals_require -[v8-docs]: https://v8docs.nodesource.com/ diff --git a/doc/api/addons.md b/doc/api/addons.md new file mode 100644 index 00000000000000..3dacf88064b858 --- /dev/null +++ b/doc/api/addons.md @@ -0,0 +1,1107 @@ +# Addons + +Node.js Addons are dynamically-linked shared objects, written in C or C++, that +can be loaded into Node.js using the [`require()`][require] function, and used +just as if they were an ordinary Node.js module. They are used primarily to +provide an interface between JavaScript running in Node.js and C/C++ libraries. + +At the moment, the method for implementing Addons is rather complicated, +involving knowledge of several components and APIs : + + - V8: the C++ library Node.js currently uses to provide the + JavaScript implementation. V8 provides the mechanisms for creating objects, + calling functions, etc. V8's API is documented mostly in the + `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source + tree), which is also available [online][v8-docs]. + + - [libuv][]: The C library that implements the Node.js event loop, its worker + threads and all of the asynchronous behaviors of the platform. It also + serves as a cross-platform abstraction library, giving easy, POSIX-like + access across all major operating systems to many common system tasks, such + as interacting with the filesystem, sockets, timers and system events. libuv + also provides a pthreads-like threading abstraction that may be used to + power more sophisticated asynchronous Addons that need to move beyond the + standard event loop. Addon authors are encouraged to think about how to + avoid blocking the event loop with I/O or other time-intensive tasks by + off-loading work via libuv to non-blocking system operations, worker threads + or a custom use of libuv's threads. + + - Internal Node.js libraries. Node.js itself exports a number of C/C++ APIs + that Addons can use — the most important of which is the + `node::ObjectWrap` class. + + - Node.js includes a number of other statically linked libraries including + OpenSSL. These other libraries are located in the `deps/` directory in the + Node.js source tree. Only the V8 and OpenSSL symbols are purposefully + re-exported by Node.js and may be used to various extents by Addons. + See [Linking to Node.js' own dependencies][] for additional information. + +All of the following examples are available for [download][] and may +be used as a starting-point for your own Addon. + +## Hello world + +This "Hello world" example is a simple Addon, written in C++, that is the +equivalent of the following JavaScript code: + +```js +module.exports.hello = () => 'world'; +``` + +First, create the file `hello.cc`: + +```cpp +// hello.cc +#include + +namespace demo { + +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + +void Method(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world")); +} + +void init(Local exports) { + NODE_SET_METHOD(exports, "hello", Method); +} + +NODE_MODULE(addon, init) + +} // namespace demo +``` + +Note that all Node.js Addons must export an initialization function following +the pattern: + +```cpp +void Initialize(Local exports); +NODE_MODULE(module_name, Initialize) +``` + +There is no semi-colon after `NODE_MODULE` as it's not a function (see +`node.h`). + +The `module_name` must match the filename of the final binary (excluding +the .node suffix). + +In the `hello.cc` example, then, the initialization function is `init` and the +Addon module name is `addon`. + +### Building + +Once the source code has been written, it must be compiled into the binary +`addon.node` file. To do so, create a file called `binding.gyp` in the +top-level of the project describing the build configuration of your module +using a JSON-like format. This file is used by [node-gyp][] -- a tool written +specifically to compile Node.js Addons. + +``` +{ + "targets": [ + { + "target_name": "addon", + "sources": [ "hello.cc" ] + } + ] +} +``` + +*Note: A version of the `node-gyp` utility is bundled and distributed with +Node.js as part of `npm`. This version is not made directly available for +developers to use and is intended only to support the ability to use the +`npm install` command to compile and install Addons. Developers who wish to +use `node-gyp` directly can install it using the command +`npm install -g node-gyp`. See the `node-gyp` [installation instructions][] for +more information, including platform-specific requirements.* + +Once the `binding.gyp` file has been created, use `node-gyp configure` to +generate the appropriate project build files for the current platform. This +will generate either a `Makefile` (on Unix platforms) or a `vcxproj` file +(on Windows) in the `build/` directory. + +Next, invoke the `node-gyp build` command to generate the compiled `addon.node` +file. This will be put into the `build/Release/` directory. + +When using `npm install` to install a Node.js Addon, npm uses its own bundled +version of `node-gyp` to perform this same set of actions, generating a +compiled version of the Addon for the user's platform on demand. + +Once built, the binary Addon can be used from within Node.js by pointing +[`require()`][require] to the built `addon.node` module: + +```js +// hello.js +const addon = require('./build/Release/addon'); + +console.log(addon.hello()); // 'world' +``` + +Please see the examples below for further information or + for an example in production. + +Because the exact path to the compiled Addon binary can vary depending on how +it is compiled (i.e. sometimes it may be in `./build/Debug/`), Addons can use +the [bindings][] package to load the compiled module. + +Note that while the `bindings` package implementation is more sophisticated +in how it locates Addon modules, it is essentially using a try-catch pattern +similar to: + +```js +try { + return require('./build/Release/addon.node'); +} catch (err) { + return require('./build/Debug/addon.node'); +} +``` + +### Linking to Node.js' own dependencies + +Node.js uses a number of statically linked libraries such as V8, libuv and +OpenSSL. All Addons are required to link to V8 and may link to any of the +other dependencies as well. Typically, this is as simple as including +the appropriate `#include <...>` statements (e.g. `#include `) and +`node-gyp` will locate the appropriate headers automatically. However, there +are a few caveats to be aware of: + +* When `node-gyp` runs, it will detect the specific release version of Node.js +and download either the full source tarball or just the headers. If the full +source is downloaded, Addons will have complete access to the full set of +Node.js dependencies. However, if only the Node.js headers are downloaded, then +only the symbols exported by Node.js will be available. + +* `node-gyp` can be run using the `--nodedir` flag pointing at a local Node.js +source image. Using this option, the Addon will have access to the full set of +dependencies. + +### Loading Addons using require() + +The filename extension of the compiled Addon binary is `.node` (as opposed +to `.dll` or `.so`). The [`require()`][require] function is written to look for +files with the `.node` file extension and initialize those as dynamically-linked +libraries. + +When calling [`require()`][require], the `.node` extension can usually be +omitted and Node.js will still find and initialize the Addon. One caveat, +however, is that Node.js will first attempt to locate and load modules or +JavaScript files that happen to share the same base name. For instance, if +there is a file `addon.js` in the same directory as the binary `addon.node`, +then [`require('addon')`][require] will give precedence to the `addon.js` file +and load it instead. + +## Native Abstractions for Node.js + +Each of the examples illustrated in this document make direct use of the +Node.js and V8 APIs for implementing Addons. It is important to understand +that the V8 API can, and has, changed dramatically from one V8 release to the +next (and one major Node.js release to the next). With each change, Addons may +need to be updated and recompiled in order to continue functioning. The Node.js +release schedule is designed to minimize the frequency and impact of such +changes but there is little that Node.js can do currently to ensure stability +of the V8 APIs. + +The [Native Abstractions for Node.js][] (or `nan`) provide a set of tools that +Addon developers are recommended to use to keep compatibility between past and +future releases of V8 and Node.js. See the `nan` [examples][] for an +illustration of how it can be used. + +## Addon examples + +Following are some example Addons intended to help developers get started. The +examples make use of the V8 APIs. Refer to the online [V8 reference][v8-docs] +for help with the various V8 calls, and V8's [Embedder's Guide][] for an +explanation of several concepts used such as handles, scopes, function +templates, etc. + +Each of these examples using the following `binding.gyp` file: + +``` +{ + "targets": [ + { + "target_name": "addon", + "sources": [ "addon.cc" ] + } + ] +} +``` + +In cases where there is more than one `.cc` file, simply add the additional +filename to the `sources` array. For example: + +``` +"sources": ["addon.cc", "myexample.cc"] +``` + +Once the `binding.gyp` file is ready, the example Addons can be configured and +built using `node-gyp`: + +``` +$ node-gyp configure build +``` + + +### Function arguments + +Addons will typically expose objects and functions that can be accessed from +JavaScript running within Node.js. When functions are invoked from JavaScript, +the input arguments and return value must be mapped to and from the C/C++ +code. + +The following example illustrates how to read function arguments passed from +JavaScript and how to return a result: + +```cpp +// addon.cc +#include + +namespace demo { + +using v8::Exception; +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Number; +using v8::Object; +using v8::String; +using v8::Value; + +// This is the implementation of the "add" method +// Input arguments are passed using the +// const FunctionCallbackInfo& args struct +void Add(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + // Check the number of arguments passed. + if (args.Length() < 2) { + // Throw an Error that is passed back to JavaScript + isolate->ThrowException(Exception::TypeError( + String::NewFromUtf8(isolate, "Wrong number of arguments"))); + return; + } + + // Check the argument types + if (!args[0]->IsNumber() || !args[1]->IsNumber()) { + isolate->ThrowException(Exception::TypeError( + String::NewFromUtf8(isolate, "Wrong arguments"))); + return; + } + + // Perform the operation + double value = args[0]->NumberValue() + args[1]->NumberValue(); + Local num = Number::New(isolate, value); + + // Set the return value (using the passed in + // FunctionCallbackInfo&) + args.GetReturnValue().Set(num); +} + +void Init(Local exports) { + NODE_SET_METHOD(exports, "add", Add); +} + +NODE_MODULE(addon, Init) + +} // namespace demo +``` + +Once compiled, the example Addon can be required and used from within Node.js: + +```js +// test.js +const addon = require('./build/Release/addon'); + +console.log('This should be eight:', addon.add(3, 5)); +``` + + +### Callbacks + +It is common practice within Addons to pass JavaScript functions to a C++ +function and execute them from there. The following example illustrates how +to invoke such callbacks: + +```cpp +// addon.cc +#include + +namespace demo { + +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Null; +using v8::Object; +using v8::String; +using v8::Value; + +void RunCallback(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + Local cb = Local::Cast(args[0]); + const unsigned argc = 1; + Local argv[argc] = { String::NewFromUtf8(isolate, "hello world") }; + cb->Call(Null(isolate), argc, argv); +} + +void Init(Local exports, Local module) { + NODE_SET_METHOD(module, "exports", RunCallback); +} + +NODE_MODULE(addon, Init) + +} // namespace demo +``` + +Note that this example uses a two-argument form of `Init()` that receives +the full `module` object as the second argument. This allows the Addon +to completely overwrite `exports` with a single function instead of +adding the function as a property of `exports`. + +To test it, run the following JavaScript: + +```js +// test.js +const addon = require('./build/Release/addon'); + +addon((msg) => { + console.log(msg); // 'hello world' +}); +``` + +Note that, in this example, the callback function is invoked synchronously. + +### Object factory + +Addons can create and return new objects from within a C++ function as +illustrated in the following example. An object is created and returned with a +property `msg` that echoes the string passed to `createObject()`: + +```cpp +// addon.cc +#include + +namespace demo { + +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + +void CreateObject(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + Local obj = Object::New(isolate); + obj->Set(String::NewFromUtf8(isolate, "msg"), args[0]->ToString()); + + args.GetReturnValue().Set(obj); +} + +void Init(Local exports, Local module) { + NODE_SET_METHOD(module, "exports", CreateObject); +} + +NODE_MODULE(addon, Init) + +} // namespace demo +``` + +To test it in JavaScript: + +```js +// test.js +const addon = require('./build/Release/addon'); + +var obj1 = addon('hello'); +var obj2 = addon('world'); +console.log(obj1.msg + ' ' + obj2.msg); // 'hello world' +``` + + +### Function factory + +Another common scenario is creating JavaScript functions that wrap C++ +functions and returning those back to JavaScript: + +```cpp +// addon.cc +#include + +namespace demo { + +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + +void MyFunction(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, "hello world")); +} + +void CreateFunction(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + Local tpl = FunctionTemplate::New(isolate, MyFunction); + Local fn = tpl->GetFunction(); + + // omit this to make it anonymous + fn->SetName(String::NewFromUtf8(isolate, "theFunction")); + + args.GetReturnValue().Set(fn); +} + +void Init(Local exports, Local module) { + NODE_SET_METHOD(module, "exports", CreateFunction); +} + +NODE_MODULE(addon, Init) + +} // namespace demo +``` + +To test: + +```js +// test.js +const addon = require('./build/Release/addon'); + +var fn = addon(); +console.log(fn()); // 'hello world' +``` + + +### Wrapping C++ objects + +It is also possible to wrap C++ objects/classes in a way that allows new +instances to be created using the JavaScript `new` operator: + +```cpp +// addon.cc +#include +#include "myobject.h" + +namespace demo { + +using v8::Local; +using v8::Object; + +void InitAll(Local exports) { + MyObject::Init(exports); +} + +NODE_MODULE(addon, InitAll) + +} // namespace demo +``` + +Then, in `myobject.h`, the wrapper class inherits from `node::ObjectWrap`: + +```cpp +// myobject.h +#ifndef MYOBJECT_H +#define MYOBJECT_H + +#include +#include + +namespace demo { + +class MyObject : public node::ObjectWrap { + public: + static void Init(v8::Local exports); + + private: + explicit MyObject(double value = 0); + ~MyObject(); + + static void New(const v8::FunctionCallbackInfo& args); + static void PlusOne(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + double value_; +}; + +} // namespace demo + +#endif +``` + +In `myobject.cc`, implement the various methods that are to be exposed. +Below, the method `plusOne()` is exposed by adding it to the constructor's +prototype: + +```cpp +// myobject.cc +#include "myobject.h" + +namespace demo { + +using v8::Context; +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; +using v8::Isolate; +using v8::Local; +using v8::Number; +using v8::Object; +using v8::Persistent; +using v8::String; +using v8::Value; + +Persistent MyObject::constructor; + +MyObject::MyObject(double value) : value_(value) { +} + +MyObject::~MyObject() { +} + +void MyObject::Init(Local exports) { + Isolate* isolate = exports->GetIsolate(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "plusOne", PlusOne); + + constructor.Reset(isolate, tpl->GetFunction()); + exports->Set(String::NewFromUtf8(isolate, "MyObject"), + tpl->GetFunction()); +} + +void MyObject::New(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + if (args.IsConstructCall()) { + // Invoked as constructor: `new MyObject(...)` + double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); + MyObject* obj = new MyObject(value); + obj->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + // Invoked as plain function `MyObject(...)`, turn into construct call. + const int argc = 1; + Local argv[argc] = { args[0] }; + Local context = isolate->GetCurrentContext(); + Local cons = Local::New(isolate, constructor); + Local result = + cons->NewInstance(context, argc, argv).ToLocalChecked(); + args.GetReturnValue().Set(result); + } +} + +void MyObject::PlusOne(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + MyObject* obj = ObjectWrap::Unwrap(args.Holder()); + obj->value_ += 1; + + args.GetReturnValue().Set(Number::New(isolate, obj->value_)); +} + +} // namespace demo +``` + +To build this example, the `myobject.cc` file must be added to the +`binding.gyp`: + +``` +{ + "targets": [ + { + "target_name": "addon", + "sources": [ + "addon.cc", + "myobject.cc" + ] + } + ] +} +``` + +Test it with: + +```js +// test.js +const addon = require('./build/Release/addon'); + +var obj = new addon.MyObject(10); +console.log(obj.plusOne()); // 11 +console.log(obj.plusOne()); // 12 +console.log(obj.plusOne()); // 13 +``` + +### Factory of wrapped objects + +Alternatively, it is possible to use a factory pattern to avoid explicitly +creating object instances using the JavaScript `new` operator: + +```js +var obj = addon.createObject(); +// instead of: +// var obj = new addon.Object(); +``` + +First, the `createObject()` method is implemented in `addon.cc`: + +```cpp +// addon.cc +#include +#include "myobject.h" + +namespace demo { + +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + +void CreateObject(const FunctionCallbackInfo& args) { + MyObject::NewInstance(args); +} + +void InitAll(Local exports, Local module) { + MyObject::Init(exports->GetIsolate()); + + NODE_SET_METHOD(module, "exports", CreateObject); +} + +NODE_MODULE(addon, InitAll) + +} // namespace demo +``` + +In `myobject.h`, the static method `NewInstance()` is added to handle +instantiating the object. This method takes the place of using `new` in +JavaScript: + +```cpp +// myobject.h +#ifndef MYOBJECT_H +#define MYOBJECT_H + +#include +#include + +namespace demo { + +class MyObject : public node::ObjectWrap { + public: + static void Init(v8::Isolate* isolate); + static void NewInstance(const v8::FunctionCallbackInfo& args); + + private: + explicit MyObject(double value = 0); + ~MyObject(); + + static void New(const v8::FunctionCallbackInfo& args); + static void PlusOne(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + double value_; +}; + +} // namespace demo + +#endif +``` + +The implementation in `myobject.cc` is similar to the previous example: + +```cpp +// myobject.cc +#include +#include "myobject.h" + +namespace demo { + +using v8::Context; +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; +using v8::Isolate; +using v8::Local; +using v8::Number; +using v8::Object; +using v8::Persistent; +using v8::String; +using v8::Value; + +Persistent MyObject::constructor; + +MyObject::MyObject(double value) : value_(value) { +} + +MyObject::~MyObject() { +} + +void MyObject::Init(Isolate* isolate) { + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "plusOne", PlusOne); + + constructor.Reset(isolate, tpl->GetFunction()); +} + +void MyObject::New(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + if (args.IsConstructCall()) { + // Invoked as constructor: `new MyObject(...)` + double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); + MyObject* obj = new MyObject(value); + obj->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + // Invoked as plain function `MyObject(...)`, turn into construct call. + const int argc = 1; + Local argv[argc] = { args[0] }; + Local cons = Local::New(isolate, constructor); + Local context = isolate->GetCurrentContext(); + Local instance = + cons->NewInstance(context, argc, argv).ToLocalChecked(); + args.GetReturnValue().Set(instance); + } +} + +void MyObject::NewInstance(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + const unsigned argc = 1; + Local argv[argc] = { args[0] }; + Local cons = Local::New(isolate, constructor); + Local context = isolate->GetCurrentContext(); + Local instance = + cons->NewInstance(context, argc, argv).ToLocalChecked(); + + args.GetReturnValue().Set(instance); +} + +void MyObject::PlusOne(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + MyObject* obj = ObjectWrap::Unwrap(args.Holder()); + obj->value_ += 1; + + args.GetReturnValue().Set(Number::New(isolate, obj->value_)); +} + +} // namespace demo +``` + +Once again, to build this example, the `myobject.cc` file must be added to the +`binding.gyp`: + +``` +{ + "targets": [ + { + "target_name": "addon", + "sources": [ + "addon.cc", + "myobject.cc" + ] + } + ] +} +``` + +Test it with: + +```js +// test.js +const createObject = require('./build/Release/addon'); + +var obj = createObject(10); +console.log(obj.plusOne()); // 11 +console.log(obj.plusOne()); // 12 +console.log(obj.plusOne()); // 13 + +var obj2 = createObject(20); +console.log(obj2.plusOne()); // 21 +console.log(obj2.plusOne()); // 22 +console.log(obj2.plusOne()); // 23 +``` + + +### Passing wrapped objects around + +In addition to wrapping and returning C++ objects, it is possible to pass +wrapped objects around by unwrapping them with the Node.js helper function +`node::ObjectWrap::Unwrap`. The following examples shows a function `add()` +that can take two `MyObject` objects as input arguments: + +```cpp +// addon.cc +#include +#include +#include "myobject.h" + +namespace demo { + +using v8::FunctionCallbackInfo; +using v8::Isolate; +using v8::Local; +using v8::Number; +using v8::Object; +using v8::String; +using v8::Value; + +void CreateObject(const FunctionCallbackInfo& args) { + MyObject::NewInstance(args); +} + +void Add(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + MyObject* obj1 = node::ObjectWrap::Unwrap( + args[0]->ToObject()); + MyObject* obj2 = node::ObjectWrap::Unwrap( + args[1]->ToObject()); + + double sum = obj1->value() + obj2->value(); + args.GetReturnValue().Set(Number::New(isolate, sum)); +} + +void InitAll(Local exports) { + MyObject::Init(exports->GetIsolate()); + + NODE_SET_METHOD(exports, "createObject", CreateObject); + NODE_SET_METHOD(exports, "add", Add); +} + +NODE_MODULE(addon, InitAll) + +} // namespace demo +``` + +In `myobject.h`, a new public method is added to allow access to private values +after unwrapping the object. + +```cpp +// myobject.h +#ifndef MYOBJECT_H +#define MYOBJECT_H + +#include +#include + +namespace demo { + +class MyObject : public node::ObjectWrap { + public: + static void Init(v8::Isolate* isolate); + static void NewInstance(const v8::FunctionCallbackInfo& args); + inline double value() const { return value_; } + + private: + explicit MyObject(double value = 0); + ~MyObject(); + + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + double value_; +}; + +} // namespace demo + +#endif +``` + +The implementation of `myobject.cc` is similar to before: + +```cpp +// myobject.cc +#include +#include "myobject.h" + +namespace demo { + +using v8::Context; +using v8::Function; +using v8::FunctionCallbackInfo; +using v8::FunctionTemplate; +using v8::Isolate; +using v8::Local; +using v8::Object; +using v8::Persistent; +using v8::String; +using v8::Value; + +Persistent MyObject::constructor; + +MyObject::MyObject(double value) : value_(value) { +} + +MyObject::~MyObject() { +} + +void MyObject::Init(Isolate* isolate) { + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "MyObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + constructor.Reset(isolate, tpl->GetFunction()); +} + +void MyObject::New(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + if (args.IsConstructCall()) { + // Invoked as constructor: `new MyObject(...)` + double value = args[0]->IsUndefined() ? 0 : args[0]->NumberValue(); + MyObject* obj = new MyObject(value); + obj->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + // Invoked as plain function `MyObject(...)`, turn into construct call. + const int argc = 1; + Local argv[argc] = { args[0] }; + Local context = isolate->GetCurrentContext(); + Local cons = Local::New(isolate, constructor); + Local instance = + cons->NewInstance(context, argc, argv).ToLocalChecked(); + args.GetReturnValue().Set(instance); + } +} + +void MyObject::NewInstance(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + + const unsigned argc = 1; + Local argv[argc] = { args[0] }; + Local cons = Local::New(isolate, constructor); + Local context = isolate->GetCurrentContext(); + Local instance = + cons->NewInstance(context, argc, argv).ToLocalChecked(); + + args.GetReturnValue().Set(instance); +} + +} // namespace demo +``` + +Test it with: + +```js +// test.js +const addon = require('./build/Release/addon'); + +var obj1 = addon.createObject(10); +var obj2 = addon.createObject(20); +var result = addon.add(obj1, obj2); + +console.log(result); // 30 +``` + +### AtExit hooks + +An "AtExit" hook is a function that is invoked after the Node.js event loop +has ended by before the JavaScript VM is terminated and Node.js shuts down. +"AtExit" hooks are registered using the `node::AtExit` API. + +#### void AtExit(callback, args) + +* `callback`: `void (*)(void*)` - A pointer to the function to call at exit. +* `args`: `void*` - A pointer to pass to the callback at exit. + +Registers exit hooks that run after the event loop has ended but before the VM +is killed. + +AtExit takes two parameters: a pointer to a callback function to run at exit, +and a pointer to untyped context data to be passed to that callback. + +Callbacks are run in last-in first-out order. + +The following `addon.cc` implements AtExit: + +```cpp +// addon.cc +#undef NDEBUG +#include +#include +#include + +namespace demo { + +using node::AtExit; +using v8::HandleScope; +using v8::Isolate; +using v8::Local; +using v8::Object; + +static char cookie[] = "yum yum"; +static int at_exit_cb1_called = 0; +static int at_exit_cb2_called = 0; + +static void at_exit_cb1(void* arg) { + Isolate* isolate = static_cast(arg); + HandleScope scope(isolate); + Local obj = Object::New(isolate); + assert(!obj.IsEmpty()); // assert VM is still alive + assert(obj->IsObject()); + at_exit_cb1_called++; +} + +static void at_exit_cb2(void* arg) { + assert(arg == static_cast(cookie)); + at_exit_cb2_called++; +} + +static void sanity_check(void*) { + assert(at_exit_cb1_called == 1); + assert(at_exit_cb2_called == 2); +} + +void init(Local exports) { + AtExit(sanity_check); + AtExit(at_exit_cb2, cookie); + AtExit(at_exit_cb2, cookie); + AtExit(at_exit_cb1, exports->GetIsolate()); +} + +NODE_MODULE(addon, init); + +} // namespace demo +``` + +Test in JavaScript by running: + +```js +// test.js +const addon = require('./build/Release/addon'); +``` + +[bindings]: https://github.com/TooTallNate/node-bindings +[download]: https://github.com/nodejs/node-addon-examples +[Embedder's Guide]: https://developers.google.com/v8/embed +[examples]: https://github.com/nodejs/nan/tree/master/examples/ +[installation instructions]: https://github.com/nodejs/node-gyp#installation +[libuv]: https://github.com/libuv/libuv +[Linking to Node.js' own dependencies]: #addons_linking_to_node_js_own_dependencies +[Native Abstractions for Node.js]: https://github.com/nodejs/nan +[node-gyp]: https://github.com/nodejs/node-gyp +[require]: globals.html#globals_require +[v8-docs]: https://v8docs.nodesource.com/ diff --git a/doc/api/all.markdown b/doc/api/all.md similarity index 100% rename from doc/api/all.markdown rename to doc/api/all.md diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown deleted file mode 100644 index 35dbc3d2192209..00000000000000 --- a/doc/api/assert.markdown +++ /dev/null @@ -1,429 +0,0 @@ -# Assert - - Stability: 3 - Locked - -The `assert` module provides a simple set of assertion tests that can be used to -test invariants. The module is intended for internal use by Node.js, but can be -used in application code via `require('assert')`. However, `assert` is not a -testing framework, and is not intended to be used as a general purpose assertion -library. - -The API for the `assert` module is [Locked][]. This means that there will be no -additions or changes to any of the methods implemented and exposed by -the module. - -## assert(value[, message]) - -An alias of [`assert.ok()`][] . - -```js -const assert = require('assert'); - -assert(true); // OK -assert(1); // OK -assert(false); - // throws "AssertionError: false == true" -assert(0); - // throws "AssertionError: 0 == true" -assert(false, 'it\'s false'); - // throws "AssertionError: it's false" -``` - -## assert.deepEqual(actual, expected[, message]) - -Tests for deep equality between the `actual` and `expected` parameters. -Primitive values are compared with the equal comparison operator ( `==` ). - -Only enumerable "own" properties are considered. The `deepEqual()` -implementation does not test object prototypes, attached symbols, or -non-enumerable properties. This can lead to some potentially surprising -results. For example, the following example does not throw an `AssertionError` -because the properties on the [`Error`][] object are non-enumerable: - -```js -// WARNING: This does not throw an AssertionError! -assert.deepEqual(Error('a'), Error('b')); -``` - -"Deep" equality means that the enumerable "own" properties of child objects -are evaluated also: - -```js -const assert = require('assert'); - -const obj1 = { - a : { - b : 1 - } -}; -const obj2 = { - a : { - b : 2 - } -}; -const obj3 = { - a : { - b : 1 - } -} -const obj4 = Object.create(obj1); - -assert.deepEqual(obj1, obj1); - // OK, object is equal to itself - -assert.deepEqual(obj1, obj2); - // AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } } - // values of b are different - -assert.deepEqual(obj1, obj3); - // OK, objects are equal - -assert.deepEqual(obj1, obj4); - // AssertionError: { a: { b: 1 } } deepEqual {} - // Prototypes are ignored -``` - -If the values are not equal, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is undefined, a default error message is assigned. - -## assert.deepStrictEqual(actual, expected[, message]) - -Generally identical to `assert.deepEqual()` with two exceptions. First, -primitive values are compared using the strict equality operator ( `===` ). -Second, object comparisons include a strict equality check of their prototypes. - -```js -const assert = require('assert'); - -assert.deepEqual({a:1}, {a:'1'}); - // OK, because 1 == '1' - -assert.deepStrictEqual({a:1}, {a:'1'}); - // AssertionError: { a: 1 } deepStrictEqual { a: '1' } - // because 1 !== '1' using strict equality -``` - -If the values are not equal, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is undefined, a default error message is assigned. - -## assert.doesNotThrow(block[, error][, message]) - -Asserts that the function `block` does not throw an error. See -[`assert.throws()`][] for more details. - -When `assert.doesNotThrow()` is called, it will immediately call the `block` -function. - -If an error is thrown and it is the same type as that specified by the `error` -parameter, then an `AssertionError` is thrown. If the error is of a different -type, or if the `error` parameter is undefined, the error is propagated back -to the caller. - -The following, for instance, will throw the [`TypeError`][] because there is no -matching error type in the assertion: - -```js -assert.doesNotThrow( - () => { - throw new TypeError('Wrong value'); - }, - SyntaxError -); -``` - -However, the following will result in an `AssertionError` with the message -'Got unwanted exception (TypeError)..': - -```js -assert.doesNotThrow( - () => { - throw new TypeError('Wrong value'); - }, - TypeError -); -``` - -If an `AssertionError` is thrown and a value is provided for the `message` -parameter, the value of `message` will be appended to the `AssertionError` -message: - -```js -assert.doesNotThrow( - () => { - throw new TypeError('Wrong value'); - }, - TypeError, - 'Whoops' -); -// Throws: AssertionError: Got unwanted exception (TypeError). Whoops -``` - -## assert.equal(actual, expected[, message]) - -Tests shallow, coercive equality between the `actual` and `expected` parameters -using the equal comparison operator ( `==` ). - -```js -const assert = require('assert'); - -assert.equal(1, 1); - // OK, 1 == 1 -assert.equal(1, '1'); - // OK, 1 == '1' - -assert.equal(1, 2); - // AssertionError: 1 == 2 -assert.equal({a: {b: 1}}, {a: {b: 1}}); - //AssertionError: { a: { b: 1 } } == { a: { b: 1 } } -``` - -If the values are not equal, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is undefined, a default error message is assigned. - -## assert.fail(actual, expected, message, operator) - -Throws an `AssertionError`. If `message` is falsy, the error message is set as -the values of `actual` and `expected` separated by the provided `operator`. -Otherwise, the error message is the value of `message`. - -```js -const assert = require('assert'); - -assert.fail(1, 2, undefined, '>'); - // AssertionError: 1 > 2 - -assert.fail(1, 2, 'whoops', '>'); - // AssertionError: whoops -``` - -## assert.ifError(value) - -Throws `value` if `value` is truthy. This is useful when testing the `error` -argument in callbacks. - -```js -const assert = require('assert'); - -assert.ifError(0); // OK -assert.ifError(1); // Throws 1 -assert.ifError('error') // Throws 'error' -assert.ifError(new Error()); // Throws Error -``` - -## assert.notDeepEqual(actual, expected[, message]) - -Tests for any deep inequality. Opposite of [`assert.deepEqual()`][]. - -```js -const assert = require('assert'); - -const obj1 = { - a : { - b : 1 - } -}; -const obj2 = { - a : { - b : 2 - } -}; -const obj3 = { - a : { - b : 1 - } -} -const obj4 = Object.create(obj1); - -assert.notDeepEqual(obj1, obj1); - // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - -assert.notDeepEqual(obj1, obj2); - // OK, obj1 and obj2 are not deeply equal - -assert.notDeepEqual(obj1, obj3); - // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - -assert.notDeepEqual(obj1, obj4); - // OK, obj1 and obj2 are not deeply equal -``` - -If the values are deeply equal, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is undefined, a default error message is assigned. - -## assert.notDeepStrictEqual(actual, expected[, message]) - -Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual()`][]. - -```js -const assert = require('assert'); - -assert.notDeepEqual({a:1}, {a:'1'}); - // AssertionError: { a: 1 } notDeepEqual { a: '1' } - -assert.notDeepStrictEqual({a:1}, {a:'1'}); - // OK -``` - -If the values are deeply and strictly equal, an `AssertionError` is thrown -with a `message` property set equal to the value of the `message` parameter. If -the `message` parameter is undefined, a default error message is assigned. - -## assert.notEqual(actual, expected[, message]) - -Tests shallow, coercive inequality with the not equal comparison operator -( `!=` ). - -```js -const assert = require('assert'); - -assert.notEqual(1, 2); - // OK - -assert.notEqual(1, 1); - // AssertionError: 1 != 1 - -assert.notEqual(1, '1'); - // AssertionError: 1 != '1' -``` - -If the values are equal, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is undefined, a default error message is assigned. - -## assert.notStrictEqual(actual, expected[, message]) - -Tests strict inequality as determined by the strict not equal operator -( `!==` ). - -```js -const assert = require('assert'); - -assert.notStrictEqual(1, 2); - // OK - -assert.notStrictEqual(1, 1); - // AssertionError: 1 != 1 - -assert.notStrictEqual(1, '1'); - // OK -``` - -If the values are strictly equal, an `AssertionError` is thrown with a -`message` property set equal to the value of the `message` parameter. If the -`message` parameter is undefined, a default error message is assigned. - -## assert.ok(value[, message]) - -Tests if `value` is truthy. It is equivalent to -`assert.equal(!!value, true, message)`. - -If `value` is not truthy, an `AssertionError` is thrown with a `message` -property set equal to the value of the `message` parameter. If the `message` -parameter is `undefined`, a default error message is assigned. - -```js -const assert = require('assert'); - -assert.ok(true); // OK -assert.ok(1); // OK -assert.ok(false); - // throws "AssertionError: false == true" -assert.ok(0); - // throws "AssertionError: 0 == true" -assert.ok(false, 'it\'s false'); - // throws "AssertionError: it's false" -``` - -## assert.strictEqual(actual, expected[, message]) - -Tests strict equality as determined by the strict equality operator ( `===` ). - -```js -const assert = require('assert'); - -assert.strictEqual(1, 2); - // AssertionError: 1 === 2 - -assert.strictEqual(1, 1); - // OK - -assert.strictEqual(1, '1'); - // AssertionError: 1 === '1' -``` - -If the values are not strictly equal, an `AssertionError` is thrown with a -`message` property set equal to the value of the `message` parameter. If the -`message` parameter is undefined, a default error message is assigned. - -## assert.throws(block[, error][, message]) - -Expects the function `block` to throw an error. - -If specified, `error` can be a constructor, [`RegExp`][], or validation -function. - -If specified, `message` will be the message provided by the `AssertionError` if -the block fails to throw. - -Validate instanceof using constructor: - -```js -assert.throws( - () => { - throw new Error('Wrong value'); - }, - Error -); -``` - -Validate error message using [`RegExp`][]: - -```js -assert.throws( - () => { - throw new Error('Wrong value'); - }, - /value/ -); -``` - -Custom error validation: - -```js -assert.throws( - () => { - throw new Error('Wrong value'); - }, - function(err) { - if ( (err instanceof Error) && /value/.test(err) ) { - return true; - } - }, - 'unexpected error' -); -``` - -Note that `error` can not be a string. If a string is provided as the second -argument, then `error` is assumed to be omitted and the string will be used for -`message` instead. This can lead to easy-to-miss mistakes: - -```js -// THIS IS A MISTAKE! DO NOT DO THIS! -assert.throws(myFunction, 'missing foo', 'did not throw with expected message'); - -// Do this instead. -assert.throws(myFunction, /missing foo/, 'did not throw with expected message'); -``` - -[Locked]: documentation.html#documentation_stability_index -[`assert.deepEqual()`]: #assert_assert_deepequal_actual_expected_message -[`assert.deepStrictEqual()`]: #assert_assert_deepstrictequal_actual_expected_message -[`assert.ok()`]: #assert_assert_ok_value_message -[`assert.throws()`]: #assert_assert_throws_block_error_message -[`Error`]: errors.html#errors_class_error -[`RegExp`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions -[`TypeError`]: errors.html#errors_class_typeerror diff --git a/doc/api/assert.md b/doc/api/assert.md new file mode 100644 index 00000000000000..e54e81d22e384e --- /dev/null +++ b/doc/api/assert.md @@ -0,0 +1,471 @@ +# Assert + + Stability: 3 - Locked + +The `assert` module provides a simple set of assertion tests that can be used to +test invariants. The module is intended for internal use by Node.js, but can be +used in application code via `require('assert')`. However, `assert` is not a +testing framework, and is not intended to be used as a general purpose assertion +library. + +The API for the `assert` module is [Locked][]. This means that there will be no +additions or changes to any of the methods implemented and exposed by +the module. + +## assert(value[, message]) + + +An alias of [`assert.ok()`][] . + +```js +const assert = require('assert'); + +assert(true); // OK +assert(1); // OK +assert(false); + // throws "AssertionError: false == true" +assert(0); + // throws "AssertionError: 0 == true" +assert(false, 'it\'s false'); + // throws "AssertionError: it's false" +``` + +## assert.deepEqual(actual, expected[, message]) + + +Tests for deep equality between the `actual` and `expected` parameters. +Primitive values are compared with the equal comparison operator ( `==` ). + +Only enumerable "own" properties are considered. The `deepEqual()` +implementation does not test object prototypes, attached symbols, or +non-enumerable properties. This can lead to some potentially surprising +results. For example, the following example does not throw an `AssertionError` +because the properties on the [`Error`][] object are non-enumerable: + +```js +// WARNING: This does not throw an AssertionError! +assert.deepEqual(Error('a'), Error('b')); +``` + +"Deep" equality means that the enumerable "own" properties of child objects +are evaluated also: + +```js +const assert = require('assert'); + +const obj1 = { + a : { + b : 1 + } +}; +const obj2 = { + a : { + b : 2 + } +}; +const obj3 = { + a : { + b : 1 + } +} +const obj4 = Object.create(obj1); + +assert.deepEqual(obj1, obj1); + // OK, object is equal to itself + +assert.deepEqual(obj1, obj2); + // AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } } + // values of b are different + +assert.deepEqual(obj1, obj3); + // OK, objects are equal + +assert.deepEqual(obj1, obj4); + // AssertionError: { a: { b: 1 } } deepEqual {} + // Prototypes are ignored +``` + +If the values are not equal, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is undefined, a default error message is assigned. + +## assert.deepStrictEqual(actual, expected[, message]) + + +Generally identical to `assert.deepEqual()` with two exceptions. First, +primitive values are compared using the strict equality operator ( `===` ). +Second, object comparisons include a strict equality check of their prototypes. + +```js +const assert = require('assert'); + +assert.deepEqual({a:1}, {a:'1'}); + // OK, because 1 == '1' + +assert.deepStrictEqual({a:1}, {a:'1'}); + // AssertionError: { a: 1 } deepStrictEqual { a: '1' } + // because 1 !== '1' using strict equality +``` + +If the values are not equal, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is undefined, a default error message is assigned. + +## assert.doesNotThrow(block[, error][, message]) + + +Asserts that the function `block` does not throw an error. See +[`assert.throws()`][] for more details. + +When `assert.doesNotThrow()` is called, it will immediately call the `block` +function. + +If an error is thrown and it is the same type as that specified by the `error` +parameter, then an `AssertionError` is thrown. If the error is of a different +type, or if the `error` parameter is undefined, the error is propagated back +to the caller. + +The following, for instance, will throw the [`TypeError`][] because there is no +matching error type in the assertion: + +```js +assert.doesNotThrow( + () => { + throw new TypeError('Wrong value'); + }, + SyntaxError +); +``` + +However, the following will result in an `AssertionError` with the message +'Got unwanted exception (TypeError)..': + +```js +assert.doesNotThrow( + () => { + throw new TypeError('Wrong value'); + }, + TypeError +); +``` + +If an `AssertionError` is thrown and a value is provided for the `message` +parameter, the value of `message` will be appended to the `AssertionError` +message: + +```js +assert.doesNotThrow( + () => { + throw new TypeError('Wrong value'); + }, + TypeError, + 'Whoops' +); +// Throws: AssertionError: Got unwanted exception (TypeError). Whoops +``` + +## assert.equal(actual, expected[, message]) + + +Tests shallow, coercive equality between the `actual` and `expected` parameters +using the equal comparison operator ( `==` ). + +```js +const assert = require('assert'); + +assert.equal(1, 1); + // OK, 1 == 1 +assert.equal(1, '1'); + // OK, 1 == '1' + +assert.equal(1, 2); + // AssertionError: 1 == 2 +assert.equal({a: {b: 1}}, {a: {b: 1}}); + //AssertionError: { a: { b: 1 } } == { a: { b: 1 } } +``` + +If the values are not equal, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is undefined, a default error message is assigned. + +## assert.fail(actual, expected, message, operator) + + +Throws an `AssertionError`. If `message` is falsy, the error message is set as +the values of `actual` and `expected` separated by the provided `operator`. +Otherwise, the error message is the value of `message`. + +```js +const assert = require('assert'); + +assert.fail(1, 2, undefined, '>'); + // AssertionError: 1 > 2 + +assert.fail(1, 2, 'whoops', '>'); + // AssertionError: whoops +``` + +## assert.ifError(value) + + +Throws `value` if `value` is truthy. This is useful when testing the `error` +argument in callbacks. + +```js +const assert = require('assert'); + +assert.ifError(0); // OK +assert.ifError(1); // Throws 1 +assert.ifError('error') // Throws 'error' +assert.ifError(new Error()); // Throws Error +``` + +## assert.notDeepEqual(actual, expected[, message]) + + +Tests for any deep inequality. Opposite of [`assert.deepEqual()`][]. + +```js +const assert = require('assert'); + +const obj1 = { + a : { + b : 1 + } +}; +const obj2 = { + a : { + b : 2 + } +}; +const obj3 = { + a : { + b : 1 + } +} +const obj4 = Object.create(obj1); + +assert.notDeepEqual(obj1, obj1); + // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + +assert.notDeepEqual(obj1, obj2); + // OK, obj1 and obj2 are not deeply equal + +assert.notDeepEqual(obj1, obj3); + // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + +assert.notDeepEqual(obj1, obj4); + // OK, obj1 and obj2 are not deeply equal +``` + +If the values are deeply equal, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is undefined, a default error message is assigned. + +## assert.notDeepStrictEqual(actual, expected[, message]) + + +Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual()`][]. + +```js +const assert = require('assert'); + +assert.notDeepEqual({a:1}, {a:'1'}); + // AssertionError: { a: 1 } notDeepEqual { a: '1' } + +assert.notDeepStrictEqual({a:1}, {a:'1'}); + // OK +``` + +If the values are deeply and strictly equal, an `AssertionError` is thrown +with a `message` property set equal to the value of the `message` parameter. If +the `message` parameter is undefined, a default error message is assigned. + +## assert.notEqual(actual, expected[, message]) + + +Tests shallow, coercive inequality with the not equal comparison operator +( `!=` ). + +```js +const assert = require('assert'); + +assert.notEqual(1, 2); + // OK + +assert.notEqual(1, 1); + // AssertionError: 1 != 1 + +assert.notEqual(1, '1'); + // AssertionError: 1 != '1' +``` + +If the values are equal, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is undefined, a default error message is assigned. + +## assert.notStrictEqual(actual, expected[, message]) + + +Tests strict inequality as determined by the strict not equal operator +( `!==` ). + +```js +const assert = require('assert'); + +assert.notStrictEqual(1, 2); + // OK + +assert.notStrictEqual(1, 1); + // AssertionError: 1 != 1 + +assert.notStrictEqual(1, '1'); + // OK +``` + +If the values are strictly equal, an `AssertionError` is thrown with a +`message` property set equal to the value of the `message` parameter. If the +`message` parameter is undefined, a default error message is assigned. + +## assert.ok(value[, message]) + + +Tests if `value` is truthy. It is equivalent to +`assert.equal(!!value, true, message)`. + +If `value` is not truthy, an `AssertionError` is thrown with a `message` +property set equal to the value of the `message` parameter. If the `message` +parameter is `undefined`, a default error message is assigned. + +```js +const assert = require('assert'); + +assert.ok(true); // OK +assert.ok(1); // OK +assert.ok(false); + // throws "AssertionError: false == true" +assert.ok(0); + // throws "AssertionError: 0 == true" +assert.ok(false, 'it\'s false'); + // throws "AssertionError: it's false" +``` + +## assert.strictEqual(actual, expected[, message]) + + +Tests strict equality as determined by the strict equality operator ( `===` ). + +```js +const assert = require('assert'); + +assert.strictEqual(1, 2); + // AssertionError: 1 === 2 + +assert.strictEqual(1, 1); + // OK + +assert.strictEqual(1, '1'); + // AssertionError: 1 === '1' +``` + +If the values are not strictly equal, an `AssertionError` is thrown with a +`message` property set equal to the value of the `message` parameter. If the +`message` parameter is undefined, a default error message is assigned. + +## assert.throws(block[, error][, message]) + + +Expects the function `block` to throw an error. + +If specified, `error` can be a constructor, [`RegExp`][], or validation +function. + +If specified, `message` will be the message provided by the `AssertionError` if +the block fails to throw. + +Validate instanceof using constructor: + +```js +assert.throws( + () => { + throw new Error('Wrong value'); + }, + Error +); +``` + +Validate error message using [`RegExp`][]: + +```js +assert.throws( + () => { + throw new Error('Wrong value'); + }, + /value/ +); +``` + +Custom error validation: + +```js +assert.throws( + () => { + throw new Error('Wrong value'); + }, + function(err) { + if ( (err instanceof Error) && /value/.test(err) ) { + return true; + } + }, + 'unexpected error' +); +``` + +Note that `error` can not be a string. If a string is provided as the second +argument, then `error` is assumed to be omitted and the string will be used for +`message` instead. This can lead to easy-to-miss mistakes: + +```js +// THIS IS A MISTAKE! DO NOT DO THIS! +assert.throws(myFunction, 'missing foo', 'did not throw with expected message'); + +// Do this instead. +assert.throws(myFunction, /missing foo/, 'did not throw with expected message'); +``` + +[Locked]: documentation.html#documentation_stability_index +[`assert.deepEqual()`]: #assert_assert_deepequal_actual_expected_message +[`assert.deepStrictEqual()`]: #assert_assert_deepstrictequal_actual_expected_message +[`assert.ok()`]: #assert_assert_ok_value_message +[`assert.throws()`]: #assert_assert_throws_block_error_message +[`Error`]: errors.html#errors_class_error +[`RegExp`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions +[`TypeError`]: errors.html#errors_class_typeerror diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown deleted file mode 100644 index f4f45c96cb3fbb..00000000000000 --- a/doc/api/buffer.markdown +++ /dev/null @@ -1,1785 +0,0 @@ -# Buffer - - Stability: 2 - Stable - -Prior to the introduction of `TypedArray` in ECMAScript 2015 (ES6), the -JavaScript language had no mechanism for reading or manipulating streams -of binary data. The `Buffer` class was introduced as part of the Node.js -API to make it possible to interact with octet streams in the context of things -like TCP streams and file system operations. - -Now that `TypedArray` has been added in ES6, the `Buffer` class implements the -`Uint8Array` API in a manner that is more optimized and suitable for Node.js' -use cases. - -Instances of the `Buffer` class are similar to arrays of integers but -correspond to fixed-sized, raw memory allocations outside the V8 heap. -The size of the `Buffer` is established when it is created and cannot be -resized. - -The `Buffer` class is a global within Node.js, making it unlikely that one -would need to ever use `require('buffer')`. - -```js -const buf1 = Buffer.alloc(10); - // Creates a zero-filled Buffer of length 10. - -const buf2 = Buffer.alloc(10, 1); - // Creates a Buffer of length 10, filled with 0x01. - -const buf3 = Buffer.allocUnsafe(10); - // Creates an uninitialized buffer of length 10. - // This is faster than calling Buffer.alloc() but the returned - // Buffer instance might contain old data that needs to be - // overwritten using either fill() or write(). - -const buf4 = Buffer.from([1,2,3]); - // Creates a Buffer containing [01, 02, 03]. - -const buf5 = Buffer.from('test'); - // Creates a Buffer containing ASCII bytes [74, 65, 73, 74]. - -const buf6 = Buffer.from('tést', 'utf8'); - // Creates a Buffer containing UTF8 bytes [74, c3, a9, 73, 74]. -``` - -## `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` - -In versions of Node.js prior to v6, `Buffer` instances were created using the -`Buffer` constructor function, which allocates the returned `Buffer` -differently based on what arguments are provided: - -* Passing a number as the first argument to `Buffer()` (e.g. `new Buffer(10)`), - allocates a new `Buffer` object of the specified size. The memory allocated - for such `Buffer` instances is *not* initialized and *can contain sensitive - data*. Such `Buffer` objects *must* be initialized *manually* by using either - [`buf.fill(0)`][] or by writing to the `Buffer` completely. While this - behavior is *intentional* to improve performance, development experience has - demonstrated that a more explicit distinction is required between creating a - fast-but-uninitialized `Buffer` versus creating a slower-but-safer `Buffer`. -* Passing a string, array, or `Buffer` as the first argument copies the - passed object's data into the `Buffer`. -* Passing an `ArrayBuffer` returns a `Buffer` that shares allocated memory with - the given `ArrayBuffer`. - -Because the behavior of `new Buffer()` changes significantly based on the type -of value passed as the first argument, applications that do not properly -validate the input arguments passed to `new Buffer()`, or that fail to -appropriately initialize newly allocated `Buffer` content, can inadvertently -introduce security and reliability issues into their code. - -To make the creation of `Buffer` objects more reliable and less error prone, -the various forms of the `new Buffer()` constructor have been **deprecated** -and replaced by separate `Buffer.from()`, `Buffer.alloc()`, and -`Buffer.allocUnsafe()` methods. - -*Developers should migrate all existing uses of the `new Buffer()` constructors -to one of these new APIs.* - -* [`Buffer.from(array)`][buffer_from_array] returns a new `Buffer` containing - a *copy* of the provided octets. -* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] - returns a new `Buffer` that *shares* the same allocated memory as the given - `ArrayBuffer`. -* [`Buffer.from(buffer)`][buffer_from_buffer] returns a new `Buffer` - containing a *copy* of the contents of the given `Buffer`. -* [`Buffer.from(str[, encoding])`][buffer_from_string] returns a new `Buffer` - containing a *copy* of the provided string. -* [`Buffer.alloc(size[, fill[, encoding]])`][buffer_alloc] returns a "filled" - `Buffer` instance of the specified size. This method can be significantly - slower than [`Buffer.allocUnsafe(size)`][buffer_allocunsafe] but ensures that - newly created `Buffer` instances never contain old and potentially sensitive - data. -* [`Buffer.allocUnsafe(size)`][buffer_allocunsafe] returns a new `Buffer` of - the specified `size` whose content *must* be initialized using either - [`buf.fill(0)`][] or written to completely. - -`Buffer` instances returned by `Buffer.allocUnsafe(size)` *may* be allocated -off a shared internal memory pool if the `size` is less than or equal to half -`Buffer.poolSize`. - -### The `--zero-fill-buffers` command line option - -Node.js can be started using the `--zero-fill-buffers` command line option to -force all newly allocated `Buffer` and `SlowBuffer` instances created using -either `new Buffer(size)`, `Buffer.allocUnsafe(size)`, or -`new SlowBuffer(size)` to be *automatically zero-filled* upon creation. Use of -this flag *changes the default behavior* of these methods and *can have a -significant impact* on performance. Use of the `--zero-fill-buffers` option is -recommended only when absolutely necessary to enforce that newly allocated -`Buffer` instances cannot contain potentially sensitive data. - -``` -$ node --zero-fill-buffers -> Buffer.allocUnsafe(5); - -``` - -### What makes `Buffer.allocUnsafe(size)` "unsafe"? - -When calling `Buffer.allocUnsafe()`, the segment of allocated memory is -*uninitialized* (it is not zeroed-out). While this design makes the allocation -of memory quite fast, the allocated segment of memory might contain old data -that is potentially sensitive. Using a `Buffer` created by -`Buffer.allocUnsafe(size)` without *completely* overwriting the memory can -allow this old data to be leaked when the `Buffer` memory is read. - -While there are clear performance advantages to using `Buffer.allocUnsafe()`, -extra care *must* be taken in order to avoid introducing security -vulnerabilities into an application. - -## Buffers and Character Encodings - -Buffers are commonly used to represent sequences of encoded characters -such as UTF8, UCS2, Base64 or even Hex-encoded data. It is possible to -convert back and forth between Buffers and ordinary JavaScript string objects -by using an explicit encoding method. - -```js -const buf = Buffer.from('hello world', 'ascii'); -console.log(buf.toString('hex')); - // prints: 68656c6c6f20776f726c64 -console.log(buf.toString('base64')); - // prints: aGVsbG8gd29ybGQ= -``` - -The character encodings currently supported by Node.js include: - -* `'ascii'` - for 7-bit ASCII data only. This encoding method is very fast and - will strip the high bit if set. - -* `'utf8'` - Multibyte encoded Unicode characters. Many web pages and other - document formats use UTF-8. - -* `'utf16le'` - 2 or 4 bytes, little-endian encoded Unicode characters. - Surrogate pairs (U+10000 to U+10FFFF) are supported. - -* `'ucs2'` - Alias of `'utf16le'`. - -* `'base64'` - Base64 string encoding. When creating a buffer from a string, - this encoding will also correctly accept "URL and Filename Safe Alphabet" as - specified in [RFC 4648, Section 5]. - -* `'binary'` - A way of encoding the buffer into a one-byte (`latin-1`) - encoded string. The string `'latin-1'` is not supported. Instead, pass - `'binary'` to use `'latin-1'` encoding. - -* `'hex'` - Encode each byte as two hexadecimal characters. - -## Buffers and TypedArray - -Buffers are also `Uint8Array` TypedArray instances. However, there are subtle -incompatibilities with the TypedArray specification in ECMAScript 2015. For -instance, while `ArrayBuffer#slice()` creates a copy of the slice, -the implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the -existing Buffer without copying, making `Buffer#slice()` far more efficient. - -It is also possible to create new TypedArray instances from a `Buffer` with the -following caveats: - -1. The `Buffer` object's memory is copied to the TypedArray, not shared. - -2. The `Buffer` object's memory is interpreted as an array of distinct -elements, and not as a byte array of the target type. That is, -`new Uint32Array(Buffer.from([1,2,3,4]))` creates a 4-element `Uint32Array` - with elements `[1,2,3,4]`, not a `Uint32Array` with a single element - `[0x1020304]` or `[0x4030201]`. - -It is possible to create a new `Buffer` that shares the same allocated memory as -a TypedArray instance by using the TypeArray object's `.buffer` property: - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf1 = Buffer.from(arr); // copies the buffer -const buf2 = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf1); - // Prints: , copied buffer has only two elements -console.log(buf2); - // Prints: - -arr[1] = 6000; -console.log(buf1); - // Prints: -console.log(buf2); - // Prints: -``` - -Note that when creating a `Buffer` using the TypedArray's `.buffer`, it is -possible to use only a portion of the underlying `ArrayBuffer` by passing in -`byteOffset` and `length` parameters: - -```js -const arr = new Uint16Array(20); -const buf = Buffer.from(arr.buffer, 0, 16); -console.log(buf.length); - // Prints: 16 -``` - -The `Buffer.from()` and [`TypedArray.from()`][] (e.g.`Uint8Array.from()`) have -different signatures and implementations. Specifically, the TypedArray variants -accept a second argument that is a mapping function that is invoked on every -element of the typed array: - -* `TypedArray.from(source[, mapFn[, thisArg]])` - -The `Buffer.from()` method, however, does not support the use of a mapping -function: - -* [`Buffer.from(array)`][buffer_from_array] -* [`Buffer.from(buffer)`][buffer_from_buffer] -* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] -* [`Buffer.from(str[, encoding])`][buffer_from_string] - -## Buffers and ES6 iteration - -Buffers can be iterated over using the ECMAScript 2015 (ES6) `for..of` syntax: - -```js -const buf = Buffer.from([1, 2, 3]); - -for (var b of buf) - console.log(b) - -// Prints: -// 1 -// 2 -// 3 -``` - -Additionally, the [`buf.values()`][], [`buf.keys()`][], and -[`buf.entries()`][] methods can be used to create iterators. - -## Class: Buffer - -The Buffer class is a global type for dealing with binary data directly. -It can be constructed in a variety of ways. - -### new Buffer(array) - - Stability: 0 - Deprecated: Use [`Buffer.from(array)`][buffer_from_array] - instead. - -* `array` {Array} - -Allocates a new Buffer using an `array` of octets. - -```js -const buf = new Buffer([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -### new Buffer(buffer) - - Stability: 0 - Deprecated: Use [`Buffer.from(buffer)`][buffer_from_buffer] - instead. - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = new Buffer('buffer'); -const buf2 = new Buffer(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -### new Buffer(arrayBuffer[, byteOffset [, length]]) - - Stability: 0 - Deprecated: Use - [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] - instead. - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or a - `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created Buffer will share the same allocated memory as the -TypedArray. - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = new Buffer(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypdArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -### new Buffer(size) - - Stability: 0 - Deprecated: Use - [`Buffer.alloc(size[, fill[, encoding]])`][buffer_alloc] instead (also - see [`Buffer.allocUnsafe(size)`][buffer_allocunsafe]). - -* `size` {Number} - -Allocates a new `Buffer` of `size` bytes. The `size` must be less than -or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. If a `size` less than 0 is specified, a zero-length Buffer will be -created. - -Unlike `ArrayBuffers`, the underlying memory for `Buffer` instances created in -this way is *not initialized*. The contents of a newly created `Buffer` are -unknown and *could contain sensitive data*. Use [`buf.fill(0)`][] to initialize -a `Buffer` to zeroes. - -```js -const buf = new Buffer(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -### new Buffer(str[, encoding]) - - Stability: 0 - Deprecated: - Use [`Buffer.from(str[, encoding])`][buffer_from_string] instead. - -* `str` {String} string to encode. -* `encoding` {String} Default: `'utf8'` - -Creates a new Buffer containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the strings character encoding. - -```js -const buf1 = new Buffer('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = new Buffer('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. If a `size` less than 0 -is specified, a zero-length `Buffer` will be created. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. If a `size` less than 0 is specified, a zero-length `Buffer` will be -created. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.byteLength(string[, encoding]) - -* `string` {String | Buffer | TypedArray | DataView | ArrayBuffer} -* `encoding` {String} Default: `'utf8'` -* Return: {Number} - -Returns the actual byte length of a string. This is not the same as -[`String.prototype.length`][] since that returns the number of *characters* in -a string. - -Example: - -```js -const str = '\u00bd + \u00bc = \u00be'; - -console.log(`${str}: ${str.length} characters, ` + - `${Buffer.byteLength(str, 'utf8')} bytes`); - -// ½ + ¼ = ¾: 9 characters, 12 bytes -``` - -When `string` is a `Buffer`/[`DataView`][]/[`TypedArray`][]/`ArrayBuffer`, -returns the actual byte length. - -Otherwise, converts to `String` and returns the byte length of string. - -### Class Method: Buffer.compare(buf1, buf2) - -* `buf1` {Buffer} -* `buf2` {Buffer} -* Return: {Number} - -Compares `buf1` to `buf2` typically for the purpose of sorting arrays of -Buffers. This is equivalent is calling [`buf1.compare(buf2)`][]. - -```js -const arr = [Buffer.from('1234'), Buffer.from('0123')]; -arr.sort(Buffer.compare); -``` - -### Class Method: Buffer.concat(list[, totalLength]) - -* `list` {Array} List of Buffer objects to concat -* `totalLength` {Number} Total length of the Buffers in the list - when concatenated -* Return: {Buffer} - -Returns a new Buffer which is the result of concatenating all the Buffers in -the `list` together. - -If the list has no items, or if the `totalLength` is 0, then a new zero-length -Buffer is returned. - -If `totalLength` is not provided, it is calculated from the Buffers in the -`list`. This, however, adds an additional loop to the function, so it is faster -to provide the length explicitly. - -Example: build a single Buffer from a list of three Buffers: - -```js -const buf1 = Buffer.alloc(10); -const buf2 = Buffer.alloc(14); -const buf3 = Buffer.alloc(18); -const totalLength = buf1.length + buf2.length + buf3.length; - -console.log(totalLength); -const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); -console.log(bufA); -console.log(bufA.length); - -// 42 -// -// 42 -``` - -### Class Method: Buffer.from(array) - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.isBuffer(obj) - -* `obj` {Object} -* Return: {Boolean} - -Returns 'true' if `obj` is a Buffer. - -### Class Method: Buffer.isEncoding(encoding) - -* `encoding` {String} The encoding string to test -* Return: {Boolean} - -Returns true if the `encoding` is a valid encoding argument, or false -otherwise. - -### buf[index] - - - - -The index operator `[index]` can be used to get and set the octet at position -`index` in the Buffer. The values refer to individual bytes, so the legal value -range is between `0x00` and `0xFF` (hex) or `0` and `255` (decimal). - -Example: copy an ASCII string into a Buffer, one byte at a time: - -```js -const str = "Node.js"; -const buf = Buffer.allocUnsafe(str.length); - -for (let i = 0; i < str.length ; i++) { - buf[i] = str.charCodeAt(i); -} - -console.log(buf.toString('ascii')); - // Prints: Node.js -``` - -### buf.compare(otherBuffer) - -* `otherBuffer` {Buffer} -* Return: {Number} - -Compares two Buffer instances and returns a number indicating whether `buf` -comes before, after, or is the same as the `otherBuffer` in sort order. -Comparison is based on the actual sequence of bytes in each Buffer. - -* `0` is returned if `otherBuffer` is the same as `buf` -* `1` is returned if `otherBuffer` should come *before* `buf` when sorted. -* `-1` is returned if `otherBuffer` should come *after* `buf` when sorted. - -```js -const buf1 = Buffer.from('ABC'); -const buf2 = Buffer.from('BCD'); -const buf3 = Buffer.from('ABCD'); - -console.log(buf1.compare(buf1)); - // Prints: 0 -console.log(buf1.compare(buf2)); - // Prints: -1 -console.log(buf1.compare(buf3)); - // Prints: 1 -console.log(buf2.compare(buf1)); - // Prints: 1 -console.log(buf2.compare(buf3)); - // Prints: 1 - -[buf1, buf2, buf3].sort(Buffer.compare); - // produces sort order [buf1, buf3, buf2] -``` - -### buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]]) - -* `targetBuffer` {Buffer} Buffer to copy into -* `targetStart` {Number} Default: 0 -* `sourceStart` {Number} Default: 0 -* `sourceEnd` {Number} Default: `buffer.length` -* Return: {Number} The number of bytes copied. - -Copies data from a region of this Buffer to a region in the target Buffer even -if the target memory region overlaps with the source. - -Example: build two Buffers, then copy `buf1` from byte 16 through byte 19 -into `buf2`, starting at the 8th byte in `buf2`. - -```js -const buf1 = Buffer.allocUnsafe(26); -const buf2 = Buffer.allocUnsafe(26).fill('!'); - -for (let i = 0 ; i < 26 ; i++) { - buf1[i] = i + 97; // 97 is ASCII a -} - -buf1.copy(buf2, 8, 16, 20); -console.log(buf2.toString('ascii', 0, 25)); - // Prints: !!!!!!!!qrst!!!!!!!!!!!!! -``` - -Example: Build a single Buffer, then copy data from one region to an overlapping -region in the same Buffer - -```js -const buf = Buffer.allocUnsafe(26); - -for (var i = 0 ; i < 26 ; i++) { - buf[i] = i + 97; // 97 is ASCII a -} - -buf.copy(buf, 0, 4, 10); -console.log(buf.toString()); - -// efghijghijklmnopqrstuvwxyz -``` - -### buf.entries() - -* Return: {Iterator} - -Creates and returns an [iterator][] of `[index, byte]` pairs from the Buffer -contents. - -```js -const buf = Buffer.from('buffer'); -for (var pair of buf.entries()) { - console.log(pair); -} -// prints: -// [0, 98] -// [1, 117] -// [2, 102] -// [3, 102] -// [4, 101] -// [5, 114] -``` - -### buf.equals(otherBuffer) - -* `otherBuffer` {Buffer} -* Return: {Boolean} - -Returns a boolean indicating whether `this` and `otherBuffer` have exactly the -same bytes. - -```js -const buf1 = Buffer.from('ABC'); -const buf2 = Buffer.from('414243', 'hex'); -const buf3 = Buffer.from('ABCD'); - -console.log(buf1.equals(buf2)); - // Prints: true -console.log(buf1.equals(buf3)); - // Prints: false -``` - -### buf.fill(value[, offset[, end]][, encoding]) - -* `value` {String|Buffer|Number} -* `offset` {Number} Default: 0 -* `end` {Number} Default: `buf.length` -* `encoding` {String} Default: `'utf8'` -* Return: {Buffer} - -Fills the Buffer with the specified value. If the `offset` (defaults to `0`) -and `end` (defaults to `buf.length`) are not given the entire buffer will be -filled. The method returns a reference to the Buffer, so calls can be chained. -This is meant as a small simplification to creating a Buffer. Allowing the -creation and fill of the Buffer to be done on a single line: - -```js -const b = Buffer.allocUnsafe(50).fill('h'); -console.log(b.toString()); - // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh -``` - -`encoding` is only relevant if `value` is a string. Otherwise it is ignored. -`value` is coerced to a `uint32` value if it is not a String or Number. - -The `fill()` operation writes bytes into the Buffer dumbly. If the final write -falls in between a multi-byte character then whatever bytes fit into the buffer -are written. - -```js -Buffer(3).fill('\u0222'); - // Prints: -``` - -### buf.indexOf(value[, byteOffset][, encoding]) - -* `value` {String|Buffer|Number} -* `byteOffset` {Number} Default: 0 -* `encoding` {String} Default: `'utf8'` -* Return: {Number} - -Operates similar to [`Array#indexOf()`][] in that it returns either the -starting index position of `value` in Buffer or `-1` if the Buffer does not -contain `value`. The `value` can be a String, Buffer or Number. Strings are by -default interpreted as UTF8. Buffers will use the entire Buffer (to compare a -partial Buffer use [`buf.slice()`][]). Numbers can range from 0 to 255. - -```js -const buf = Buffer.from('this is a buffer'); - -buf.indexOf('this'); - // returns 0 -buf.indexOf('is'); - // returns 2 -buf.indexOf(Buffer.from('a buffer')); - // returns 8 -buf.indexOf(97); // ascii for 'a' - // returns 8 -buf.indexOf(Buffer.from('a buffer example')); - // returns -1 -buf.indexOf(Buffer.from('a buffer example').slice(0,8)); - // returns 8 - -const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); - -utf16Buffer.indexOf('\u03a3', 0, 'ucs2'); - // returns 4 -utf16Buffer.indexOf('\u03a3', -4, 'ucs2'); - // returns 6 -``` - -### buf.includes(value[, byteOffset][, encoding]) - -* `value` {String|Buffer|Number} -* `byteOffset` {Number} Default: 0 -* `encoding` {String} Default: `'utf8'` -* Return: {Boolean} - -Operates similar to [`Array#includes()`][]. The `value` can be a String, Buffer -or Number. Strings are interpreted as UTF8 unless overridden with the -`encoding` argument. Buffers will use the entire Buffer (to compare a partial -Buffer use [`buf.slice()`][]). Numbers can range from 0 to 255. - -The `byteOffset` indicates the index in `buf` where searching begins. - -```js -const buf = Buffer.from('this is a buffer'); - -buf.includes('this'); - // returns true -buf.includes('is'); - // returns true -buf.includes(Buffer.from('a buffer')); - // returns true -buf.includes(97); // ascii for 'a' - // returns true -buf.includes(Buffer.from('a buffer example')); - // returns false -buf.includes(Buffer.from('a buffer example').slice(0,8)); - // returns true -buf.includes('this', 4); - // returns false -``` - -### buf.keys() - -* Return: {Iterator} - -Creates and returns an [iterator][] of Buffer keys (indices). - -```js -const buf = Buffer.from('buffer'); -for (var key of buf.keys()) { - console.log(key); -} -// prints: -// 0 -// 1 -// 2 -// 3 -// 4 -// 5 -``` - -### buf.length - -* {Number} - -Returns the amount of memory allocated for the Buffer in number of bytes. Note -that this does not necessarily reflect the amount of usable data within the -Buffer. For instance, in the example below, a Buffer with 1234 bytes is -allocated, but only 11 ASCII bytes are written. - -```js -const buf = Buffer.alloc(1234); - -console.log(buf.length); - // Prints: 1234 - -buf.write('some string', 0, 'ascii'); -console.log(buf.length); - // Prints: 1234 -``` - -While the `length` property is not immutable, changing the value of `length` -can result in undefined and inconsistent behavior. Applications that wish to -modify the length of a Buffer should therefore treat `length` as read-only and -use [`buf.slice()`][] to create a new Buffer. - -```js -var buf = Buffer.allocUnsafe(10); -buf.write('abcdefghj', 0, 'ascii'); -console.log(buf.length); - // Prints: 10 -buf = buf.slice(0,5); -console.log(buf.length); - // Prints: 5 -``` - -### buf.readDoubleBE(offset[, noAssert]) -### buf.readDoubleLE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 8` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads a 64-bit double from the Buffer at the specified `offset` with specified -endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns -little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -```js -const buf = Buffer.from([1,2,3,4,5,6,7,8]); - -buf.readDoubleBE(); - // Returns: 8.20788039913184e-304 -buf.readDoubleLE(); - // Returns: 5.447603722011605e-270 -buf.readDoubleLE(1); - // throws RangeError: Index out of range - -buf.readDoubleLE(1, true); // Warning: reads passed end of buffer! - // Segmentation fault! don't do this! -``` - -### buf.readFloatBE(offset[, noAssert]) -### buf.readFloatLE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads a 32-bit float from the Buffer at the specified `offset` with specified -endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns -little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -```js -const buf = Buffer.from([1,2,3,4]); - -buf.readFloatBE(); - // Returns: 2.387939260590663e-38 -buf.readFloatLE(); - // Returns: 1.539989614439558e-36 -buf.readFloatLE(1); - // throws RangeError: Index out of range - -buf.readFloatLE(1, true); // Warning: reads passed end of buffer! - // Segmentation fault! don't do this! -``` - -### buf.readInt8(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 1` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads a signed 8-bit integer from the Buffer at the specified `offset`. - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -Integers read from the Buffer are interpreted as two's complement signed values. - -```js -const buf = Buffer.from([1,-2,3,4]); - -buf.readInt8(0); - // returns 1 -buf.readInt8(1); - // returns -2 -``` - -### buf.readInt16BE(offset[, noAssert]) -### buf.readInt16LE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 2` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads a signed 16-bit integer from the Buffer at the specified `offset` with -the specified endian format (`readInt16BE()` returns big endian, -`readInt16LE()` returns little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -Integers read from the Buffer are interpreted as two's complement signed values. - -```js -const buf = Buffer.from([1,-2,3,4]); - -buf.readInt16BE(); - // returns 510 -buf.readInt16LE(1); - // returns 1022 -``` - -### buf.readInt32BE(offset[, noAssert]) -### buf.readInt32LE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads a signed 32-bit integer from the Buffer at the specified `offset` with -the specified endian format (`readInt32BE()` returns big endian, -`readInt32LE()` returns little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -Integers read from the Buffer are interpreted as two's complement signed values. - -```js -const buf = Buffer.from([1,-2,3,4]); - -buf.readInt32BE(); - // returns 33424132 -buf.readInt32LE(); - // returns 67370497 -buf.readInt32LE(1); - // throws RangeError: Index out of range -``` - -### buf.readIntBE(offset, byteLength[, noAssert]) -### buf.readIntLE(offset, byteLength[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - byteLength` -* `byteLength` {Number} `0 < byteLength <= 6` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads `byteLength` number of bytes from the Buffer at the specified `offset` -and interprets the result as a two's complement signed value. Supports up to 48 -bits of accuracy. For example: - -```js -const buf = Buffer.allocUnsafe(6); -buf.writeUInt16LE(0x90ab, 0); -buf.writeUInt32LE(0x12345678, 2); -buf.readIntLE(0, 6).toString(16); // Specify 6 bytes (48 bits) -// Returns: '1234567890ab' - -buf.readIntBE(0, 6).toString(16); -// Returns: -546f87a9cbee -``` - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -### buf.readUInt8(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 1` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads an unsigned 8-bit integer from the Buffer at the specified `offset`. - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -```js -const buf = Buffer.from([1,-2,3,4]); - -buf.readUInt8(0); - // returns 1 -buf.readUInt8(1); - // returns 254 -``` - -### buf.readUInt16BE(offset[, noAssert]) -### buf.readUInt16LE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 2` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads an unsigned 16-bit integer from the Buffer at the specified `offset` with -specified endian format (`readInt32BE()` returns big endian, -`readInt32LE()` returns little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -Example: - -```js -const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]); - -buf.readUInt16BE(0); - // Returns: 0x0304 -buf.readUInt16LE(0); - // Returns: 0x0403 -buf.readUInt16BE(1); - // Returns: 0x0423 -buf.readUInt16LE(1); - // Returns: 0x2304 -buf.readUInt16BE(2); - // Returns: 0x2342 -buf.readUInt16LE(2); - // Returns: 0x4223 -``` - -### buf.readUInt32BE(offset[, noAssert]) -### buf.readUInt32LE(offset[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads an unsigned 32-bit integer from the Buffer at the specified `offset` with -specified endian format (`readInt32BE()` returns big endian, -`readInt32LE()` returns little endian). - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -Example: - -```js -const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]); - -buf.readUInt32BE(0); - // Returns: 0x03042342 -console.log(buf.readUInt32LE(0)); - // Returns: 0x42230403 -``` - -### buf.readUIntBE(offset, byteLength[, noAssert]) -### buf.readUIntLE(offset, byteLength[, noAssert]) - -* `offset` {Number} `0 <= offset <= buf.length - byteLength` -* `byteLength` {Number} `0 < byteLength <= 6` -* `noAssert` {Boolean} Default: false -* Return: {Number} - -Reads `byteLength` number of bytes from the Buffer at the specified `offset` -and interprets the result as an unsigned integer. Supports up to 48 -bits of accuracy. For example: - -```js -const buf = Buffer.allocUnsafe(6); -buf.writeUInt16LE(0x90ab, 0); -buf.writeUInt32LE(0x12345678, 2); -buf.readUIntLE(0, 6).toString(16); // Specify 6 bytes (48 bits) -// Returns: '1234567890ab' - -buf.readUIntBE(0, 6).toString(16); -// Returns: ab9078563412 -``` - -Setting `noAssert` to `true` skips validation of the `offset`. This allows the -`offset` to be beyond the end of the Buffer. - -### buf.slice([start[, end]]) - -* `start` {Number} Default: 0 -* `end` {Number} Default: `buffer.length` -* Return: {Buffer} - -Returns a new Buffer that references the same memory as the original, but -offset and cropped by the `start` and `end` indices. - -**Note that modifying the new Buffer slice will modify the memory in the -original Buffer because the allocated memory of the two objects overlap.** - -Example: build a Buffer with the ASCII alphabet, take a slice, then modify one -byte from the original Buffer. - -```js -const buf1 = Buffer.allocUnsafe(26); - -for (var i = 0 ; i < 26 ; i++) { - buf1[i] = i + 97; // 97 is ASCII a -} - -const buf2 = buf1.slice(0, 3); -buf2.toString('ascii', 0, buf2.length); - // Returns: 'abc' -buf1[0] = 33; -buf2.toString('ascii', 0, buf2.length); - // Returns : '!bc' -``` - -Specifying negative indexes causes the slice to be generated relative to the -end of the Buffer rather than the beginning. - -```js -const buf = Buffer.from('buffer'); - -buf.slice(-6, -1).toString(); - // Returns 'buffe', equivalent to buf.slice(0, 5) -buf.slice(-6, -2).toString(); - // Returns 'buff', equivalent to buf.slice(0, 4) -buf.slice(-5, -2).toString(); - // Returns 'uff', equivalent to buf.slice(1, 4) -``` - -### buf.swap16() - -* Return: {Buffer} - -Interprets the `Buffer` as an array of unsigned 16-bit integers and swaps -the byte-order *in-place*. Throws a `RangeError` if the `Buffer` length is -not a multiple of 16 bits. The method returns a reference to the Buffer, so -calls can be chained. - -```js -const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); -console.log(buf); - // Prints Buffer(0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8) -buf.swap16(); -console.log(buf); - // Prints Buffer(0x2, 0x1, 0x4, 0x3, 0x6, 0x5, 0x8, 0x7) -``` - -### buf.swap32() - -* Return: {Buffer} - -Interprets the `Buffer` as an array of unsigned 32-bit integers and swaps -the byte-order *in-place*. Throws a `RangeError` if the `Buffer` length is -not a multiple of 32 bits. The method returns a reference to the Buffer, so -calls can be chained. - -```js -const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); -console.log(buf); - // Prints Buffer(0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8) -buf.swap32(); -console.log(buf); - // Prints Buffer(0x4, 0x3, 0x2, 0x1, 0x8, 0x7, 0x6, 0x5) -``` - -### buf.toString([encoding[, start[, end]]]) - -* `encoding` {String} Default: `'utf8'` -* `start` {Number} Default: 0 -* `end` {Number} Default: `buffer.length` -* Return: {String} - -Decodes and returns a string from the Buffer data using the specified -character set `encoding`. - -```js -const buf = Buffer.allocUnsafe(26); -for (var i = 0 ; i < 26 ; i++) { - buf[i] = i + 97; // 97 is ASCII a -} -buf.toString('ascii'); - // Returns: 'abcdefghijklmnopqrstuvwxyz' -buf.toString('ascii',0,5); - // Returns: 'abcde' -buf.toString('utf8',0,5); - // Returns: 'abcde' -buf.toString(undefined,0,5); - // Returns: 'abcde', encoding defaults to 'utf8' -``` - -### buf.toJSON() - -* Return: {Object} - -Returns a JSON representation of the Buffer instance. [`JSON.stringify()`][] -implicitly calls this function when stringifying a Buffer instance. - -Example: - -```js -const buf = Buffer.from('test'); -const json = JSON.stringify(buf); - -console.log(json); -// Prints: '{"type":"Buffer","data":[116,101,115,116]}' - -const copy = JSON.parse(json, (key, value) => { - return value && value.type === 'Buffer' - ? Buffer.from(value.data) - : value; - }); - -console.log(copy.toString()); -// Prints: 'test' -``` - -### buf.values() - -* Return: {Iterator} - -Creates and returns an [iterator][] for Buffer values (bytes). This function is -called automatically when the Buffer is used in a `for..of` statement. - -```js -const buf = Buffer.from('buffer'); -for (var value of buf.values()) { - console.log(value); -} -// prints: -// 98 -// 117 -// 102 -// 102 -// 101 -// 114 - -for (var value of buf) { - console.log(value); -} -// prints: -// 98 -// 117 -// 102 -// 102 -// 101 -// 114 -``` - -### buf.write(string[, offset[, length]][, encoding]) - -* `string` {String} Bytes to be written to buffer -* `offset` {Number} Default: 0 -* `length` {Number} Default: `buffer.length - offset` -* `encoding` {String} Default: `'utf8'` -* Return: {Number} Numbers of bytes written - -Writes `string` to the Buffer at `offset` using the given `encoding`. -The `length` parameter is the number of bytes to write. If the Buffer did not -contain enough space to fit the entire string, only a partial amount of the -string will be written however, it will not write only partially encoded -characters. - -```js -const buf = Buffer.allocUnsafe(256); -const len = buf.write('\u00bd + \u00bc = \u00be', 0); -console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - // Prints: 12 bytes: ½ + ¼ = ¾ -``` - -### buf.writeDoubleBE(value, offset[, noAssert]) -### buf.writeDoubleLE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 8` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little -endian). The `value` argument *should* be a valid 64-bit double. Behavior is -not defined when `value` is anything other than a 64-bit double. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Example: - -```js -const buf = Buffer.allocUnsafe(8); -buf.writeDoubleBE(0xdeadbeefcafebabe, 0); - -console.log(buf); - // Prints: - -buf.writeDoubleLE(0xdeadbeefcafebabe, 0); - -console.log(buf); - // Prints: -``` - -### buf.writeFloatBE(value, offset[, noAssert]) -### buf.writeFloatLE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little -endian). Behavior is not defined when `value` is anything other than a 32-bit -float. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Example: - -```js -const buf = Buffer.allocUnsafe(4); -buf.writeFloatBE(0xcafebabe, 0); - -console.log(buf); - // Prints: - -buf.writeFloatLE(0xcafebabe, 0); - -console.log(buf); - // Prints: -``` - -### buf.writeInt8(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 1` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset`. The `value` should be a -valid signed 8-bit integer. Behavior is not defined when `value` is anything -other than a signed 8-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -The `value` is interpreted and written as a two's complement signed integer. - -```js -const buf = Buffer.allocUnsafe(2); -buf.writeInt8(2, 0); -buf.writeInt8(-2, 1); -console.log(buf); - // Prints: -``` - -### buf.writeInt16BE(value, offset[, noAssert]) -### buf.writeInt16LE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 2` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little -endian). The `value` should be a valid signed 16-bit integer. Behavior is -not defined when `value` is anything other than a signed 16-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -The `value` is interpreted and written as a two's complement signed integer. - -```js -const buf = Buffer.allocUnsafe(4); -buf.writeInt16BE(0x0102,0); -buf.writeInt16LE(0x0304,2); -console.log(buf); - // Prints: -``` - -### buf.writeInt32BE(value, offset[, noAssert]) -### buf.writeInt32LE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little -endian). The `value` should be a valid signed 32-bit integer. Behavior is -not defined when `value` is anything other than a signed 32-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -The `value` is interpreted and written as a two's complement signed integer. - -```js -const buf = Buffer.allocUnsafe(8); -buf.writeInt32BE(0x01020304,0); -buf.writeInt32LE(0x05060708,4); -console.log(buf); - // Prints: -``` - -### buf.writeIntBE(value, offset, byteLength[, noAssert]) -### buf.writeIntLE(value, offset, byteLength[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - byteLength` -* `byteLength` {Number} `0 < byteLength <= 6` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` and `byteLength`. -Supports up to 48 bits of accuracy. For example: - -```js -const buf1 = Buffer.allocUnsafe(6); -buf1.writeUIntBE(0x1234567890ab, 0, 6); -console.log(buf1); - // Prints: - -const buf2 = Buffer.allocUnsafe(6); -buf2.writeUIntLE(0x1234567890ab, 0, 6); -console.log(buf2); - // Prints: -``` - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Behavior is not defined when `value` is anything other than an integer. - -### buf.writeUInt8(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 1` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset`. The `value` should be a -valid unsigned 8-bit integer. Behavior is not defined when `value` is anything -other than an unsigned 8-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Example: - -```js -const buf = Buffer.allocUnsafe(4); -buf.writeUInt8(0x3, 0); -buf.writeUInt8(0x4, 1); -buf.writeUInt8(0x23, 2); -buf.writeUInt8(0x42, 3); - -console.log(buf); - // Prints: -``` - -### buf.writeUInt16BE(value, offset[, noAssert]) -### buf.writeUInt16LE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 2` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little -endian). The `value` should be a valid unsigned 16-bit integer. Behavior is -not defined when `value` is anything other than an unsigned 16-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Example: - -```js -const buf = Buffer.allocUnsafe(4); -buf.writeUInt16BE(0xdead, 0); -buf.writeUInt16BE(0xbeef, 2); - -console.log(buf); - // Prints: - -buf.writeUInt16LE(0xdead, 0); -buf.writeUInt16LE(0xbeef, 2); - -console.log(buf); - // Prints: -``` - -### buf.writeUInt32BE(value, offset[, noAssert]) -### buf.writeUInt32LE(value, offset[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - 4` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` with specified endian -format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little -endian). The `value` should be a valid unsigned 32-bit integer. Behavior is -not defined when `value` is anything other than an unsigned 32-bit integer. - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Example: - -```js -const buf = Buffer.allocUnsafe(4); -buf.writeUInt32BE(0xfeedface, 0); - -console.log(buf); - // Prints: - -buf.writeUInt32LE(0xfeedface, 0); - -console.log(buf); - // Prints: -``` - -### buf.writeUIntBE(value, offset, byteLength[, noAssert]) -### buf.writeUIntLE(value, offset, byteLength[, noAssert]) - -* `value` {Number} Bytes to be written to Buffer -* `offset` {Number} `0 <= offset <= buf.length - byteLength` -* `byteLength` {Number} `0 < byteLength <= 6` -* `noAssert` {Boolean} Default: false -* Return: {Number} The offset plus the number of written bytes - -Writes `value` to the Buffer at the specified `offset` and `byteLength`. -Supports up to 48 bits of accuracy. For example: - -```js -const buf = Buffer.allocUnsafe(6); -buf.writeUIntBE(0x1234567890ab, 0, 6); -console.log(buf); - // Prints: -``` - -Set `noAssert` to true to skip validation of `value` and `offset`. This means -that `value` may be too large for the specific function and `offset` may be -beyond the end of the Buffer leading to the values being silently dropped. This -should not be used unless you are certain of correctness. - -Behavior is not defined when `value` is anything other than an unsigned integer. - -## buffer.INSPECT_MAX_BYTES - -* {Number} Default: 50 - -Returns the maximum number of bytes that will be returned when -`buffer.inspect()` is called. This can be overridden by user modules. See -[`util.inspect()`][] for more details on `buffer.inspect()` behavior. - -Note that this is a property on the `buffer` module as returned by -`require('buffer')`, not on the Buffer global or a Buffer instance. - -## Class: SlowBuffer - -Returns an un-pooled `Buffer`. - -In order to avoid the garbage collection overhead of creating many individually -allocated Buffers, by default allocations under 4KB are sliced from a single -larger allocated object. This approach improves both performance and memory -usage since v8 does not need to track and cleanup as many `Persistent` objects. - -In the case where a developer may need to retain a small chunk of memory from a -pool for an indeterminate amount of time, it may be appropriate to create an -un-pooled Buffer instance using `SlowBuffer` then copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - var data = socket.read(); - // allocate for retained data - var sb = SlowBuffer(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `SlowBuffer` should be used only as a last resort *after* a developer -has observed undue memory retention in their applications. - -### new SlowBuffer(size) - -* `size` Number - -Allocates a new `SlowBuffer` of `size` bytes. The `size` must be less than -or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. If a `size` less than 0 is specified, a zero-length `SlowBuffer` will be -created. - -The underlying memory for `SlowBuffer` instances is *not initialized*. The -contents of a newly created `SlowBuffer` are unknown and could contain -sensitive data. Use [`buf.fill(0)`][] to initialize a `SlowBuffer` to zeroes. - -```js -const SlowBuffer = require('buffer').SlowBuffer; -const buf = new SlowBuffer(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols -[`Array#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf -[`Array#includes()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes -[`buf.entries()`]: #buffer_buf_entries -[`buf.fill(0)`]: #buffer_buf_fill_value_offset_end -[`buf.keys()`]: #buffer_buf_keys -[`buf.slice()`]: #buffer_buf_slice_start_end -[`buf.values()`]: #buffer_buf_values -[`buf1.compare(buf2)`]: #buffer_buf_compare_otherbuffer -[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify -[`RangeError`]: errors.html#errors_class_rangeerror -[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length -[`util.inspect()`]: util.html#util_util_inspect_object_options -[RFC 4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5 -[buffer_from_array]: #buffer_class_method_buffer_from_array -[buffer_from_buffer]: #buffer_class_method_buffer_from_buffer -[buffer_from_arraybuf]: #buffer_class_method_buffer_from_arraybuffer -[buffer_from_string]: #buffer_class_method_buffer_from_str_encoding -[buffer_allocunsafe]: #buffer_class_method_buffer_allocraw_size -[buffer_alloc]: #buffer_class_method_buffer_alloc_size_fill_encoding -[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from -[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView -[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray diff --git a/doc/api/buffer.md b/doc/api/buffer.md new file mode 100644 index 00000000000000..f20f80c747da77 --- /dev/null +++ b/doc/api/buffer.md @@ -0,0 +1,2009 @@ +# Buffer + + Stability: 2 - Stable + +Prior to the introduction of `TypedArray` in ECMAScript 2015 (ES6), the +JavaScript language had no mechanism for reading or manipulating streams +of binary data. The `Buffer` class was introduced as part of the Node.js +API to make it possible to interact with octet streams in the context of things +like TCP streams and file system operations. + +Now that `TypedArray` has been added in ES6, the `Buffer` class implements the +`Uint8Array` API in a manner that is more optimized and suitable for Node.js' +use cases. + +Instances of the `Buffer` class are similar to arrays of integers but +correspond to fixed-sized, raw memory allocations outside the V8 heap. +The size of the `Buffer` is established when it is created and cannot be +resized. + +The `Buffer` class is a global within Node.js, making it unlikely that one +would need to ever use `require('buffer').Buffer`. + +```js +const buf1 = Buffer.alloc(10); + // Creates a zero-filled Buffer of length 10. + +const buf2 = Buffer.alloc(10, 1); + // Creates a Buffer of length 10, filled with 0x01. + +const buf3 = Buffer.allocUnsafe(10); + // Creates an uninitialized buffer of length 10. + // This is faster than calling Buffer.alloc() but the returned + // Buffer instance might contain old data that needs to be + // overwritten using either fill() or write(). + +const buf4 = Buffer.from([1,2,3]); + // Creates a Buffer containing [01, 02, 03]. + +const buf5 = Buffer.from('test'); + // Creates a Buffer containing ASCII bytes [74, 65, 73, 74]. + +const buf6 = Buffer.from('tést', 'utf8'); + // Creates a Buffer containing UTF8 bytes [74, c3, a9, 73, 74]. +``` + +## `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` + +In versions of Node.js prior to v6, `Buffer` instances were created using the +`Buffer` constructor function, which allocates the returned `Buffer` +differently based on what arguments are provided: + +* Passing a number as the first argument to `Buffer()` (e.g. `new Buffer(10)`), + allocates a new `Buffer` object of the specified size. The memory allocated + for such `Buffer` instances is *not* initialized and *can contain sensitive + data*. Such `Buffer` objects *must* be initialized *manually* by using either + [`buf.fill(0)`][] or by writing to the `Buffer` completely. While this + behavior is *intentional* to improve performance, development experience has + demonstrated that a more explicit distinction is required between creating a + fast-but-uninitialized `Buffer` versus creating a slower-but-safer `Buffer`. +* Passing a string, array, or `Buffer` as the first argument copies the + passed object's data into the `Buffer`. +* Passing an `ArrayBuffer` returns a `Buffer` that shares allocated memory with + the given `ArrayBuffer`. + +Because the behavior of `new Buffer()` changes significantly based on the type +of value passed as the first argument, applications that do not properly +validate the input arguments passed to `new Buffer()`, or that fail to +appropriately initialize newly allocated `Buffer` content, can inadvertently +introduce security and reliability issues into their code. + +To make the creation of `Buffer` objects more reliable and less error prone, +the various forms of the `new Buffer()` constructor have been **deprecated** +and replaced by separate `Buffer.from()`, `Buffer.alloc()`, and +`Buffer.allocUnsafe()` methods. + +*Developers should migrate all existing uses of the `new Buffer()` constructors +to one of these new APIs.* + +* [`Buffer.from(array)`][buffer_from_array] returns a new `Buffer` containing + a *copy* of the provided octets. +* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] + returns a new `Buffer` that *shares* the same allocated memory as the given + `ArrayBuffer`. +* [`Buffer.from(buffer)`][buffer_from_buffer] returns a new `Buffer` + containing a *copy* of the contents of the given `Buffer`. +* [`Buffer.from(str[, encoding])`][buffer_from_string] returns a new `Buffer` + containing a *copy* of the provided string. +* [`Buffer.alloc(size[, fill[, encoding]])`][buffer_alloc] returns a "filled" + `Buffer` instance of the specified size. This method can be significantly + slower than [`Buffer.allocUnsafe(size)`][buffer_allocunsafe] but ensures + that newly created `Buffer` instances never contain old and potentially + sensitive data. +* [`Buffer.allocUnsafe(size)`][buffer_allocunsafe] and + [`Buffer.allocUnsafeSlow(size)`][buffer_allocunsafeslow] each return a + new `Buffer` of the specified `size` whose content *must* be initialized + using either [`buf.fill(0)`][] or written to completely. + +`Buffer` instances returned by `Buffer.allocUnsafe(size)` *may* be allocated +off a shared internal memory pool if `size` is less than or equal to half +`Buffer.poolSize`. Instances returned by `Buffer.allocUnsafeSlow(size)` *never* +use the shared internal memory pool. + +### The `--zero-fill-buffers` command line option + + +Node.js can be started using the `--zero-fill-buffers` command line option to +force all newly allocated `Buffer` instances created using either +`new Buffer(size)`, `Buffer.allocUnsafe(size)`, `Buffer.allocUnsafeSlow(size)` +or `new SlowBuffer(size)` to be *automatically zero-filled* upon creation. Use +of this flag *changes the default behavior* of these methods and *can have a +significant impact* on performance. Use of the `--zero-fill-buffers` option is +recommended only when absolutely necessary to enforce that newly allocated +`Buffer` instances cannot contain potentially sensitive data. + +``` +$ node --zero-fill-buffers +> Buffer.allocUnsafe(5); + +``` + +### What makes `Buffer.allocUnsafe(size)` and `Buffer.allocUnsafeSlow(size)` "unsafe"? + +When calling `Buffer.allocUnsafe()` (and `Buffer.allocUnsafeSlow()`), the +segment of allocated memory is *uninitialized* (it is not zeroed-out). While +this design makes the allocation of memory quite fast, the allocated segment of +memory might contain old data that is potentially sensitive. Using a `Buffer` +created by `Buffer.allocUnsafe()` without *completely* overwriting the memory +can allow this old data to be leaked when the `Buffer` memory is read. + +While there are clear performance advantages to using `Buffer.allocUnsafe()`, +extra care *must* be taken in order to avoid introducing security +vulnerabilities into an application. + +## Buffers and Character Encodings + +Buffers are commonly used to represent sequences of encoded characters +such as UTF8, UCS2, Base64 or even Hex-encoded data. It is possible to +convert back and forth between Buffers and ordinary JavaScript string objects +by using an explicit encoding method. + +```js +const buf = Buffer.from('hello world', 'ascii'); +console.log(buf.toString('hex')); + // prints: 68656c6c6f20776f726c64 +console.log(buf.toString('base64')); + // prints: aGVsbG8gd29ybGQ= +``` + +The character encodings currently supported by Node.js include: + +* `'ascii'` - for 7-bit ASCII data only. This encoding method is very fast and + will strip the high bit if set. + +* `'utf8'` - Multibyte encoded Unicode characters. Many web pages and other + document formats use UTF-8. + +* `'utf16le'` - 2 or 4 bytes, little-endian encoded Unicode characters. + Surrogate pairs (U+10000 to U+10FFFF) are supported. + +* `'ucs2'` - Alias of `'utf16le'`. + +* `'base64'` - Base64 string encoding. When creating a buffer from a string, + this encoding will also correctly accept "URL and Filename Safe Alphabet" as + specified in [RFC 4648, Section 5]. + +* `'binary'` - A way of encoding the buffer into a one-byte (`latin-1`) + encoded string. The string `'latin-1'` is not supported. Instead, pass + `'binary'` to use `'latin-1'` encoding. + +* `'hex'` - Encode each byte as two hexadecimal characters. + +## Buffers and TypedArray + +Buffers are also `Uint8Array` TypedArray instances. However, there are subtle +incompatibilities with the TypedArray specification in ECMAScript 2015. For +instance, while `ArrayBuffer#slice()` creates a copy of the slice, +the implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the +existing Buffer without copying, making `Buffer#slice()` far more efficient. + +It is also possible to create new TypedArray instances from a `Buffer` with the +following caveats: + +1. The `Buffer` object's memory is copied to the TypedArray, not shared. + +2. The `Buffer` object's memory is interpreted as an array of distinct +elements, and not as a byte array of the target type. That is, +`new Uint32Array(Buffer.from([1,2,3,4]))` creates a 4-element `Uint32Array` + with elements `[1,2,3,4]`, not a `Uint32Array` with a single element + `[0x1020304]` or `[0x4030201]`. + +It is possible to create a new `Buffer` that shares the same allocated memory as +a TypedArray instance by using the TypeArray object's `.buffer` property: + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf1 = Buffer.from(arr); // copies the buffer +const buf2 = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf1); + // Prints: , copied buffer has only two elements +console.log(buf2); + // Prints: + +arr[1] = 6000; +console.log(buf1); + // Prints: +console.log(buf2); + // Prints: +``` + +Note that when creating a `Buffer` using the TypedArray's `.buffer`, it is +possible to use only a portion of the underlying `ArrayBuffer` by passing in +`byteOffset` and `length` parameters: + +```js +const arr = new Uint16Array(20); +const buf = Buffer.from(arr.buffer, 0, 16); +console.log(buf.length); + // Prints: 16 +``` + +The `Buffer.from()` and [`TypedArray.from()`][] (e.g.`Uint8Array.from()`) have +different signatures and implementations. Specifically, the TypedArray variants +accept a second argument that is a mapping function that is invoked on every +element of the typed array: + +* `TypedArray.from(source[, mapFn[, thisArg]])` + +The `Buffer.from()` method, however, does not support the use of a mapping +function: + +* [`Buffer.from(array)`][buffer_from_array] +* [`Buffer.from(buffer)`][buffer_from_buffer] +* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] +* [`Buffer.from(str[, encoding])`][buffer_from_string] + +## Buffers and ES6 iteration + +Buffers can be iterated over using the ECMAScript 2015 (ES6) `for..of` syntax: + +```js +const buf = Buffer.from([1, 2, 3]); + +for (var b of buf) + console.log(b) + +// Prints: +// 1 +// 2 +// 3 +``` + +Additionally, the [`buf.values()`][], [`buf.keys()`][], and +[`buf.entries()`][] methods can be used to create iterators. + +## Class: Buffer + +The Buffer class is a global type for dealing with binary data directly. +It can be constructed in a variety of ways. + +### new Buffer(array) + + + Stability: 0 - Deprecated: Use [`Buffer.from(array)`][buffer_from_array] + instead. + +* `array` {Array} + +Allocates a new Buffer using an `array` of octets. + +```js +const buf = new Buffer([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +### new Buffer(buffer) + + + Stability: 0 - Deprecated: Use [`Buffer.from(buffer)`][buffer_from_buffer] + instead. + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = new Buffer('buffer'); +const buf2 = new Buffer(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +### new Buffer(arrayBuffer[, byteOffset [, length]]) + + + Stability: 0 - Deprecated: Use + [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][buffer_from_arraybuf] + instead. + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or a + `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created Buffer will share the same allocated memory as the +TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = new Buffer(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypdArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +### new Buffer(size) + + + Stability: 0 - Deprecated: Use + [`Buffer.alloc(size[, fill[, encoding]])`][buffer_alloc] instead (also + see [`Buffer.allocUnsafe(size)`][buffer_allocunsafe]). + +* `size` {Number} + +Allocates a new `Buffer` of `size` bytes. The `size` must be less than +or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +Unlike `ArrayBuffers`, the underlying memory for `Buffer` instances created in +this way is *not initialized*. The contents of a newly created `Buffer` are +unknown and *could contain sensitive data*. Use [`buf.fill(0)`][] to initialize +a `Buffer` to zeroes. + +```js +const buf = new Buffer(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +### new Buffer(str[, encoding]) + + + Stability: 0 - Deprecated: + Use [`Buffer.from(str[, encoding])`][buffer_from_string] instead. + +* `str` {String} string to encode. +* `encoding` {String} Default: `'utf8'` + +Creates a new Buffer containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the strings character encoding. + +```js +const buf1 = new Buffer('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = new Buffer('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.byteLength(string[, encoding]) + +* `string` {String | Buffer | TypedArray | DataView | ArrayBuffer} +* `encoding` {String} Default: `'utf8'` +* Return: {Number} + +Returns the actual byte length of a string. This is not the same as +[`String.prototype.length`][] since that returns the number of *characters* in +a string. + +Example: + +```js +const str = '\u00bd + \u00bc = \u00be'; + +console.log(`${str}: ${str.length} characters, ` + + `${Buffer.byteLength(str, 'utf8')} bytes`); + +// ½ + ¼ = ¾: 9 characters, 12 bytes +``` + +When `string` is a `Buffer`/[`DataView`][]/[`TypedArray`][]/`ArrayBuffer`, +returns the actual byte length. + +Otherwise, converts to `String` and returns the byte length of string. + +### Class Method: Buffer.compare(buf1, buf2) + + +* `buf1` {Buffer} +* `buf2` {Buffer} +* Return: {Number} + +Compares `buf1` to `buf2` typically for the purpose of sorting arrays of +Buffers. This is equivalent is calling [`buf1.compare(buf2)`][]. + +```js +const arr = [Buffer.from('1234'), Buffer.from('0123')]; +arr.sort(Buffer.compare); +``` + +### Class Method: Buffer.concat(list[, totalLength]) + + +* `list` {Array} List of Buffer objects to concat +* `totalLength` {Number} Total length of the Buffers in the list + when concatenated +* Return: {Buffer} + +Returns a new Buffer which is the result of concatenating all the Buffers in +the `list` together. + +If the list has no items, or if the `totalLength` is 0, then a new zero-length +Buffer is returned. + +If `totalLength` is not provided, it is calculated from the Buffers in the +`list`. This, however, adds an additional loop to the function, so it is faster +to provide the length explicitly. + +Example: build a single Buffer from a list of three Buffers: + +```js +const buf1 = Buffer.alloc(10); +const buf2 = Buffer.alloc(14); +const buf3 = Buffer.alloc(18); +const totalLength = buf1.length + buf2.length + buf3.length; + +console.log(totalLength); +const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); +console.log(bufA); +console.log(bufA.length); + +// 42 +// +// 42 +``` + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.isBuffer(obj) + +* `obj` {Object} +* Return: {Boolean} + +Returns 'true' if `obj` is a Buffer. + +### Class Method: Buffer.isEncoding(encoding) + + +* `encoding` {String} The encoding string to test +* Return: {Boolean} + +Returns true if the `encoding` is a valid encoding argument, or false +otherwise. + +### buf[index] + + +The index operator `[index]` can be used to get and set the octet at position +`index` in the Buffer. The values refer to individual bytes, so the legal value +range is between `0x00` and `0xFF` (hex) or `0` and `255` (decimal). + +Example: copy an ASCII string into a Buffer, one byte at a time: + +```js +const str = "Node.js"; +const buf = Buffer.allocUnsafe(str.length); + +for (let i = 0; i < str.length ; i++) { + buf[i] = str.charCodeAt(i); +} + +console.log(buf.toString('ascii')); + // Prints: Node.js +``` + +### buf.compare(target[, targetStart[, targetEnd[, sourceStart[, sourceEnd]]]]) + + +* `target` {Buffer} +* `targetStart` {Integer} The offset within `target` at which to begin + comparison. default = `0`. +* `targetEnd` {Integer} The offset with `target` at which to end comparison. + Ignored when `targetStart` is `undefined`. default = `target.byteLength`. +* `sourceStart` {Integer} The offset within `buf` at which to begin comparison. + Ignored when `targetStart` is `undefined`. default = `0` +* `sourceEnd` {Integer} The offset within `buf` at which to end comparison. + Ignored when `targetStart` is `undefined`. default = `buf.byteLength`. +* Return: {Number} + +Compares two Buffer instances and returns a number indicating whether `buf` +comes before, after, or is the same as the `target` in sort order. +Comparison is based on the actual sequence of bytes in each Buffer. + +* `0` is returned if `target` is the same as `buf` +* `1` is returned if `target` should come *before* `buf` when sorted. +* `-1` is returned if `target` should come *after* `buf` when sorted. + +```js +const buf1 = Buffer.from('ABC'); +const buf2 = Buffer.from('BCD'); +const buf3 = Buffer.from('ABCD'); + +console.log(buf1.compare(buf1)); + // Prints: 0 +console.log(buf1.compare(buf2)); + // Prints: -1 +console.log(buf1.compare(buf3)); + // Prints: 1 +console.log(buf2.compare(buf1)); + // Prints: 1 +console.log(buf2.compare(buf3)); + // Prints: 1 + +[buf1, buf2, buf3].sort(Buffer.compare); + // produces sort order [buf1, buf3, buf2] +``` + +The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` +arguments can be used to limit the comparison to specific ranges within the two +`Buffer` objects. + +```js +const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); +const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + +console.log(buf1.compare(buf2, 5, 9, 0, 4)); + // Prints: 0 +console.log(buf1.compare(buf2, 0, 6, 4)); + // Prints: -1 +console.log(buf1.compare(buf2, 5, 6, 5)); + // Prints: 1 +``` + +A `RangeError` will be thrown if: `targetStart < 0`, `sourceStart < 0`, +`targetEnd > target.byteLength` or `sourceEnd > source.byteLength`. + +### buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]]) + +* `targetBuffer` {Buffer} Buffer to copy into +* `targetStart` {Number} Default: 0 +* `sourceStart` {Number} Default: 0 +* `sourceEnd` {Number} Default: `buffer.length` +* Return: {Number} The number of bytes copied. + +Copies data from a region of this Buffer to a region in the target Buffer even +if the target memory region overlaps with the source. + +Example: build two Buffers, then copy `buf1` from byte 16 through byte 19 +into `buf2`, starting at the 8th byte in `buf2`. + +```js +const buf1 = Buffer.allocUnsafe(26); +const buf2 = Buffer.allocUnsafe(26).fill('!'); + +for (let i = 0 ; i < 26 ; i++) { + buf1[i] = i + 97; // 97 is ASCII a +} + +buf1.copy(buf2, 8, 16, 20); +console.log(buf2.toString('ascii', 0, 25)); + // Prints: !!!!!!!!qrst!!!!!!!!!!!!! +``` + +Example: Build a single Buffer, then copy data from one region to an overlapping +region in the same Buffer + +```js +const buf = Buffer.allocUnsafe(26); + +for (var i = 0 ; i < 26 ; i++) { + buf[i] = i + 97; // 97 is ASCII a +} + +buf.copy(buf, 0, 4, 10); +console.log(buf.toString()); + +// efghijghijklmnopqrstuvwxyz +``` + +### buf.entries() + + +* Return: {Iterator} + +Creates and returns an [iterator][] of `[index, byte]` pairs from the Buffer +contents. + +```js +const buf = Buffer.from('buffer'); +for (var pair of buf.entries()) { + console.log(pair); +} +// prints: +// [0, 98] +// [1, 117] +// [2, 102] +// [3, 102] +// [4, 101] +// [5, 114] +``` + +### buf.equals(otherBuffer) + + +* `otherBuffer` {Buffer} +* Return: {Boolean} + +Returns a boolean indicating whether `this` and `otherBuffer` have exactly the +same bytes. + +```js +const buf1 = Buffer.from('ABC'); +const buf2 = Buffer.from('414243', 'hex'); +const buf3 = Buffer.from('ABCD'); + +console.log(buf1.equals(buf2)); + // Prints: true +console.log(buf1.equals(buf3)); + // Prints: false +``` + +### buf.fill(value[, offset[, end]][, encoding]) + + +* `value` {String|Buffer|Number} +* `offset` {Number} Default: 0 +* `end` {Number} Default: `buf.length` +* `encoding` {String} Default: `'utf8'` +* Return: {Buffer} + +Fills the Buffer with the specified value. If the `offset` (defaults to `0`) +and `end` (defaults to `buf.length`) are not given the entire buffer will be +filled. The method returns a reference to the Buffer, so calls can be chained. +This is meant as a small simplification to creating a Buffer. Allowing the +creation and fill of the Buffer to be done on a single line: + +```js +const b = Buffer.allocUnsafe(50).fill('h'); +console.log(b.toString()); + // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh +``` + +`encoding` is only relevant if `value` is a string. Otherwise it is ignored. +`value` is coerced to a `uint32` value if it is not a String or Number. + +The `fill()` operation writes bytes into the Buffer dumbly. If the final write +falls in between a multi-byte character then whatever bytes fit into the buffer +are written. + +```js +Buffer(3).fill('\u0222'); + // Prints: +``` + +### buf.indexOf(value[, byteOffset][, encoding]) + + +* `value` {String|Buffer|Number} +* `byteOffset` {Number} Default: 0 +* `encoding` {String} Default: `'utf8'` +* Return: {Number} + +Operates similar to [`Array#indexOf()`][] in that it returns either the +starting index position of `value` in Buffer or `-1` if the Buffer does not +contain `value`. The `value` can be a String, Buffer or Number. Strings are by +default interpreted as UTF8. Buffers will use the entire Buffer (to compare a +partial Buffer use [`buf.slice()`][]). Numbers can range from 0 to 255. + +```js +const buf = Buffer.from('this is a buffer'); + +buf.indexOf('this'); + // returns 0 +buf.indexOf('is'); + // returns 2 +buf.indexOf(Buffer.from('a buffer')); + // returns 8 +buf.indexOf(97); // ascii for 'a' + // returns 8 +buf.indexOf(Buffer.from('a buffer example')); + // returns -1 +buf.indexOf(Buffer.from('a buffer example').slice(0,8)); + // returns 8 + +const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); + +utf16Buffer.indexOf('\u03a3', 0, 'ucs2'); + // returns 4 +utf16Buffer.indexOf('\u03a3', -4, 'ucs2'); + // returns 6 +``` + +### buf.includes(value[, byteOffset][, encoding]) + + +* `value` {String|Buffer|Number} +* `byteOffset` {Number} Default: 0 +* `encoding` {String} Default: `'utf8'` +* Return: {Boolean} + +Operates similar to [`Array#includes()`][]. The `value` can be a String, Buffer +or Number. Strings are interpreted as UTF8 unless overridden with the +`encoding` argument. Buffers will use the entire Buffer (to compare a partial +Buffer use [`buf.slice()`][]). Numbers can range from 0 to 255. + +The `byteOffset` indicates the index in `buf` where searching begins. + +```js +const buf = Buffer.from('this is a buffer'); + +buf.includes('this'); + // returns true +buf.includes('is'); + // returns true +buf.includes(Buffer.from('a buffer')); + // returns true +buf.includes(97); // ascii for 'a' + // returns true +buf.includes(Buffer.from('a buffer example')); + // returns false +buf.includes(Buffer.from('a buffer example').slice(0,8)); + // returns true +buf.includes('this', 4); + // returns false +``` + +### buf.keys() + + +* Return: {Iterator} + +Creates and returns an [iterator][] of Buffer keys (indices). + +```js +const buf = Buffer.from('buffer'); +for (var key of buf.keys()) { + console.log(key); +} +// prints: +// 0 +// 1 +// 2 +// 3 +// 4 +// 5 +``` + +### buf.lastIndexOf(value[, byteOffset][, encoding]) + + +* `value` {String|Buffer|Number} +* `byteOffset` {Number} Default: `buf.length` +* `encoding` {String} Default: `'utf8'` +* Return: {Number} + +Identical to [`Buffer#indexOf()`][], but searches the Buffer from back to front +instead of front to back. Returns the starting index position of `value` in +Buffer or `-1` if the Buffer does not contain `value`. The `value` can be a +String, Buffer or Number. Strings are by default interpreted as UTF8. If +`byteOffset` is provided, will return the last match that begins at or before +`byteOffset`. + +```js +const buf = new Buffer('this buffer is a buffer'); + +buf.lastIndexOf('this'); + // returns 0 +buf.lastIndexOf('buffer'); + // returns 17 +buf.lastIndexOf(new Buffer('buffer')); + // returns 17 +buf.lastIndexOf(97); // ascii for 'a' + // returns 15 +buf.lastIndexOf(new Buffer('yolo')); + // returns -1 +buf.lastIndexOf('buffer', 5) + // returns 5 +buf.lastIndexOf('buffer', 4) + // returns -1 + +const utf16Buffer = new Buffer('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); + +utf16Buffer.lastIndexOf('\u03a3', null, 'ucs2'); + // returns 6 +utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'); + // returns 4 +``` + +### buf.length + +* {Number} + +Returns the amount of memory allocated for the Buffer in number of bytes. Note +that this does not necessarily reflect the amount of usable data within the +Buffer. For instance, in the example below, a Buffer with 1234 bytes is +allocated, but only 11 ASCII bytes are written. + +```js +const buf = Buffer.alloc(1234); + +console.log(buf.length); + // Prints: 1234 + +buf.write('some string', 0, 'ascii'); +console.log(buf.length); + // Prints: 1234 +``` + +While the `length` property is not immutable, changing the value of `length` +can result in undefined and inconsistent behavior. Applications that wish to +modify the length of a Buffer should therefore treat `length` as read-only and +use [`buf.slice()`][] to create a new Buffer. + +```js +var buf = Buffer.allocUnsafe(10); +buf.write('abcdefghj', 0, 'ascii'); +console.log(buf.length); + // Prints: 10 +buf = buf.slice(0,5); +console.log(buf.length); + // Prints: 5 +``` + +### buf.readDoubleBE(offset[, noAssert]) +### buf.readDoubleLE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 8` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads a 64-bit double from the Buffer at the specified `offset` with specified +endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns +little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +```js +const buf = Buffer.from([1,2,3,4,5,6,7,8]); + +buf.readDoubleBE(); + // Returns: 8.20788039913184e-304 +buf.readDoubleLE(); + // Returns: 5.447603722011605e-270 +buf.readDoubleLE(1); + // throws RangeError: Index out of range + +buf.readDoubleLE(1, true); // Warning: reads passed end of buffer! + // Segmentation fault! don't do this! +``` + +### buf.readFloatBE(offset[, noAssert]) +### buf.readFloatLE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads a 32-bit float from the Buffer at the specified `offset` with specified +endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns +little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +```js +const buf = Buffer.from([1,2,3,4]); + +buf.readFloatBE(); + // Returns: 2.387939260590663e-38 +buf.readFloatLE(); + // Returns: 1.539989614439558e-36 +buf.readFloatLE(1); + // throws RangeError: Index out of range + +buf.readFloatLE(1, true); // Warning: reads passed end of buffer! + // Segmentation fault! don't do this! +``` + +### buf.readInt8(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 1` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads a signed 8-bit integer from the Buffer at the specified `offset`. + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +Integers read from the Buffer are interpreted as two's complement signed values. + +```js +const buf = Buffer.from([1,-2,3,4]); + +buf.readInt8(0); + // returns 1 +buf.readInt8(1); + // returns -2 +``` + +### buf.readInt16BE(offset[, noAssert]) +### buf.readInt16LE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 2` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads a signed 16-bit integer from the Buffer at the specified `offset` with +the specified endian format (`readInt16BE()` returns big endian, +`readInt16LE()` returns little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +Integers read from the Buffer are interpreted as two's complement signed values. + +```js +const buf = Buffer.from([1,-2,3,4]); + +buf.readInt16BE(); + // returns 510 +buf.readInt16LE(1); + // returns 1022 +``` + +### buf.readInt32BE(offset[, noAssert]) +### buf.readInt32LE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads a signed 32-bit integer from the Buffer at the specified `offset` with +the specified endian format (`readInt32BE()` returns big endian, +`readInt32LE()` returns little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +Integers read from the Buffer are interpreted as two's complement signed values. + +```js +const buf = Buffer.from([1,-2,3,4]); + +buf.readInt32BE(); + // returns 33424132 +buf.readInt32LE(); + // returns 67370497 +buf.readInt32LE(1); + // throws RangeError: Index out of range +``` + +### buf.readIntBE(offset, byteLength[, noAssert]) +### buf.readIntLE(offset, byteLength[, noAssert]) + + +* `offset` {Number} `0 <= offset <= buf.length - byteLength` +* `byteLength` {Number} `0 < byteLength <= 6` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads `byteLength` number of bytes from the Buffer at the specified `offset` +and interprets the result as a two's complement signed value. Supports up to 48 +bits of accuracy. For example: + +```js +const buf = Buffer.allocUnsafe(6); +buf.writeUInt16LE(0x90ab, 0); +buf.writeUInt32LE(0x12345678, 2); +buf.readIntLE(0, 6).toString(16); // Specify 6 bytes (48 bits) +// Returns: '1234567890ab' + +buf.readIntBE(0, 6).toString(16); +// Returns: -546f87a9cbee +``` + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +### buf.readUInt8(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 1` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads an unsigned 8-bit integer from the Buffer at the specified `offset`. + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +```js +const buf = Buffer.from([1,-2,3,4]); + +buf.readUInt8(0); + // returns 1 +buf.readUInt8(1); + // returns 254 +``` + +### buf.readUInt16BE(offset[, noAssert]) +### buf.readUInt16LE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 2` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads an unsigned 16-bit integer from the Buffer at the specified `offset` with +specified endian format (`readUInt16BE()` returns big endian, +`readUInt16LE()` returns little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +Example: + +```js +const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]); + +buf.readUInt16BE(0); + // Returns: 0x0304 +buf.readUInt16LE(0); + // Returns: 0x0403 +buf.readUInt16BE(1); + // Returns: 0x0423 +buf.readUInt16LE(1); + // Returns: 0x2304 +buf.readUInt16BE(2); + // Returns: 0x2342 +buf.readUInt16LE(2); + // Returns: 0x4223 +``` + +### buf.readUInt32BE(offset[, noAssert]) +### buf.readUInt32LE(offset[, noAssert]) + +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads an unsigned 32-bit integer from the Buffer at the specified `offset` with +specified endian format (`readUInt32BE()` returns big endian, +`readUInt32LE()` returns little endian). + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +Example: + +```js +const buf = Buffer.from([0x3, 0x4, 0x23, 0x42]); + +buf.readUInt32BE(0); + // Returns: 0x03042342 +console.log(buf.readUInt32LE(0)); + // Returns: 0x42230403 +``` + +### buf.readUIntBE(offset, byteLength[, noAssert]) +### buf.readUIntLE(offset, byteLength[, noAssert]) + + +* `offset` {Number} `0 <= offset <= buf.length - byteLength` +* `byteLength` {Number} `0 < byteLength <= 6` +* `noAssert` {Boolean} Default: false +* Return: {Number} + +Reads `byteLength` number of bytes from the Buffer at the specified `offset` +and interprets the result as an unsigned integer. Supports up to 48 +bits of accuracy. For example: + +```js +const buf = Buffer.allocUnsafe(6); +buf.writeUInt16LE(0x90ab, 0); +buf.writeUInt32LE(0x12345678, 2); +buf.readUIntLE(0, 6).toString(16); // Specify 6 bytes (48 bits) +// Returns: '1234567890ab' + +buf.readUIntBE(0, 6).toString(16); +// Returns: ab9078563412 +``` + +Setting `noAssert` to `true` skips validation of the `offset`. This allows the +`offset` to be beyond the end of the Buffer. + +### buf.slice([start[, end]]) + +* `start` {Number} Default: 0 +* `end` {Number} Default: `buffer.length` +* Return: {Buffer} + +Returns a new Buffer that references the same memory as the original, but +offset and cropped by the `start` and `end` indices. + +**Note that modifying the new Buffer slice will modify the memory in the +original Buffer because the allocated memory of the two objects overlap.** + +Example: build a Buffer with the ASCII alphabet, take a slice, then modify one +byte from the original Buffer. + +```js +const buf1 = Buffer.allocUnsafe(26); + +for (var i = 0 ; i < 26 ; i++) { + buf1[i] = i + 97; // 97 is ASCII a +} + +const buf2 = buf1.slice(0, 3); +buf2.toString('ascii', 0, buf2.length); + // Returns: 'abc' +buf1[0] = 33; +buf2.toString('ascii', 0, buf2.length); + // Returns : '!bc' +``` + +Specifying negative indexes causes the slice to be generated relative to the +end of the Buffer rather than the beginning. + +```js +const buf = Buffer.from('buffer'); + +buf.slice(-6, -1).toString(); + // Returns 'buffe', equivalent to buf.slice(0, 5) +buf.slice(-6, -2).toString(); + // Returns 'buff', equivalent to buf.slice(0, 4) +buf.slice(-5, -2).toString(); + // Returns 'uff', equivalent to buf.slice(1, 4) +``` + +### buf.swap16() + + +* Return: {Buffer} + +Interprets the `Buffer` as an array of unsigned 16-bit integers and swaps +the byte-order *in-place*. Throws a `RangeError` if the `Buffer` length is +not a multiple of 16 bits. The method returns a reference to the Buffer, so +calls can be chained. + +```js +const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); +console.log(buf); + // Prints Buffer(0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8) +buf.swap16(); +console.log(buf); + // Prints Buffer(0x2, 0x1, 0x4, 0x3, 0x6, 0x5, 0x8, 0x7) +``` + +### buf.swap32() + + +* Return: {Buffer} + +Interprets the `Buffer` as an array of unsigned 32-bit integers and swaps +the byte-order *in-place*. Throws a `RangeError` if the `Buffer` length is +not a multiple of 32 bits. The method returns a reference to the Buffer, so +calls can be chained. + +```js +const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); +console.log(buf); + // Prints Buffer(0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8) +buf.swap32(); +console.log(buf); + // Prints Buffer(0x4, 0x3, 0x2, 0x1, 0x8, 0x7, 0x6, 0x5) +``` + +### buf.toString([encoding[, start[, end]]]) + +* `encoding` {String} Default: `'utf8'` +* `start` {Number} Default: 0 +* `end` {Number} Default: `buffer.length` +* Return: {String} + +Decodes and returns a string from the Buffer data using the specified +character set `encoding`. + +```js +const buf = Buffer.allocUnsafe(26); +for (var i = 0 ; i < 26 ; i++) { + buf[i] = i + 97; // 97 is ASCII a +} +buf.toString('ascii'); + // Returns: 'abcdefghijklmnopqrstuvwxyz' +buf.toString('ascii',0,5); + // Returns: 'abcde' +buf.toString('utf8',0,5); + // Returns: 'abcde' +buf.toString(undefined,0,5); + // Returns: 'abcde', encoding defaults to 'utf8' +``` + +### buf.toJSON() + + +* Return: {Object} + +Returns a JSON representation of the Buffer instance. [`JSON.stringify()`][] +implicitly calls this function when stringifying a Buffer instance. + +Example: + +```js +const buf = Buffer.from('test'); +const json = JSON.stringify(buf); + +console.log(json); +// Prints: '{"type":"Buffer","data":[116,101,115,116]}' + +const copy = JSON.parse(json, (key, value) => { + return value && value.type === 'Buffer' + ? Buffer.from(value.data) + : value; + }); + +console.log(copy.toString()); +// Prints: 'test' +``` + +### buf.values() + + +* Return: {Iterator} + +Creates and returns an [iterator][] for Buffer values (bytes). This function is +called automatically when the Buffer is used in a `for..of` statement. + +```js +const buf = Buffer.from('buffer'); +for (var value of buf.values()) { + console.log(value); +} +// prints: +// 98 +// 117 +// 102 +// 102 +// 101 +// 114 + +for (var value of buf) { + console.log(value); +} +// prints: +// 98 +// 117 +// 102 +// 102 +// 101 +// 114 +``` + +### buf.write(string[, offset[, length]][, encoding]) + +* `string` {String} Bytes to be written to buffer +* `offset` {Number} Default: 0 +* `length` {Number} Default: `buffer.length - offset` +* `encoding` {String} Default: `'utf8'` +* Return: {Number} Numbers of bytes written + +Writes `string` to the Buffer at `offset` using the given `encoding`. +The `length` parameter is the number of bytes to write. If the Buffer did not +contain enough space to fit the entire string, only a partial amount of the +string will be written however, it will not write only partially encoded +characters. + +```js +const buf = Buffer.allocUnsafe(256); +const len = buf.write('\u00bd + \u00bc = \u00be', 0); +console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + // Prints: 12 bytes: ½ + ¼ = ¾ +``` + +### buf.writeDoubleBE(value, offset[, noAssert]) +### buf.writeDoubleLE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 8` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little +endian). The `value` argument *should* be a valid 64-bit double. Behavior is +not defined when `value` is anything other than a 64-bit double. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Example: + +```js +const buf = Buffer.allocUnsafe(8); +buf.writeDoubleBE(0xdeadbeefcafebabe, 0); + +console.log(buf); + // Prints: + +buf.writeDoubleLE(0xdeadbeefcafebabe, 0); + +console.log(buf); + // Prints: +``` + +### buf.writeFloatBE(value, offset[, noAssert]) +### buf.writeFloatLE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little +endian). Behavior is not defined when `value` is anything other than a 32-bit +float. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Example: + +```js +const buf = Buffer.allocUnsafe(4); +buf.writeFloatBE(0xcafebabe, 0); + +console.log(buf); + // Prints: + +buf.writeFloatLE(0xcafebabe, 0); + +console.log(buf); + // Prints: +``` + +### buf.writeInt8(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 1` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset`. The `value` should be a +valid signed 8-bit integer. Behavior is not defined when `value` is anything +other than a signed 8-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +const buf = Buffer.allocUnsafe(2); +buf.writeInt8(2, 0); +buf.writeInt8(-2, 1); +console.log(buf); + // Prints: +``` + +### buf.writeInt16BE(value, offset[, noAssert]) +### buf.writeInt16LE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 2` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little +endian). The `value` should be a valid signed 16-bit integer. Behavior is +not defined when `value` is anything other than a signed 16-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +const buf = Buffer.allocUnsafe(4); +buf.writeInt16BE(0x0102,0); +buf.writeInt16LE(0x0304,2); +console.log(buf); + // Prints: +``` + +### buf.writeInt32BE(value, offset[, noAssert]) +### buf.writeInt32LE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little +endian). The `value` should be a valid signed 32-bit integer. Behavior is +not defined when `value` is anything other than a signed 32-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +const buf = Buffer.allocUnsafe(8); +buf.writeInt32BE(0x01020304,0); +buf.writeInt32LE(0x05060708,4); +console.log(buf); + // Prints: +``` + +### buf.writeIntBE(value, offset, byteLength[, noAssert]) +### buf.writeIntLE(value, offset, byteLength[, noAssert]) + + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - byteLength` +* `byteLength` {Number} `0 < byteLength <= 6` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` and `byteLength`. +Supports up to 48 bits of accuracy. For example: + +```js +const buf1 = Buffer.allocUnsafe(6); +buf1.writeUIntBE(0x1234567890ab, 0, 6); +console.log(buf1); + // Prints: + +const buf2 = Buffer.allocUnsafe(6); +buf2.writeUIntLE(0x1234567890ab, 0, 6); +console.log(buf2); + // Prints: +``` + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Behavior is not defined when `value` is anything other than an integer. + +### buf.writeUInt8(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 1` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset`. The `value` should be a +valid unsigned 8-bit integer. Behavior is not defined when `value` is anything +other than an unsigned 8-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Example: + +```js +const buf = Buffer.allocUnsafe(4); +buf.writeUInt8(0x3, 0); +buf.writeUInt8(0x4, 1); +buf.writeUInt8(0x23, 2); +buf.writeUInt8(0x42, 3); + +console.log(buf); + // Prints: +``` + +### buf.writeUInt16BE(value, offset[, noAssert]) +### buf.writeUInt16LE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 2` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little +endian). The `value` should be a valid unsigned 16-bit integer. Behavior is +not defined when `value` is anything other than an unsigned 16-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Example: + +```js +const buf = Buffer.allocUnsafe(4); +buf.writeUInt16BE(0xdead, 0); +buf.writeUInt16BE(0xbeef, 2); + +console.log(buf); + // Prints: + +buf.writeUInt16LE(0xdead, 0); +buf.writeUInt16LE(0xbeef, 2); + +console.log(buf); + // Prints: +``` + +### buf.writeUInt32BE(value, offset[, noAssert]) +### buf.writeUInt32LE(value, offset[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - 4` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` with specified endian +format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little +endian). The `value` should be a valid unsigned 32-bit integer. Behavior is +not defined when `value` is anything other than an unsigned 32-bit integer. + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Example: + +```js +const buf = Buffer.allocUnsafe(4); +buf.writeUInt32BE(0xfeedface, 0); + +console.log(buf); + // Prints: + +buf.writeUInt32LE(0xfeedface, 0); + +console.log(buf); + // Prints: +``` + +### buf.writeUIntBE(value, offset, byteLength[, noAssert]) +### buf.writeUIntLE(value, offset, byteLength[, noAssert]) + +* `value` {Number} Bytes to be written to Buffer +* `offset` {Number} `0 <= offset <= buf.length - byteLength` +* `byteLength` {Number} `0 < byteLength <= 6` +* `noAssert` {Boolean} Default: false +* Return: {Number} The offset plus the number of written bytes + +Writes `value` to the Buffer at the specified `offset` and `byteLength`. +Supports up to 48 bits of accuracy. For example: + +```js +const buf = Buffer.allocUnsafe(6); +buf.writeUIntBE(0x1234567890ab, 0, 6); +console.log(buf); + // Prints: +``` + +Set `noAssert` to true to skip validation of `value` and `offset`. This means +that `value` may be too large for the specific function and `offset` may be +beyond the end of the Buffer leading to the values being silently dropped. This +should not be used unless you are certain of correctness. + +Behavior is not defined when `value` is anything other than an unsigned integer. + +## buffer.INSPECT_MAX_BYTES + +* {Number} Default: 50 + +Returns the maximum number of bytes that will be returned when +`buffer.inspect()` is called. This can be overridden by user modules. See +[`util.inspect()`][] for more details on `buffer.inspect()` behavior. + +Note that this is a property on the `buffer` module as returned by +`require('buffer')`, not on the Buffer global or a Buffer instance. + +## Class: SlowBuffer + + + Stability: 0 - Deprecated: Use + [`Buffer.allocUnsafeSlow(size)`][buffer_allocunsafeslow] instead. + +Returns an un-pooled `Buffer`. + +In order to avoid the garbage collection overhead of creating many individually +allocated Buffers, by default allocations under 4KB are sliced from a single +larger allocated object. This approach improves both performance and memory +usage since v8 does not need to track and cleanup as many `Persistent` objects. + +In the case where a developer may need to retain a small chunk of memory from a +pool for an indeterminate amount of time, it may be appropriate to create an +un-pooled Buffer instance using `SlowBuffer` then copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + var data = socket.read(); + // allocate for retained data + var sb = SlowBuffer(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `SlowBuffer` should be used only as a last resort *after* a developer +has observed undue memory retention in their applications. + +### new SlowBuffer(size) + + + Stability: 0 - Deprecated: Use + [`Buffer.allocUnsafeSlow(size)`][buffer_allocunsafeslow] instead. + +* `size` Number + +Allocates a new `SlowBuffer` of `size` bytes. The `size` must be less than +or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `SlowBuffer` instances is *not initialized*. The +contents of a newly created `SlowBuffer` are unknown and could contain +sensitive data. Use [`buf.fill(0)`][] to initialize a `SlowBuffer` to zeroes. + +```js +const SlowBuffer = require('buffer').SlowBuffer; +const buf = new SlowBuffer(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols +[`Array#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf +[`Buffer#indexOf()`]: #buffer_buf_indexof_value_byteoffset_encoding +[`Array#includes()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes +[`buf.entries()`]: #buffer_buf_entries +[`buf.fill(0)`]: #buffer_buf_fill_value_offset_end_encoding +[`buf.fill()`]: #buffer_buf_fill_value_offset_end_encoding +[`buf.keys()`]: #buffer_buf_keys +[`buf.slice()`]: #buffer_buf_slice_start_end +[`buf.values()`]: #buffer_buf_values +[`buf1.compare(buf2)`]: #buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend +[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[`RangeError`]: errors.html#errors_class_rangeerror +[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length +[`util.inspect()`]: util.html#util_util_inspect_object_options +[RFC 4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5 +[buffer_from_array]: #buffer_class_method_buffer_from_array +[buffer_from_buffer]: #buffer_class_method_buffer_from_buffer +[buffer_from_arraybuf]: #buffer_class_method_buffer_from_arraybuffer_byteoffset_length +[buffer_from_string]: #buffer_class_method_buffer_from_str_encoding +[buffer_allocunsafe]: #buffer_class_method_buffer_allocunsafe_size +[buffer_allocunsafeslow]: #buffer_class_method_buffer_allocunsafeslow_size +[buffer_alloc]: #buffer_class_method_buffer_alloc_size_fill_encoding +[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from +[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView +[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown deleted file mode 100644 index aaaa002fb4440c..00000000000000 --- a/doc/api/child_process.markdown +++ /dev/null @@ -1,1028 +0,0 @@ -# Child Process - - Stability: 2 - Stable - -The `child_process` module provides the ability to spawn child processes in -a manner that is similar, but not identical, to [`popen(3)`][]. This capability -is primarily provided by the `child_process.spawn()` function: - -```js -const spawn = require('child_process').spawn; -const ls = spawn('ls', ['-lh', '/usr']); - -ls.stdout.on('data', (data) => { - console.log(`stdout: ${data}`); -}); - -ls.stderr.on('data', (data) => { - console.log(`stderr: ${data}`); -}); - -ls.on('close', (code) => { - console.log(`child process exited with code ${code}`); -}); -``` - -By default, pipes for `stdin`, `stdout` and `stderr` are established between -the parent Node.js process and the spawned child. It is possible to stream data -through these pipes in a non-blocking way. *Note, however, that some programs -use line-buffered I/O internally. While that does not affect Node.js, it can -mean that data sent to the child process may not be immediately consumed.* - -The `child_process.spawn()` method spawns the child process asynchronously, -without blocking the Node.js event loop. The `child_process.spawnSync()` -function provides equivalent functionality in a synchronous manner that blocks -the event loop until the spawned process either exits or is terminated. - -For convenience, the `child_process` module provides a handful of synchronous -and asynchronous alternatives to [`child_process.spawn()`][] and -[`child_process.spawnSync()`][]. *Note that each of these alternatives are -implemented on top of `child_process.spawn()` or `child_process.spawnSync()`.* - - * `child_process.exec()`: spawns a shell and runs a command within that shell, - passing the `stdout` and `stderr` to a callback function when complete. - * `child_process.execFile()`: similar to `child_process.exec()` except that - it spawns the command directly without first spawning a shell. - * `child_process.fork()`: spawns a new Node.js process and invokes a - specified module with an IPC communication channel established that allows - sending messages between parent and child. - * `child_process.execSync()`: a synchronous version of - `child_process.exec()` that *will* block the Node.js event loop. - * `child_process.execFileSync()`: a synchronous version of - `child_process.execFile()` that *will* block the Node.js event loop. - -For certain use cases, such as automating shell scripts, the -[synchronous counterparts][] may be more convenient. In many cases, however, -the synchronous methods can have significant impact on performance due to -stalling the event loop while spawned processes complete. - -## Asynchronous Process Creation - -The `child_process.spawn()`, `child_process.fork()`, `child_process.exec()`, -and `child_process.execFile()` methods all follow the idiomatic asynchronous -programming pattern typical of other Node.js APIs. - -Each of the methods returns a [`ChildProcess`][] instance. These objects -implement the Node.js [`EventEmitter`][] API, allowing the parent process to -register listener functions that are called when certain events occur during -the life cycle of the child process. - -The `child_process.exec()` and `child_process.execFile()` methods additionally -allow for an optional `callback` function to be specified that is invoked -when the child process terminates. - -### Spawning `.bat` and `.cmd` files on Windows - -The importance of the distinction between `child_process.exec()` and -`child_process.execFile()` can vary based on platform. On Unix-type operating -systems (Unix, Linux, OSX) `child_process.execFile()` can be more efficient -because it does not spawn a shell. On Windows, however, `.bat` and `.cmd` -files are not executable on their own without a terminal, and therefore cannot -be launched using `child_process.execFile()`. When running on Windows, `.bat` -and `.cmd` files can be invoked using `child_process.spawn()` with the `shell` -option set, with `child_process.exec()`, or by spawning `cmd.exe` and passing -the `.bat` or `.cmd` file as an argument (which is what the `shell` option and -`child_process.exec()` do). - -```js -// On Windows Only ... -const spawn = require('child_process').spawn; -const bat = spawn('cmd.exe', ['/c', 'my.bat']); - -bat.stdout.on('data', (data) => { - console.log(data); -}); - -bat.stderr.on('data', (data) => { - console.log(data); -}); - -bat.on('exit', (code) => { - console.log(`Child exited with code ${code}`); -}); - -// OR... -const exec = require('child_process').exec; -exec('my.bat', (err, stdout, stderr) => { - if (err) { - console.error(err); - return; - } - console.log(stdout); -}); -``` - -### child_process.exec(command[, options][, callback]) - -* `command` {String} The command to run, with space-separated arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `env` {Object} Environment key-value pairs - * `encoding` {String} (Default: 'utf8') - * `shell` {String} Shell to execute the command with - (Default: '/bin/sh' on UNIX, 'cmd.exe' on Windows, The shell should - understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows, - command line parsing should be compatible with `cmd.exe`.) - * `timeout` {Number} (Default: 0) - * `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or - stderr - if exceeded child process is killed (Default: `200*1024`) - * `killSignal` {String} (Default: 'SIGTERM') - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) -* `callback` {Function} called with the output when process terminates - * `error` {Error} - * `stdout` {String|Buffer} - * `stderr` {String|Buffer} -* Return: {ChildProcess} - -Spawns a shell then executes the `command` within that shell, buffering any -generated output. - -```js -const exec = require('child_process').exec; -const child = exec('cat *.js bad_file | wc -l', - (error, stdout, stderr) => { - console.log(`stdout: ${stdout}`); - console.log(`stderr: ${stderr}`); - if (error !== null) { - console.log(`exec error: ${error}`); - } -}); -``` - -If a `callback` function is provided, it is called with the arguments -`(error, stdout, stderr)`. On success, `error` will be `null`. On error, -`error` will be an instance of [`Error`][]. The `error.code` property will be -the exit code of the child process while `error.signal` will be set to the -signal that terminated the process. Any exit code other than `0` is considered -to be an error. - -The `stdout` and `stderr` arguments passed to the callback will contain the -stdout and stderr output of the child process. By default, Node.js will decode -the output as UTF-8 and pass strings to the callback. The `encoding` option -can be used to specify the character encoding used to decode the stdout and -stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to -the callback instead. - -The `options` argument may be passed as the second argument to customize how -the process is spawned. The default options are: - -```js -{ - encoding: 'utf8', - timeout: 0, - maxBuffer: 200*1024, - killSignal: 'SIGTERM', - cwd: null, - env: null -} -``` - -If `timeout` is greater than `0`, the parent will send the the signal -identified by the `killSignal` property (the default is `'SIGTERM'`) if the -child runs longer than `timeout` milliseconds. - -The `maxBuffer` option specifies the largest amount of data (in bytes) allowed -on stdout or stderr - if this value is exceeded then the child process is -terminated. - -*Note: Unlike the `exec()` POSIX system call, `child_process.exec()` does not -replace the existing process and uses a shell to execute the command.* - -### child_process.execFile(file[, args][, options][, callback]) - -* `file` {String} The name or path of the executable file to run -* `args` {Array} List of string arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `env` {Object} Environment key-value pairs - * `encoding` {String} (Default: 'utf8') - * `timeout` {Number} (Default: 0) - * `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or - stderr - if exceeded child process is killed (Default: 200\*1024) - * `killSignal` {String} (Default: 'SIGTERM') - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) -* `callback` {Function} called with the output when process terminates - * `error` {Error} - * `stdout` {String|Buffer} - * `stderr` {String|Buffer} -* Return: {ChildProcess} - -The `child_process.execFile()` function is similar to [`child_process.exec()`][] -except that it does not spawn a shell. Rather, the specified executable `file` -is spawned directly as a new process making it slightly more efficient than -[`child_process.exec()`][]. - -The same options as `child_process.exec()` are supported. Since a shell is not -spawned, behaviors such as I/O redirection and file globbing are not supported. - -```js -const execFile = require('child_process').execFile; -const child = execFile('node', ['--version'], (error, stdout, stderr) => { - if (error) { - throw error; - } - console.log(stdout); -}); -``` - -The `stdout` and `stderr` arguments passed to the callback will contain the -stdout and stderr output of the child process. By default, Node.js will decode -the output as UTF-8 and pass strings to the callback. The `encoding` option -can be used to specify the character encoding used to decode the stdout and -stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to -the callback instead. - -### child_process.fork(modulePath[, args][, options]) - -* `modulePath` {String} The module to run in the child -* `args` {Array} List of string arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `env` {Object} Environment key-value pairs - * `execPath` {String} Executable used to create the child process - * `execArgv` {Array} List of string arguments passed to the executable - (Default: `process.execArgv`) - * `silent` {Boolean} If true, stdin, stdout, and stderr of the child will be - piped to the parent, otherwise they will be inherited from the parent, see - the `'pipe'` and `'inherit'` options for [`child_process.spawn()`][]'s - [`stdio`][] for more details (default is false) - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) -* Return: {ChildProcess} - -The `child_process.fork()` method is a special case of -[`child_process.spawn()`][] used specifically to spawn new Node.js processes. -Like `child_process.spawn()`, a `ChildProcess` object is returned. The returned -`ChildProcess` will have an additional communication channel built-in that -allows messages to be passed back and forth between the parent and child. See -[`ChildProcess#send()`][] for details. - -It is important to keep in mind that spawned Node.js child processes are -independent of the parent with exception of the IPC communication channel -that is established between the two. Each process has it's own memory, with -their own V8 instances. Because of the additional resource allocations -required, spawning a large number of child Node.js processes is not -recommended. - -By default, `child_process.fork()` will spawn new Node.js instances using the -`process.execPath` of the parent process. The `execPath` property in the -`options` object allows for an alternative execution path to be used. - -Node.js processes launched with a custom `execPath` will communicate with the -parent process using the file descriptor (fd) identified using the -environment variable `NODE_CHANNEL_FD` on the child process. The input and -output on this fd is expected to be line delimited JSON objects. - -*Note: Unlike the `fork()` POSIX system call, [`child_process.fork()`][] does -not clone the current process.* - -### child_process.spawn(command[, args][, options]) - -* `command` {String} The command to run -* `args` {Array} List of string arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `env` {Object} Environment key-value pairs - * `stdio` {Array|String} Child's stdio configuration. (See - [`options.stdio`][]) - * `detached` {Boolean} Prepare child to run independently of its parent - process. Specific behavior depends on the platform, see - [`options.detached`][]) - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) - * `shell` {Boolean|String} If `true`, runs `command` inside of a shell. Uses - '/bin/sh' on UNIX, and 'cmd.exe' on Windows. A different shell can be - specified as a string. The shell should understand the `-c` switch on UNIX, - or `/s /c` on Windows. Defaults to `false` (no shell). -* return: {ChildProcess} - -The `child_process.spawn()` method spawns a new process using the given -`command`, with command line arguments in `args`. If omitted, `args` defaults -to an empty array. - -A third argument may be used to specify additional options, with these defaults: - -```js -{ - cwd: undefined, - env: process.env -} -``` - -Use `cwd` to specify the working directory from which the process is spawned. -If not given, the default is to inherit the current working directory. - -Use `env` to specify environment variables that will be visible to the new -process, the default is `process.env`. - -Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the -exit code: - -```js -const spawn = require('child_process').spawn; -const ls = spawn('ls', ['-lh', '/usr']); - -ls.stdout.on('data', (data) => { - console.log(`stdout: ${data}`); -}); - -ls.stderr.on('data', (data) => { - console.log(`stderr: ${data}`); -}); - -ls.on('close', (code) => { - console.log(`child process exited with code ${code}`); -}); -``` - - -Example: A very elaborate way to run 'ps ax | grep ssh' - -```js -const spawn = require('child_process').spawn; -const ps = spawn('ps', ['ax']); -const grep = spawn('grep', ['ssh']); - -ps.stdout.on('data', (data) => { - grep.stdin.write(data); -}); - -ps.stderr.on('data', (data) => { - console.log(`ps stderr: ${data}`); -}); - -ps.on('close', (code) => { - if (code !== 0) { - console.log(`ps process exited with code ${code}`); - } - grep.stdin.end(); -}); - -grep.stdout.on('data', (data) => { - console.log(`${data}`); -}); - -grep.stderr.on('data', (data) => { - console.log(`grep stderr: ${data}`); -}); - -grep.on('close', (code) => { - if (code !== 0) { - console.log(`grep process exited with code ${code}`); - } -}); -``` - - -Example of checking for failed exec: - -```js -const spawn = require('child_process').spawn; -const child = spawn('bad_command'); - -child.on('error', (err) => { - console.log('Failed to start child process.'); -}); -``` - -#### options.detached - -On Windows, setting `options.detached` to `true` makes it possible for the -child process to continue running after the parent exits. The child will have -its own console window. *Once enabled for a child process, it cannot be -disabled*. - -On non-Windows platforms, if `options.detached` is set to `true`, the child -process will be made the leader of a new process group and session. Note that -child processes may continue running after the parent exits regardless of -whether they are detached or not. See `setsid(2)` for more information. - -By default, the parent will wait for the detached child to exit. To prevent -the parent from waiting for a given `child`, use the `child.unref()` method. -Doing so will cause the parent's event loop to not include the child in its -reference count, allowing the parent to exit independently of the child, unless -there is an established IPC channel between the child and parent. - -When using the `detached` option to start a long-running process, the process -will not stay running in the background after the parent exits unless it is -provided with a `stdio` configuration that is not connected to the parent. -If the parent's `stdio` is inherited, the child will remain attached to the -controlling terminal. - -Example of a long-running process, by detaching and also ignoring its parent -`stdio` file descriptors, in order to ignore the parent's termination: - -```js -const spawn = require('child_process').spawn; - -const child = spawn(process.argv[0], ['child_program.js'], { - detached: true, - stdio: ['ignore'] -}); - -child.unref(); -``` - -Alternatively one can redirect the child process' output into files: - -```js -const fs = require('fs'); -const spawn = require('child_process').spawn; -const out = fs.openSync('./out.log', 'a'); -const err = fs.openSync('./out.log', 'a'); - -const child = spawn('prg', [], { - detached: true, - stdio: [ 'ignore', out, err ] -}); - -child.unref(); -``` - -#### options.stdio - -The `options.stdio` option is used to configure the pipes that are established -between the parent and child process. By default, the child's stdin, stdout, -and stderr are redirected to corresponding `child.stdin`, `child.stdout`, and -`child.stderr` streams on the `ChildProcess` object. This is equivalent to -setting the `options.stdio` equal to `['pipe', 'pipe', 'pipe']`. - -For convenience, `options.stdio` may be one of the following strings: - -* `'pipe'` - equivalent to `['pipe', 'pipe', 'pipe']` (the default) -* `'ignore'` - equivalent to `['ignore', 'ignore', 'ignore']` -* `'inherit'` - equivalent to `[process.stdin, process.stdout, process.stderr]` - or `[0,1,2]` - -Otherwise, the value of `option.stdio` is an array where each index corresponds -to an fd in the child. The fds 0, 1, and 2 correspond to stdin, stdout, -and stderr, respectively. Additional fds can be specified to create additional -pipes between the parent and child. The value is one of the following: - -1. `'pipe'` - Create a pipe between the child process and the parent process. - The parent end of the pipe is exposed to the parent as a property on the - `child_process` object as `ChildProcess.stdio[fd]`. Pipes created for - fds 0 - 2 are also available as ChildProcess.stdin, ChildProcess.stdout - and ChildProcess.stderr, respectively. -2. `'ipc'` - Create an IPC channel for passing messages/file descriptors - between parent and child. A ChildProcess may have at most *one* IPC stdio - file descriptor. Setting this option enables the ChildProcess.send() method. - If the child writes JSON messages to this file descriptor, the - `ChildProcess.on('message')` event handler will be triggered in the parent. - If the child is a Node.js process, the presence of an IPC channel will enable - `process.send()`, `process.disconnect()`, `process.on('disconnect')`, and - `process.on('message')` within the child. -3. `'ignore'` - Instructs Node.js to ignore the fd in the child. While Node.js - will always open fds 0 - 2 for the processes it spawns, setting the fd to - `'ignore'` will cause Node.js to open `/dev/null` and attach it to the - child's fd. -4. `Stream` object - Share a readable or writable stream that refers to a tty, - file, socket, or a pipe with the child process. The stream's underlying - file descriptor is duplicated in the child process to the fd that - corresponds to the index in the `stdio` array. Note that the stream must - have an underlying descriptor (file streams do not until the `'open'` - event has occurred). -5. Positive integer - The integer value is interpreted as a file descriptor - that is is currently open in the parent process. It is shared with the child - process, similar to how `Stream` objects can be shared. -6. `null`, `undefined` - Use default value. For stdio fds 0, 1 and 2 (in other - words, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the - default is `'ignore'`. - -Example: - -```js -const spawn = require('child_process').spawn; - -// Child will use parent's stdios -spawn('prg', [], { stdio: 'inherit' }); - -// Spawn child sharing only stderr -spawn('prg', [], { stdio: ['pipe', 'pipe', process.stderr] }); - -// Open an extra fd=4, to interact with programs presenting a -// startd-style interface. -spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] }); -``` - -*It is worth noting that when an IPC channel is established between the -parent and child processes, and the child is a Node.js process, the child -is launched with the IPC channel unreferenced (using `unref()`) until the -child registers an event handler for the `process.on('disconnected')` event. -This allows the child to exit normally without the process being held open -by the open IPC channel.* - -See also: [`child_process.exec()`][] and [`child_process.fork()`][] - -## Synchronous Process Creation - -The `child_process.spawnSync()`, `child_process.execSync()`, and -`child_process.execFileSync()` methods are **synchronous** and **WILL** block -the Node.js event loop, pausing execution of any additional code until the -spawned process exits. - -Blocking calls like these are mostly useful for simplifying general purpose -scripting tasks and for simplifying the loading/processing of application -configuration at startup. - -### child_process.execFileSync(file[, args][, options]) - -* `file` {String} The name or path of the executable file to run -* `args` {Array} List of string arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `input` {String|Buffer} The value which will be passed as stdin to the spawned process - - supplying this value will override `stdio[0]` - * `stdio` {Array} Child's stdio configuration. (Default: 'pipe') - - `stderr` by default will be output to the parent process' stderr unless - `stdio` is specified - * `env` {Object} Environment key-value pairs - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) - * `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined) - * `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM') - * `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or - stderr - if exceeded child process is killed - * `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer') -* return: {Buffer|String} The stdout from the command - -The `child_process.execFileSync()` method is generally identical to -`child_process.execFile()` with the exception that the method will not return -until the child process has fully closed. When a timeout has been encountered -and `killSignal` is sent, the method won't return until the process has -completely exited. *Note that if the child process intercepts and handles -the `SIGTERM` signal and does not exit, the parent process will still wait -until the child process has exited.* - -If the process times out, or has a non-zero exit code, this method ***will*** -throw. The [`Error`][] object will contain the entire result from -[`child_process.spawnSync()`][] - -### child_process.execSync(command[, options]) - -* `command` {String} The command to run -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `input` {String|Buffer} The value which will be passed as stdin to the spawned process - - supplying this value will override `stdio[0]` - * `stdio` {Array} Child's stdio configuration. (Default: 'pipe') - - `stderr` by default will be output to the parent process' stderr unless - `stdio` is specified - * `env` {Object} Environment key-value pairs - * `shell` {String} Shell to execute the command with - (Default: '/bin/sh' on UNIX, 'cmd.exe' on Windows, The shell should - understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows, - command line parsing should be compatible with `cmd.exe`.) - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) - * `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined) - * `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM') - * `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or - stderr - if exceeded child process is killed - * `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer') -* return: {Buffer|String} The stdout from the command - -The `child_process.execSync()` method is generally identical to -`child_process.exec()` with the exception that the method will not return until -the child process has fully closed. When a timeout has been encountered and -`killSignal` is sent, the method won't return until the process has completely -exited. *Note that if the child process intercepts and handles the `SIGTERM` -signal and doesn't exit, the parent process will wait until the child -process has exited.* - -If the process times out, or has a non-zero exit code, this method ***will*** -throw. The [`Error`][] object will contain the entire result from -[`child_process.spawnSync()`][] - -### child_process.spawnSync(command[, args][, options]) - -* `command` {String} The command to run -* `args` {Array} List of string arguments -* `options` {Object} - * `cwd` {String} Current working directory of the child process - * `input` {String|Buffer} The value which will be passed as stdin to the spawned process - - supplying this value will override `stdio[0]` - * `stdio` {Array} Child's stdio configuration. - * `env` {Object} Environment key-value pairs - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) - * `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined) - * `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM') - * `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or - stderr - if exceeded child process is killed - * `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer') - * `shell` {Boolean|String} If `true`, runs `command` inside of a shell. Uses - '/bin/sh' on UNIX, and 'cmd.exe' on Windows. A different shell can be - specified as a string. The shell should understand the `-c` switch on UNIX, - or `/s /c` on Windows. Defaults to `false` (no shell). -* return: {Object} - * `pid` {Number} Pid of the child process - * `output` {Array} Array of results from stdio output - * `stdout` {Buffer|String} The contents of `output[1]` - * `stderr` {Buffer|String} The contents of `output[2]` - * `status` {Number} The exit code of the child process - * `signal` {String} The signal used to kill the child process - * `error` {Error} The error object if the child process failed or timed out - -The `child_process.spawnSync()` method is generally identical to -`child_process.spawn()` with the exception that the function will not return -until the child process has fully closed. When a timeout has been encountered -and `killSignal` is sent, the method won't return until the process has -completely exited. Note that if the process intercepts and handles the -`SIGTERM` signal and doesn't exit, the parent process will wait until the child -process has exited. - -## Class: ChildProcess - -Instances of the `ChildProcess` class are [`EventEmitters`][] that represent -spawned child processes. - -Instances of `ChildProcess` are not intended to be created directly. Rather, -use the [`child_process.spawn()`][], [`child_process.exec()`][], -[`child_process.execFile()`][], or [`child_process.fork()`][] methods to create -instances of `ChildProcess`. - -### Event: 'close' - -* `code` {Number} the exit code if the child exited on its own. -* `signal` {String} the signal by which the child process was terminated. - -The `'close'` event is emitted when the stdio streams of a child process have -been closed. This is distinct from the `'exit'` event, since multiple -processes might share the same stdio streams. - -### Event: 'disconnect' - -The `'disconnect'` event is emitted after calling the -`ChildProcess.disconnect()` method in the parent or child process. After -disconnecting it is no longer possible to send or receive messages, and the -`ChildProcess.connected` property is false. - -### Event: 'error' - -* `err` {Error} the error. - -The `'error'` event is emitted whenever: - -1. The process could not be spawned, or -2. The process could not be killed, or -3. Sending a message to the child process failed. - -Note that the `'exit'` event may or may not fire after an error has occurred. -If you are listening to both the `'exit'` and `'error'` events, it is important -to guard against accidentally invoking handler functions multiple times. - -See also [`ChildProcess#kill()`][] and [`ChildProcess#send()`][]. - -### Event: 'exit' - -* `code` {Number} the exit code if the child exited on its own. -* `signal` {String} the signal by which the child process was terminated. - -The `'exit'` event is emitted after the child process ends. If the process -exited, `code` is the final exit code of the process, otherwise `null`. If the -process terminated due to receipt of a signal, `signal` is the string name of -the signal, otherwise `null`. One of the two will always be non-null. - -Note that when the `'exit'` event is triggered, child process stdio streams -might still be open. - -Also, note that Node.js establishes signal handlers for `SIGINT` and -`SIGTERM` and Node.js processes will not terminate immediately due to receipt -of those signals. Rather, Node.js will perform a sequence of cleanup actions -and then will re-raise the handled signal. - -See `waitpid(2)`. - -### Event: 'message' - -* `message` {Object} a parsed JSON object or primitive value. -* `sendHandle` {Handle} a [`net.Socket`][] or [`net.Server`][] object, or - undefined. - -The `'message'` event is triggered when a child process uses `process.send()` -to send messages. - -### child.connected - -* {Boolean} Set to false after `.disconnect` is called - -The `child.connected` property indicates whether it is still possible to send -and receive messages from a child process. When `child.connected` is false, it -is no longer possible to send or receive messages. - -### child.disconnect() - -Closes the IPC channel between parent and child, allowing the child to exit -gracefully once there are no other connections keeping it alive. After calling -this method the `child.connected` and `process.connected` properties in both -the parent and child (respectively) will be set to `false`, and it will be no -longer possible to pass messages between the processes. - -The `'disconnect'` event will be emitted when there are no messages in the -process of being received. This will most often be triggered immediately after -calling `child.disconnect()`. - -Note that when the child process is a Node.js instance (e.g. spawned using -[`child_process.fork()`]), the `process.disconnect()` method can be invoked -within the child process to close the IPC channel as well. - -### child.kill([signal]) - -* `signal` {String} - -The `child.kill()` methods sends a signal to the child process. If no argument -is given, the process will be sent the `'SIGTERM'` signal. See `signal(7)` for -a list of available signals. - -```js -const spawn = require('child_process').spawn; -const grep = spawn('grep', ['ssh']); - -grep.on('close', (code, signal) => { - console.log( - `child process terminated due to receipt of signal ${signal}`); -}); - -// Send SIGHUP to process -grep.kill('SIGHUP'); -``` - -The `ChildProcess` object may emit an `'error'` event if the signal cannot be -delivered. Sending a signal to a child process that has already exited is not -an error but may have unforeseen consequences. Specifically, if the process -identifier (PID) has been reassigned to another process, the signal will be -delivered to that process instead which can have unexpected results. - -Note that while the function is called `kill`, the signal delivered to the -child process may not actually terminate the process. - -See `kill(2)` - -### child.pid - -* {Number} Integer - -Returns the process identifier (PID) of the child process. - -Example: - -```js -const spawn = require('child_process').spawn; -const grep = spawn('grep', ['ssh']); - -console.log(`Spawned child pid: ${grep.pid}`); -grep.stdin.end(); -``` - -### child.send(message[, sendHandle[, options]][, callback]) - -* `message` {Object} -* `sendHandle` {Handle} -* `options` {Object} -* `callback` {Function} -* Return: {Boolean} - -When an IPC channel has been established between the parent and child ( -i.e. when using [`child_process.fork()`][]), the `child.send()` method can be -used to send messages to the child process. When the child process is a Node.js -instance, these messages can be received via the `process.on('message')` event. - -For example, in the parent script: - -```js -const cp = require('child_process'); -const n = cp.fork(`${__dirname}/sub.js`); - -n.on('message', (m) => { - console.log('PARENT got message:', m); -}); - -n.send({ hello: 'world' }); -``` - -And then the child script, `'sub.js'` might look like this: - -```js -process.on('message', (m) => { - console.log('CHILD got message:', m); -}); - -process.send({ foo: 'bar' }); -``` - -Child Node.js processes will have a `process.send()` method of their own that -allows the child to send messages back to the parent. - -There is a special case when sending a `{cmd: 'NODE_foo'}` message. All messages -containing a `NODE_` prefix in its `cmd` property are considered to be reserved -for use within Node.js core and will not be emitted in the child's -`process.on('message')` event. Rather, such messages are emitted using the -`process.on('internalMessage')` event and are consumed internally by Node.js. -Applications should avoid using such messages or listening for -`'internalMessage'` events as it is subject to change without notice. - -The optional `sendHandle` argument that may be passed to `child.send()` is for -passing a TCP server or socket object to the child process. The child will -receive the object as the second argument passed to the callback function -registered on the `process.on('message')` event. - -The `options` argument, if present, is an object used to parameterize the -sending of certain types of handles. `options` supports the following -properties: - - * `keepOpen` - A Boolean value that can be used when passing instances of - `net.Socket`. When `true`, the socket is kept open in the sending process. - Defaults to `false`. - -The optional `callback` is a function that is invoked after the message is -sent but before the child may have received it. The function is called with a -single argument: `null` on success, or an [`Error`][] object on failure. - -If no `callback` function is provided and the message cannot be sent, an -`'error'` event will be emitted by the `ChildProcess` object. This can happen, -for instance, when the child process has already exited. - -`child.send()` will return `false` if the channel has closed or when the -backlog of unsent messages exceeds a threshold that makes it unwise to send -more. Otherwise, the method returns `true`. The `callback` function can be -used to implement flow control. - -#### Example: sending a server object - -The `sendHandle` argument can be used, for instance, to pass the handle of -a TCP server object to the child process as illustrated in the example below: - -```js -const child = require('child_process').fork('child.js'); - -// Open up the server object and send the handle. -const server = require('net').createServer(); -server.on('connection', (socket) => { - socket.end('handled by parent'); -}); -server.listen(1337, () => { - child.send('server', server); -}); -``` - -The child would then receive the server object as: - -```js -process.on('message', (m, server) => { - if (m === 'server') { - server.on('connection', (socket) => { - socket.end('handled by child'); - }); - } -}); -``` - -Once the server is now shared between the parent and child, some connections -can be handled by the parent and some by the child. - -While the example above uses a server created using the `net` module, `dgram` -module servers use exactly the same workflow with the exceptions of listening on -a `'message'` event instead of `'connection'` and using `server.bind` instead of -`server.listen`. This is, however, currently only supported on UNIX platforms. - -#### Example: sending a socket object - -Similarly, the `sendHandler` argument can be used to pass the handle of a -socket to the child process. The example below spawns two children that each -handle connections with "normal" or "special" priority: - -```js -const normal = require('child_process').fork('child.js', ['normal']); -const special = require('child_process').fork('child.js', ['special']); - -// Open up the server and send sockets to child -const server = require('net').createServer(); -server.on('connection', (socket) => { - - // If this is special priority - if (socket.remoteAddress === '74.125.127.100') { - special.send('socket', socket); - return; - } - // This is normal priority - normal.send('socket', socket); -}); -server.listen(1337); -``` - -The `child.js` would receive the socket handle as the second argument passed -to the event callback function: - -```js -process.on('message', (m, socket) => { - if (m === 'socket') { - socket.end(`Request handled with ${process.argv[2]} priority`); - } -}); -``` - -Once a socket has been passed to a child, the parent is no longer capable of -tracking when the socket is destroyed. To indicate this, the `.connections` -property becomes `null`. It is recommended not to use `.maxConnections` when -this occurs. - -*Note: this function uses [`JSON.stringify()`][] internally to serialize the `message`.* - -### child.stderr - -* {Stream} - -A `Readable Stream` that represents the child process's `stderr`. - -If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, -then this will be `undefined`. - -`child.stderr` is an alias for `child.stdio[2]`. Both properties will refer to -the same value. - -### child.stdin - -* {Stream} - -A `Writable Stream` that represents the child process's `stdin`. - -*Note that if a child process waits to read all of its input, the child will not -continue until this stream has been closed via `end()`.* - -If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, -then this will be `undefined`. - -`child.stdin` is an alias for `child.stdio[0]`. Both properties will refer to -the same value. - -### child.stdio - -* {Array} - -A sparse array of pipes to the child process, corresponding with positions in -the [`stdio`][] option passed to [`child_process.spawn()`][] that have been set -to the value `'pipe'`. Note that `child.stdio[0]`, `child.stdio[1]`, and -`child.stdio[2]` are also available as `child.stdin`, `child.stdout`, and -`child.stderr`, respectively. - -In the following example, only the child's fd `1` (stdout) is configured as a -pipe, so only the parent's `child.stdio[1]` is a stream, all other values in -the array are `null`. - -```js -const assert = require('assert'); -const fs = require('fs'); -const child_process = require('child_process'); - -const child = child_process.spawn('ls', { - stdio: [ - 0, // Use parents stdin for child - 'pipe', // Pipe child's stdout to parent - fs.openSync('err.out', 'w') // Direct child's stderr to a file - ] -}); - -assert.equal(child.stdio[0], null); -assert.equal(child.stdio[0], child.stdin); - -assert(child.stdout); -assert.equal(child.stdio[1], child.stdout); - -assert.equal(child.stdio[2], null); -assert.equal(child.stdio[2], child.stderr); -``` - -### child.stdout - -* {Stream} - -A `Readable Stream` that represents the child process's `stdout`. - -If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, -then this will be `undefined`. - -`child.stdout` is an alias for `child.stdio[1]`. Both properties will refer -to the same value. - -[`popen(3)`]: http://linux.die.net/man/3/popen -[`ChildProcess`]: #child_process_child_process -[`child_process.exec()`]: #child_process_child_process_exec_command_options_callback -[`child_process.execFile()`]: #child_process_child_process_execfile_file_args_options_callback -[`child_process.fork()`]: #child_process_child_process_fork_modulepath_args_options -[`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options -[`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options -[`ChildProcess#kill()`]: #child_process_child_kill_signal -[`ChildProcess#send()`]: #child_process_child_send_message_sendhandle_callback -[`Error`]: errors.html#errors_class_error -[`EventEmitter`]: events.html#events_class_events_eventemitter -[`EventEmitters`]: events.html#events_class_events_eventemitter -[`net.Server`]: net.html#net_class_net_server -[`net.Socket`]: net.html#net_class_net_socket -[`options.detached`]: #child_process_options_detached -[`options.stdio`]: #child_process_options_stdio -[`stdio`]: #child_process_options_stdio -[synchronous counterparts]: #child_process_synchronous_process_creation -[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify \ No newline at end of file diff --git a/doc/api/child_process.md b/doc/api/child_process.md new file mode 100644 index 00000000000000..a196f99b282b8d --- /dev/null +++ b/doc/api/child_process.md @@ -0,0 +1,1155 @@ +# Child Process + + Stability: 2 - Stable + +The `child_process` module provides the ability to spawn child processes in +a manner that is similar, but not identical, to popen(3). This capability +is primarily provided by the [`child_process.spawn()`][] function: + +```js +const spawn = require('child_process').spawn; +const ls = spawn('ls', ['-lh', '/usr']); + +ls.stdout.on('data', (data) => { + console.log(`stdout: ${data}`); +}); + +ls.stderr.on('data', (data) => { + console.log(`stderr: ${data}`); +}); + +ls.on('close', (code) => { + console.log(`child process exited with code ${code}`); +}); +``` + +By default, pipes for `stdin`, `stdout` and `stderr` are established between +the parent Node.js process and the spawned child. It is possible to stream data +through these pipes in a non-blocking way. *Note, however, that some programs +use line-buffered I/O internally. While that does not affect Node.js, it can +mean that data sent to the child process may not be immediately consumed.* + +The [`child_process.spawn()`][] method spawns the child process asynchronously, +without blocking the Node.js event loop. The [`child_process.spawnSync()`][] +function provides equivalent functionality in a synchronous manner that blocks +the event loop until the spawned process either exits or is terminated. + +For convenience, the `child_process` module provides a handful of synchronous +and asynchronous alternatives to [`child_process.spawn()`][] and +[`child_process.spawnSync()`][]. *Note that each of these alternatives are +implemented on top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][].* + + * [`child_process.exec()`][]: spawns a shell and runs a command within that shell, + passing the `stdout` and `stderr` to a callback function when complete. + * [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except that + it spawns the command directly without first spawning a shell. + * [`child_process.fork()`][]: spawns a new Node.js process and invokes a + specified module with an IPC communication channel established that allows + sending messages between parent and child. + * [`child_process.execSync()`][]: a synchronous version of + [`child_process.exec()`][] that *will* block the Node.js event loop. + * [`child_process.execFileSync()`][]: a synchronous version of + [`child_process.execFile()`][] that *will* block the Node.js event loop. + +For certain use cases, such as automating shell scripts, the +[synchronous counterparts][] may be more convenient. In many cases, however, +the synchronous methods can have significant impact on performance due to +stalling the event loop while spawned processes complete. + +## Asynchronous Process Creation + +The [`child_process.spawn()`][], [`child_process.fork()`][], [`child_process.exec()`][], +and [`child_process.execFile()`][] methods all follow the idiomatic asynchronous +programming pattern typical of other Node.js APIs. + +Each of the methods returns a [`ChildProcess`][] instance. These objects +implement the Node.js [`EventEmitter`][] API, allowing the parent process to +register listener functions that are called when certain events occur during +the life cycle of the child process. + +The [`child_process.exec()`][] and [`child_process.execFile()`][] methods additionally +allow for an optional `callback` function to be specified that is invoked +when the child process terminates. + +### Spawning `.bat` and `.cmd` files on Windows + +The importance of the distinction between [`child_process.exec()`][] and +[`child_process.execFile()`][] can vary based on platform. On Unix-type operating +systems (Unix, Linux, OSX) [`child_process.execFile()`][] can be more efficient +because it does not spawn a shell. On Windows, however, `.bat` and `.cmd` +files are not executable on their own without a terminal, and therefore cannot +be launched using [`child_process.execFile()`][]. When running on Windows, `.bat` +and `.cmd` files can be invoked using [`child_process.spawn()`][] with the `shell` +option set, with [`child_process.exec()`][], or by spawning `cmd.exe` and passing +the `.bat` or `.cmd` file as an argument (which is what the `shell` option and +[`child_process.exec()`][] do). + +```js +// On Windows Only ... +const spawn = require('child_process').spawn; +const bat = spawn('cmd.exe', ['/c', 'my.bat']); + +bat.stdout.on('data', (data) => { + console.log(data); +}); + +bat.stderr.on('data', (data) => { + console.log(data); +}); + +bat.on('exit', (code) => { + console.log(`Child exited with code ${code}`); +}); + +// OR... +const exec = require('child_process').exec; +exec('my.bat', (err, stdout, stderr) => { + if (err) { + console.error(err); + return; + } + console.log(stdout); +}); +``` + +### child_process.exec(command[, options][, callback]) + + +* `command` {String} The command to run, with space-separated arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `env` {Object} Environment key-value pairs + * `encoding` {String} (Default: `'utf8'`) + * `shell` {String} Shell to execute the command with + (Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should + understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows, + command line parsing should be compatible with `cmd.exe`.) + * `timeout` {Number} (Default: `0`) + * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on + stdout or stderr - if exceeded child process is killed (Default: `200*1024`) + * `killSignal` {String} (Default: `'SIGTERM'`) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) +* `callback` {Function} called with the output when process terminates + * `error` {Error} + * `stdout` {String|Buffer} + * `stderr` {String|Buffer} +* Return: {ChildProcess} + +Spawns a shell then executes the `command` within that shell, buffering any +generated output. + +```js +const exec = require('child_process').exec; +exec('cat *.js bad_file | wc -l', (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + return; + } + console.log(`stdout: ${stdout}`); + console.log(`stderr: ${stderr}`); +}); +``` + +If a `callback` function is provided, it is called with the arguments +`(error, stdout, stderr)`. On success, `error` will be `null`. On error, +`error` will be an instance of [`Error`][]. The `error.code` property will be +the exit code of the child process while `error.signal` will be set to the +signal that terminated the process. Any exit code other than `0` is considered +to be an error. + +The `stdout` and `stderr` arguments passed to the callback will contain the +stdout and stderr output of the child process. By default, Node.js will decode +the output as UTF-8 and pass strings to the callback. The `encoding` option +can be used to specify the character encoding used to decode the stdout and +stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to +the callback instead. + +The `options` argument may be passed as the second argument to customize how +the process is spawned. The default options are: + +```js +{ + encoding: 'utf8', + timeout: 0, + maxBuffer: 200*1024, + killSignal: 'SIGTERM', + cwd: null, + env: null +} +``` + +If `timeout` is greater than `0`, the parent will send the the signal +identified by the `killSignal` property (the default is `'SIGTERM'`) if the +child runs longer than `timeout` milliseconds. + +*Note: Unlike the exec(3) POSIX system call, `child_process.exec()` does not +replace the existing process and uses a shell to execute the command.* + +### child_process.execFile(file[, args][, options][, callback]) + + +* `file` {String} The name or path of the executable file to run +* `args` {Array} List of string arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `env` {Object} Environment key-value pairs + * `encoding` {String} (Default: `'utf8'`) + * `timeout` {Number} (Default: `0`) + * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on + stdout or stderr - if exceeded child process is killed (Default: `200*1024`) + * `killSignal` {String} (Default: `'SIGTERM'`) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) +* `callback` {Function} called with the output when process terminates + * `error` {Error} + * `stdout` {String|Buffer} + * `stderr` {String|Buffer} +* Return: {ChildProcess} + +The `child_process.execFile()` function is similar to [`child_process.exec()`][] +except that it does not spawn a shell. Rather, the specified executable `file` +is spawned directly as a new process making it slightly more efficient than +[`child_process.exec()`][]. + +The same options as [`child_process.exec()`][] are supported. Since a shell is not +spawned, behaviors such as I/O redirection and file globbing are not supported. + +```js +const execFile = require('child_process').execFile; +const child = execFile('node', ['--version'], (error, stdout, stderr) => { + if (error) { + throw error; + } + console.log(stdout); +}); +``` + +The `stdout` and `stderr` arguments passed to the callback will contain the +stdout and stderr output of the child process. By default, Node.js will decode +the output as UTF-8 and pass strings to the callback. The `encoding` option +can be used to specify the character encoding used to decode the stdout and +stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to +the callback instead. + +### child_process.fork(modulePath[, args][, options]) + + +* `modulePath` {String} The module to run in the child +* `args` {Array} List of string arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `env` {Object} Environment key-value pairs + * `execPath` {String} Executable used to create the child process + * `execArgv` {Array} List of string arguments passed to the executable + (Default: `process.execArgv`) + * `silent` {Boolean} If `true`, stdin, stdout, and stderr of the child will be + piped to the parent, otherwise they will be inherited from the parent, see + the `'pipe'` and `'inherit'` options for [`child_process.spawn()`][]'s + [`stdio`][] for more details (Default: `false`) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) +* Return: {ChildProcess} + +The `child_process.fork()` method is a special case of +[`child_process.spawn()`][] used specifically to spawn new Node.js processes. +Like [`child_process.spawn()`][], a [`ChildProcess`][] object is returned. The returned +[`ChildProcess`][] will have an additional communication channel built-in that +allows messages to be passed back and forth between the parent and child. See +[`child.send()`][] for details. + +It is important to keep in mind that spawned Node.js child processes are +independent of the parent with exception of the IPC communication channel +that is established between the two. Each process has it's own memory, with +their own V8 instances. Because of the additional resource allocations +required, spawning a large number of child Node.js processes is not +recommended. + +By default, `child_process.fork()` will spawn new Node.js instances using the +[`process.execPath`][] of the parent process. The `execPath` property in the +`options` object allows for an alternative execution path to be used. + +Node.js processes launched with a custom `execPath` will communicate with the +parent process using the file descriptor (fd) identified using the +environment variable `NODE_CHANNEL_FD` on the child process. The input and +output on this fd is expected to be line delimited JSON objects. + +*Note: Unlike the fork(2) POSIX system call, `child_process.fork()` does +not clone the current process.* + +### child_process.spawn(command[, args][, options]) + + +* `command` {String} The command to run +* `args` {Array} List of string arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `env` {Object} Environment key-value pairs + * `stdio` {Array|String} Child's stdio configuration. (See + [`options.stdio`][`stdio`]) + * `detached` {Boolean} Prepare child to run independently of its parent + process. Specific behavior depends on the platform, see + [`options.detached`][]) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) + * `shell` {Boolean|String} If `true`, runs `command` inside of a shell. Uses + `'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be + specified as a string. The shell should understand the `-c` switch on UNIX, + or `/s /c` on Windows. Defaults to `false` (no shell). +* return: {ChildProcess} + +The `child_process.spawn()` method spawns a new process using the given +`command`, with command line arguments in `args`. If omitted, `args` defaults +to an empty array. + +A third argument may be used to specify additional options, with these defaults: + +```js +{ + cwd: undefined, + env: process.env +} +``` + +Use `cwd` to specify the working directory from which the process is spawned. +If not given, the default is to inherit the current working directory. + +Use `env` to specify environment variables that will be visible to the new +process, the default is [`process.env`][]. + +Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the +exit code: + +```js +const spawn = require('child_process').spawn; +const ls = spawn('ls', ['-lh', '/usr']); + +ls.stdout.on('data', (data) => { + console.log(`stdout: ${data}`); +}); + +ls.stderr.on('data', (data) => { + console.log(`stderr: ${data}`); +}); + +ls.on('close', (code) => { + console.log(`child process exited with code ${code}`); +}); +``` + + +Example: A very elaborate way to run `ps ax | grep ssh` + +```js +const spawn = require('child_process').spawn; +const ps = spawn('ps', ['ax']); +const grep = spawn('grep', ['ssh']); + +ps.stdout.on('data', (data) => { + grep.stdin.write(data); +}); + +ps.stderr.on('data', (data) => { + console.log(`ps stderr: ${data}`); +}); + +ps.on('close', (code) => { + if (code !== 0) { + console.log(`ps process exited with code ${code}`); + } + grep.stdin.end(); +}); + +grep.stdout.on('data', (data) => { + console.log(`${data}`); +}); + +grep.stderr.on('data', (data) => { + console.log(`grep stderr: ${data}`); +}); + +grep.on('close', (code) => { + if (code !== 0) { + console.log(`grep process exited with code ${code}`); + } +}); +``` + + +Example of checking for failed exec: + +```js +const spawn = require('child_process').spawn; +const child = spawn('bad_command'); + +child.on('error', (err) => { + console.log('Failed to start child process.'); +}); +``` + +#### options.detached + + +On Windows, setting `options.detached` to `true` makes it possible for the +child process to continue running after the parent exits. The child will have +its own console window. *Once enabled for a child process, it cannot be +disabled*. + +On non-Windows platforms, if `options.detached` is set to `true`, the child +process will be made the leader of a new process group and session. Note that +child processes may continue running after the parent exits regardless of +whether they are detached or not. See setsid(2) for more information. + +By default, the parent will wait for the detached child to exit. To prevent +the parent from waiting for a given `child`, use the `child.unref()` method. +Doing so will cause the parent's event loop to not include the child in its +reference count, allowing the parent to exit independently of the child, unless +there is an established IPC channel between the child and parent. + +When using the `detached` option to start a long-running process, the process +will not stay running in the background after the parent exits unless it is +provided with a `stdio` configuration that is not connected to the parent. +If the parent's `stdio` is inherited, the child will remain attached to the +controlling terminal. + +Example of a long-running process, by detaching and also ignoring its parent +`stdio` file descriptors, in order to ignore the parent's termination: + +```js +const spawn = require('child_process').spawn; + +const child = spawn(process.argv[0], ['child_program.js'], { + detached: true, + stdio: ['ignore'] +}); + +child.unref(); +``` + +Alternatively one can redirect the child process' output into files: + +```js +const fs = require('fs'); +const spawn = require('child_process').spawn; +const out = fs.openSync('./out.log', 'a'); +const err = fs.openSync('./out.log', 'a'); + +const child = spawn('prg', [], { + detached: true, + stdio: [ 'ignore', out, err ] +}); + +child.unref(); +``` + +#### options.stdio + + +The `options.stdio` option is used to configure the pipes that are established +between the parent and child process. By default, the child's stdin, stdout, +and stderr are redirected to corresponding [`child.stdin`][], [`child.stdout`][], and +[`child.stderr`][] streams on the [`ChildProcess`][] object. This is equivalent to +setting the `options.stdio` equal to `['pipe', 'pipe', 'pipe']`. + +For convenience, `options.stdio` may be one of the following strings: + +* `'pipe'` - equivalent to `['pipe', 'pipe', 'pipe']` (the default) +* `'ignore'` - equivalent to `['ignore', 'ignore', 'ignore']` +* `'inherit'` - equivalent to `[process.stdin, process.stdout, process.stderr]` + or `[0,1,2]` + +Otherwise, the value of `options.stdio` is an array where each index corresponds +to an fd in the child. The fds 0, 1, and 2 correspond to stdin, stdout, +and stderr, respectively. Additional fds can be specified to create additional +pipes between the parent and child. The value is one of the following: + +1. `'pipe'` - Create a pipe between the child process and the parent process. + The parent end of the pipe is exposed to the parent as a property on the + `child_process` object as [`child.stdio[fd]`][`stdio`]. Pipes created for + fds 0 - 2 are also available as [`child.stdin`][], [`child.stdout`][] + and [`child.stderr`][], respectively. +2. `'ipc'` - Create an IPC channel for passing messages/file descriptors + between parent and child. A [`ChildProcess`][] may have at most *one* IPC stdio + file descriptor. Setting this option enables the [`child.send()`][] method. + If the child writes JSON messages to this file descriptor, the + [`child.on('message')`][`'message'`] event handler will be triggered in the parent. + If the child is a Node.js process, the presence of an IPC channel will enable + [`process.send()`][], [`process.disconnect()`][], [`process.on('disconnect')`][], and + [`process.on('message')`] within the child. +3. `'ignore'` - Instructs Node.js to ignore the fd in the child. While Node.js + will always open fds 0 - 2 for the processes it spawns, setting the fd to + `'ignore'` will cause Node.js to open `/dev/null` and attach it to the + child's fd. +4. {Stream} object - Share a readable or writable stream that refers to a tty, + file, socket, or a pipe with the child process. The stream's underlying + file descriptor is duplicated in the child process to the fd that + corresponds to the index in the `stdio` array. Note that the stream must + have an underlying descriptor (file streams do not until the `'open'` + event has occurred). +5. Positive integer - The integer value is interpreted as a file descriptor + that is is currently open in the parent process. It is shared with the child + process, similar to how {Stream} objects can be shared. +6. `null`, `undefined` - Use default value. For stdio fds 0, 1 and 2 (in other + words, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the + default is `'ignore'`. + +Example: + +```js +const spawn = require('child_process').spawn; + +// Child will use parent's stdios +spawn('prg', [], { stdio: 'inherit' }); + +// Spawn child sharing only stderr +spawn('prg', [], { stdio: ['pipe', 'pipe', process.stderr] }); + +// Open an extra fd=4, to interact with programs presenting a +// startd-style interface. +spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] }); +``` + +*It is worth noting that when an IPC channel is established between the +parent and child processes, and the child is a Node.js process, the child +is launched with the IPC channel unreferenced (using `unref()`) until the +child registers an event handler for the [`process.on('disconnect')`][] event. +This allows the child to exit normally without the process being held open +by the open IPC channel.* + +See also: [`child_process.exec()`][] and [`child_process.fork()`][] + +## Synchronous Process Creation + +The [`child_process.spawnSync()`][], [`child_process.execSync()`][], and +[`child_process.execFileSync()`][] methods are **synchronous** and **WILL** block +the Node.js event loop, pausing execution of any additional code until the +spawned process exits. + +Blocking calls like these are mostly useful for simplifying general purpose +scripting tasks and for simplifying the loading/processing of application +configuration at startup. + +### child_process.execFileSync(file[, args][, options]) + + +* `file` {String} The name or path of the executable file to run +* `args` {Array} List of string arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `input` {String|Buffer} The value which will be passed as stdin to the + spawned process + - supplying this value will override `stdio[0]` + * `stdio` {Array} Child's stdio configuration. (Default: `'pipe'`) + - `stderr` by default will be output to the parent process' stderr unless + `stdio` is specified + * `env` {Object} Environment key-value pairs + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) + * `timeout` {Number} In milliseconds the maximum amount of time the process + is allowed to run. (Default: `undefined`) + * `killSignal` {String} The signal value to be used when the spawned process + will be killed. (Default: `'SIGTERM'`) + * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on + stdout or stderr - if exceeded child process is killed + * `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: `'buffer'`) +* return: {Buffer|String} The stdout from the command + +The `child_process.execFileSync()` method is generally identical to +[`child_process.execFile()`][] with the exception that the method will not return +until the child process has fully closed. When a timeout has been encountered +and `killSignal` is sent, the method won't return until the process has +completely exited. *Note that if the child process intercepts and handles +the `SIGTERM` signal and does not exit, the parent process will still wait +until the child process has exited.* + +If the process times out, or has a non-zero exit code, this method ***will*** +throw. The [`Error`][] object will contain the entire result from +[`child_process.spawnSync()`][] + +### child_process.execSync(command[, options]) + + +* `command` {String} The command to run +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `input` {String|Buffer} The value which will be passed as stdin to the + spawned process + - supplying this value will override `stdio[0]` + * `stdio` {Array} Child's stdio configuration. (Default: `'pipe'`) + - `stderr` by default will be output to the parent process' stderr unless + `stdio` is specified + * `env` {Object} Environment key-value pairs + * `shell` {String} Shell to execute the command with + (Default: `'/bin/sh'` on UNIX, `'cmd.exe'` on Windows, The shell should + understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows, + command line parsing should be compatible with `cmd.exe`.) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) + * `timeout` {Number} In milliseconds the maximum amount of time the process + is allowed to run. (Default: `undefined`) + * `killSignal` {String} The signal value to be used when the spawned process + will be killed. (Default: `'SIGTERM'`) + * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on + stdout or stderr - if exceeded child process is killed + * `encoding` {String} The encoding used for all stdio inputs and outputs. + (Default: `'buffer'`) +* return: {Buffer|String} The stdout from the command + +The `child_process.execSync()` method is generally identical to +[`child_process.exec()`][] with the exception that the method will not return until +the child process has fully closed. When a timeout has been encountered and +`killSignal` is sent, the method won't return until the process has completely +exited. *Note that if the child process intercepts and handles the `SIGTERM` +signal and doesn't exit, the parent process will wait until the child +process has exited.* + +If the process times out, or has a non-zero exit code, this method ***will*** +throw. The [`Error`][] object will contain the entire result from +[`child_process.spawnSync()`][] + +### child_process.spawnSync(command[, args][, options]) + + +* `command` {String} The command to run +* `args` {Array} List of string arguments +* `options` {Object} + * `cwd` {String} Current working directory of the child process + * `input` {String|Buffer} The value which will be passed as stdin to the + spawned process + - supplying this value will override `stdio[0]` + * `stdio` {Array} Child's stdio configuration. + * `env` {Object} Environment key-value pairs + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) + * `timeout` {Number} In milliseconds the maximum amount of time the process + is allowed to run. (Default: `undefined`) + * `killSignal` {String} The signal value to be used when the spawned process + will be killed. (Default: `'SIGTERM'`) + * [`maxBuffer`][] {Number} largest amount of data (in bytes) allowed on + stdout or stderr - if exceeded child process is killed + * `encoding` {String} The encoding used for all stdio inputs and outputs. + (Default: `'buffer'`) + * `shell` {Boolean|String} If `true`, runs `command` inside of a shell. Uses + `'/bin/sh'` on UNIX, and `'cmd.exe'` on Windows. A different shell can be + specified as a string. The shell should understand the `-c` switch on UNIX, + or `/s /c` on Windows. Defaults to `false` (no shell). +* return: {Object} + * `pid` {Number} Pid of the child process + * `output` {Array} Array of results from stdio output + * `stdout` {Buffer|String} The contents of `output[1]` + * `stderr` {Buffer|String} The contents of `output[2]` + * `status` {Number} The exit code of the child process + * `signal` {String} The signal used to kill the child process + * `error` {Error} The error object if the child process failed or timed out + +The `child_process.spawnSync()` method is generally identical to +[`child_process.spawn()`][] with the exception that the function will not return +until the child process has fully closed. When a timeout has been encountered +and `killSignal` is sent, the method won't return until the process has +completely exited. Note that if the process intercepts and handles the +`SIGTERM` signal and doesn't exit, the parent process will wait until the child +process has exited. + +## Class: ChildProcess + + +Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that represent +spawned child processes. + +Instances of `ChildProcess` are not intended to be created directly. Rather, +use the [`child_process.spawn()`][], [`child_process.exec()`][], +[`child_process.execFile()`][], or [`child_process.fork()`][] methods to create +instances of `ChildProcess`. + +### Event: 'close' + + +* `code` {Number} the exit code if the child exited on its own. +* `signal` {String} the signal by which the child process was terminated. + +The `'close'` event is emitted when the stdio streams of a child process have +been closed. This is distinct from the [`'exit'`][] event, since multiple +processes might share the same stdio streams. + +### Event: 'disconnect' + + +The `'disconnect'` event is emitted after calling the +[`child.disconnect()`][] method in parent process or [`process.disconnect()`][] in child process. After +disconnecting it is no longer possible to send or receive messages, and the +[`child.connected`][] property is `false`. + +### Event: 'error' + +* `err` {Error} the error. + +The `'error'` event is emitted whenever: + +1. The process could not be spawned, or +2. The process could not be killed, or +3. Sending a message to the child process failed. + +Note that the `'exit'` event may or may not fire after an error has occurred. +If you are listening to both the `'exit'` and `'error'` events, it is important +to guard against accidentally invoking handler functions multiple times. + +See also [`child.kill()`][] and [`child.send()`][]. + +### Event: 'exit' + + +* `code` {Number} the exit code if the child exited on its own. +* `signal` {String} the signal by which the child process was terminated. + +The `'exit'` event is emitted after the child process ends. If the process +exited, `code` is the final exit code of the process, otherwise `null`. If the +process terminated due to receipt of a signal, `signal` is the string name of +the signal, otherwise `null`. One of the two will always be non-null. + +Note that when the `'exit'` event is triggered, child process stdio streams +might still be open. + +Also, note that Node.js establishes signal handlers for `SIGINT` and +`SIGTERM` and Node.js processes will not terminate immediately due to receipt +of those signals. Rather, Node.js will perform a sequence of cleanup actions +and then will re-raise the handled signal. + +See waitpid(2). + +### Event: 'message' + + +* `message` {Object} a parsed JSON object or primitive value. +* `sendHandle` {Handle} a [`net.Socket`][] or [`net.Server`][] object, or + undefined. + +The `'message'` event is triggered when a child process uses [`process.send()`][] +to send messages. + +### child.connected + + +* {Boolean} Set to `false` after `child.disconnect()` is called + +The `child.connected` property indicates whether it is still possible to send +and receive messages from a child process. When `child.connected` is `false`, it +is no longer possible to send or receive messages. + +### child.disconnect() + + +Closes the IPC channel between parent and child, allowing the child to exit +gracefully once there are no other connections keeping it alive. After calling +this method the `child.connected` and `process.connected` properties in both +the parent and child (respectively) will be set to `false`, and it will be no +longer possible to pass messages between the processes. + +The `'disconnect'` event will be emitted when there are no messages in the +process of being received. This will most often be triggered immediately after +calling `child.disconnect()`. + +Note that when the child process is a Node.js instance (e.g. spawned using +[`child_process.fork()`]), the `process.disconnect()` method can be invoked +within the child process to close the IPC channel as well. + +### child.kill([signal]) + + +* `signal` {String} + +The `child.kill()` methods sends a signal to the child process. If no argument +is given, the process will be sent the `'SIGTERM'` signal. See `signal(7)` for +a list of available signals. + +```js +const spawn = require('child_process').spawn; +const grep = spawn('grep', ['ssh']); + +grep.on('close', (code, signal) => { + console.log( + `child process terminated due to receipt of signal ${signal}`); +}); + +// Send SIGHUP to process +grep.kill('SIGHUP'); +``` + +The [`ChildProcess`][] object may emit an [`'error'`][] event if the signal cannot be +delivered. Sending a signal to a child process that has already exited is not +an error but may have unforeseen consequences. Specifically, if the process +identifier (PID) has been reassigned to another process, the signal will be +delivered to that process instead which can have unexpected results. + +Note that while the function is called `kill`, the signal delivered to the +child process may not actually terminate the process. + +See kill(2) for reference. + +Also note: on Linux, child processes of child processes will not be terminated +when attempting to kill their parent. This is likely to happen when running a +new process in a shell or with use of the `shell` option of `ChildProcess`, such +as in this example: + +```js +'use strict'; +const spawn = require('child_process').spawn; + +let child = spawn('sh', ['-c', + `node -e "setInterval(() => { + console.log(process.pid + 'is alive') + }, 500);"` + ], { + stdio: ['inherit', 'inherit', 'inherit'] + }); + +setTimeout(() => { + child.kill(); // does not terminate the node process in the shell +}, 2000); +``` + +### child.pid + + +* {Number} Integer + +Returns the process identifier (PID) of the child process. + +Example: + +```js +const spawn = require('child_process').spawn; +const grep = spawn('grep', ['ssh']); + +console.log(`Spawned child pid: ${grep.pid}`); +grep.stdin.end(); +``` + +### child.send(message[, sendHandle[, options]][, callback]) + + +* `message` {Object} +* `sendHandle` {Handle} +* `options` {Object} +* `callback` {Function} +* Return: {Boolean} + +When an IPC channel has been established between the parent and child ( +i.e. when using [`child_process.fork()`][]), the `child.send()` method can be +used to send messages to the child process. When the child process is a Node.js +instance, these messages can be received via the [`process.on('message')`][] event. + +For example, in the parent script: + +```js +const cp = require('child_process'); +const n = cp.fork(`${__dirname}/sub.js`); + +n.on('message', (m) => { + console.log('PARENT got message:', m); +}); + +n.send({ hello: 'world' }); +``` + +And then the child script, `'sub.js'` might look like this: + +```js +process.on('message', (m) => { + console.log('CHILD got message:', m); +}); + +process.send({ foo: 'bar' }); +``` + +Child Node.js processes will have a [`process.send()`][] method of their own that +allows the child to send messages back to the parent. + +There is a special case when sending a `{cmd: 'NODE_foo'}` message. All messages +containing a `NODE_` prefix in its `cmd` property are considered to be reserved +for use within Node.js core and will not be emitted in the child's +[`process.on('message')`][] event. Rather, such messages are emitted using the +`process.on('internalMessage')` event and are consumed internally by Node.js. +Applications should avoid using such messages or listening for +`'internalMessage'` events as it is subject to change without notice. + +The optional `sendHandle` argument that may be passed to `child.send()` is for +passing a TCP server or socket object to the child process. The child will +receive the object as the second argument passed to the callback function +registered on the [`process.on('message')`][] event. Any data that is received +and buffered in the socket will not be sent to the child. + +The `options` argument, if present, is an object used to parameterize the +sending of certain types of handles. `options` supports the following +properties: + + * `keepOpen` - A Boolean value that can be used when passing instances of + `net.Socket`. When `true`, the socket is kept open in the sending process. + Defaults to `false`. + +The optional `callback` is a function that is invoked after the message is +sent but before the child may have received it. The function is called with a +single argument: `null` on success, or an [`Error`][] object on failure. + +If no `callback` function is provided and the message cannot be sent, an +`'error'` event will be emitted by the [`ChildProcess`][] object. This can happen, +for instance, when the child process has already exited. + +`child.send()` will return `false` if the channel has closed or when the +backlog of unsent messages exceeds a threshold that makes it unwise to send +more. Otherwise, the method returns `true`. The `callback` function can be +used to implement flow control. + +#### Example: sending a server object + +The `sendHandle` argument can be used, for instance, to pass the handle of +a TCP server object to the child process as illustrated in the example below: + +```js +const child = require('child_process').fork('child.js'); + +// Open up the server object and send the handle. +const server = require('net').createServer(); +server.on('connection', (socket) => { + socket.end('handled by parent'); +}); +server.listen(1337, () => { + child.send('server', server); +}); +``` + +The child would then receive the server object as: + +```js +process.on('message', (m, server) => { + if (m === 'server') { + server.on('connection', (socket) => { + socket.end('handled by child'); + }); + } +}); +``` + +Once the server is now shared between the parent and child, some connections +can be handled by the parent and some by the child. + +While the example above uses a server created using the `net` module, `dgram` +module servers use exactly the same workflow with the exceptions of listening on +a `'message'` event instead of `'connection'` and using `server.bind()` instead of +`server.listen()`. This is, however, currently only supported on UNIX platforms. + +#### Example: sending a socket object + +Similarly, the `sendHandler` argument can be used to pass the handle of a +socket to the child process. The example below spawns two children that each +handle connections with "normal" or "special" priority: + +```js +const normal = require('child_process').fork('child.js', ['normal']); +const special = require('child_process').fork('child.js', ['special']); + +// Open up the server and send sockets to child +const server = require('net').createServer(); +server.on('connection', (socket) => { + + // If this is special priority + if (socket.remoteAddress === '74.125.127.100') { + special.send('socket', socket); + return; + } + // This is normal priority + normal.send('socket', socket); +}); +server.listen(1337); +``` + +The `child.js` would receive the socket handle as the second argument passed +to the event callback function: + +```js +process.on('message', (m, socket) => { + if (m === 'socket') { + socket.end(`Request handled with ${process.argv[2]} priority`); + } +}); +``` + +Once a socket has been passed to a child, the parent is no longer capable of +tracking when the socket is destroyed. To indicate this, the `.connections` +property becomes `null`. It is recommended not to use `.maxConnections` when +this occurs. + +*Note: this function uses [`JSON.stringify()`][] internally to serialize the +`message`.* + +### child.stderr + + +* {Stream} + +A `Readable Stream` that represents the child process's `stderr`. + +If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, +then this will be `undefined`. + +`child.stderr` is an alias for `child.stdio[2]`. Both properties will refer to +the same value. + +### child.stdin + + +* {Stream} + +A `Writable Stream` that represents the child process's `stdin`. + +*Note that if a child process waits to read all of its input, the child will not +continue until this stream has been closed via `end()`.* + +If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, +then this will be `undefined`. + +`child.stdin` is an alias for `child.stdio[0]`. Both properties will refer to +the same value. + +### child.stdio + + +* {Array} + +A sparse array of pipes to the child process, corresponding with positions in +the [`stdio`][] option passed to [`child_process.spawn()`][] that have been set +to the value `'pipe'`. Note that `child.stdio[0]`, `child.stdio[1]`, and +`child.stdio[2]` are also available as `child.stdin`, `child.stdout`, and +`child.stderr`, respectively. + +In the following example, only the child's fd `1` (stdout) is configured as a +pipe, so only the parent's `child.stdio[1]` is a stream, all other values in +the array are `null`. + +```js +const assert = require('assert'); +const fs = require('fs'); +const child_process = require('child_process'); + +const child = child_process.spawn('ls', { + stdio: [ + 0, // Use parents stdin for child + 'pipe', // Pipe child's stdout to parent + fs.openSync('err.out', 'w') // Direct child's stderr to a file + ] +}); + +assert.equal(child.stdio[0], null); +assert.equal(child.stdio[0], child.stdin); + +assert(child.stdout); +assert.equal(child.stdio[1], child.stdout); + +assert.equal(child.stdio[2], null); +assert.equal(child.stdio[2], child.stderr); +``` + +### child.stdout + + +* {Stream} + +A `Readable Stream` that represents the child process's `stdout`. + +If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, +then this will be `undefined`. + +`child.stdout` is an alias for `child.stdio[1]`. Both properties will refer +to the same value. + +## `maxBuffer` and Unicode + +It is important to keep in mind that the `maxBuffer` option specifies the +largest number of *octets* allowed on `stdout` or `stderr`. If this value is +exceeded, then the child process is terminated. This particularly impacts +output that includes multibyte character encodings such as UTF-8 or UTF-16. +For instance, the following will output 13 UTF-8 encoded octets to `stdout` +although there are only 4 characters: + +```js +console.log('中文测试'); +``` + +[`'error'`]: #child_process_event_error +[`'exit'`]: #child_process_event_exit +[`'message'`]: #child_process_event_message +[`child.connected`]: #child_process_child_connected +[`child.disconnect()`]: #child_process_child_disconnect +[`child.kill()`]: #child_process_child_kill_signal +[`child.send()`]: #child_process_child_send_message_sendhandle_options_callback +[`child.stderr`]: #child_process_child_stderr +[`child.stdin`]: #child_process_child_stdin +[`child.stdout`]: #child_process_child_stdout +[`child_process.exec()`]: #child_process_child_process_exec_command_options_callback +[`child_process.execFile()`]: #child_process_child_process_execfile_file_args_options_callback +[`child_process.execFileSync()`]: #child_process_child_process_execfilesync_file_args_options +[`child_process.execSync()`]: #child_process_child_process_execsync_command_options +[`child_process.fork()`]: #child_process_child_process_fork_modulepath_args_options +[`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options +[`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options +[`ChildProcess`]: #child_process_child_process +[`Error`]: errors.html#errors_class_error +[`EventEmitter`]: events.html#events_class_eventemitter +[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[`maxBuffer`]: #child_process_maxbuffer_and_unicode +[`net.Server`]: net.html#net_class_net_server +[`net.Socket`]: net.html#net_class_net_socket +[`options.detached`]: #child_process_options_detached +[`process.disconnect()`]: process.html#process_process_disconnect +[`process.env`]: process.html#process_process_env +[`process.execPath`]: process.html#process_process_execpath +[`process.on('disconnect')`]: process.html#process_event_disconnect +[`process.on('message')`]: process.html#process_event_message +[`process.send()`]: process.html#process_process_send_message_sendhandle_options_callback +[`stdio`]: #child_process_options_stdio +[synchronous counterparts]: #child_process_synchronous_process_creation diff --git a/doc/api/cli.markdown b/doc/api/cli.markdown deleted file mode 100644 index 52e3f2709c3543..00000000000000 --- a/doc/api/cli.markdown +++ /dev/null @@ -1,172 +0,0 @@ -# Command Line Options - - - -Node.js comes with a wide variety of CLI options. These options expose built-in -debugging, multiple ways to execute scripts, and other helpful runtime options. - -To view this documentation as a manual page in your terminal, run `man node`. - - -## Synopsis - -`node [options] [v8 options] [script.js | -e "script"] [arguments]` - -`node debug [script.js | -e "script" | :] …` - -`node --v8-options` - -Execute without arguments to start the [REPL][]. - -_For more info about `node debug`, please see the [debugger][] documentation._ - - -## Options - -### `-v`, `--version` - -Print node's version. - - -### `-h`, `--help` - -Print node command line options. -The output of this option is less detailed than this document. - - -### `-e`, `--eval "script"` - -Evaluate the following argument as JavaScript. - - -### `-p`, `--print "script"` - -Identical to `-e` but prints the result. - - -### `-c`, `--check` - -Syntax check the script without executing. - - -### `-i`, `--interactive` - -Opens the REPL even if stdin does not appear to be a terminal. - - -### `-r`, `--require module` - -Preload the specified module at startup. - -Follows `require()`'s module resolution -rules. `module` may be either a path to a file, or a node module name. - - -### `--no-deprecation` - -Silence deprecation warnings. - - -### `--trace-deprecation` - -Print stack traces for deprecations. - - -### `--throw-deprecation` - -Throw errors for deprecations. - -### `--no-warnings` - -Silence all process warnings (including deprecations). - -### `--trace-warnings` - -Print stack traces for process warnings (including deprecations). - -### `--trace-sync-io` - -Prints a stack trace whenever synchronous I/O is detected after the first turn -of the event loop. - - -### `--zero-fill-buffers` - -Automatically zero-fills all newly allocated [Buffer][] and [SlowBuffer][] -instances. - - -### `--track-heap-objects` - -Track heap object allocations for heap snapshots. - - -### `--prof-process` - -Process v8 profiler output generated using the v8 option `--prof`. - - -### `--v8-options` - -Print v8 command line options. - - -### `--tls-cipher-list=list` - -Specify an alternative default TLS cipher list. (Requires Node.js to be built -with crypto support. (Default)) - - -### `--enable-fips` - -Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with -`./configure --openssl-fips`) - - -### `--force-fips` - -Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) -(Same requirements as `--enable-fips`) - - -### `--icu-data-dir=file` - -Specify ICU data load path. (overrides `NODE_ICU_DATA`) - - -## Environment Variables - -### `NODE_DEBUG=module[,…]` - -`','`-separated list of core modules that should print debug information. - - -### `NODE_PATH=path[:…]` - -`':'`-separated list of directories prefixed to the module search path. - -_Note: on Windows, this is a `';'`-separated list instead._ - - -### `NODE_DISABLE_COLORS=1` - -When set to `1` colors will not be used in the REPL. - - -### `NODE_ICU_DATA=file` - -Data path for ICU (Intl object) data. Will extend linked-in data when compiled -with small-icu support. - - -### `NODE_REPL_HISTORY=file` - -Path to the file used to store the persistent REPL history. The default path is -`~/.node_repl_history`, which is overridden by this variable. Setting the value -to an empty string (`""` or `" "`) disables persistent REPL history. - - -[Buffer]: buffer.html#buffer_buffer -[debugger]: debugger.html -[REPL]: repl.html -[SlowBuffer]: buffer.html#buffer_class_slowbuffer diff --git a/doc/api/cli.md b/doc/api/cli.md new file mode 100644 index 00000000000000..e40ddada742bbe --- /dev/null +++ b/doc/api/cli.md @@ -0,0 +1,294 @@ +# Command Line Options + + + +Node.js comes with a variety of CLI options. These options expose built-in +debugging, multiple ways to execute scripts, and other helpful runtime options. + +To view this documentation as a manual page in your terminal, run `man node`. + + +## Synopsis + +`node [options] [v8 options] [script.js | -e "script"] [arguments]` + +`node debug [script.js | -e "script" | :] …` + +`node --v8-options` + +Execute without arguments to start the [REPL][]. + +_For more info about `node debug`, please see the [debugger][] documentation._ + + +## Options + +### `-v`, `--version` + + +Print node's version. + + +### `-h`, `--help` + + +Print node command line options. +The output of this option is less detailed than this document. + + +### `-e`, `--eval "script"` + + +Evaluate the following argument as JavaScript. The modules which are +predefined in the REPL can also be used in `script`. + + +### `-p`, `--print "script"` + + +Identical to `-e` but prints the result. + + +### `-c`, `--check` + + +Syntax check the script without executing. + + +### `-i`, `--interactive` + + +Opens the REPL even if stdin does not appear to be a terminal. + + +### `-r`, `--require module` + + +Preload the specified module at startup. + +Follows `require()`'s module resolution +rules. `module` may be either a path to a file, or a node module name. + + +### `--no-deprecation` + + +Silence deprecation warnings. + + +### `--trace-deprecation` + + +Print stack traces for deprecations. + + +### `--throw-deprecation` + + +Throw errors for deprecations. + +### `--no-warnings` + + +Silence all process warnings (including deprecations). + +### `--trace-warnings` + + +Print stack traces for process warnings (including deprecations). + +### `--trace-sync-io` + + +Prints a stack trace whenever synchronous I/O is detected after the first turn +of the event loop. + + +### `--zero-fill-buffers` + + +Automatically zero-fills all newly allocated [Buffer][] and [SlowBuffer][] +instances. + + +### `--preserve-symlinks` + + +Instructs the module loader to preserve symbolic links when resolving and +caching modules. + +By default, when Node.js loads a module from a path that is symbolically linked +to a different on-disk location, Node.js will dereference the link and use the +actual on-disk "real path" of the module as both an identifier and as a root +path to locate other dependency modules. In most cases, this default behavior +is acceptable. However, when using symbolically linked peer dependencies, as +illustrated in the example below, the default behavior causes an exception to +be thrown if `moduleA` attempts to require `moduleB` as a peer dependency: + +```text +{appDir} + ├── app + │ ├── index.js + │ └── node_modules + │ ├── moduleA -> {appDir}/moduleA + │ └── moduleB + │ ├── index.js + │ └── package.json + └── moduleA + ├── index.js + └── package.json +``` + +The `--preserve-symlinks` command line flag instructs Node.js to use the +symlink path for modules as opposed to the real path, allowing symbolically +linked peer dependencies to be found. + +Note, however, that using `--preserve-symlinks` can have other side effects. +Specifically, symbolically linked *native* modules can fail to load if those +are linked from more than one location in the dependency tree (Node.js would +see those as two separate modules and would attempt to load the module multiple +times, causing an exception to be thrown). + +### `--track-heap-objects` + + +Track heap object allocations for heap snapshots. + + +### `--prof-process` + + +Process v8 profiler output generated using the v8 option `--prof`. + + +### `--v8-options` + + +Print v8 command line options. + +Note: v8 options allow words to be separated by both dashes (`-`) or underscores +(`_`). + +For example, `--stack-trace-limit` is equivalent to `--stack_trace_limit`. + +### `--tls-cipher-list=list` + + +Specify an alternative default TLS cipher list. (Requires Node.js to be built +with crypto support. (Default)) + + +### `--enable-fips` + + +Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with +`./configure --openssl-fips`) + + +### `--force-fips` + + +Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) +(Same requirements as `--enable-fips`) + + +### `--icu-data-dir=file` + + +Specify ICU data load path. (overrides `NODE_ICU_DATA`) + +## Environment Variables + +### `NODE_DEBUG=module[,…]` + + +`','`-separated list of core modules that should print debug information. + + +### `NODE_PATH=path[:…]` + + +`':'`-separated list of directories prefixed to the module search path. + +_Note: on Windows, this is a `';'`-separated list instead._ + + +### `NODE_DISABLE_COLORS=1` + + +When set to `1` colors will not be used in the REPL. + + +### `NODE_ICU_DATA=file` + + +Data path for ICU (Intl object) data. Will extend linked-in data when compiled +with small-icu support. + + +### `NODE_REPL_HISTORY=file` + + +Path to the file used to store the persistent REPL history. The default path is +`~/.node_repl_history`, which is overridden by this variable. Setting the value +to an empty string (`""` or `" "`) disables persistent REPL history. + + +[Buffer]: buffer.html#buffer_buffer +[debugger]: debugger.html +[REPL]: repl.html +[SlowBuffer]: buffer.html#buffer_class_slowbuffer diff --git a/doc/api/cluster.markdown b/doc/api/cluster.markdown deleted file mode 100644 index f510468c898ec2..00000000000000 --- a/doc/api/cluster.markdown +++ /dev/null @@ -1,712 +0,0 @@ -# Cluster - - Stability: 2 - Stable - -A single instance of Node.js runs in a single thread. To take advantage of -multi-core systems the user will sometimes want to launch a cluster of Node.js -processes to handle the load. - -The cluster module allows you to easily create child processes that -all share server ports. - -```js -const cluster = require('cluster'); -const http = require('http'); -const numCPUs = require('os').cpus().length; - -if (cluster.isMaster) { - // Fork workers. - for (var i = 0; i < numCPUs; i++) { - cluster.fork(); - } - - cluster.on('exit', (worker, code, signal) => { - console.log(`worker ${worker.process.pid} died`); - }); -} else { - // Workers can share any TCP connection - // In this case it is an HTTP server - http.createServer((req, res) => { - res.writeHead(200); - res.end('hello world\n'); - }).listen(8000); -} -``` - -Running Node.js will now share port 8000 between the workers: - -``` -$ NODE_DEBUG=cluster node server.js -23521,Master Worker 23524 online -23521,Master Worker 23526 online -23521,Master Worker 23523 online -23521,Master Worker 23528 online -``` - -Please note that, on Windows, it is not yet possible to set up a named pipe -server in a worker. - -## How It Works - - - -The worker processes are spawned using the [`child_process.fork()`][] method, -so that they can communicate with the parent via IPC and pass server -handles back and forth. - -The cluster module supports two methods of distributing incoming -connections. - -The first one (and the default one on all platforms except Windows), -is the round-robin approach, where the master process listens on a -port, accepts new connections and distributes them across the workers -in a round-robin fashion, with some built-in smarts to avoid -overloading a worker process. - -The second approach is where the master process creates the listen -socket and sends it to interested workers. The workers then accept -incoming connections directly. - -The second approach should, in theory, give the best performance. -In practice however, distribution tends to be very unbalanced due -to operating system scheduler vagaries. Loads have been observed -where over 70% of all connections ended up in just two processes, -out of a total of eight. - -Because `server.listen()` hands off most of the work to the master -process, there are three cases where the behavior between a normal -Node.js process and a cluster worker differs: - -1. `server.listen({fd: 7})` Because the message is passed to the master, - file descriptor 7 **in the parent** will be listened on, and the - handle passed to the worker, rather than listening to the worker's - idea of what the number 7 file descriptor references. -2. `server.listen(handle)` Listening on handles explicitly will cause - the worker to use the supplied handle, rather than talk to the master - process. If the worker already has the handle, then it's presumed - that you know what you are doing. -3. `server.listen(0)` Normally, this will cause servers to listen on a - random port. However, in a cluster, each worker will receive the - same "random" port each time they do `listen(0)`. In essence, the - port is random the first time, but predictable thereafter. If you - want to listen on a unique port, generate a port number based on the - cluster worker ID. - -There is no routing logic in Node.js, or in your program, and no shared -state between the workers. Therefore, it is important to design your -program such that it does not rely too heavily on in-memory data objects -for things like sessions and login. - -Because workers are all separate processes, they can be killed or -re-spawned depending on your program's needs, without affecting other -workers. As long as there are some workers still alive, the server will -continue to accept connections. If no workers are alive, existing connections -will be dropped and new connections will be refused. Node.js does not -automatically manage the number of workers for you, however. It is your -responsibility to manage the worker pool for your application's needs. - - - -## Class: Worker - -A Worker object contains all public information and method about a worker. -In the master it can be obtained using `cluster.workers`. In a worker -it can be obtained using `cluster.worker`. - -### Event: 'disconnect' - -Similar to the `cluster.on('disconnect')` event, but specific to this worker. - -```js -cluster.fork().on('disconnect', () => { - // Worker has disconnected -}); -``` - -### Event: 'error' - -This event is the same as the one provided by [`child_process.fork()`][]. - -In a worker you can also use `process.on('error')`. - -### Event: 'exit' - -* `code` {Number} the exit code, if it exited normally. -* `signal` {String} the name of the signal (eg. `'SIGHUP'`) that caused - the process to be killed. - -Similar to the `cluster.on('exit')` event, but specific to this worker. - -```js -const worker = cluster.fork(); -worker.on('exit', (code, signal) => { - if( signal ) { - console.log(`worker was killed by signal: ${signal}`); - } else if( code !== 0 ) { - console.log(`worker exited with error code: ${code}`); - } else { - console.log('worker success!'); - } -}); -``` - -### Event: 'listening' - -* `address` {Object} - -Similar to the `cluster.on('listening')` event, but specific to this worker. - -```js -cluster.fork().on('listening', (address) => { - // Worker is listening -}); -``` - -It is not emitted in the worker. - -### Event: 'message' - -* `message` {Object} - -Similar to the `cluster.on('message')` event, but specific to this worker. - -This event is the same as the one provided by [`child_process.fork()`][]. - -In a worker you can also use `process.on('message')`. - -As an example, here is a cluster that keeps count of the number of requests -in the master process using the message system: - -```js -const cluster = require('cluster'); -const http = require('http'); - -if (cluster.isMaster) { - - // Keep track of http requests - var numReqs = 0; - setInterval(() => { - console.log('numReqs =', numReqs); - }, 1000); - - // Count requests - function messageHandler(msg) { - if (msg.cmd && msg.cmd == 'notifyRequest') { - numReqs += 1; - } - } - - // Start workers and listen for messages containing notifyRequest - const numCPUs = require('os').cpus().length; - for (var i = 0; i < numCPUs; i++) { - cluster.fork(); - } - - Object.keys(cluster.workers).forEach((id) => { - cluster.workers[id].on('message', messageHandler); - }); - -} else { - - // Worker processes have a http server. - http.Server((req, res) => { - res.writeHead(200); - res.end('hello world\n'); - - // notify master about the request - process.send({ cmd: 'notifyRequest' }); - }).listen(8000); -} -``` - -### Event: 'online' - -Similar to the `cluster.on('online')` event, but specific to this worker. - -```js -cluster.fork().on('online', () => { - // Worker is online -}); -``` - -It is not emitted in the worker. - -### worker.disconnect() - -In a worker, this function will close all servers, wait for the `'close'` event on -those servers, and then disconnect the IPC channel. - -In the master, an internal message is sent to the worker causing it to call -`.disconnect()` on itself. - -Causes `.suicide` to be set. - -Note that after a server is closed, it will no longer accept new connections, -but connections may be accepted by any other listening worker. Existing -connections will be allowed to close as usual. When no more connections exist, -see [`server.close()`][], the IPC channel to the worker will close allowing it to -die gracefully. - -The above applies *only* to server connections, client connections are not -automatically closed by workers, and disconnect does not wait for them to close -before exiting. - -Note that in a worker, `process.disconnect` exists, but it is not this function, -it is [`disconnect`][]. - -Because long living server connections may block workers from disconnecting, it -may be useful to send a message, so application specific actions may be taken to -close them. It also may be useful to implement a timeout, killing a worker if -the `'disconnect'` event has not been emitted after some time. - -```js -if (cluster.isMaster) { - var worker = cluster.fork(); - var timeout; - - worker.on('listening', (address) => { - worker.send('shutdown'); - worker.disconnect(); - timeout = setTimeout(() => { - worker.kill(); - }, 2000); - }); - - worker.on('disconnect', () => { - clearTimeout(timeout); - }); - -} else if (cluster.isWorker) { - const net = require('net'); - var server = net.createServer((socket) => { - // connections never end - }); - - server.listen(8000); - - process.on('message', (msg) => { - if(msg === 'shutdown') { - // initiate graceful close of any connections to server - } - }); -} -``` - -### worker.id - -* {Number} - -Each new worker is given its own unique id, this id is stored in the -`id`. - -While a worker is alive, this is the key that indexes it in -cluster.workers - -### worker.isConnected() - -This function returns `true` if the worker is connected to its master via its IPC -channel, `false` otherwise. A worker is connected to its master after it's been -created. It is disconnected after the `'disconnect'` event is emitted. - -### worker.isDead() - -This function returns `true` if the worker's process has terminated (either -because of exiting or being signaled). Otherwise, it returns `false`. - -### worker.kill([signal='SIGTERM']) - -* `signal` {String} Name of the kill signal to send to the worker - process. - -This function will kill the worker. In the master, it does this by disconnecting -the `worker.process`, and once disconnected, killing with `signal`. In the -worker, it does it by disconnecting the channel, and then exiting with code `0`. - -Causes `.suicide` to be set. - -This method is aliased as `worker.destroy()` for backwards compatibility. - -Note that in a worker, `process.kill()` exists, but it is not this function, -it is [`kill`][]. - -### worker.process - -* {ChildProcess} - -All workers are created using [`child_process.fork()`][], the returned object -from this function is stored as `.process`. In a worker, the global `process` -is stored. - -See: [Child Process module][] - -Note that workers will call `process.exit(0)` if the `'disconnect'` event occurs -on `process` and `.suicide` is not `true`. This protects against accidental -disconnection. - -### worker.send(message[, sendHandle][, callback]) - -* `message` {Object} -* `sendHandle` {Handle} -* `callback` {Function} -* Return: Boolean - -Send a message to a worker or master, optionally with a handle. - -In the master this sends a message to a specific worker. It is identical to -[`ChildProcess.send()`][]. - -In a worker this sends a message to the master. It is identical to -`process.send()`. - -This example will echo back all messages from the master: - -```js -if (cluster.isMaster) { - var worker = cluster.fork(); - worker.send('hi there'); - -} else if (cluster.isWorker) { - process.on('message', (msg) => { - process.send(msg); - }); -} -``` - -### worker.suicide - -* {Boolean} - -Set by calling `.kill()` or `.disconnect()`, until then it is `undefined`. - -The boolean `worker.suicide` lets you distinguish between voluntary and accidental -exit, the master may choose not to respawn a worker based on this value. - -```js -cluster.on('exit', (worker, code, signal) => { - if (worker.suicide === true) { - console.log('Oh, it was just suicide\' – no need to worry'). - } -}); - -// kill worker -worker.kill(); -``` - -## Event: 'disconnect' - -* `worker` {cluster.Worker} - -Emitted after the worker IPC channel has disconnected. This can occur when a -worker exits gracefully, is killed, or is disconnected manually (such as with -worker.disconnect()). - -There may be a delay between the `'disconnect'` and `'exit'` events. These events -can be used to detect if the process is stuck in a cleanup or if there are -long-living connections. - -```js -cluster.on('disconnect', (worker) => { - console.log(`The worker #${worker.id} has disconnected`); -}); -``` - -## Event: 'exit' - -* `worker` {cluster.Worker} -* `code` {Number} the exit code, if it exited normally. -* `signal` {String} the name of the signal (eg. `'SIGHUP'`) that caused - the process to be killed. - -When any of the workers die the cluster module will emit the `'exit'` event. - -This can be used to restart the worker by calling `.fork()` again. - -```js -cluster.on('exit', (worker, code, signal) => { - console.log('worker %d died (%s). restarting...', - worker.process.pid, signal || code); - cluster.fork(); -}); -``` - -See [child_process event: 'exit'][]. - -## Event: 'fork' - -* `worker` {cluster.Worker} - -When a new worker is forked the cluster module will emit a `'fork'` event. -This can be used to log worker activity, and create your own timeout. - -```js -var timeouts = []; -function errorMsg() { - console.error('Something must be wrong with the connection ...'); -} - -cluster.on('fork', (worker) => { - timeouts[worker.id] = setTimeout(errorMsg, 2000); -}); -cluster.on('listening', (worker, address) => { - clearTimeout(timeouts[worker.id]); -}); -cluster.on('exit', (worker, code, signal) => { - clearTimeout(timeouts[worker.id]); - errorMsg(); -}); -``` - -## Event: 'listening' - -* `worker` {cluster.Worker} -* `address` {Object} - -After calling `listen()` from a worker, when the `'listening'` event is emitted on -the server, a `'listening'` event will also be emitted on `cluster` in the master. - -The event handler is executed with two arguments, the `worker` contains the worker -object and the `address` object contains the following connection properties: -`address`, `port` and `addressType`. This is very useful if the worker is listening -on more than one address. - -```js -cluster.on('listening', (worker, address) => { - console.log( - `A worker is now connected to ${address.address}:${address.port}`); -}); -``` - -The `addressType` is one of: - -* `4` (TCPv4) -* `6` (TCPv6) -* `-1` (unix domain socket) -* `"udp4"` or `"udp6"` (UDP v4 or v6) - -## Event: 'message' - -* `worker` {cluster.Worker} -* `message` {Object} -* `handle` {undefined|Object} - -Emitted when any worker receives a message. - -See [child_process event: 'message'][]. - -Before Node.js v6.0, this event emitted only the message and the handle, -but not the worker object, contrary to what the documentation stated. - -If you need to support older versions and don't need the worker object, -you can work around the discrepancy by checking the number of arguments: - -```js -cluster.on('message', function(worker, message, handle) { - if (arguments.length === 2) { - handle = message; - message = worker; - worker = undefined; - } - // ... -}); -``` - -## Event: 'online' - -* `worker` {cluster.Worker} - -After forking a new worker, the worker should respond with an online message. -When the master receives an online message it will emit this event. -The difference between `'fork'` and `'online'` is that fork is emitted when the -master forks a worker, and 'online' is emitted when the worker is running. - -```js -cluster.on('online', (worker) => { - console.log('Yay, the worker responded after it was forked'); -}); -``` - -## Event: 'setup' - -* `settings` {Object} - -Emitted every time `.setupMaster()` is called. - -The `settings` object is the `cluster.settings` object at the time -`.setupMaster()` was called and is advisory only, since multiple calls to -`.setupMaster()` can be made in a single tick. - -If accuracy is important, use `cluster.settings`. - -## cluster.disconnect([callback]) - -* `callback` {Function} called when all workers are disconnected and handles are - closed - -Calls `.disconnect()` on each worker in `cluster.workers`. - -When they are disconnected all internal handles will be closed, allowing the -master process to die gracefully if no other event is waiting. - -The method takes an optional callback argument which will be called when finished. - -This can only be called from the master process. - -## cluster.fork([env]) - -* `env` {Object} Key/value pairs to add to worker process environment. -* return {cluster.Worker} - -Spawn a new worker process. - -This can only be called from the master process. - -## cluster.isMaster - -* {Boolean} - -True if the process is a master. This is determined -by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` is -undefined, then `isMaster` is `true`. - -## cluster.isWorker - -* {Boolean} - -True if the process is not a master (it is the negation of `cluster.isMaster`). - -## cluster.schedulingPolicy - -The scheduling policy, either `cluster.SCHED_RR` for round-robin or -`cluster.SCHED_NONE` to leave it to the operating system. This is a -global setting and effectively frozen once you spawn the first worker -or call `cluster.setupMaster()`, whatever comes first. - -`SCHED_RR` is the default on all operating systems except Windows. -Windows will change to `SCHED_RR` once libuv is able to effectively -distribute IOCP handles without incurring a large performance hit. - -`cluster.schedulingPolicy` can also be set through the -`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid -values are `"rr"` and `"none"`. - -## cluster.settings - -* {Object} - * `execArgv` {Array} list of string arguments passed to the Node.js - executable. (Default=`process.execArgv`) - * `exec` {String} file path to worker file. (Default=`process.argv[1]`) - * `args` {Array} string arguments passed to worker. - (Default=`process.argv.slice(2)`) - * `silent` {Boolean} whether or not to send output to parent's stdio. - (Default=`false`) - * `uid` {Number} Sets the user identity of the process. (See setuid(2).) - * `gid` {Number} Sets the group identity of the process. (See setgid(2).) - -After calling `.setupMaster()` (or `.fork()`) this settings object will contain -the settings, including the default values. - -It is effectively frozen after being set, because `.setupMaster()` can -only be called once. - -This object is not supposed to be changed or set manually, by you. - -## cluster.setupMaster([settings]) - -* `settings` {Object} - * `exec` {String} file path to worker file. (Default=`process.argv[1]`) - * `args` {Array} string arguments passed to worker. - (Default=`process.argv.slice(2)`) - * `silent` {Boolean} whether or not to send output to parent's stdio. - (Default=`false`) - -`setupMaster` is used to change the default 'fork' behavior. Once called, -the settings will be present in `cluster.settings`. - -Note that: - -* any settings changes only affect future calls to `.fork()` and have no - effect on workers that are already running -* The *only* attribute of a worker that cannot be set via `.setupMaster()` is - the `env` passed to `.fork()` -* the defaults above apply to the first call only, the defaults for later - calls is the current value at the time of `cluster.setupMaster()` is called - -Example: - -```js -const cluster = require('cluster'); -cluster.setupMaster({ - exec: 'worker.js', - args: ['--use', 'https'], - silent: true -}); -cluster.fork(); // https worker -cluster.setupMaster({ - exec: 'worker.js', - args: ['--use', 'http'] -}); -cluster.fork(); // http worker -``` - -This can only be called from the master process. - -## cluster.worker - -* {Object} - -A reference to the current worker object. Not available in the master process. - -```js -const cluster = require('cluster'); - -if (cluster.isMaster) { - console.log('I am master'); - cluster.fork(); - cluster.fork(); -} else if (cluster.isWorker) { - console.log(`I am worker #${cluster.worker.id}`); -} -``` - -## cluster.workers - -* {Object} - -A hash that stores the active worker objects, keyed by `id` field. Makes it -easy to loop through all the workers. It is only available in the master -process. - -A worker is removed from cluster.workers after the worker has disconnected _and_ -exited. The order between these two events cannot be determined in advance. -However, it is guaranteed that the removal from the cluster.workers list happens -before last `'disconnect'` or `'exit'` event is emitted. - -```js -// Go through all workers -function eachWorker(callback) { - for (var id in cluster.workers) { - callback(cluster.workers[id]); - } -} -eachWorker((worker) => { - worker.send('big announcement to all workers'); -}); -``` - -Should you wish to reference a worker over a communication channel, using -the worker's unique id is the easiest way to find the worker. - -```js -socket.on('data', (id) => { - var worker = cluster.workers[id]; -}); -``` - -[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options -[`ChildProcess.send()`]: child_process.html#child_process_child_send_message_sendhandle_callback -[`disconnect`]: child_process.html#child_process_child_disconnect -[`kill`]: process.html#process_process_kill_pid_signal -[`server.close()`]: net.html#net_event_close -[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options -[child_process event: 'exit']: child_process.html#child_process_event_exit -[child_process event: 'message']: child_process.html#child_process_event_message diff --git a/doc/api/cluster.md b/doc/api/cluster.md new file mode 100644 index 00000000000000..06ef0d94b2cd3a --- /dev/null +++ b/doc/api/cluster.md @@ -0,0 +1,740 @@ +# Cluster + + Stability: 2 - Stable + +A single instance of Node.js runs in a single thread. To take advantage of +multi-core systems the user will sometimes want to launch a cluster of Node.js +processes to handle the load. + +The cluster module allows you to easily create child processes that +all share server ports. + +```js +const cluster = require('cluster'); +const http = require('http'); +const numCPUs = require('os').cpus().length; + +if (cluster.isMaster) { + // Fork workers. + for (var i = 0; i < numCPUs; i++) { + cluster.fork(); + } + + cluster.on('exit', (worker, code, signal) => { + console.log(`worker ${worker.process.pid} died`); + }); +} else { + // Workers can share any TCP connection + // In this case it is an HTTP server + http.createServer((req, res) => { + res.writeHead(200); + res.end('hello world\n'); + }).listen(8000); +} +``` + +Running Node.js will now share port 8000 between the workers: + +``` +$ NODE_DEBUG=cluster node server.js +23521,Master Worker 23524 online +23521,Master Worker 23526 online +23521,Master Worker 23523 online +23521,Master Worker 23528 online +``` + +Please note that, on Windows, it is not yet possible to set up a named pipe +server in a worker. + +## How It Works + + + +The worker processes are spawned using the [`child_process.fork()`][] method, +so that they can communicate with the parent via IPC and pass server +handles back and forth. + +The cluster module supports two methods of distributing incoming +connections. + +The first one (and the default one on all platforms except Windows), +is the round-robin approach, where the master process listens on a +port, accepts new connections and distributes them across the workers +in a round-robin fashion, with some built-in smarts to avoid +overloading a worker process. + +The second approach is where the master process creates the listen +socket and sends it to interested workers. The workers then accept +incoming connections directly. + +The second approach should, in theory, give the best performance. +In practice however, distribution tends to be very unbalanced due +to operating system scheduler vagaries. Loads have been observed +where over 70% of all connections ended up in just two processes, +out of a total of eight. + +Because `server.listen()` hands off most of the work to the master +process, there are three cases where the behavior between a normal +Node.js process and a cluster worker differs: + +1. `server.listen({fd: 7})` Because the message is passed to the master, + file descriptor 7 **in the parent** will be listened on, and the + handle passed to the worker, rather than listening to the worker's + idea of what the number 7 file descriptor references. +2. `server.listen(handle)` Listening on handles explicitly will cause + the worker to use the supplied handle, rather than talk to the master + process. If the worker already has the handle, then it's presumed + that you know what you are doing. +3. `server.listen(0)` Normally, this will cause servers to listen on a + random port. However, in a cluster, each worker will receive the + same "random" port each time they do `listen(0)`. In essence, the + port is random the first time, but predictable thereafter. If you + want to listen on a unique port, generate a port number based on the + cluster worker ID. + +There is no routing logic in Node.js, or in your program, and no shared +state between the workers. Therefore, it is important to design your +program such that it does not rely too heavily on in-memory data objects +for things like sessions and login. + +Because workers are all separate processes, they can be killed or +re-spawned depending on your program's needs, without affecting other +workers. As long as there are some workers still alive, the server will +continue to accept connections. If no workers are alive, existing connections +will be dropped and new connections will be refused. Node.js does not +automatically manage the number of workers for you, however. It is your +responsibility to manage the worker pool for your application's needs. + + + +## Class: Worker + +A Worker object contains all public information and method about a worker. +In the master it can be obtained using `cluster.workers`. In a worker +it can be obtained using `cluster.worker`. + +### Event: 'disconnect' + +Similar to the `cluster.on('disconnect')` event, but specific to this worker. + +```js +cluster.fork().on('disconnect', () => { + // Worker has disconnected +}); +``` + +### Event: 'error' + +This event is the same as the one provided by [`child_process.fork()`][]. + +In a worker you can also use `process.on('error')`. + +### Event: 'exit' + +* `code` {Number} the exit code, if it exited normally. +* `signal` {String} the name of the signal (eg. `'SIGHUP'`) that caused + the process to be killed. + +Similar to the `cluster.on('exit')` event, but specific to this worker. + +```js +const worker = cluster.fork(); +worker.on('exit', (code, signal) => { + if (signal) { + console.log(`worker was killed by signal: ${signal}`); + } else if (code !== 0) { + console.log(`worker exited with error code: ${code}`); + } else { + console.log('worker success!'); + } +}); +``` + +### Event: 'listening' + +* `address` {Object} + +Similar to the `cluster.on('listening')` event, but specific to this worker. + +```js +cluster.fork().on('listening', (address) => { + // Worker is listening +}); +``` + +It is not emitted in the worker. + +### Event: 'message' + +* `message` {Object} + +Similar to the `cluster.on('message')` event, but specific to this worker. + +This event is the same as the one provided by [`child_process.fork()`][]. + +In a worker you can also use `process.on('message')`. + +As an example, here is a cluster that keeps count of the number of requests +in the master process using the message system: + +```js +const cluster = require('cluster'); +const http = require('http'); + +if (cluster.isMaster) { + + // Keep track of http requests + var numReqs = 0; + setInterval(() => { + console.log('numReqs =', numReqs); + }, 1000); + + // Count requests + function messageHandler(msg) { + if (msg.cmd && msg.cmd == 'notifyRequest') { + numReqs += 1; + } + } + + // Start workers and listen for messages containing notifyRequest + const numCPUs = require('os').cpus().length; + for (var i = 0; i < numCPUs; i++) { + cluster.fork(); + } + + Object.keys(cluster.workers).forEach((id) => { + cluster.workers[id].on('message', messageHandler); + }); + +} else { + + // Worker processes have a http server. + http.Server((req, res) => { + res.writeHead(200); + res.end('hello world\n'); + + // notify master about the request + process.send({ cmd: 'notifyRequest' }); + }).listen(8000); +} +``` + +### Event: 'online' + +Similar to the `cluster.on('online')` event, but specific to this worker. + +```js +cluster.fork().on('online', () => { + // Worker is online +}); +``` + +It is not emitted in the worker. + +### worker.disconnect() + +In a worker, this function will close all servers, wait for the `'close'` event on +those servers, and then disconnect the IPC channel. + +In the master, an internal message is sent to the worker causing it to call +`.disconnect()` on itself. + +Causes `.exitedAfterDisconnect` to be set. + +Note that after a server is closed, it will no longer accept new connections, +but connections may be accepted by any other listening worker. Existing +connections will be allowed to close as usual. When no more connections exist, +see [`server.close()`][], the IPC channel to the worker will close allowing it to +die gracefully. + +The above applies *only* to server connections, client connections are not +automatically closed by workers, and disconnect does not wait for them to close +before exiting. + +Note that in a worker, `process.disconnect` exists, but it is not this function, +it is [`disconnect`][]. + +Because long living server connections may block workers from disconnecting, it +may be useful to send a message, so application specific actions may be taken to +close them. It also may be useful to implement a timeout, killing a worker if +the `'disconnect'` event has not been emitted after some time. + +```js +if (cluster.isMaster) { + var worker = cluster.fork(); + var timeout; + + worker.on('listening', (address) => { + worker.send('shutdown'); + worker.disconnect(); + timeout = setTimeout(() => { + worker.kill(); + }, 2000); + }); + + worker.on('disconnect', () => { + clearTimeout(timeout); + }); + +} else if (cluster.isWorker) { + const net = require('net'); + var server = net.createServer((socket) => { + // connections never end + }); + + server.listen(8000); + + process.on('message', (msg) => { + if (msg === 'shutdown') { + // initiate graceful close of any connections to server + } + }); +} +``` + +### worker.exitedAfterDisconnect + +* {Boolean} + +Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`. + +The boolean `worker.exitedAfterDisconnect` lets you distinguish between voluntary +and accidental exit, the master may choose not to respawn a worker based on +this value. + +```js +cluster.on('exit', (worker, code, signal) => { + if (worker.exitedAfterDisconnect === true) { + console.log('Oh, it was just voluntary – no need to worry'); + } +}); + +// kill worker +worker.kill(); +``` + +### worker.id + +* {Number} + +Each new worker is given its own unique id, this id is stored in the +`id`. + +While a worker is alive, this is the key that indexes it in +cluster.workers + +### worker.isConnected() + +This function returns `true` if the worker is connected to its master via its IPC +channel, `false` otherwise. A worker is connected to its master after it's been +created. It is disconnected after the `'disconnect'` event is emitted. + +### worker.isDead() + +This function returns `true` if the worker's process has terminated (either +because of exiting or being signaled). Otherwise, it returns `false`. + +### worker.kill([signal='SIGTERM']) + +* `signal` {String} Name of the kill signal to send to the worker + process. + +This function will kill the worker. In the master, it does this by disconnecting +the `worker.process`, and once disconnected, killing with `signal`. In the +worker, it does it by disconnecting the channel, and then exiting with code `0`. + +Causes `.exitedAfterDisconnect` to be set. + +This method is aliased as `worker.destroy()` for backwards compatibility. + +Note that in a worker, `process.kill()` exists, but it is not this function, +it is [`kill`][]. + +### worker.process + +* {ChildProcess} + +All workers are created using [`child_process.fork()`][], the returned object +from this function is stored as `.process`. In a worker, the global `process` +is stored. + +See: [Child Process module][] + +Note that workers will call `process.exit(0)` if the `'disconnect'` event occurs +on `process` and `.exitedAfterDisconnect` is not `true`. This protects against +accidental disconnection. + +### worker.send(message[, sendHandle][, callback]) + +* `message` {Object} +* `sendHandle` {Handle} +* `callback` {Function} +* Return: Boolean + +Send a message to a worker or master, optionally with a handle. + +In the master this sends a message to a specific worker. It is identical to +[`ChildProcess.send()`][]. + +In a worker this sends a message to the master. It is identical to +`process.send()`. + +This example will echo back all messages from the master: + +```js +if (cluster.isMaster) { + var worker = cluster.fork(); + worker.send('hi there'); + +} else if (cluster.isWorker) { + process.on('message', (msg) => { + process.send(msg); + }); +} +``` + +### worker.suicide + + Stability: 0 - Deprecated: Use [`worker.exitedAfterDisconnect`][] instead. + +An alias to [`worker.exitedAfterDisconnect`][]. + +Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`. + +The boolean `worker.suicide` lets you distinguish between voluntary +and accidental exit, the master may choose not to respawn a worker based on +this value. + +```js +cluster.on('exit', (worker, code, signal) => { + if (worker.suicide === true) { + console.log('Oh, it was just voluntary – no need to worry'); + } +}); + +// kill worker +worker.kill(); +``` + +This API only exists for backwards compatibility and will be removed in the +future. + +## Event: 'disconnect' + +* `worker` {cluster.Worker} + +Emitted after the worker IPC channel has disconnected. This can occur when a +worker exits gracefully, is killed, or is disconnected manually (such as with +worker.disconnect()). + +There may be a delay between the `'disconnect'` and `'exit'` events. These events +can be used to detect if the process is stuck in a cleanup or if there are +long-living connections. + +```js +cluster.on('disconnect', (worker) => { + console.log(`The worker #${worker.id} has disconnected`); +}); +``` + +## Event: 'exit' + +* `worker` {cluster.Worker} +* `code` {Number} the exit code, if it exited normally. +* `signal` {String} the name of the signal (eg. `'SIGHUP'`) that caused + the process to be killed. + +When any of the workers die the cluster module will emit the `'exit'` event. + +This can be used to restart the worker by calling `.fork()` again. + +```js +cluster.on('exit', (worker, code, signal) => { + console.log('worker %d died (%s). restarting...', + worker.process.pid, signal || code); + cluster.fork(); +}); +``` + +See [child_process event: 'exit'][]. + +## Event: 'fork' + +* `worker` {cluster.Worker} + +When a new worker is forked the cluster module will emit a `'fork'` event. +This can be used to log worker activity, and create your own timeout. + +```js +var timeouts = []; +function errorMsg() { + console.error('Something must be wrong with the connection ...'); +} + +cluster.on('fork', (worker) => { + timeouts[worker.id] = setTimeout(errorMsg, 2000); +}); +cluster.on('listening', (worker, address) => { + clearTimeout(timeouts[worker.id]); +}); +cluster.on('exit', (worker, code, signal) => { + clearTimeout(timeouts[worker.id]); + errorMsg(); +}); +``` + +## Event: 'listening' + +* `worker` {cluster.Worker} +* `address` {Object} + +After calling `listen()` from a worker, when the `'listening'` event is emitted on +the server, a `'listening'` event will also be emitted on `cluster` in the master. + +The event handler is executed with two arguments, the `worker` contains the worker +object and the `address` object contains the following connection properties: +`address`, `port` and `addressType`. This is very useful if the worker is listening +on more than one address. + +```js +cluster.on('listening', (worker, address) => { + console.log( + `A worker is now connected to ${address.address}:${address.port}`); +}); +``` + +The `addressType` is one of: + +* `4` (TCPv4) +* `6` (TCPv6) +* `-1` (unix domain socket) +* `"udp4"` or `"udp6"` (UDP v4 or v6) + +## Event: 'message' + +* `worker` {cluster.Worker} +* `message` {Object} +* `handle` {undefined|Object} + +Emitted when any worker receives a message. + +See [child_process event: 'message'][]. + +Before Node.js v6.0, this event emitted only the message and the handle, +but not the worker object, contrary to what the documentation stated. + +If you need to support older versions and don't need the worker object, +you can work around the discrepancy by checking the number of arguments: + +```js +cluster.on('message', function(worker, message, handle) { + if (arguments.length === 2) { + handle = message; + message = worker; + worker = undefined; + } + // ... +}); +``` + +## Event: 'online' + +* `worker` {cluster.Worker} + +After forking a new worker, the worker should respond with an online message. +When the master receives an online message it will emit this event. +The difference between `'fork'` and `'online'` is that fork is emitted when the +master forks a worker, and 'online' is emitted when the worker is running. + +```js +cluster.on('online', (worker) => { + console.log('Yay, the worker responded after it was forked'); +}); +``` + +## Event: 'setup' + +* `settings` {Object} + +Emitted every time `.setupMaster()` is called. + +The `settings` object is the `cluster.settings` object at the time +`.setupMaster()` was called and is advisory only, since multiple calls to +`.setupMaster()` can be made in a single tick. + +If accuracy is important, use `cluster.settings`. + +## cluster.disconnect([callback]) + +* `callback` {Function} called when all workers are disconnected and handles are + closed + +Calls `.disconnect()` on each worker in `cluster.workers`. + +When they are disconnected all internal handles will be closed, allowing the +master process to die gracefully if no other event is waiting. + +The method takes an optional callback argument which will be called when finished. + +This can only be called from the master process. + +## cluster.fork([env]) + +* `env` {Object} Key/value pairs to add to worker process environment. +* return {cluster.Worker} + +Spawn a new worker process. + +This can only be called from the master process. + +## cluster.isMaster + +* {Boolean} + +True if the process is a master. This is determined +by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` is +undefined, then `isMaster` is `true`. + +## cluster.isWorker + +* {Boolean} + +True if the process is not a master (it is the negation of `cluster.isMaster`). + +## cluster.schedulingPolicy + +The scheduling policy, either `cluster.SCHED_RR` for round-robin or +`cluster.SCHED_NONE` to leave it to the operating system. This is a +global setting and effectively frozen once you spawn the first worker +or call `cluster.setupMaster()`, whatever comes first. + +`SCHED_RR` is the default on all operating systems except Windows. +Windows will change to `SCHED_RR` once libuv is able to effectively +distribute IOCP handles without incurring a large performance hit. + +`cluster.schedulingPolicy` can also be set through the +`NODE_CLUSTER_SCHED_POLICY` environment variable. Valid +values are `"rr"` and `"none"`. + +## cluster.settings + +* {Object} + * `execArgv` {Array} list of string arguments passed to the Node.js + executable. (Default=`process.execArgv`) + * `exec` {String} file path to worker file. (Default=`process.argv[1]`) + * `args` {Array} string arguments passed to worker. + (Default=`process.argv.slice(2)`) + * `silent` {Boolean} whether or not to send output to parent's stdio. + (Default=`false`) + * `uid` {Number} Sets the user identity of the process. (See setuid(2).) + * `gid` {Number} Sets the group identity of the process. (See setgid(2).) + +After calling `.setupMaster()` (or `.fork()`) this settings object will contain +the settings, including the default values. + +It is effectively frozen after being set, because `.setupMaster()` can +only be called once. + +This object is not supposed to be changed or set manually, by you. + +## cluster.setupMaster([settings]) + +* `settings` {Object} + * `exec` {String} file path to worker file. (Default=`process.argv[1]`) + * `args` {Array} string arguments passed to worker. + (Default=`process.argv.slice(2)`) + * `silent` {Boolean} whether or not to send output to parent's stdio. + (Default=`false`) + +`setupMaster` is used to change the default 'fork' behavior. Once called, +the settings will be present in `cluster.settings`. + +Note that: + +* any settings changes only affect future calls to `.fork()` and have no + effect on workers that are already running +* The *only* attribute of a worker that cannot be set via `.setupMaster()` is + the `env` passed to `.fork()` +* the defaults above apply to the first call only, the defaults for later + calls is the current value at the time of `cluster.setupMaster()` is called + +Example: + +```js +const cluster = require('cluster'); +cluster.setupMaster({ + exec: 'worker.js', + args: ['--use', 'https'], + silent: true +}); +cluster.fork(); // https worker +cluster.setupMaster({ + exec: 'worker.js', + args: ['--use', 'http'] +}); +cluster.fork(); // http worker +``` + +This can only be called from the master process. + +## cluster.worker + +* {Object} + +A reference to the current worker object. Not available in the master process. + +```js +const cluster = require('cluster'); + +if (cluster.isMaster) { + console.log('I am master'); + cluster.fork(); + cluster.fork(); +} else if (cluster.isWorker) { + console.log(`I am worker #${cluster.worker.id}`); +} +``` + +## cluster.workers + +* {Object} + +A hash that stores the active worker objects, keyed by `id` field. Makes it +easy to loop through all the workers. It is only available in the master +process. + +A worker is removed from cluster.workers after the worker has disconnected _and_ +exited. The order between these two events cannot be determined in advance. +However, it is guaranteed that the removal from the cluster.workers list happens +before last `'disconnect'` or `'exit'` event is emitted. + +```js +// Go through all workers +function eachWorker(callback) { + for (var id in cluster.workers) { + callback(cluster.workers[id]); + } +} +eachWorker((worker) => { + worker.send('big announcement to all workers'); +}); +``` + +Should you wish to reference a worker over a communication channel, using +the worker's unique id is the easiest way to find the worker. + +```js +socket.on('data', (id) => { + var worker = cluster.workers[id]; +}); +``` + +[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options +[`ChildProcess.send()`]: child_process.html#child_process_child_send_message_sendhandle_options_callback +[`disconnect`]: child_process.html#child_process_child_disconnect +[`kill`]: process.html#process_process_kill_pid_signal +[`server.close()`]: net.html#net_event_close +[`worker.exitedAfterDisconnect`]: #cluster_worker_exitedafterdisconnect +[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options +[child_process event: 'exit']: child_process.html#child_process_event_exit +[child_process event: 'message']: child_process.html#child_process_event_message diff --git a/doc/api/console.markdown b/doc/api/console.markdown deleted file mode 100644 index 6cf5051af2591e..00000000000000 --- a/doc/api/console.markdown +++ /dev/null @@ -1,226 +0,0 @@ -# Console - - Stability: 2 - Stable - -The `console` module provides a simple debugging console that is similar to the -JavaScript console mechanism provided by web browsers. - -The module exports two specific components: - -* A `Console` class with methods such as `console.log()`, `console.error()` and - `console.warn()` that can be used to write to any Node.js stream. -* A global `console` instance configured to write to `stdout` and `stderr`. - Because this object is global, it can be used without calling - `require('console')`. - -Example using the global `console`: - -```js -console.log('hello world'); - // Prints: hello world, to stdout -console.log('hello %s', 'world'); - // Prints: hello world, to stdout -console.error(new Error('Whoops, something bad happened')); - // Prints: [Error: Whoops, something bad happened], to stderr - -const name = 'Will Robinson'; -console.warn(`Danger ${name}! Danger!`); - // Prints: Danger Will Robinson! Danger!, to stderr -``` - -Example using the `Console` class: - -```js -const out = getStreamSomehow(); -const err = getStreamSomehow(); -const myConsole = new console.Console(out, err); - -myConsole.log('hello world'); - // Prints: hello world, to out -myConsole.log('hello %s', 'world'); - // Prints: hello world, to out -myConsole.error(new Error('Whoops, something bad happened')); - // Prints: [Error: Whoops, something bad happened], to err - -const name = 'Will Robinson'; -myConsole.warn(`Danger ${name}! Danger!`); - // Prints: Danger Will Robinson! Danger!, to err -``` - -While the API for the `Console` class is designed fundamentally around the -browser `console` object, the `Console` in Node.js is *not* intended to -duplicate the browser's functionality exactly. - -## Asynchronous vs Synchronous Consoles - -The console functions are asynchronous unless the destination is a file. -Disks are fast and operating systems normally employ write-back caching; -it should be a very rare occurrence indeed that a write blocks, but it -is possible. - -## Class: Console - - - -The `Console` class can be used to create a simple logger with configurable -output streams and can be accessed using either `require('console').Console` -or `console.Console`: - -```js -const Console = require('console').Console; -const Console = console.Console; -``` - -### new Console(stdout[, stderr]) - -Creates a new `Console` by passing one or two writable stream instances. -`stdout` is a writable stream to print log or info output. `stderr` -is used for warning or error output. If `stderr` isn't passed, warning and error -output will be sent to `stdout`. - -```js -const output = fs.createWriteStream('./stdout.log'); -const errorOutput = fs.createWriteStream('./stderr.log'); -// custom simple logger -const logger = new Console(output, errorOutput); -// use it like console -var count = 5; -logger.log('count: %d', count); -// in stdout.log: count 5 -``` - -The global `console` is a special `Console` whose output is sent to -[`process.stdout`][] and [`process.stderr`][]. It is equivalent to calling: - -```js -new Console(process.stdout, process.stderr); -``` - -### console.assert(value[, message][, ...]) - -A simple assertion test that verifies whether `value` is truthy. If it is not, -an `AssertionError` is thrown. If provided, the error `message` is formatted -using [`util.format()`][] and used as the error message. - -```js -console.assert(true, 'does nothing'); - // OK -console.assert(false, 'Whoops %s', 'didn\'t work'); - // AssertionError: Whoops didn't work -``` - -### console.dir(obj[, options]) - -Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. -This function bypasses any custom `inspect()` function defined on `obj`. An -optional `options` object may be passed to alter certain aspects of the -formatted string: - -- `showHidden` - if `true` then the object's non-enumerable and symbol -properties will be shown too. Defaults to `false`. - -- `depth` - tells [`util.inspect()`][] how many times to recurse while -formatting the object. This is useful for inspecting large complicated objects. -Defaults to `2`. To make it recurse indefinitely, pass `null`. - -- `colors` - if `true`, then the output will be styled with ANSI color codes. -Defaults to `false`. Colors are customizable; see -[customizing `util.inspect()` colors][]. - -### console.error([data][, ...]) - -Prints to `stderr` with newline. Multiple arguments can be passed, with the -first used as the primary message and all additional used as substitution -values similar to `printf(3)` (the arguments are all passed to -[`util.format()`][]). - -```js -const code = 5; -console.error('error #%d', code); - // Prints: error #5, to stderr -console.error('error', code); - // Prints: error 5, to stderr -``` - -If formatting elements (e.g. `%d`) are not found in the first string then -[`util.inspect()`][] is called on each argument and the resulting string -values are concatenated. See [`util.format()`][] for more information. - -### console.info([data][, ...]) - -The `console.info()` function is an alias for [`console.log()`][]. - -### console.log([data][, ...]) - -Prints to `stdout` with newline. Multiple arguments can be passed, with the -first used as the primary message and all additional used as substitution -values similar to `printf(3)` (the arguments are all passed to -[`util.format()`][]). - -```js -var count = 5; -console.log('count: %d', count); - // Prints: count: 5, to stdout -console.log('count: ', count); - // Prints: count: 5, to stdout -``` - -If formatting elements (e.g. `%d`) are not found in the first string then -[`util.inspect()`][] is called on each argument and the resulting string -values are concatenated. See [`util.format()`][] for more information. - -### console.time(label) - -Starts a timer that can be used to compute the duration of an operation. Timers -are identified by a unique `label`. Use the same `label` when you call -[`console.timeEnd()`][] to stop the timer and output the elapsed time in -milliseconds to stdout. Timer durations are accurate to the sub-millisecond. - -### console.timeEnd(label) - -Stops a timer that was previously started by calling [`console.time()`][] and -prints the result to stdout: - -```js -console.time('100-elements'); -for (var i = 0; i < 100; i++) { - ; -} -console.timeEnd('100-elements'); -// prints 100-elements: 225.438ms -``` - -### console.trace(message[, ...]) - -Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][] -formatted message and stack trace to the current position in the code. - -```js -console.trace('Show me'); - // Prints: (stack trace will vary based on where trace is called) - // Trace: Show me - // at repl:2:9 - // at REPLServer.defaultEval (repl.js:248:27) - // at bound (domain.js:287:14) - // at REPLServer.runBound [as eval] (domain.js:300:12) - // at REPLServer. (repl.js:412:12) - // at emitOne (events.js:82:20) - // at REPLServer.emit (events.js:169:7) - // at REPLServer.Interface._onLine (readline.js:210:10) - // at REPLServer.Interface._line (readline.js:549:8) - // at REPLServer.Interface._ttyWrite (readline.js:826:14) -``` - -### console.warn([data][, ...]) - -The `console.warn()` function is an alias for [`console.error()`][]. - -[`console.error()`]: #console_console_error_data -[`console.log()`]: #console_console_log_data -[`console.time()`]: #console_console_time_label -[`console.timeEnd()`]: #console_console_timeend_label -[`process.stderr`]: process.html#process_process_stderr -[`process.stdout`]: process.html#process_process_stdout -[`util.format()`]: util.html#util_util_format_format -[`util.inspect()`]: util.html#util_util_inspect_object_options -[customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors diff --git a/doc/api/console.md b/doc/api/console.md new file mode 100644 index 00000000000000..ac0ce25a37c7a6 --- /dev/null +++ b/doc/api/console.md @@ -0,0 +1,303 @@ +# Console + + Stability: 2 - Stable + +The `console` module provides a simple debugging console that is similar to the +JavaScript console mechanism provided by web browsers. + +The module exports two specific components: + +* A `Console` class with methods such as `console.log()`, `console.error()` and + `console.warn()` that can be used to write to any Node.js stream. +* A global `console` instance configured to write to `stdout` and `stderr`. + Because this object is global, it can be used without calling + `require('console')`. + +Example using the global `console`: + +```js +console.log('hello world'); + // Prints: hello world, to stdout +console.log('hello %s', 'world'); + // Prints: hello world, to stdout +console.error(new Error('Whoops, something bad happened')); + // Prints: [Error: Whoops, something bad happened], to stderr + +const name = 'Will Robinson'; +console.warn(`Danger ${name}! Danger!`); + // Prints: Danger Will Robinson! Danger!, to stderr +``` + +Example using the `Console` class: + +```js +const out = getStreamSomehow(); +const err = getStreamSomehow(); +const myConsole = new console.Console(out, err); + +myConsole.log('hello world'); + // Prints: hello world, to out +myConsole.log('hello %s', 'world'); + // Prints: hello world, to out +myConsole.error(new Error('Whoops, something bad happened')); + // Prints: [Error: Whoops, something bad happened], to err + +const name = 'Will Robinson'; +myConsole.warn(`Danger ${name}! Danger!`); + // Prints: Danger Will Robinson! Danger!, to err +``` + +While the API for the `Console` class is designed fundamentally around the +browser `console` object, the `Console` in Node.js is *not* intended to +duplicate the browser's functionality exactly. + +## Asynchronous vs Synchronous Consoles + +The console functions are usually asynchronous unless the destination is a file. +Disks are fast and operating systems normally employ write-back caching; +it should be a very rare occurrence indeed that a write blocks, but it +is possible. + +Additionally, console functions are blocking when outputting to TTYs +(terminals) on OS X as a workaround for the OS's very small, 1kb buffer size. +This is to prevent interleaving between `stdout` and `stderr`. + +## Class: Console + + + +The `Console` class can be used to create a simple logger with configurable +output streams and can be accessed using either `require('console').Console` +or `console.Console`: + +```js +const Console = require('console').Console; +const Console = console.Console; +``` + +### new Console(stdout[, stderr]) + +Creates a new `Console` by passing one or two writable stream instances. +`stdout` is a writable stream to print log or info output. `stderr` +is used for warning or error output. If `stderr` isn't passed, warning and error +output will be sent to `stdout`. + +```js +const output = fs.createWriteStream('./stdout.log'); +const errorOutput = fs.createWriteStream('./stderr.log'); +// custom simple logger +const logger = new Console(output, errorOutput); +// use it like console +var count = 5; +logger.log('count: %d', count); +// in stdout.log: count 5 +``` + +The global `console` is a special `Console` whose output is sent to +[`process.stdout`][] and [`process.stderr`][]. It is equivalent to calling: + +```js +new Console(process.stdout, process.stderr); +``` + +### console.assert(value[, message][, ...]) + + +A simple assertion test that verifies whether `value` is truthy. If it is not, +an `AssertionError` is thrown. If provided, the error `message` is formatted +using [`util.format()`][] and used as the error message. + +```js +console.assert(true, 'does nothing'); + // OK +console.assert(false, 'Whoops %s', 'didn\'t work'); + // AssertionError: Whoops didn't work +``` + +*Note: the `console.assert()` method is implemented differently in Node.js +than the `console.assert()` method [available in browsers][web-api-assert].* + +Specifically, in browsers, calling `console.assert()` with a falsy +assertion will cause the `message` to be printed to the console without +interrupting execution of subsequent code. In Node.js, however, a falsy +assertion will cause an `AssertionError` to be thrown. + +Functionality approximating that implemented by browsers can be implemented +by extending Node.js' `console` and overriding the `console.assert()` method. + +In the following example, a simple module is created that extends and overrides +the default behavior of `console` in Node.js. + +```js +'use strict'; + +// Creates a simple extension of console with a +// new impl for assert without monkey-patching. +const myConsole = Object.setPrototypeOf({ + assert(assertion, message, ...args) { + try { + console.assert(assertion, message, ...args); + } catch (err) { + console.error(err.stack); + } + } +}, console); + +module.exports = myConsole; +``` + +This can then be used as a direct replacement for the built in console: + +```js +const console = require('./myConsole'); +console.assert(false, 'this message will print, but no error thrown'); +console.log('this will also print'); +``` + +### console.dir(obj[, options]) + + +Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. +This function bypasses any custom `inspect()` function defined on `obj`. An +optional `options` object may be passed to alter certain aspects of the +formatted string: + +- `showHidden` - if `true` then the object's non-enumerable and symbol +properties will be shown too. Defaults to `false`. + +- `depth` - tells [`util.inspect()`][] how many times to recurse while +formatting the object. This is useful for inspecting large complicated objects. +Defaults to `2`. To make it recurse indefinitely, pass `null`. + +- `colors` - if `true`, then the output will be styled with ANSI color codes. +Defaults to `false`. Colors are customizable; see +[customizing `util.inspect()` colors][]. + +### console.error([data][, ...]) + + +Prints to `stderr` with newline. Multiple arguments can be passed, with the +first used as the primary message and all additional used as substitution +values similar to `printf(3)` (the arguments are all passed to +[`util.format()`][]). + +```js +const code = 5; +console.error('error #%d', code); + // Prints: error #5, to stderr +console.error('error', code); + // Prints: error 5, to stderr +``` + +If formatting elements (e.g. `%d`) are not found in the first string then +[`util.inspect()`][] is called on each argument and the resulting string +values are concatenated. See [`util.format()`][] for more information. + +### console.info([data][, ...]) + + +The `console.info()` function is an alias for [`console.log()`][]. + +### console.log([data][, ...]) + + +Prints to `stdout` with newline. Multiple arguments can be passed, with the +first used as the primary message and all additional used as substitution +values similar to `printf(3)` (the arguments are all passed to +[`util.format()`][]). + +```js +var count = 5; +console.log('count: %d', count); + // Prints: count: 5, to stdout +console.log('count: ', count); + // Prints: count: 5, to stdout +``` + +If formatting elements (e.g. `%d`) are not found in the first string then +[`util.inspect()`][] is called on each argument and the resulting string +values are concatenated. See [`util.format()`][] for more information. + +### console.time(label) + + +Starts a timer that can be used to compute the duration of an operation. Timers +are identified by a unique `label`. Use the same `label` when you call +[`console.timeEnd()`][] to stop the timer and output the elapsed time in +milliseconds to stdout. Timer durations are accurate to the sub-millisecond. + +### console.timeEnd(label) + + +Stops a timer that was previously started by calling [`console.time()`][] and +prints the result to stdout: + +```js +console.time('100-elements'); +for (var i = 0; i < 100; i++) { + ; +} +console.timeEnd('100-elements'); +// prints 100-elements: 225.438ms +``` + +*Note: As of Node.js v6.0.0, `console.timeEnd()` deletes the timer to avoid +leaking it. On older versions, the timer persisted. This allowed +`console.timeEnd()` to be called multiple times for the same label. This +functionality was unintended and is no longer supported.* + +### console.trace(message[, ...]) + + +Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][] +formatted message and stack trace to the current position in the code. + +```js +console.trace('Show me'); + // Prints: (stack trace will vary based on where trace is called) + // Trace: Show me + // at repl:2:9 + // at REPLServer.defaultEval (repl.js:248:27) + // at bound (domain.js:287:14) + // at REPLServer.runBound [as eval] (domain.js:300:12) + // at REPLServer. (repl.js:412:12) + // at emitOne (events.js:82:20) + // at REPLServer.emit (events.js:169:7) + // at REPLServer.Interface._onLine (readline.js:210:10) + // at REPLServer.Interface._line (readline.js:549:8) + // at REPLServer.Interface._ttyWrite (readline.js:826:14) +``` + +### console.warn([data][, ...]) + + +The `console.warn()` function is an alias for [`console.error()`][]. + +[`console.error()`]: #console_console_error_data +[`console.log()`]: #console_console_log_data +[`console.time()`]: #console_console_time_label +[`console.timeEnd()`]: #console_console_timeend_label +[`process.stderr`]: process.html#process_process_stderr +[`process.stdout`]: process.html#process_process_stdout +[`util.format()`]: util.html#util_util_format_format +[`util.inspect()`]: util.html#util_util_inspect_object_options +[customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors +[web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown deleted file mode 100644 index 6c45d17951bdd4..00000000000000 --- a/doc/api/crypto.markdown +++ /dev/null @@ -1,1403 +0,0 @@ -# Crypto - - Stability: 2 - Stable - -The `crypto` module provides cryptographic functionality that includes a set of -wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign and verify functions. - -Use `require('crypto')` to access this module. - -```js -const crypto = require('crypto'); - -const secret = 'abcdefg'; -const hash = crypto.createHmac('sha256', secret) - .update('I love cupcakes') - .digest('hex'); -console.log(hash); - // Prints: - // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e -``` - -## Determining if crypto support is unavailable - -It is possible for Node.js to be built without including support for the -`crypto` module. In such cases, calling `require('crypto')` will result in an -error being thrown. - -```js -var crypto; -try { - crypto = require('crypto'); -} catch (err) { - console.log('crypto support is disabled!'); -} -``` - -## Class: Certificate - -SPKAC is a Certificate Signing Request mechanism originally implemented by -Netscape and now specified formally as part of [HTML5's `keygen` element][]. - -The `crypto` module provides the `Certificate` class for working with SPKAC -data. The most common usage is handling output generated by the HTML5 -`` element. Node.js uses [OpenSSL's SPKAC implementation][] internally. - -### new crypto.Certificate() - -Instances of the `Certificate` class can be created using the `new` keyword -or by calling `crypto.Certificate()` as a function: - -```js -const crypto = require('crypto'); - -const cert1 = new crypto.Certificate(); -const cert2 = crypto.Certificate(); -``` - -### certificate.exportChallenge(spkac) - -The `spkac` data structure includes a public key and a challenge. The -`certificate.exportChallenge()` returns the challenge component in the -form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string -or a [`Buffer`][]. - -```js -const cert = require('crypto').Certificate(); -const spkac = getSpkacSomehow(); -const challenge = cert.exportChallenge(spkac); -console.log(challenge.toString('utf8')); - // Prints the challenge as a UTF8 string -``` - -### certificate.exportPublicKey(spkac) - -The `spkac` data structure includes a public key and a challenge. The -`certificate.exportPublicKey()` returns the public key component in the -form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string -or a [`Buffer`][]. - -```js -const cert = require('crypto').Certificate(); -const spkac = getSpkacSomehow(); -const publicKey = cert.exportPublicKey(spkac); -console.log(publicKey); - // Prints the public key as -``` - -### certificate.verifySpkac(spkac) - -Returns `true` if the given `spkac` data structure is valid, `false` otherwise. -The `spkac` argument must be a Node.js [`Buffer`][]. - -```js -const cert = require('crypto').Certificate(); -const spkac = getSpkacSomehow(); -console.log(cert.verifySpkac(new Buffer(spkac))); - // Prints true or false -``` - -## Class: Cipher - -Instances of the `Cipher` class are used to encrypt data. The class can be -used in one of two ways: - -- As a [stream][] that is both readable and writable, where plain unencrypted - data is written to produce encrypted data on the readable side, or -- Using the [`cipher.update()`][] and [`cipher.final()`][] methods to produce - the encrypted data. - -The [`crypto.createCipher()`][] or [`crypto.createCipheriv()`][] methods are -used to create `Cipher` instances. `Cipher` objects are not to be created -directly using the `new` keyword. - -Example: Using `Cipher` objects as streams: - -```js -const crypto = require('crypto'); -const cipher = crypto.createCipher('aes192', 'a password'); - -var encrypted = ''; -cipher.on('readable', () => { - var data = cipher.read(); - if (data) - encrypted += data.toString('hex'); -}); -cipher.on('end', () => { - console.log(encrypted); - // Prints: ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504 -}); - -cipher.write('some clear text data'); -cipher.end(); -``` - -Example: Using `Cipher` and piped streams: - -```js -const crypto = require('crypto'); -const fs = require('fs'); -const cipher = crypto.createCipher('aes192', 'a password'); - -const input = fs.createReadStream('test.js'); -const output = fs.createWriteStream('test.enc'); - -input.pipe(cipher).pipe(output); -``` - -Example: Using the [`cipher.update()`][] and [`cipher.final()`][] methods: - -```js -const crypto = require('crypto'); -const cipher = crypto.createCipher('aes192', 'a password'); - -var encrypted = cipher.update('some clear text data', 'utf8', 'hex'); -encrypted += cipher.final('hex'); -console.log(encrypted); - // Prints: ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504 -``` - -### cipher.final([output_encoding]) - -Returns any remaining enciphered contents. If `output_encoding` -parameter is one of `'binary'`, `'base64'` or `'hex'`, a string is returned. -If an `output_encoding` is not provided, a [`Buffer`][] is returned. - -Once the `cipher.final()` method has been called, the `Cipher` object can no -longer be used to encrypt data. Attempts to call `cipher.final()` more than -once will result in an error being thrown. - -### cipher.setAAD(buffer) - -When using an authenticated encryption mode (only `GCM` is currently -supported), the `cipher.setAAD()` method sets the value used for the -_additional authenticated data_ (AAD) input parameter. - -### cipher.getAuthTag() - -When using an authenticated encryption mode (only `GCM` is currently -supported), the `cipher.getAuthTag()` method returns a [`Buffer`][] containing -the _authentication tag_ that has been computed from the given data. - -The `cipher.getAuthTag()` method should only be called after encryption has -been completed using the [`cipher.final()`][] method. - -### cipher.setAutoPadding(auto_padding=true) - -When using block encryption algorithms, the `Cipher` class will automatically -add padding to the input data to the appropriate block size. To disable the -default padding call `cipher.setAutoPadding(false)`. - -When `auto_padding` is `false`, the length of the entire input data must be a -multiple of the cipher's block size or [`cipher.final()`][] will throw an Error. -Disabling automatic padding is useful for non-standard padding, for instance -using `0x0` instead of PKCS padding. - -The `cipher.setAutoPadding()` method must be called before [`cipher.final()`][]. - -### cipher.update(data[, input_encoding][, output_encoding]) - -Updates the cipher with `data`. If the `input_encoding` argument is given, -it's value must be one of `'utf8'`, `'ascii'`, or `'binary'` and the `data` -argument is a string using the specified encoding. If the `input_encoding` -argument is not given, `data` must be a [`Buffer`][]. If `data` is a -[`Buffer`][] then `input_encoding` is ignored. - -The `output_encoding` specifies the output format of the enciphered -data, and can be `'binary'`, `'base64'` or `'hex'`. If the `output_encoding` -is specified, a string using the specified encoding is returned. If no -`output_encoding` is provided, a [`Buffer`][] is returned. - -The `cipher.update()` method can be called multiple times with new data until -[`cipher.final()`][] is called. Calling `cipher.update()` after -[`cipher.final()`][] will result in an error being thrown. - -## Class: Decipher - -Instances of the `Decipher` class are used to decrypt data. The class can be -used in one of two ways: - -- As a [stream][] that is both readable and writable, where plain encrypted - data is written to produce unencrypted data on the readable side, or -- Using the [`decipher.update()`][] and [`decipher.final()`][] methods to - produce the unencrypted data. - -The [`crypto.createDecipher()`][] or [`crypto.createDecipheriv()`][] methods are -used to create `Decipher` instances. `Decipher` objects are not to be created -directly using the `new` keyword. - -Example: Using `Decipher` objects as streams: - -```js -const crypto = require('crypto'); -const decipher = crypto.createDecipher('aes192', 'a password'); - -var decrypted = ''; -decipher.on('readable', () => { - var data = decipher.read(); - if (data) - decrypted += data.toString('utf8'); -}); -decipher.on('end', () => { - console.log(decrypted); - // Prints: some clear text data -}); - -var encrypted = 'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504'; -decipher.write(encrypted, 'hex'); -decipher.end(); -``` - -Example: Using `Decipher` and piped streams: - -```js -const crypto = require('crypto'); -const fs = require('fs'); -const decipher = crypto.createDecipher('aes192', 'a password'); - -const input = fs.createReadStream('test.enc'); -const output = fs.createWriteStream('test.js'); - -input.pipe(decipher).pipe(output); -``` - -Example: Using the [`decipher.update()`][] and [`decipher.final()`][] methods: - -```js -const crypto = require('crypto'); -const decipher = crypto.createDecipher('aes192', 'a password'); - -var encrypted = 'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504'; -var decrypted = decipher.update(encrypted, 'hex', 'utf8'); -decrypted += decipher.final('utf8'); -console.log(decrypted); - // Prints: some clear text data -``` - -### decipher.final([output_encoding]) - -Returns any remaining deciphered contents. If `output_encoding` -parameter is one of `'binary'`, `'base64'` or `'hex'`, a string is returned. -If an `output_encoding` is not provided, a [`Buffer`][] is returned. - -Once the `decipher.final()` method has been called, the `Decipher` object can -no longer be used to decrypt data. Attempts to call `decipher.final()` more -than once will result in an error being thrown. - -### decipher.setAAD(buffer) - -When using an authenticated encryption mode (only `GCM` is currently -supported), the `cipher.setAAD()` method sets the value used for the -_additional authenticated data_ (AAD) input parameter. - -### decipher.setAuthTag(buffer) - -When using an authenticated encryption mode (only `GCM` is currently -supported), the `decipher.setAuthTag()` method is used to pass in the -received _authentication tag_. If no tag is provided, or if the cipher text -has been tampered with, [`decipher.final()`][] with throw, indicating that the -cipher text should be discarded due to failed authentication. - -### decipher.setAutoPadding(auto_padding=true) - -When data has been encrypted without standard block padding, calling -`decipher.setAutoPadding(false)` will disable automatic padding to prevent -[`decipher.final()`][] from checking for and removing padding. - -Turning auto padding off will only work if the input data's length is a -multiple of the ciphers block size. - -The `decipher.setAutoPadding()` method must be called before -[`decipher.update()`][]. - -### decipher.update(data[, input_encoding][, output_encoding]) - -Updates the decipher with `data`. If the `input_encoding` argument is given, -it's value must be one of `'binary'`, `'base64'`, or `'hex'` and the `data` -argument is a string using the specified encoding. If the `input_encoding` -argument is not given, `data` must be a [`Buffer`][]. If `data` is a -[`Buffer`][] then `input_encoding` is ignored. - -The `output_encoding` specifies the output format of the enciphered -data, and can be `'binary'`, `'ascii'` or `'utf8'`. If the `output_encoding` -is specified, a string using the specified encoding is returned. If no -`output_encoding` is provided, a [`Buffer`][] is returned. - -The `decipher.update()` method can be called multiple times with new data until -[`decipher.final()`][] is called. Calling `decipher.update()` after -[`decipher.final()`][] will result in an error being thrown. - -## Class: DiffieHellman - -The `DiffieHellman` class is a utility for creating Diffie-Hellman key -exchanges. - -Instances of the `DiffieHellman` class can be created using the -[`crypto.createDiffieHellman()`][] function. - -```js -const crypto = require('crypto'); -const assert = require('assert'); - -// Generate Alice's keys... -const alice = crypto.createDiffieHellman(2048); -const alice_key = alice.generateKeys(); - -// Generate Bob's keys... -const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator()); -const bob_key = bob.generateKeys(); - -// Exchange and generate the secret... -const alice_secret = alice.computeSecret(bob_key); -const bob_secret = bob.computeSecret(alice_key); - -// OK -assert.equal(alice_secret.toString('hex'), bob_secret.toString('hex')); -``` - -### diffieHellman.computeSecret(other_public_key[, input_encoding][, output_encoding]) - -Computes the shared secret using `other_public_key` as the other -party's public key and returns the computed shared secret. The supplied -key is interpreted using the specified `input_encoding`, and secret is -encoded using specified `output_encoding`. Encodings can be -`'binary'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][]. - -If `output_encoding` is given a string is returned; otherwise, a -[`Buffer`][] is returned. - -### diffieHellman.generateKeys([encoding]) - -Generates private and public Diffie-Hellman key values, and returns -the public key in the specified `encoding`. This key should be -transferred to the other party. Encoding can be `'binary'`, `'hex'`, -or `'base64'`. If `encoding` is provided a string is returned; otherwise a -[`Buffer`][] is returned. - -### diffieHellman.getGenerator([encoding]) - -Returns the Diffie-Hellman generator in the specified `encoding`, which can -be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is -returned; otherwise a [`Buffer`][] is returned. - -### diffieHellman.getPrime([encoding]) - -Returns the Diffie-Hellman prime in the specified `encoding`, which can -be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is -returned; otherwise a [`Buffer`][] is returned. - -### diffieHellman.getPrivateKey([encoding]) - -Returns the Diffie-Hellman private key in the specified `encoding`, -which can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a -string is returned; otherwise a [`Buffer`][] is returned. - -### diffieHellman.getPublicKey([encoding]) - -Returns the Diffie-Hellman public key in the specified `encoding`, which -can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a -string is returned; otherwise a [`Buffer`][] is returned. - -### diffieHellman.setPrivateKey(private_key[, encoding]) - -Sets the Diffie-Hellman private key. If the `encoding` argument is provided -and is either `'binary'`, `'hex'`, or `'base64'`, `private_key` is expected -to be a string. If no `encoding` is provided, `private_key` is expected -to be a [`Buffer`][]. - -### diffieHellman.setPublicKey(public_key[, encoding]) - -Sets the Diffie-Hellman public key. If the `encoding` argument is provided -and is either `'binary'`, `'hex'` or `'base64'`, `public_key` is expected -to be a string. If no `encoding` is provided, `public_key` is expected -to be a [`Buffer`][]. - -### diffieHellman.verifyError - -A bit field containing any warnings and/or errors resulting from a check -performed during initialization of the `DiffieHellman` object. - -The following values are valid for this property (as defined in `constants` -module): - -* `DH_CHECK_P_NOT_SAFE_PRIME` -* `DH_CHECK_P_NOT_PRIME` -* `DH_UNABLE_TO_CHECK_GENERATOR` -* `DH_NOT_SUITABLE_GENERATOR` - -## Class: ECDH - -The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) -key exchanges. - -Instances of the `ECDH` class can be created using the -[`crypto.createECDH()`][] function. - -```js -const crypto = require('crypto'); -const assert = require('assert'); - -// Generate Alice's keys... -const alice = crypto.createECDH('secp521r1'); -const alice_key = alice.generateKeys(); - -// Generate Bob's keys... -const bob = crypto.createECDH('secp521r1'); -const bob_key = bob.generateKeys(); - -// Exchange and generate the secret... -const alice_secret = alice.computeSecret(bob_key); -const bob_secret = bob.computeSecret(alice_key); - -assert(alice_secret, bob_secret); - // OK -``` - -### ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding]) - -Computes the shared secret using `other_public_key` as the other -party's public key and returns the computed shared secret. The supplied -key is interpreted using specified `input_encoding`, and the returned secret -is encoded using the specified `output_encoding`. Encodings can be -`'binary'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][]. - -If `output_encoding` is given a string will be returned; otherwise a -[`Buffer`][] is returned. - -### ecdh.generateKeys([encoding[, format]]) - -Generates private and public EC Diffie-Hellman key values, and returns -the public key in the specified `format` and `encoding`. This key should be -transferred to the other party. - -The `format` arguments specifies point encoding and can be `'compressed'`, -`'uncompressed'`, or `'hybrid'`. If `format` is not specified, the point will -be returned in `'uncompressed'` format. - -The `encoding` argument can be `'binary'`, `'hex'`, or `'base64'`. If -`encoding` is provided a string is returned; otherwise a [`Buffer`][] -is returned. - -### ecdh.getPrivateKey([encoding]) - -Returns the EC Diffie-Hellman private key in the specified `encoding`, -which can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided -a string is returned; otherwise a [`Buffer`][] is returned. - -### ecdh.getPublicKey([encoding[, format]]) - -Returns the EC Diffie-Hellman public key in the specified `encoding` and -`format`. - -The `format` argument specifies point encoding and can be `'compressed'`, -`'uncompressed'`, or `'hybrid'`. If `format` is not specified the point will be -returned in `'uncompressed'` format. - -The `encoding` argument can be `'binary'`, `'hex'`, or `'base64'`. If -`encoding` is specified, a string is returned; otherwise a [`Buffer`][] is -returned. - -### ecdh.setPrivateKey(private_key[, encoding]) - -Sets the EC Diffie-Hellman private key. The `encoding` can be `'binary'`, -`'hex'` or `'base64'`. If `encoding` is provided, `private_key` is expected -to be a string; otherwise `private_key` is expected to be a [`Buffer`][]. If -`private_key` is not valid for the curve specified when the `ECDH` object was -created, an error is thrown. Upon setting the private key, the associated -public point (key) is also generated and set in the ECDH object. - -### ecdh.setPublicKey(public_key[, encoding]) - - Stability: 0 - Deprecated - -Sets the EC Diffie-Hellman public key. Key encoding can be `'binary'`, -`'hex'` or `'base64'`. If `encoding` is provided `public_key` is expected to -be a string; otherwise a [`Buffer`][] is expected. - -Note that there is not normally a reason to call this method because `ECDH` -only requires a private key and the other party's public key to compute the -shared secret. Typically either [`ecdh.generateKeys()`][] or -[`ecdh.setPrivateKey()`][] will be called. The [`ecdh.setPrivateKey()`][] method -attempts to generate the public point/key associated with the private key being -set. - -Example (obtaining a shared secret): - -```js -const crypto = require('crypto'); -const alice = crypto.createECDH('secp256k1'); -const bob = crypto.createECDH('secp256k1'); - -// Note: This is a shortcut way to specify one of Alice's previous private -// keys. It would be unwise to use such a predictable private key in a real -// application. -alice.setPrivateKey( - crypto.createHash('sha256').update('alice', 'utf8').digest() -); - -// Bob uses a newly generated cryptographically strong -// pseudorandom key pair bob.generateKeys(); - -const alice_secret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); -const bob_secret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - -// alice_secret and bob_secret should be the same shared secret value -console.log(alice_secret === bob_secret); -``` - -## Class: Hash - -The `Hash` class is a utility for creating hash digests of data. It can be -used in one of two ways: - -- As a [stream][] that is both readable and writable, where data is written - to produce a computed hash digest on the readable side, or -- Using the [`hash.update()`][] and [`hash.digest()`][] methods to produce the - computed hash. - -The [`crypto.createHash()`][] method is used to create `Hash` instances. `Hash` -objects are not to be created directly using the `new` keyword. - -Example: Using `Hash` objects as streams: - -```js -const crypto = require('crypto'); -const hash = crypto.createHash('sha256'); - -hash.on('readable', () => { - var data = hash.read(); - if (data) - console.log(data.toString('hex')); - // Prints: - // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 -}); - -hash.write('some data to hash'); -hash.end(); -``` - -Example: Using `Hash` and piped streams: - -```js -const crypto = require('crypto'); -const fs = require('fs'); -const hash = crypto.createHash('sha256'); - -const input = fs.createReadStream('test.js'); -input.pipe(hash).pipe(process.stdout); -``` - -Example: Using the [`hash.update()`][] and [`hash.digest()`][] methods: - -```js -const crypto = require('crypto'); -const hash = crypto.createHash('sha256'); - -hash.update('some data to hash'); -console.log(hash.digest('hex')); - // Prints: - // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 -``` - -### hash.digest([encoding]) - -Calculates the digest of all of the data passed to be hashed (using the -[`hash.update()`][] method). The `encoding` can be `'hex'`, `'binary'` or -`'base64'`. If `encoding` is provided a string will be returned; otherwise -a [`Buffer`][] is returned. - -The `Hash` object can not be used again after `hash.digest()` method has been -called. Multiple calls will cause an error to be thrown. - -### hash.update(data[, input_encoding]) - -Updates the hash content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or -`'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. - -This can be called many times with new data as it is streamed. - -## Class: Hmac - -The `Hmac` Class is a utility for creating cryptographic HMAC digests. It can -be used in one of two ways: - -- As a [stream][] that is both readable and writable, where data is written - to produce a computed HMAC digest on the readable side, or -- Using the [`hmac.update()`][] and [`hmac.digest()`][] methods to produce the - computed HMAC digest. - -The [`crypto.createHmac()`][] method is used to create `Hmac` instances. `Hmac` -objects are not to be created directly using the `new` keyword. - -Example: Using `Hmac` objects as streams: - -```js -const crypto = require('crypto'); -const hmac = crypto.createHmac('sha256', 'a secret'); - -hmac.on('readable', () => { - var data = hmac.read(); - if (data) - console.log(data.toString('hex')); - // Prints: - // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e -}); - -hmac.write('some data to hash'); -hmac.end(); -``` - -Example: Using `Hmac` and piped streams: - -```js -const crypto = require('crypto'); -const fs = require('fs'); -const hmac = crypto.createHmac('sha256', 'a secret'); - -const input = fs.createReadStream('test.js'); -input.pipe(hmac).pipe(process.stdout); -``` - -Example: Using the [`hmac.update()`][] and [`hmac.digest()`][] methods: - -```js -const crypto = require('crypto'); -const hmac = crypto.createHmac('sha256', 'a secret'); - -hmac.update('some data to hash'); -console.log(hmac.digest('hex')); - // Prints: - // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e -``` - -### hmac.digest([encoding]) - -Calculates the HMAC digest of all of the data passed using [`hmac.update()`][]. -The `encoding` can be `'hex'`, `'binary'` or `'base64'`. If `encoding` is -provided a string is returned; otherwise a [`Buffer`][] is returned; - -The `Hmac` object can not be used again after `hmac.digest()` has been -called. Multiple calls to `hmac.digest()` will result in an error being thrown. - -### hmac.update(data[, input_encoding]) - -Updates the `Hmac` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or -`'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. - -This can be called many times with new data as it is streamed. - -## Class: Sign - -The `Sign` Class is a utility for generating signatures. It can be used in one -of two ways: - -- As a writable [stream][], where data to be signed is written and the - [`sign.sign()`][] method is used to generate and return the signature, or -- Using the [`sign.update()`][] and [`sign.sign()`][] methods to produce the - signature. - -The [`crypto.createSign()`][] method is used to create `Sign` instances. `Sign` -objects are not to be created directly using the `new` keyword. - -Example: Using `Sign` objects as streams: - -```js -const crypto = require('crypto'); -const sign = crypto.createSign('RSA-SHA256'); - -sign.write('some data to sign'); -sign.end(); - -const private_key = getPrivateKeySomehow(); -console.log(sign.sign(private_key, 'hex')); - // Prints the calculated signature -``` - -Example: Using the [`sign.update()`][] and [`sign.sign()`][] methods: - -```js -const crypto = require('crypto'); -const sign = crypto.createSign('RSA-SHA256'); - -sign.update('some data to sign'); - -const private_key = getPrivateKeySomehow(); -console.log(sign.sign(private_key, 'hex')); - // Prints the calculated signature -``` - -### sign.sign(private_key[, output_format]) - -Calculates the signature on all the data passed through using either -[`sign.update()`][] or [`sign.write()`][stream-writable-write]. - -The `private_key` argument can be an object or a string. If `private_key` is a -string, it is treated as a raw key with no passphrase. If `private_key` is an -object, it is interpreted as a hash containing two properties: - -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - passphrase for the private key - -The `output_format` can specify one of `'binary'`, `'hex'` or `'base64'`. If -`output_format` is provided a string is returned; otherwise a [`Buffer`][] is -returned. - -The `Sign` object can not be again used after `sign.sign()` method has been -called. Multiple calls to `sign.sign()` will result in an error being thrown. - -### sign.update(data[, input_encoding]) - -Updates the `Sign` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or -`'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. - -This can be called many times with new data as it is streamed. - -## Class: Verify - -The `Verify` class is a utility for verifying signatures. It can be used in one -of two ways: - -- As a writable [stream][] where written data is used to validate against the - supplied signature, or -- Using the [`verify.update()`][] and [`verify.verify()`][] methods to verify - the signature. - - The [`crypto.createSign()`][] method is used to create `Sign` instances. - `Sign` objects are not to be created directly using the `new` keyword. - -Example: Using `Verify` objects as streams: - -```js -const crypto = require('crypto'); -const verify = crypto.createVerify('RSA-SHA256'); - -verify.write('some data to sign'); -verify.end(); - -const public_key = getPublicKeySomehow(); -const signature = getSignatureToVerify(); -console.log(sign.verify(public_key, signature)); - // Prints true or false -``` - -Example: Using the [`verify.update()`][] and [`verify.verify()`][] methods: - -```js -const crypto = require('crypto'); -const verify = crypto.createVerify('RSA-SHA256'); - -verify.update('some data to sign'); - -const public_key = getPublicKeySomehow(); -const signature = getSignatureToVerify(); -console.log(verify.verify(public_key, signature)); - // Prints true or false -``` - -### verifier.update(data[, input_encoding]) - -Updates the `Verify` content with the given `data`, the encoding of which -is given in `input_encoding` and can be `'utf8'`, `'ascii'` or -`'binary'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. - -This can be called many times with new data as it is streamed. - -### verifier.verify(object, signature[, signature_format]) - -Verifies the provided data using the given `object` and `signature`. -The `object` argument is a string containing a PEM encoded object, which can be -one an RSA public key, a DSA public key, or an X.509 certificate. -The `signature` argument is the previously calculated signature for the data, in -the `signature_format` which can be `'binary'`, `'hex'` or `'base64'`. -If a `signature_format` is specified, the `signature` is expected to be a -string; otherwise `signature` is expected to be a [`Buffer`][]. - -Returns `true` or `false` depending on the validity of the signature for -the data and public key. - -The `verifier` object can not be used again after `verify.verify()` has been -called. Multiple calls to `verify.verify()` will result in an error being -thrown. - -## `crypto` module methods and properties - -### crypto.DEFAULT_ENCODING - -The default encoding to use for functions that can take either strings -or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods -default to [`Buffer`][] objects. - -The `crypto.DEFAULT_ENCODING` mechanism is provided for backwards compatibility -with legacy programs that expect `'binary'` to be the default encoding. - -New applications should expect the default to be `'buffer'`. This property may -become deprecated in a future Node.js release. - -### crypto.fips - -Property for checking and controlling whether a FIPS compliant crypto provider is -currently in use. Setting to true requires a FIPS build of Node.js. - -### crypto.createCipher(algorithm, password) - -Creates and returns a `Cipher` object that uses the given `algorithm` and -`password`. - -The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list-cipher-algorithms` will display the -available cipher algorithms. - -The `password` is used to derive the cipher key and initialization vector (IV). -The value must be either a `'binary'` encoded string or a [`Buffer`][]. - -The implementation of `crypto.createCipher()` derives keys using the OpenSSL -function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one -iteration, and no salt. The lack of salt allows dictionary attacks as the same -password always creates the same key. The low iteration count and -non-cryptographically secure hash algorithm allow passwords to be tested very -rapidly. - -In line with OpenSSL's recommendation to use pbkdf2 instead of -[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on -their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] -to create the `Cipher` object. - -### crypto.createCipheriv(algorithm, key, iv) - -Creates and returns a `Cipher` object, with the given `algorithm`, `key` and -initialization vector (`iv`). - -The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list-cipher-algorithms` will display the -available cipher algorithms. - -The `key` is the raw key used by the `algorithm` and `iv` is an -[initialization vector][]. Both arguments must be `'binary'` encoded strings or -[buffers][`Buffer`]. - -### crypto.createCredentials(details) - - Stability: 0 - Deprecated: Use [`tls.createSecureContext()`][] instead. - -The `crypto.createCredentials()` method is a deprecated alias for creating -and returning a `tls.SecureContext` object. The `crypto.createCredentials()` -method should not be used. - -The optional `details` argument is a hash object with keys: - -* `pfx` : {String|Buffer} - PFX or PKCS12 encoded private - key, certificate and CA certificates -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - passphrase for the private key or PFX -* `cert` : {String} - PEM encoded certificate -* `ca` : {String|Array} - Either a string or array of strings of PEM encoded CA - certificates to trust. -* `crl` : {String|Array} - Either a string or array of strings of PEM encoded CRLs - (Certificate Revocation List) -* `ciphers`: {String} using the [OpenSSL cipher list format][] describing the - cipher algorithms to use or exclude. - -If no 'ca' details are given, Node.js will use Mozilla's default -[publicly trusted list of CAs][]. - -### crypto.createDecipher(algorithm, password) - -Creates and returns a `Decipher` object that uses the given `algorithm` and -`password` (key). - -The implementation of `crypto.createDecipher()` derives keys using the OpenSSL -function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one -iteration, and no salt. The lack of salt allows dictionary attacks as the same -password always creates the same key. The low iteration count and -non-cryptographically secure hash algorithm allow passwords to be tested very -rapidly. - -In line with OpenSSL's recommendation to use pbkdf2 instead of -[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on -their own using [`crypto.pbkdf2()`][] and to use [`crypto.createDecipheriv()`][] -to create the `Decipher` object. - -### crypto.createDecipheriv(algorithm, key, iv) - -Creates and returns a `Decipher` object that uses the given `algorithm`, `key` -and initialization vector (`iv`). - -The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list-cipher-algorithms` will display the -available cipher algorithms. - -The `key` is the raw key used by the `algorithm` and `iv` is an -[initialization vector][]. Both arguments must be `'binary'` encoded strings or -[buffers][`Buffer`]. - -### crypto.createDiffieHellman(prime[, prime_encoding][, generator][, generator_encoding]) - -Creates a `DiffieHellman` key exchange object using the supplied `prime` and an -optional specific `generator`. - -The `generator` argument can be a number, string, or [`Buffer`][]. If -`generator` is not specified, the value `2` is used. - -The `prime_encoding` and `generator_encoding` arguments can be `'binary'`, -`'hex'`, or `'base64'`. - -If `prime_encoding` is specified, `prime` is expected to be a string; otherwise -a [`Buffer`][] is expected. - -If `generator_encoding` is specified, `generator` is expected to be a string; -otherwise either a number or [`Buffer`][] is expected. - -### crypto.createDiffieHellman(prime_length[, generator]) - -Creates a `DiffieHellman` key exchange object and generates a prime of -`prime_length` bits using an optional specific numeric `generator`. -If `generator` is not specified, the value `2` is used. - -### crypto.createECDH(curve_name) - -Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a -predefined curve specified by the `curve_name` string. Use -[`crypto.getCurves()`][] to obtain a list of available curve names. On recent -OpenSSL releases, `openssl ecparam -list_curves` will also display the name -and description of each available elliptic curve. - -### crypto.createHash(algorithm) - -Creates and returns a `Hash` object that can be used to generate hash digests -using the given `algorithm`. - -The `algorithm` is dependent on the available algorithms supported by the -version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. -On recent releases of OpenSSL, `openssl list-message-digest-algorithms` will -display the available digest algorithms. - -Example: generating the sha256 sum of a file - -```js -const filename = process.argv[2]; -const crypto = require('crypto'); -const fs = require('fs'); - -const hash = crypto.createHash('sha256'); - -const input = fs.createReadStream(filename); -input.on('readable', () => { - var data = input.read(); - if (data) - hash.update(data); - else { - console.log(`${hash.digest('hex')} ${filename}`); - } -}); -``` - -### crypto.createHmac(algorithm, key) - -Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - -The `algorithm` is dependent on the available algorithms supported by the -version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. -On recent releases of OpenSSL, `openssl list-message-digest-algorithms` will -display the available digest algorithms. - -The `key` is the HMAC key used to generate the cryptographic HMAC hash. - -Example: generating the sha256 HMAC of a file - -```js -const filename = process.argv[2]; -const crypto = require('crypto'); -const fs = require('fs'); - -const hmac = crypto.createHmac('sha256', 'a secret'); - -const input = fs.createReadStream(filename); -input.on('readable', () => { - var data = input.read(); - if (data) - hmac.update(data); - else { - console.log(`${hmac.digest('hex')} ${filename}`); - } -}); -``` - -### crypto.createSign(algorithm) - -Creates and returns a `Sign` object that uses the given `algorithm`. On -recent OpenSSL releases, `openssl list-public-key-algorithms` will -display the available signing algorithms. One example is `'RSA-SHA256'`. - -### crypto.createVerify(algorithm) - -Creates and returns a `Verify` object that uses the given algorithm. On -recent OpenSSL releases, `openssl list-public-key-algorithms` will -display the available signing algorithms. One example is `'RSA-SHA256'`. - -### crypto.getCiphers() - -Returns an array with the names of the supported cipher algorithms. - -Example: - -```js -const ciphers = crypto.getCiphers(); -console.log(ciphers); // ['aes-128-cbc', 'aes-128-ccm', ...] -``` - -### crypto.getCurves() - -Returns an array with the names of the supported elliptic curves. - -Example: - -```js -const curves = crypto.getCurves(); -console.log(curves); // ['secp256k1', 'secp384r1', ...] -``` - -### crypto.getDiffieHellman(group_name) - -Creates a predefined `DiffieHellman` key exchange object. The -supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in -[RFC 2412][], but see [Caveats][]) and `'modp14'`, `'modp15'`, -`'modp16'`, `'modp17'`, `'modp18'` (defined in [RFC 3526][]). The -returned object mimics the interface of objects created by -[`crypto.createDiffieHellman()`][], but will not allow changing -the keys (with [`diffieHellman.setPublicKey()`][] for example). The -advantage of using this method is that the parties do not have to -generate nor exchange a group modulus beforehand, saving both processor -and communication time. - -Example (obtaining a shared secret): - -```js -const crypto = require('crypto'); -const alice = crypto.getDiffieHellman('modp14'); -const bob = crypto.getDiffieHellman('modp14'); - -alice.generateKeys(); -bob.generateKeys(); - -const alice_secret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); -const bob_secret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - -/* alice_secret and bob_secret should be the same */ -console.log(alice_secret == bob_secret); -``` - -### crypto.getHashes() - -Returns an array with the names of the supported hash algorithms. - -Example: - -```js -const hashes = crypto.getHashes(); -console.log(hashes); // ['sha', 'sha1', 'sha1WithRSAEncryption', ...] -``` - -### crypto.pbkdf2(password, salt, iterations, keylen, digest, callback) - -Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) -implementation. A selected HMAC digest algorithm specified by `digest` is -applied to derive a key of the requested byte length (`keylen`) from the -`password`, `salt` and `iterations`. - -The supplied `callback` function is called with two arguments: `err` and -`derivedKey`. If an error occurs, `err` will be set; otherwise `err` will be -null. The successfully generated `derivedKey` will be passed as a [`Buffer`][]. - -The `iterations` argument must be a number set as high as possible. The -higher the number of iterations, the more secure the derived key will be, -but will take a longer amount of time to complete. - -The `salt` should also be as unique as possible. It is recommended that the -salts are random and their lengths are greater than 16 bytes. See -[NIST SP 800-132][] for details. - -Example: - -```js -const crypto = require('crypto'); -crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, key) => { - if (err) throw err; - console.log(key.toString('hex')); // 'c5e478d...1469e50' -}); -``` - -An array of supported digest functions can be retrieved using -[`crypto.getHashes()`][]. - -### crypto.pbkdf2Sync(password, salt, iterations, keylen, digest) - -Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) -implementation. A selected HMAC digest algorithm specified by `digest` is -applied to derive a key of the requested byte length (`keylen`) from the -`password`, `salt` and `iterations`. - -If an error occurs an Error will be thrown, otherwise the derived key will be -returned as a [`Buffer`][]. - -The `iterations` argument must be a number set as high as possible. The -higher the number of iterations, the more secure the derived key will be, -but will take a longer amount of time to complete. - -The `salt` should also be as unique as possible. It is recommended that the -salts are random and their lengths are greater than 16 bytes. See -[NIST SP 800-132][] for details. - -Example: - -```js -const crypto = require('crypto'); -const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); -console.log(key.toString('hex')); // 'c5e478d...1469e50' -``` - -An array of supported digest functions can be retrieved using -[`crypto.getHashes()`][]. - -### crypto.privateDecrypt(private_key, buffer) - -Decrypts `buffer` with `private_key`. - -`private_key` can be an object or a string. If `private_key` is a string, it is -treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. -If `private_key` is an object, it is interpreted as a hash object with the -keys: - -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - Optional passphrase for the private key -* `padding` : An optional padding value, one of the following: - * `constants.RSA_NO_PADDING` - * `constants.RSA_PKCS1_PADDING` - * `constants.RSA_PKCS1_OAEP_PADDING` - -All paddings are defined in the `constants` module. - -### crypto.privateEncrypt(private_key, buffer) - -Encrypts `buffer` with `private_key`. - -`private_key` can be an object or a string. If `private_key` is a string, it is -treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. -If `private_key` is an object, it is interpreted as a hash object with the -keys: - -* `key` : {String} - PEM encoded private key -* `passphrase` : {String} - Optional passphrase for the private key -* `padding` : An optional padding value, one of the following: - * `constants.RSA_NO_PADDING` - * `constants.RSA_PKCS1_PADDING` - * `constants.RSA_PKCS1_OAEP_PADDING` - -All paddings are defined in the `constants` module. - -### crypto.publicDecrypt(public_key, buffer) - -Decrypts `buffer` with `public_key`. - -`public_key` can be an object or a string. If `public_key` is a string, it is -treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. -If `public_key` is an object, it is interpreted as a hash object with the -keys: - -* `key` : {String} - PEM encoded public key -* `passphrase` : {String} - Optional passphrase for the private key -* `padding` : An optional padding value, one of the following: - * `constants.RSA_NO_PADDING` - * `constants.RSA_PKCS1_PADDING` - * `constants.RSA_PKCS1_OAEP_PADDING` - -Because RSA public keys can be derived from private keys, a private key may -be passed instead of a public key. - -All paddings are defined in the `constants` module. - -### crypto.publicEncrypt(public_key, buffer) - -Encrypts `buffer` with `public_key`. - -`public_key` can be an object or a string. If `public_key` is a string, it is -treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. -If `public_key` is an object, it is interpreted as a hash object with the -keys: - -* `key` : {String} - PEM encoded public key -* `passphrase` : {String} - Optional passphrase for the private key -* `padding` : An optional padding value, one of the following: - * `constants.RSA_NO_PADDING` - * `constants.RSA_PKCS1_PADDING` - * `constants.RSA_PKCS1_OAEP_PADDING` - -Because RSA public keys can be derived from private keys, a private key may -be passed instead of a public key. - -All paddings are defined in the `constants` module. - -### crypto.randomBytes(size[, callback]) - -Generates cryptographically strong pseudo-random data. The `size` argument -is a number indicating the number of bytes to generate. - -If a `callback` function is provided, the bytes are generated asynchronously -and the `callback` function is invoked with two arguments: `err` and `buf`. -If an error occurs, `err` will be an Error object; otherwise it is null. The -`buf` argument is a [`Buffer`][] containing the generated bytes. - -```js -// Asynchronous -const crypto = require('crypto'); -crypto.randomBytes(256, (err, buf) => { - if (err) throw err; - console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); -}); -``` - -If the `callback` function is not provided, the random bytes are generated -synchronously and returned as a [`Buffer`][]. An error will be thrown if -there is a problem generating the bytes. - -```js -// Synchronous -const buf = crypto.randomBytes(256); -console.log( - `${buf.length} bytes of random data: ${buf.toString('hex')}`); -``` - -The `crypto.randomBytes()` method will block until there is sufficient entropy. -This should normally never take longer than a few milliseconds. The only time -when generating the random bytes may conceivably block for a longer period of -time is right after boot, when the whole system is still low on entropy. - -### crypto.setEngine(engine[, flags]) - -Load and set the `engine` for some or all OpenSSL functions (selected by flags). - -`engine` could be either an id or a path to the engine's shared library. - -The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` -is a bit field taking one of or a mix of the following flags (defined in the -`constants` module): - -* `ENGINE_METHOD_RSA` -* `ENGINE_METHOD_DSA` -* `ENGINE_METHOD_DH` -* `ENGINE_METHOD_RAND` -* `ENGINE_METHOD_ECDH` -* `ENGINE_METHOD_ECDSA` -* `ENGINE_METHOD_CIPHERS` -* `ENGINE_METHOD_DIGESTS` -* `ENGINE_METHOD_STORE` -* `ENGINE_METHOD_PKEY_METHS` -* `ENGINE_METHOD_PKEY_ASN1_METHS` -* `ENGINE_METHOD_ALL` -* `ENGINE_METHOD_NONE` - -## Notes - -### Legacy Streams API (pre Node.js v0.10) - -The Crypto module was added to Node.js before there was the concept of a -unified Stream API, and before there were [`Buffer`][] objects for handling -binary data. As such, the many of the `crypto` defined classes have methods not -typically found on other Node.js classes that implement the [streams][stream] -API (e.g. `update()`, `final()`, or `digest()`). Also, many methods accepted -and returned `'binary'` encoded strings by default rather than Buffers. This -default was changed after Node.js v0.8 to use [`Buffer`][] objects by default -instead. - -### Recent ECDH Changes - -Usage of `ECDH` with non-dynamically generated key pairs has been simplified. -Now, [`ecdh.setPrivateKey()`][] can be called with a preselected private key -and the associated public point (key) will be computed and stored in the object. -This allows code to only store and provide the private part of the EC key pair. -[`ecdh.setPrivateKey()`][] now also validates that the private key is valid for -the selected curve. - -The [`ecdh.setPublicKey()`][] method is now deprecated as its inclusion in the -API is not useful. Either a previously stored private key should be set, which -automatically generates the associated public key, or [`ecdh.generateKeys()`][] -should be called. The main drawback of using [`ecdh.setPublicKey()`][] is that -it can be used to put the ECDH key pair into an inconsistent state. - -### Support for weak or compromised algorithms - -The `crypto` module still supports some algorithms which are already -compromised and are not currently recommended for use. The API also allows -the use of ciphers and hashes with a small key size that are considered to be -too weak for safe use. - -Users should take full responsibility for selecting the crypto -algorithm and key size according to their security requirements. - -Based on the recommendations of [NIST SP 800-131A][]: - -- MD5 and SHA-1 are no longer acceptable where collision resistance is - required such as digital signatures. -- The key used with RSA, DSA and DH algorithms is recommended to have - at least 2048 bits and that of the curve of ECDSA and ECDH at least - 224 bits, to be safe to use for several years. -- The DH groups of `modp1`, `modp2` and `modp5` have a key size - smaller than 2048 bits and are not recommended. - -See the reference for other recommendations and details. - -[`Buffer`]: buffer.html -[`cipher.final()`]: #crypto_cipher_final_output_encoding -[`cipher.update()`]: #crypto_cipher_update_data_input_encoding_output_encoding -[`crypto.createCipher()`]: #crypto_crypto_createcipher_algorithm_password -[`crypto.createCipheriv()`]: #crypto_crypto_createcipheriv_algorithm_key_iv -[`crypto.createDecipher()`]: #crypto_crypto_createdecipher_algorithm_password -[`crypto.createDecipheriv()`]: #crypto_crypto_createdecipheriv_algorithm_key_iv -[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_prime_encoding_generator_generator_encoding -[`crypto.createECDH()`]: #crypto_crypto_createecdh_curve_name -[`crypto.createHash()`]: #crypto_crypto_createhash_algorithm -[`crypto.createHmac()`]: #crypto_crypto_createhmac_algorithm_key -[`crypto.createSign()`]: #crypto_crypto_createsign_algorithm -[`crypto.getCurves()`]: #crypto_crypto_getcurves -[`crypto.getHashes()`]: #crypto_crypto_gethashes -[`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback -[`decipher.final()`]: #crypto_decipher_final_output_encoding -[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding -[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding -[`ecdh.generateKeys()`]: #crypto_ecdh_generatekeys_encoding_format -[`ecdh.setPrivateKey()`]: #crypto_ecdh_setprivatekey_private_key_encoding -[`ecdh.setPublicKey()`]: #crypto_ecdh_setpublickey_public_key_encoding -[`EVP_BytesToKey`]: https://www.openssl.org/docs/crypto/EVP_BytesToKey.html -[`hash.digest()`]: #crypto_hash_digest_encoding -[`hash.update()`]: #crypto_hash_update_data_input_encoding -[`hmac.digest()`]: #crypto_hmac_digest_encoding -[`hmac.update()`]: #crypto_hmac_update_data -[`sign.sign()`]: #crypto_sign_sign_private_key_output_format -[`sign.update()`]: #crypto_sign_update_data -[`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_details -[`verify.update()`]: #crypto_verifier_update_data -[`verify.verify()`]: #crypto_verifier_verify_object_signature_signature_format -[Caveats]: #crypto_support_for_weak_or_compromised_algorithms -[HTML5's `keygen` element]: http://www.w3.org/TR/html5/forms.html#the-keygen-element -[initialization vector]: https://en.wikipedia.org/wiki/Initialization_vector -[NIST SP 800-131A]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf -[NIST SP 800-132]: http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf -[OpenSSL cipher list format]: https://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT -[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/apps/spkac.html -[publicly trusted list of CAs]: https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt -[RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt -[RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt -[stream]: stream.html -[stream-writable-write]: stream.html#stream_writable_write_chunk_encoding_callback diff --git a/doc/api/crypto.md b/doc/api/crypto.md new file mode 100644 index 00000000000000..e1166230d719c6 --- /dev/null +++ b/doc/api/crypto.md @@ -0,0 +1,1425 @@ +# Crypto + + Stability: 2 - Stable + +The `crypto` module provides cryptographic functionality that includes a set of +wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign and verify functions. + +Use `require('crypto')` to access this module. + +```js +const crypto = require('crypto'); + +const secret = 'abcdefg'; +const hash = crypto.createHmac('sha256', secret) + .update('I love cupcakes') + .digest('hex'); +console.log(hash); + // Prints: + // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e +``` + +## Determining if crypto support is unavailable + +It is possible for Node.js to be built without including support for the +`crypto` module. In such cases, calling `require('crypto')` will result in an +error being thrown. + +```js +var crypto; +try { + crypto = require('crypto'); +} catch (err) { + console.log('crypto support is disabled!'); +} +``` + +## Class: Certificate + +SPKAC is a Certificate Signing Request mechanism originally implemented by +Netscape and now specified formally as part of [HTML5's `keygen` element][]. + +The `crypto` module provides the `Certificate` class for working with SPKAC +data. The most common usage is handling output generated by the HTML5 +`` element. Node.js uses [OpenSSL's SPKAC implementation][] internally. + +### new crypto.Certificate() + +Instances of the `Certificate` class can be created using the `new` keyword +or by calling `crypto.Certificate()` as a function: + +```js +const crypto = require('crypto'); + +const cert1 = new crypto.Certificate(); +const cert2 = crypto.Certificate(); +``` + +### certificate.exportChallenge(spkac) + +The `spkac` data structure includes a public key and a challenge. The +`certificate.exportChallenge()` returns the challenge component in the +form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string +or a [`Buffer`][]. + +```js +const cert = require('crypto').Certificate(); +const spkac = getSpkacSomehow(); +const challenge = cert.exportChallenge(spkac); +console.log(challenge.toString('utf8')); + // Prints the challenge as a UTF8 string +``` + +### certificate.exportPublicKey(spkac) + +The `spkac` data structure includes a public key and a challenge. The +`certificate.exportPublicKey()` returns the public key component in the +form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string +or a [`Buffer`][]. + +```js +const cert = require('crypto').Certificate(); +const spkac = getSpkacSomehow(); +const publicKey = cert.exportPublicKey(spkac); +console.log(publicKey); + // Prints the public key as +``` + +### certificate.verifySpkac(spkac) + +Returns `true` if the given `spkac` data structure is valid, `false` otherwise. +The `spkac` argument must be a Node.js [`Buffer`][]. + +```js +const cert = require('crypto').Certificate(); +const spkac = getSpkacSomehow(); +console.log(cert.verifySpkac(Buffer.from(spkac))); + // Prints true or false +``` + +## Class: Cipher + +Instances of the `Cipher` class are used to encrypt data. The class can be +used in one of two ways: + +- As a [stream][] that is both readable and writable, where plain unencrypted + data is written to produce encrypted data on the readable side, or +- Using the [`cipher.update()`][] and [`cipher.final()`][] methods to produce + the encrypted data. + +The [`crypto.createCipher()`][] or [`crypto.createCipheriv()`][] methods are +used to create `Cipher` instances. `Cipher` objects are not to be created +directly using the `new` keyword. + +Example: Using `Cipher` objects as streams: + +```js +const crypto = require('crypto'); +const cipher = crypto.createCipher('aes192', 'a password'); + +var encrypted = ''; +cipher.on('readable', () => { + var data = cipher.read(); + if (data) + encrypted += data.toString('hex'); +}); +cipher.on('end', () => { + console.log(encrypted); + // Prints: ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504 +}); + +cipher.write('some clear text data'); +cipher.end(); +``` + +Example: Using `Cipher` and piped streams: + +```js +const crypto = require('crypto'); +const fs = require('fs'); +const cipher = crypto.createCipher('aes192', 'a password'); + +const input = fs.createReadStream('test.js'); +const output = fs.createWriteStream('test.enc'); + +input.pipe(cipher).pipe(output); +``` + +Example: Using the [`cipher.update()`][] and [`cipher.final()`][] methods: + +```js +const crypto = require('crypto'); +const cipher = crypto.createCipher('aes192', 'a password'); + +var encrypted = cipher.update('some clear text data', 'utf8', 'hex'); +encrypted += cipher.final('hex'); +console.log(encrypted); + // Prints: ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504 +``` + +### cipher.final([output_encoding]) + +Returns any remaining enciphered contents. If `output_encoding` +parameter is one of `'binary'`, `'base64'` or `'hex'`, a string is returned. +If an `output_encoding` is not provided, a [`Buffer`][] is returned. + +Once the `cipher.final()` method has been called, the `Cipher` object can no +longer be used to encrypt data. Attempts to call `cipher.final()` more than +once will result in an error being thrown. + +### cipher.setAAD(buffer) + +When using an authenticated encryption mode (only `GCM` is currently +supported), the `cipher.setAAD()` method sets the value used for the +_additional authenticated data_ (AAD) input parameter. + +### cipher.getAuthTag() + +When using an authenticated encryption mode (only `GCM` is currently +supported), the `cipher.getAuthTag()` method returns a [`Buffer`][] containing +the _authentication tag_ that has been computed from the given data. + +The `cipher.getAuthTag()` method should only be called after encryption has +been completed using the [`cipher.final()`][] method. + +### cipher.setAutoPadding(auto_padding=true) + +When using block encryption algorithms, the `Cipher` class will automatically +add padding to the input data to the appropriate block size. To disable the +default padding call `cipher.setAutoPadding(false)`. + +When `auto_padding` is `false`, the length of the entire input data must be a +multiple of the cipher's block size or [`cipher.final()`][] will throw an Error. +Disabling automatic padding is useful for non-standard padding, for instance +using `0x0` instead of PKCS padding. + +The `cipher.setAutoPadding()` method must be called before [`cipher.final()`][]. + +### cipher.update(data[, input_encoding][, output_encoding]) + +Updates the cipher with `data`. If the `input_encoding` argument is given, +it's value must be one of `'utf8'`, `'ascii'`, or `'binary'` and the `data` +argument is a string using the specified encoding. If the `input_encoding` +argument is not given, `data` must be a [`Buffer`][]. If `data` is a +[`Buffer`][] then `input_encoding` is ignored. + +The `output_encoding` specifies the output format of the enciphered +data, and can be `'binary'`, `'base64'` or `'hex'`. If the `output_encoding` +is specified, a string using the specified encoding is returned. If no +`output_encoding` is provided, a [`Buffer`][] is returned. + +The `cipher.update()` method can be called multiple times with new data until +[`cipher.final()`][] is called. Calling `cipher.update()` after +[`cipher.final()`][] will result in an error being thrown. + +## Class: Decipher + +Instances of the `Decipher` class are used to decrypt data. The class can be +used in one of two ways: + +- As a [stream][] that is both readable and writable, where plain encrypted + data is written to produce unencrypted data on the readable side, or +- Using the [`decipher.update()`][] and [`decipher.final()`][] methods to + produce the unencrypted data. + +The [`crypto.createDecipher()`][] or [`crypto.createDecipheriv()`][] methods are +used to create `Decipher` instances. `Decipher` objects are not to be created +directly using the `new` keyword. + +Example: Using `Decipher` objects as streams: + +```js +const crypto = require('crypto'); +const decipher = crypto.createDecipher('aes192', 'a password'); + +var decrypted = ''; +decipher.on('readable', () => { + var data = decipher.read(); + if (data) + decrypted += data.toString('utf8'); +}); +decipher.on('end', () => { + console.log(decrypted); + // Prints: some clear text data +}); + +var encrypted = 'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504'; +decipher.write(encrypted, 'hex'); +decipher.end(); +``` + +Example: Using `Decipher` and piped streams: + +```js +const crypto = require('crypto'); +const fs = require('fs'); +const decipher = crypto.createDecipher('aes192', 'a password'); + +const input = fs.createReadStream('test.enc'); +const output = fs.createWriteStream('test.js'); + +input.pipe(decipher).pipe(output); +``` + +Example: Using the [`decipher.update()`][] and [`decipher.final()`][] methods: + +```js +const crypto = require('crypto'); +const decipher = crypto.createDecipher('aes192', 'a password'); + +var encrypted = 'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504'; +var decrypted = decipher.update(encrypted, 'hex', 'utf8'); +decrypted += decipher.final('utf8'); +console.log(decrypted); + // Prints: some clear text data +``` + +### decipher.final([output_encoding]) + +Returns any remaining deciphered contents. If `output_encoding` +parameter is one of `'binary'`, `'base64'` or `'hex'`, a string is returned. +If an `output_encoding` is not provided, a [`Buffer`][] is returned. + +Once the `decipher.final()` method has been called, the `Decipher` object can +no longer be used to decrypt data. Attempts to call `decipher.final()` more +than once will result in an error being thrown. + +### decipher.setAAD(buffer) + +When using an authenticated encryption mode (only `GCM` is currently +supported), the `cipher.setAAD()` method sets the value used for the +_additional authenticated data_ (AAD) input parameter. + +### decipher.setAuthTag(buffer) + +When using an authenticated encryption mode (only `GCM` is currently +supported), the `decipher.setAuthTag()` method is used to pass in the +received _authentication tag_. If no tag is provided, or if the cipher text +has been tampered with, [`decipher.final()`][] with throw, indicating that the +cipher text should be discarded due to failed authentication. + +### decipher.setAutoPadding(auto_padding=true) + +When data has been encrypted without standard block padding, calling +`decipher.setAutoPadding(false)` will disable automatic padding to prevent +[`decipher.final()`][] from checking for and removing padding. + +Turning auto padding off will only work if the input data's length is a +multiple of the ciphers block size. + +The `decipher.setAutoPadding()` method must be called before +[`decipher.update()`][]. + +### decipher.update(data[, input_encoding][, output_encoding]) + +Updates the decipher with `data`. If the `input_encoding` argument is given, +it's value must be one of `'binary'`, `'base64'`, or `'hex'` and the `data` +argument is a string using the specified encoding. If the `input_encoding` +argument is not given, `data` must be a [`Buffer`][]. If `data` is a +[`Buffer`][] then `input_encoding` is ignored. + +The `output_encoding` specifies the output format of the enciphered +data, and can be `'binary'`, `'ascii'` or `'utf8'`. If the `output_encoding` +is specified, a string using the specified encoding is returned. If no +`output_encoding` is provided, a [`Buffer`][] is returned. + +The `decipher.update()` method can be called multiple times with new data until +[`decipher.final()`][] is called. Calling `decipher.update()` after +[`decipher.final()`][] will result in an error being thrown. + +## Class: DiffieHellman + +The `DiffieHellman` class is a utility for creating Diffie-Hellman key +exchanges. + +Instances of the `DiffieHellman` class can be created using the +[`crypto.createDiffieHellman()`][] function. + +```js +const crypto = require('crypto'); +const assert = require('assert'); + +// Generate Alice's keys... +const alice = crypto.createDiffieHellman(2048); +const alice_key = alice.generateKeys(); + +// Generate Bob's keys... +const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator()); +const bob_key = bob.generateKeys(); + +// Exchange and generate the secret... +const alice_secret = alice.computeSecret(bob_key); +const bob_secret = bob.computeSecret(alice_key); + +// OK +assert.equal(alice_secret.toString('hex'), bob_secret.toString('hex')); +``` + +### diffieHellman.computeSecret(other_public_key[, input_encoding][, output_encoding]) + +Computes the shared secret using `other_public_key` as the other +party's public key and returns the computed shared secret. The supplied +key is interpreted using the specified `input_encoding`, and secret is +encoded using specified `output_encoding`. Encodings can be +`'binary'`, `'hex'`, or `'base64'`. If the `input_encoding` is not +provided, `other_public_key` is expected to be a [`Buffer`][]. + +If `output_encoding` is given a string is returned; otherwise, a +[`Buffer`][] is returned. + +### diffieHellman.generateKeys([encoding]) + +Generates private and public Diffie-Hellman key values, and returns +the public key in the specified `encoding`. This key should be +transferred to the other party. Encoding can be `'binary'`, `'hex'`, +or `'base64'`. If `encoding` is provided a string is returned; otherwise a +[`Buffer`][] is returned. + +### diffieHellman.getGenerator([encoding]) + +Returns the Diffie-Hellman generator in the specified `encoding`, which can +be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is +returned; otherwise a [`Buffer`][] is returned. + +### diffieHellman.getPrime([encoding]) + +Returns the Diffie-Hellman prime in the specified `encoding`, which can +be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is +returned; otherwise a [`Buffer`][] is returned. + +### diffieHellman.getPrivateKey([encoding]) + +Returns the Diffie-Hellman private key in the specified `encoding`, +which can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a +string is returned; otherwise a [`Buffer`][] is returned. + +### diffieHellman.getPublicKey([encoding]) + +Returns the Diffie-Hellman public key in the specified `encoding`, which +can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided a +string is returned; otherwise a [`Buffer`][] is returned. + +### diffieHellman.setPrivateKey(private_key[, encoding]) + +Sets the Diffie-Hellman private key. If the `encoding` argument is provided +and is either `'binary'`, `'hex'`, or `'base64'`, `private_key` is expected +to be a string. If no `encoding` is provided, `private_key` is expected +to be a [`Buffer`][]. + +### diffieHellman.setPublicKey(public_key[, encoding]) + +Sets the Diffie-Hellman public key. If the `encoding` argument is provided +and is either `'binary'`, `'hex'` or `'base64'`, `public_key` is expected +to be a string. If no `encoding` is provided, `public_key` is expected +to be a [`Buffer`][]. + +### diffieHellman.verifyError + +A bit field containing any warnings and/or errors resulting from a check +performed during initialization of the `DiffieHellman` object. + +The following values are valid for this property (as defined in `constants` +module): + +* `DH_CHECK_P_NOT_SAFE_PRIME` +* `DH_CHECK_P_NOT_PRIME` +* `DH_UNABLE_TO_CHECK_GENERATOR` +* `DH_NOT_SUITABLE_GENERATOR` + +## Class: ECDH + +The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) +key exchanges. + +Instances of the `ECDH` class can be created using the +[`crypto.createECDH()`][] function. + +```js +const crypto = require('crypto'); +const assert = require('assert'); + +// Generate Alice's keys... +const alice = crypto.createECDH('secp521r1'); +const alice_key = alice.generateKeys(); + +// Generate Bob's keys... +const bob = crypto.createECDH('secp521r1'); +const bob_key = bob.generateKeys(); + +// Exchange and generate the secret... +const alice_secret = alice.computeSecret(bob_key); +const bob_secret = bob.computeSecret(alice_key); + +assert(alice_secret, bob_secret); + // OK +``` + +### ecdh.computeSecret(other_public_key[, input_encoding][, output_encoding]) + +Computes the shared secret using `other_public_key` as the other +party's public key and returns the computed shared secret. The supplied +key is interpreted using specified `input_encoding`, and the returned secret +is encoded using the specified `output_encoding`. Encodings can be +`'binary'`, `'hex'`, or `'base64'`. If the `input_encoding` is not +provided, `other_public_key` is expected to be a [`Buffer`][]. + +If `output_encoding` is given a string will be returned; otherwise a +[`Buffer`][] is returned. + +### ecdh.generateKeys([encoding[, format]]) + +Generates private and public EC Diffie-Hellman key values, and returns +the public key in the specified `format` and `encoding`. This key should be +transferred to the other party. + +The `format` arguments specifies point encoding and can be `'compressed'`, +`'uncompressed'`, or `'hybrid'`. If `format` is not specified, the point will +be returned in `'uncompressed'` format. + +The `encoding` argument can be `'binary'`, `'hex'`, or `'base64'`. If +`encoding` is provided a string is returned; otherwise a [`Buffer`][] +is returned. + +### ecdh.getPrivateKey([encoding]) + +Returns the EC Diffie-Hellman private key in the specified `encoding`, +which can be `'binary'`, `'hex'`, or `'base64'`. If `encoding` is provided +a string is returned; otherwise a [`Buffer`][] is returned. + +### ecdh.getPublicKey([encoding[, format]]) + +Returns the EC Diffie-Hellman public key in the specified `encoding` and +`format`. + +The `format` argument specifies point encoding and can be `'compressed'`, +`'uncompressed'`, or `'hybrid'`. If `format` is not specified the point will be +returned in `'uncompressed'` format. + +The `encoding` argument can be `'binary'`, `'hex'`, or `'base64'`. If +`encoding` is specified, a string is returned; otherwise a [`Buffer`][] is +returned. + +### ecdh.setPrivateKey(private_key[, encoding]) + +Sets the EC Diffie-Hellman private key. The `encoding` can be `'binary'`, +`'hex'` or `'base64'`. If `encoding` is provided, `private_key` is expected +to be a string; otherwise `private_key` is expected to be a [`Buffer`][]. If +`private_key` is not valid for the curve specified when the `ECDH` object was +created, an error is thrown. Upon setting the private key, the associated +public point (key) is also generated and set in the ECDH object. + +### ecdh.setPublicKey(public_key[, encoding]) + + Stability: 0 - Deprecated + +Sets the EC Diffie-Hellman public key. Key encoding can be `'binary'`, +`'hex'` or `'base64'`. If `encoding` is provided `public_key` is expected to +be a string; otherwise a [`Buffer`][] is expected. + +Note that there is not normally a reason to call this method because `ECDH` +only requires a private key and the other party's public key to compute the +shared secret. Typically either [`ecdh.generateKeys()`][] or +[`ecdh.setPrivateKey()`][] will be called. The [`ecdh.setPrivateKey()`][] method +attempts to generate the public point/key associated with the private key being +set. + +Example (obtaining a shared secret): + +```js +const crypto = require('crypto'); +const alice = crypto.createECDH('secp256k1'); +const bob = crypto.createECDH('secp256k1'); + +// Note: This is a shortcut way to specify one of Alice's previous private +// keys. It would be unwise to use such a predictable private key in a real +// application. +alice.setPrivateKey( + crypto.createHash('sha256').update('alice', 'utf8').digest() +); + +// Bob uses a newly generated cryptographically strong +// pseudorandom key pair bob.generateKeys(); + +const alice_secret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); +const bob_secret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + +// alice_secret and bob_secret should be the same shared secret value +console.log(alice_secret === bob_secret); +``` + +## Class: Hash + +The `Hash` class is a utility for creating hash digests of data. It can be +used in one of two ways: + +- As a [stream][] that is both readable and writable, where data is written + to produce a computed hash digest on the readable side, or +- Using the [`hash.update()`][] and [`hash.digest()`][] methods to produce the + computed hash. + +The [`crypto.createHash()`][] method is used to create `Hash` instances. `Hash` +objects are not to be created directly using the `new` keyword. + +Example: Using `Hash` objects as streams: + +```js +const crypto = require('crypto'); +const hash = crypto.createHash('sha256'); + +hash.on('readable', () => { + var data = hash.read(); + if (data) + console.log(data.toString('hex')); + // Prints: + // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 +}); + +hash.write('some data to hash'); +hash.end(); +``` + +Example: Using `Hash` and piped streams: + +```js +const crypto = require('crypto'); +const fs = require('fs'); +const hash = crypto.createHash('sha256'); + +const input = fs.createReadStream('test.js'); +input.pipe(hash).pipe(process.stdout); +``` + +Example: Using the [`hash.update()`][] and [`hash.digest()`][] methods: + +```js +const crypto = require('crypto'); +const hash = crypto.createHash('sha256'); + +hash.update('some data to hash'); +console.log(hash.digest('hex')); + // Prints: + // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 +``` + +### hash.digest([encoding]) + +Calculates the digest of all of the data passed to be hashed (using the +[`hash.update()`][] method). The `encoding` can be `'hex'`, `'binary'` or +`'base64'`. If `encoding` is provided a string will be returned; otherwise +a [`Buffer`][] is returned. + +The `Hash` object can not be used again after `hash.digest()` method has been +called. Multiple calls will cause an error to be thrown. + +### hash.update(data[, input_encoding]) + +Updates the hash content with the given `data`, the encoding of which +is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +`'binary'`. If `encoding` is not provided, and the `data` is a string, an +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. + +## Class: Hmac + +The `Hmac` Class is a utility for creating cryptographic HMAC digests. It can +be used in one of two ways: + +- As a [stream][] that is both readable and writable, where data is written + to produce a computed HMAC digest on the readable side, or +- Using the [`hmac.update()`][] and [`hmac.digest()`][] methods to produce the + computed HMAC digest. + +The [`crypto.createHmac()`][] method is used to create `Hmac` instances. `Hmac` +objects are not to be created directly using the `new` keyword. + +Example: Using `Hmac` objects as streams: + +```js +const crypto = require('crypto'); +const hmac = crypto.createHmac('sha256', 'a secret'); + +hmac.on('readable', () => { + var data = hmac.read(); + if (data) + console.log(data.toString('hex')); + // Prints: + // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e +}); + +hmac.write('some data to hash'); +hmac.end(); +``` + +Example: Using `Hmac` and piped streams: + +```js +const crypto = require('crypto'); +const fs = require('fs'); +const hmac = crypto.createHmac('sha256', 'a secret'); + +const input = fs.createReadStream('test.js'); +input.pipe(hmac).pipe(process.stdout); +``` + +Example: Using the [`hmac.update()`][] and [`hmac.digest()`][] methods: + +```js +const crypto = require('crypto'); +const hmac = crypto.createHmac('sha256', 'a secret'); + +hmac.update('some data to hash'); +console.log(hmac.digest('hex')); + // Prints: + // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e +``` + +### hmac.digest([encoding]) + +Calculates the HMAC digest of all of the data passed using [`hmac.update()`][]. +The `encoding` can be `'hex'`, `'binary'` or `'base64'`. If `encoding` is +provided a string is returned; otherwise a [`Buffer`][] is returned; + +The `Hmac` object can not be used again after `hmac.digest()` has been +called. Multiple calls to `hmac.digest()` will result in an error being thrown. + +### hmac.update(data[, input_encoding]) + +Updates the `Hmac` content with the given `data`, the encoding of which +is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +`'binary'`. If `encoding` is not provided, and the `data` is a string, an +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. + +## Class: Sign + +The `Sign` Class is a utility for generating signatures. It can be used in one +of two ways: + +- As a writable [stream][], where data to be signed is written and the + [`sign.sign()`][] method is used to generate and return the signature, or +- Using the [`sign.update()`][] and [`sign.sign()`][] methods to produce the + signature. + +The [`crypto.createSign()`][] method is used to create `Sign` instances. `Sign` +objects are not to be created directly using the `new` keyword. + +Example: Using `Sign` objects as streams: + +```js +const crypto = require('crypto'); +const sign = crypto.createSign('RSA-SHA256'); + +sign.write('some data to sign'); +sign.end(); + +const private_key = getPrivateKeySomehow(); +console.log(sign.sign(private_key, 'hex')); + // Prints the calculated signature +``` + +Example: Using the [`sign.update()`][] and [`sign.sign()`][] methods: + +```js +const crypto = require('crypto'); +const sign = crypto.createSign('RSA-SHA256'); + +sign.update('some data to sign'); + +const private_key = getPrivateKeySomehow(); +console.log(sign.sign(private_key, 'hex')); + // Prints the calculated signature +``` + +A `Sign` instance can also be created by just passing in the digest +algorithm name, in which case OpenSSL will infer the full signature algorithm +from the type of the PEM-formatted private key, including algorithms that +do not have directly exposed name constants, e.g. 'ecdsa-with-SHA256'. + +Example: signing using ECDSA with SHA256 + +```js +const crypto = require('crypto'); +const sign = crypto.createSign('sha256'); + +sign.update('some data to sign'); + +const private_key = '-----BEGIN EC PRIVATE KEY-----\n' + + 'MHcCAQEEIF+jnWY1D5kbVYDNvxxo/Y+ku2uJPDwS0r/VuPZQrjjVoAoGCCqGSM49\n' + + 'AwEHoUQDQgAEurOxfSxmqIRYzJVagdZfMMSjRNNhB8i3mXyIMq704m2m52FdfKZ2\n' + + 'pQhByd5eyj3lgZ7m7jbchtdgyOF8Io/1ng==\n' + + '-----END EC PRIVATE KEY-----\n'; + +console.log(sign.sign(private_key).toString('hex')); +``` + +### sign.sign(private_key[, output_format]) + +Calculates the signature on all the data passed through using either +[`sign.update()`][] or [`sign.write()`][stream-writable-write]. + +The `private_key` argument can be an object or a string. If `private_key` is a +string, it is treated as a raw key with no passphrase. If `private_key` is an +object, it is interpreted as a hash containing two properties: + +* `key` : {String} - PEM encoded private key +* `passphrase` : {String} - passphrase for the private key + +The `output_format` can specify one of `'binary'`, `'hex'` or `'base64'`. If +`output_format` is provided a string is returned; otherwise a [`Buffer`][] is +returned. + +The `Sign` object can not be again used after `sign.sign()` method has been +called. Multiple calls to `sign.sign()` will result in an error being thrown. + +### sign.update(data[, input_encoding]) + +Updates the `Sign` content with the given `data`, the encoding of which +is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +`'binary'`. If `encoding` is not provided, and the `data` is a string, an +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. + +## Class: Verify + +The `Verify` class is a utility for verifying signatures. It can be used in one +of two ways: + +- As a writable [stream][] where written data is used to validate against the + supplied signature, or +- Using the [`verify.update()`][] and [`verify.verify()`][] methods to verify + the signature. + + The [`crypto.createSign()`][] method is used to create `Sign` instances. + `Sign` objects are not to be created directly using the `new` keyword. + +Example: Using `Verify` objects as streams: + +```js +const crypto = require('crypto'); +const verify = crypto.createVerify('RSA-SHA256'); + +verify.write('some data to sign'); +verify.end(); + +const public_key = getPublicKeySomehow(); +const signature = getSignatureToVerify(); +console.log(sign.verify(public_key, signature)); + // Prints true or false +``` + +Example: Using the [`verify.update()`][] and [`verify.verify()`][] methods: + +```js +const crypto = require('crypto'); +const verify = crypto.createVerify('RSA-SHA256'); + +verify.update('some data to sign'); + +const public_key = getPublicKeySomehow(); +const signature = getSignatureToVerify(); +console.log(verify.verify(public_key, signature)); + // Prints true or false +``` + +### verifier.update(data[, input_encoding]) + +Updates the `Verify` content with the given `data`, the encoding of which +is given in `input_encoding` and can be `'utf8'`, `'ascii'` or +`'binary'`. If `encoding` is not provided, and the `data` is a string, an +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then +`input_encoding` is ignored. + +This can be called many times with new data as it is streamed. + +### verifier.verify(object, signature[, signature_format]) + +Verifies the provided data using the given `object` and `signature`. +The `object` argument is a string containing a PEM encoded object, which can be +one an RSA public key, a DSA public key, or an X.509 certificate. +The `signature` argument is the previously calculated signature for the data, in +the `signature_format` which can be `'binary'`, `'hex'` or `'base64'`. +If a `signature_format` is specified, the `signature` is expected to be a +string; otherwise `signature` is expected to be a [`Buffer`][]. + +Returns `true` or `false` depending on the validity of the signature for +the data and public key. + +The `verifier` object can not be used again after `verify.verify()` has been +called. Multiple calls to `verify.verify()` will result in an error being +thrown. + +## `crypto` module methods and properties + +### crypto.DEFAULT_ENCODING + +The default encoding to use for functions that can take either strings +or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods +default to [`Buffer`][] objects. + +The `crypto.DEFAULT_ENCODING` mechanism is provided for backwards compatibility +with legacy programs that expect `'binary'` to be the default encoding. + +New applications should expect the default to be `'buffer'`. This property may +become deprecated in a future Node.js release. + +### crypto.fips + +Property for checking and controlling whether a FIPS compliant crypto provider is +currently in use. Setting to true requires a FIPS build of Node.js. + +### crypto.createCipher(algorithm, password) + +Creates and returns a `Cipher` object that uses the given `algorithm` and +`password`. + +The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On +recent OpenSSL releases, `openssl list-cipher-algorithms` will display the +available cipher algorithms. + +The `password` is used to derive the cipher key and initialization vector (IV). +The value must be either a `'binary'` encoded string or a [`Buffer`][]. + +The implementation of `crypto.createCipher()` derives keys using the OpenSSL +function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one +iteration, and no salt. The lack of salt allows dictionary attacks as the same +password always creates the same key. The low iteration count and +non-cryptographically secure hash algorithm allow passwords to be tested very +rapidly. + +In line with OpenSSL's recommendation to use pbkdf2 instead of +[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on +their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] +to create the `Cipher` object. + +### crypto.createCipheriv(algorithm, key, iv) + +Creates and returns a `Cipher` object, with the given `algorithm`, `key` and +initialization vector (`iv`). + +The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On +recent OpenSSL releases, `openssl list-cipher-algorithms` will display the +available cipher algorithms. + +The `key` is the raw key used by the `algorithm` and `iv` is an +[initialization vector][]. Both arguments must be `'binary'` encoded strings or +[buffers][`Buffer`]. + +### crypto.createCredentials(details) + + Stability: 0 - Deprecated: Use [`tls.createSecureContext()`][] instead. + +The `crypto.createCredentials()` method is a deprecated alias for creating +and returning a `tls.SecureContext` object. The `crypto.createCredentials()` +method should not be used. + +The optional `details` argument is a hash object with keys: + +* `pfx` : {String|Buffer} - PFX or PKCS12 encoded private + key, certificate and CA certificates +* `key` : {String} - PEM encoded private key +* `passphrase` : {String} - passphrase for the private key or PFX +* `cert` : {String} - PEM encoded certificate +* `ca` : {String|Array} - Either a string or array of strings of PEM encoded CA + certificates to trust. +* `crl` : {String|Array} - Either a string or array of strings of PEM encoded CRLs + (Certificate Revocation List) +* `ciphers`: {String} using the [OpenSSL cipher list format][] describing the + cipher algorithms to use or exclude. + +If no 'ca' details are given, Node.js will use Mozilla's default +[publicly trusted list of CAs][]. + +### crypto.createDecipher(algorithm, password) + +Creates and returns a `Decipher` object that uses the given `algorithm` and +`password` (key). + +The implementation of `crypto.createDecipher()` derives keys using the OpenSSL +function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one +iteration, and no salt. The lack of salt allows dictionary attacks as the same +password always creates the same key. The low iteration count and +non-cryptographically secure hash algorithm allow passwords to be tested very +rapidly. + +In line with OpenSSL's recommendation to use pbkdf2 instead of +[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on +their own using [`crypto.pbkdf2()`][] and to use [`crypto.createDecipheriv()`][] +to create the `Decipher` object. + +### crypto.createDecipheriv(algorithm, key, iv) + +Creates and returns a `Decipher` object that uses the given `algorithm`, `key` +and initialization vector (`iv`). + +The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On +recent OpenSSL releases, `openssl list-cipher-algorithms` will display the +available cipher algorithms. + +The `key` is the raw key used by the `algorithm` and `iv` is an +[initialization vector][]. Both arguments must be `'binary'` encoded strings or +[buffers][`Buffer`]. + +### crypto.createDiffieHellman(prime[, prime_encoding][, generator][, generator_encoding]) + +Creates a `DiffieHellman` key exchange object using the supplied `prime` and an +optional specific `generator`. + +The `generator` argument can be a number, string, or [`Buffer`][]. If +`generator` is not specified, the value `2` is used. + +The `prime_encoding` and `generator_encoding` arguments can be `'binary'`, +`'hex'`, or `'base64'`. + +If `prime_encoding` is specified, `prime` is expected to be a string; otherwise +a [`Buffer`][] is expected. + +If `generator_encoding` is specified, `generator` is expected to be a string; +otherwise either a number or [`Buffer`][] is expected. + +### crypto.createDiffieHellman(prime_length[, generator]) + +Creates a `DiffieHellman` key exchange object and generates a prime of +`prime_length` bits using an optional specific numeric `generator`. +If `generator` is not specified, the value `2` is used. + +### crypto.createECDH(curve_name) + +Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a +predefined curve specified by the `curve_name` string. Use +[`crypto.getCurves()`][] to obtain a list of available curve names. On recent +OpenSSL releases, `openssl ecparam -list_curves` will also display the name +and description of each available elliptic curve. + +### crypto.createHash(algorithm) + +Creates and returns a `Hash` object that can be used to generate hash digests +using the given `algorithm`. + +The `algorithm` is dependent on the available algorithms supported by the +version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. +On recent releases of OpenSSL, `openssl list-message-digest-algorithms` will +display the available digest algorithms. + +Example: generating the sha256 sum of a file + +```js +const filename = process.argv[2]; +const crypto = require('crypto'); +const fs = require('fs'); + +const hash = crypto.createHash('sha256'); + +const input = fs.createReadStream(filename); +input.on('readable', () => { + var data = input.read(); + if (data) + hash.update(data); + else { + console.log(`${hash.digest('hex')} ${filename}`); + } +}); +``` + +### crypto.createHmac(algorithm, key) + +Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + +The `algorithm` is dependent on the available algorithms supported by the +version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. +On recent releases of OpenSSL, `openssl list-message-digest-algorithms` will +display the available digest algorithms. + +The `key` is the HMAC key used to generate the cryptographic HMAC hash. + +Example: generating the sha256 HMAC of a file + +```js +const filename = process.argv[2]; +const crypto = require('crypto'); +const fs = require('fs'); + +const hmac = crypto.createHmac('sha256', 'a secret'); + +const input = fs.createReadStream(filename); +input.on('readable', () => { + var data = input.read(); + if (data) + hmac.update(data); + else { + console.log(`${hmac.digest('hex')} ${filename}`); + } +}); +``` + +### crypto.createSign(algorithm) + +Creates and returns a `Sign` object that uses the given `algorithm`. On +recent OpenSSL releases, `openssl list-public-key-algorithms` will +display the available signing algorithms. One example is `'RSA-SHA256'`. + +### crypto.createVerify(algorithm) + +Creates and returns a `Verify` object that uses the given algorithm. On +recent OpenSSL releases, `openssl list-public-key-algorithms` will +display the available signing algorithms. One example is `'RSA-SHA256'`. + +### crypto.getCiphers() + +Returns an array with the names of the supported cipher algorithms. + +Example: + +```js +const ciphers = crypto.getCiphers(); +console.log(ciphers); // ['aes-128-cbc', 'aes-128-ccm', ...] +``` + +### crypto.getCurves() + +Returns an array with the names of the supported elliptic curves. + +Example: + +```js +const curves = crypto.getCurves(); +console.log(curves); // ['secp256k1', 'secp384r1', ...] +``` + +### crypto.getDiffieHellman(group_name) + +Creates a predefined `DiffieHellman` key exchange object. The +supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in +[RFC 2412][], but see [Caveats][]) and `'modp14'`, `'modp15'`, +`'modp16'`, `'modp17'`, `'modp18'` (defined in [RFC 3526][]). The +returned object mimics the interface of objects created by +[`crypto.createDiffieHellman()`][], but will not allow changing +the keys (with [`diffieHellman.setPublicKey()`][] for example). The +advantage of using this method is that the parties do not have to +generate nor exchange a group modulus beforehand, saving both processor +and communication time. + +Example (obtaining a shared secret): + +```js +const crypto = require('crypto'); +const alice = crypto.getDiffieHellman('modp14'); +const bob = crypto.getDiffieHellman('modp14'); + +alice.generateKeys(); +bob.generateKeys(); + +const alice_secret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); +const bob_secret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + +/* alice_secret and bob_secret should be the same */ +console.log(alice_secret == bob_secret); +``` + +### crypto.getHashes() + +Returns an array with the names of the supported hash algorithms. + +Example: + +```js +const hashes = crypto.getHashes(); +console.log(hashes); // ['sha', 'sha1', 'sha1WithRSAEncryption', ...] +``` + +### crypto.pbkdf2(password, salt, iterations, keylen, digest, callback) + +Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) +implementation. A selected HMAC digest algorithm specified by `digest` is +applied to derive a key of the requested byte length (`keylen`) from the +`password`, `salt` and `iterations`. + +The supplied `callback` function is called with two arguments: `err` and +`derivedKey`. If an error occurs, `err` will be set; otherwise `err` will be +null. The successfully generated `derivedKey` will be passed as a [`Buffer`][]. + +The `iterations` argument must be a number set as high as possible. The +higher the number of iterations, the more secure the derived key will be, +but will take a longer amount of time to complete. + +The `salt` should also be as unique as possible. It is recommended that the +salts are random and their lengths are greater than 16 bytes. See +[NIST SP 800-132][] for details. + +Example: + +```js +const crypto = require('crypto'); +crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, key) => { + if (err) throw err; + console.log(key.toString('hex')); // 'c5e478d...1469e50' +}); +``` + +An array of supported digest functions can be retrieved using +[`crypto.getHashes()`][]. + +### crypto.pbkdf2Sync(password, salt, iterations, keylen, digest) + +Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) +implementation. A selected HMAC digest algorithm specified by `digest` is +applied to derive a key of the requested byte length (`keylen`) from the +`password`, `salt` and `iterations`. + +If an error occurs an Error will be thrown, otherwise the derived key will be +returned as a [`Buffer`][]. + +The `iterations` argument must be a number set as high as possible. The +higher the number of iterations, the more secure the derived key will be, +but will take a longer amount of time to complete. + +The `salt` should also be as unique as possible. It is recommended that the +salts are random and their lengths are greater than 16 bytes. See +[NIST SP 800-132][] for details. + +Example: + +```js +const crypto = require('crypto'); +const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); +console.log(key.toString('hex')); // 'c5e478d...1469e50' +``` + +An array of supported digest functions can be retrieved using +[`crypto.getHashes()`][]. + +### crypto.privateDecrypt(private_key, buffer) + +Decrypts `buffer` with `private_key`. + +`private_key` can be an object or a string. If `private_key` is a string, it is +treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. +If `private_key` is an object, it is interpreted as a hash object with the +keys: + +* `key` : {String} - PEM encoded private key +* `passphrase` : {String} - Optional passphrase for the private key +* `padding` : An optional padding value, one of the following: + * `constants.RSA_NO_PADDING` + * `constants.RSA_PKCS1_PADDING` + * `constants.RSA_PKCS1_OAEP_PADDING` + +All paddings are defined in the `constants` module. + +### crypto.privateEncrypt(private_key, buffer) + +Encrypts `buffer` with `private_key`. + +`private_key` can be an object or a string. If `private_key` is a string, it is +treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. +If `private_key` is an object, it is interpreted as a hash object with the +keys: + +* `key` : {String} - PEM encoded private key +* `passphrase` : {String} - Optional passphrase for the private key +* `padding` : An optional padding value, one of the following: + * `constants.RSA_NO_PADDING` + * `constants.RSA_PKCS1_PADDING` + * `constants.RSA_PKCS1_OAEP_PADDING` + +All paddings are defined in the `constants` module. + +### crypto.publicDecrypt(public_key, buffer) + +Decrypts `buffer` with `public_key`. + +`public_key` can be an object or a string. If `public_key` is a string, it is +treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. +If `public_key` is an object, it is interpreted as a hash object with the +keys: + +* `key` : {String} - PEM encoded public key +* `passphrase` : {String} - Optional passphrase for the private key +* `padding` : An optional padding value, one of the following: + * `constants.RSA_NO_PADDING` + * `constants.RSA_PKCS1_PADDING` + * `constants.RSA_PKCS1_OAEP_PADDING` + +Because RSA public keys can be derived from private keys, a private key may +be passed instead of a public key. + +All paddings are defined in the `constants` module. + +### crypto.publicEncrypt(public_key, buffer) + +Encrypts `buffer` with `public_key`. + +`public_key` can be an object or a string. If `public_key` is a string, it is +treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. +If `public_key` is an object, it is interpreted as a hash object with the +keys: + +* `key` : {String} - PEM encoded public key +* `passphrase` : {String} - Optional passphrase for the private key +* `padding` : An optional padding value, one of the following: + * `constants.RSA_NO_PADDING` + * `constants.RSA_PKCS1_PADDING` + * `constants.RSA_PKCS1_OAEP_PADDING` + +Because RSA public keys can be derived from private keys, a private key may +be passed instead of a public key. + +All paddings are defined in the `constants` module. + +### crypto.randomBytes(size[, callback]) + +Generates cryptographically strong pseudo-random data. The `size` argument +is a number indicating the number of bytes to generate. + +If a `callback` function is provided, the bytes are generated asynchronously +and the `callback` function is invoked with two arguments: `err` and `buf`. +If an error occurs, `err` will be an Error object; otherwise it is null. The +`buf` argument is a [`Buffer`][] containing the generated bytes. + +```js +// Asynchronous +const crypto = require('crypto'); +crypto.randomBytes(256, (err, buf) => { + if (err) throw err; + console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); +}); +``` + +If the `callback` function is not provided, the random bytes are generated +synchronously and returned as a [`Buffer`][]. An error will be thrown if +there is a problem generating the bytes. + +```js +// Synchronous +const buf = crypto.randomBytes(256); +console.log( + `${buf.length} bytes of random data: ${buf.toString('hex')}`); +``` + +The `crypto.randomBytes()` method will block until there is sufficient entropy. +This should normally never take longer than a few milliseconds. The only time +when generating the random bytes may conceivably block for a longer period of +time is right after boot, when the whole system is still low on entropy. + +### crypto.setEngine(engine[, flags]) + +Load and set the `engine` for some or all OpenSSL functions (selected by flags). + +`engine` could be either an id or a path to the engine's shared library. + +The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` +is a bit field taking one of or a mix of the following flags (defined in the +`constants` module): + +* `ENGINE_METHOD_RSA` +* `ENGINE_METHOD_DSA` +* `ENGINE_METHOD_DH` +* `ENGINE_METHOD_RAND` +* `ENGINE_METHOD_ECDH` +* `ENGINE_METHOD_ECDSA` +* `ENGINE_METHOD_CIPHERS` +* `ENGINE_METHOD_DIGESTS` +* `ENGINE_METHOD_STORE` +* `ENGINE_METHOD_PKEY_METHS` +* `ENGINE_METHOD_PKEY_ASN1_METHS` +* `ENGINE_METHOD_ALL` +* `ENGINE_METHOD_NONE` + +## Notes + +### Legacy Streams API (pre Node.js v0.10) + +The Crypto module was added to Node.js before there was the concept of a +unified Stream API, and before there were [`Buffer`][] objects for handling +binary data. As such, the many of the `crypto` defined classes have methods not +typically found on other Node.js classes that implement the [streams][stream] +API (e.g. `update()`, `final()`, or `digest()`). Also, many methods accepted +and returned `'binary'` encoded strings by default rather than Buffers. This +default was changed after Node.js v0.8 to use [`Buffer`][] objects by default +instead. + +### Recent ECDH Changes + +Usage of `ECDH` with non-dynamically generated key pairs has been simplified. +Now, [`ecdh.setPrivateKey()`][] can be called with a preselected private key +and the associated public point (key) will be computed and stored in the object. +This allows code to only store and provide the private part of the EC key pair. +[`ecdh.setPrivateKey()`][] now also validates that the private key is valid for +the selected curve. + +The [`ecdh.setPublicKey()`][] method is now deprecated as its inclusion in the +API is not useful. Either a previously stored private key should be set, which +automatically generates the associated public key, or [`ecdh.generateKeys()`][] +should be called. The main drawback of using [`ecdh.setPublicKey()`][] is that +it can be used to put the ECDH key pair into an inconsistent state. + +### Support for weak or compromised algorithms + +The `crypto` module still supports some algorithms which are already +compromised and are not currently recommended for use. The API also allows +the use of ciphers and hashes with a small key size that are considered to be +too weak for safe use. + +Users should take full responsibility for selecting the crypto +algorithm and key size according to their security requirements. + +Based on the recommendations of [NIST SP 800-131A][]: + +- MD5 and SHA-1 are no longer acceptable where collision resistance is + required such as digital signatures. +- The key used with RSA, DSA and DH algorithms is recommended to have + at least 2048 bits and that of the curve of ECDSA and ECDH at least + 224 bits, to be safe to use for several years. +- The DH groups of `modp1`, `modp2` and `modp5` have a key size + smaller than 2048 bits and are not recommended. + +See the reference for other recommendations and details. + +[`Buffer`]: buffer.html +[`cipher.final()`]: #crypto_cipher_final_output_encoding +[`cipher.update()`]: #crypto_cipher_update_data_input_encoding_output_encoding +[`crypto.createCipher()`]: #crypto_crypto_createcipher_algorithm_password +[`crypto.createCipheriv()`]: #crypto_crypto_createcipheriv_algorithm_key_iv +[`crypto.createDecipher()`]: #crypto_crypto_createdecipher_algorithm_password +[`crypto.createDecipheriv()`]: #crypto_crypto_createdecipheriv_algorithm_key_iv +[`crypto.createDiffieHellman()`]: #crypto_crypto_creatediffiehellman_prime_prime_encoding_generator_generator_encoding +[`crypto.createECDH()`]: #crypto_crypto_createecdh_curve_name +[`crypto.createHash()`]: #crypto_crypto_createhash_algorithm +[`crypto.createHmac()`]: #crypto_crypto_createhmac_algorithm_key +[`crypto.createSign()`]: #crypto_crypto_createsign_algorithm +[`crypto.getCurves()`]: #crypto_crypto_getcurves +[`crypto.getHashes()`]: #crypto_crypto_gethashes +[`crypto.pbkdf2()`]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback +[`decipher.final()`]: #crypto_decipher_final_output_encoding +[`decipher.update()`]: #crypto_decipher_update_data_input_encoding_output_encoding +[`diffieHellman.setPublicKey()`]: #crypto_diffiehellman_setpublickey_public_key_encoding +[`ecdh.generateKeys()`]: #crypto_ecdh_generatekeys_encoding_format +[`ecdh.setPrivateKey()`]: #crypto_ecdh_setprivatekey_private_key_encoding +[`ecdh.setPublicKey()`]: #crypto_ecdh_setpublickey_public_key_encoding +[`EVP_BytesToKey`]: https://www.openssl.org/docs/crypto/EVP_BytesToKey.html +[`hash.digest()`]: #crypto_hash_digest_encoding +[`hash.update()`]: #crypto_hash_update_data_input_encoding +[`hmac.digest()`]: #crypto_hmac_digest_encoding +[`hmac.update()`]: #crypto_hmac_update_data_input_encoding +[`sign.sign()`]: #crypto_sign_sign_private_key_output_format +[`sign.update()`]: #crypto_sign_update_data_input_encoding +[`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_options +[`verify.update()`]: #crypto_verifier_update_data_input_encoding +[`verify.verify()`]: #crypto_verifier_verify_object_signature_signature_format +[Caveats]: #crypto_support_for_weak_or_compromised_algorithms +[HTML5's `keygen` element]: http://www.w3.org/TR/html5/forms.html#the-keygen-element +[initialization vector]: https://en.wikipedia.org/wiki/Initialization_vector +[NIST SP 800-131A]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf +[NIST SP 800-132]: http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf +[OpenSSL cipher list format]: https://www.openssl.org/docs/apps/ciphers.html#CIPHER-LIST-FORMAT +[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/apps/spkac.html +[publicly trusted list of CAs]: https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt +[RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt +[RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt +[stream]: stream.html +[stream-writable-write]: stream.html#stream_writable_write_chunk_encoding_callback diff --git a/doc/api/debugger.markdown b/doc/api/debugger.markdown deleted file mode 100644 index 2bbaf9049eb5fb..00000000000000 --- a/doc/api/debugger.markdown +++ /dev/null @@ -1,182 +0,0 @@ -# Debugger - - Stability: 2 - Stable - - - -Node.js includes a full-featured out-of-process debugging utility accessible -via a simple [TCP-based protocol][] and built-in debugging client. To use it, -start Node.js with the `debug` argument followed by the path to the script to -debug; a prompt will be displayed indicating successful launch of the debugger: - -``` -$ node debug myscript.js -< debugger listening on port 5858 -connecting... ok -break in /home/indutny/Code/git/indutny/myscript.js:1 - 1 x = 5; - 2 setTimeout(() => { - 3 debugger; -debug> -``` - -Node.js's debugger client does not yet support the full range of commands, but -simple step and inspection are possible. - -Inserting the statement `debugger;` into the source code of a script will -enable a breakpoint at that position in the code. - -For example, suppose `myscript.js` is written as: - -```js -// myscript.js -x = 5; -setTimeout(() => { - debugger; - console.log('world'); -}, 1000); -console.log('hello'); -``` - -Once the debugger is run, a breakpoint will occur at line 4: - -``` -$ node debug myscript.js -< debugger listening on port 5858 -connecting... ok -break in /home/indutny/Code/git/indutny/myscript.js:1 - 1 x = 5; - 2 setTimeout(() => { - 3 debugger; -debug> cont -< hello -break in /home/indutny/Code/git/indutny/myscript.js:3 - 1 x = 5; - 2 setTimeout(() => { - 3 debugger; - 4 console.log('world'); - 5 }, 1000); -debug> next -break in /home/indutny/Code/git/indutny/myscript.js:4 - 2 setTimeout(() => { - 3 debugger; - 4 console.log('world'); - 5 }, 1000); - 6 console.log('hello'); -debug> repl -Press Ctrl + C to leave debug repl -> x -5 -> 2+2 -4 -debug> next -< world -break in /home/indutny/Code/git/indutny/myscript.js:5 - 3 debugger; - 4 console.log('world'); - 5 }, 1000); - 6 console.log('hello'); - 7 -debug> quit -``` - -The `repl` command allows code to be evaluated remotely. The `next` command -steps over to the next line. Type `help` to see what other commands are -available. - -## Watchers - -It is possible to watch expression and variable values while debugging. On -every breakpoint, each expression from the watchers list will be evaluated -in the current context and displayed immediately before the breakpoint's -source code listing. - -To begin watching an expression, type `watch('my_expression')`. The command -`watchers` will print the active watchers. To remove a watcher, type -`unwatch('my_expression')`. - -## Commands reference - -### Stepping - -* `cont`, `c` - Continue execution -* `next`, `n` - Step next -* `step`, `s` - Step in -* `out`, `o` - Step out -* `pause` - Pause running code (like pause button in Developer Tools) - -### Breakpoints - -* `setBreakpoint()`, `sb()` - Set breakpoint on current line -* `setBreakpoint(line)`, `sb(line)` - Set breakpoint on specific line -* `setBreakpoint('fn()')`, `sb(...)` - Set breakpoint on a first statement in -functions body -* `setBreakpoint('script.js', 1)`, `sb(...)` - Set breakpoint on first line of -script.js -* `clearBreakpoint('script.js', 1)`, `cb(...)` - Clear breakpoint in script.js -on line 1 - -It is also possible to set a breakpoint in a file (module) that -isn't loaded yet: - -``` -$ ./node debug test/fixtures/break-in-module/main.js -< debugger listening on port 5858 -connecting to port 5858... ok -break in test/fixtures/break-in-module/main.js:1 - 1 var mod = require('./mod.js'); - 2 mod.hello(); - 3 mod.hello(); -debug> setBreakpoint('mod.js', 23) -Warning: script 'mod.js' was not loaded yet. - 1 var mod = require('./mod.js'); - 2 mod.hello(); - 3 mod.hello(); -debug> c -break in test/fixtures/break-in-module/mod.js:23 - 21 - 22 exports.hello = () => { - 23 return 'hello from module'; - 24 }; - 25 -debug> -``` - -### Info - -* `backtrace`, `bt` - Print backtrace of current execution frame -* `list(5)` - List scripts source code with 5 line context (5 lines before and -after) -* `watch(expr)` - Add expression to watch list -* `unwatch(expr)` - Remove expression from watch list -* `watchers` - List all watchers and their values (automatically listed on each -breakpoint) -* `repl` - Open debugger's repl for evaluation in debugging script's context -* `exec expr` - Execute an expression in debugging script's context - -### Execution control - -* `run` - Run script (automatically runs on debugger's start) -* `restart` - Restart script -* `kill` - Kill script - -### Various - -* `scripts` - List all loaded scripts -* `version` - Display V8's version - -## Advanced Usage - -An alternative way of enabling and accessing the debugger is to start -Node.js with the `--debug` command-line flag or by signaling an existing -Node.js process with `SIGUSR1`. - -Once a process has been set in debug mode this way, it can be connected to -using the Node.js debugger by either connecting to the `pid` of the running -process or via URI reference to the listening debugger: - -* `node debug -p ` - Connects to the process via the `pid` -* `node debug ` - Connects to the process via the URI such as -localhost:5858 - -[TCP-based protocol]: https://github.com/v8/v8/wiki/Debugging-Protocol diff --git a/doc/api/debugger.md b/doc/api/debugger.md new file mode 100644 index 00000000000000..a966ee2b01183e --- /dev/null +++ b/doc/api/debugger.md @@ -0,0 +1,182 @@ +# Debugger + + Stability: 2 - Stable + + + +Node.js includes a full-featured out-of-process debugging utility accessible +via a simple [TCP-based protocol][] and built-in debugging client. To use it, +start Node.js with the `debug` argument followed by the path to the script to +debug; a prompt will be displayed indicating successful launch of the debugger: + +``` +$ node debug myscript.js +< debugger listening on port 5858 +connecting... ok +break in /home/indutny/Code/git/indutny/myscript.js:1 + 1 x = 5; + 2 setTimeout(() => { + 3 debugger; +debug> +``` + +Node.js's debugger client is not a full-featured debugger, but simple step and +inspection are possible. + +Inserting the statement `debugger;` into the source code of a script will +enable a breakpoint at that position in the code: + +```js +// myscript.js +x = 5; +setTimeout(() => { + debugger; + console.log('world'); +}, 1000); +console.log('hello'); +``` + +Once the debugger is run, a breakpoint will occur at line 4: + +``` +$ node debug myscript.js +< debugger listening on port 5858 +connecting... ok +break in /home/indutny/Code/git/indutny/myscript.js:1 + 1 x = 5; + 2 setTimeout(() => { + 3 debugger; +debug> cont +< hello +break in /home/indutny/Code/git/indutny/myscript.js:3 + 1 x = 5; + 2 setTimeout(() => { + 3 debugger; + 4 console.log('world'); + 5 }, 1000); +debug> next +break in /home/indutny/Code/git/indutny/myscript.js:4 + 2 setTimeout(() => { + 3 debugger; + 4 console.log('world'); + 5 }, 1000); + 6 console.log('hello'); +debug> repl +Press Ctrl + C to leave debug repl +> x +5 +> 2+2 +4 +debug> next +< world +break in /home/indutny/Code/git/indutny/myscript.js:5 + 3 debugger; + 4 console.log('world'); + 5 }, 1000); + 6 console.log('hello'); + 7 +debug> quit +``` + +The `repl` command allows code to be evaluated remotely. The `next` command +steps to the next line. Type `help` to see what other commands are available. + +Pressing `enter` without typing a command will repeat the previous debugger +command. + +## Watchers + +It is possible to watch expression and variable values while debugging. On +every breakpoint, each expression from the watchers list will be evaluated +in the current context and displayed immediately before the breakpoint's +source code listing. + +To begin watching an expression, type `watch('my_expression')`. The command +`watchers` will print the active watchers. To remove a watcher, type +`unwatch('my_expression')`. + +## Command reference + +### Stepping + +* `cont`, `c` - Continue execution +* `next`, `n` - Step next +* `step`, `s` - Step in +* `out`, `o` - Step out +* `pause` - Pause running code (like pause button in Developer Tools) + +### Breakpoints + +* `setBreakpoint()`, `sb()` - Set breakpoint on current line +* `setBreakpoint(line)`, `sb(line)` - Set breakpoint on specific line +* `setBreakpoint('fn()')`, `sb(...)` - Set breakpoint on a first statement in +functions body +* `setBreakpoint('script.js', 1)`, `sb(...)` - Set breakpoint on first line of +script.js +* `clearBreakpoint('script.js', 1)`, `cb(...)` - Clear breakpoint in script.js +on line 1 + +It is also possible to set a breakpoint in a file (module) that +isn't loaded yet: + +``` +$ ./node debug test/fixtures/break-in-module/main.js +< debugger listening on port 5858 +connecting to port 5858... ok +break in test/fixtures/break-in-module/main.js:1 + 1 var mod = require('./mod.js'); + 2 mod.hello(); + 3 mod.hello(); +debug> setBreakpoint('mod.js', 23) +Warning: script 'mod.js' was not loaded yet. + 1 var mod = require('./mod.js'); + 2 mod.hello(); + 3 mod.hello(); +debug> c +break in test/fixtures/break-in-module/mod.js:23 + 21 + 22 exports.hello = () => { + 23 return 'hello from module'; + 24 }; + 25 +debug> +``` + +### Information + +* `backtrace`, `bt` - Print backtrace of current execution frame +* `list(5)` - List scripts source code with 5 line context (5 lines before and +after) +* `watch(expr)` - Add expression to watch list +* `unwatch(expr)` - Remove expression from watch list +* `watchers` - List all watchers and their values (automatically listed on each +breakpoint) +* `repl` - Open debugger's repl for evaluation in debugging script's context +* `exec expr` - Execute an expression in debugging script's context + +### Execution control + +* `run` - Run script (automatically runs on debugger's start) +* `restart` - Restart script +* `kill` - Kill script + +### Various + +* `scripts` - List all loaded scripts +* `version` - Display V8's version + +## Advanced Usage + +An alternative way of enabling and accessing the debugger is to start +Node.js with the `--debug` command-line flag or by signaling an existing +Node.js process with `SIGUSR1`. + +Once a process has been set in debug mode this way, it can be inspected +using the Node.js debugger by either connecting to the `pid` of the running +process or via URI reference to the listening debugger: + +* `node debug -p ` - Connects to the process via the `pid` +* `node debug ` - Connects to the process via the URI such as +localhost:5858 + +[TCP-based protocol]: https://github.com/v8/v8/wiki/Debugging-Protocol diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown deleted file mode 100644 index 1bb5155578d6cf..00000000000000 --- a/doc/api/dgram.markdown +++ /dev/null @@ -1,426 +0,0 @@ -# UDP / Datagram Sockets - - Stability: 2 - Stable - - - -The `dgram` module provides an implementation of UDP Datagram sockets. - -```js -const dgram = require('dgram'); -const server = dgram.createSocket('udp4'); - -server.on('error', (err) => { - console.log(`server error:\n${err.stack}`); - server.close(); -}); - -server.on('message', (msg, rinfo) => { - console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); -}); - -server.on('listening', () => { - var address = server.address(); - console.log(`server listening ${address.address}:${address.port}`); -}); - -server.bind(41234); -// server listening 0.0.0.0:41234 -``` - -## Class: dgram.Socket - -The `dgram.Socket` object is an [`EventEmitter`][] that encapsulates the -datagram functionality. - -New instances of `dgram.Socket` are created using [`dgram.createSocket()`][]. -The `new` keyword is not to be used to create `dgram.Socket` instances. - -### Event: 'close' - -The `'close'` event is emitted after a socket is closed with [`close()`][]. -Once triggered, no new `'message'` events will be emitted on this socket. - -### Event: 'error' - -* `exception` {Error} - -The `'error'` event is emitted whenever any error occurs. The event handler -function is passed a single Error object. - -### Event: 'listening' - -The `'listening'` event is emitted whenever a socket begins listening for -datagram messages. This occurs as soon as UDP sockets are created. - -### Event: 'message' - -* `msg` {Buffer} - The message -* `rinfo` {Object} - Remote address information - -The `'message'` event is emitted when a new datagram is available on a socket. -The event handler function is passed two arguments: `msg` and `rinfo`. The -`msg` argument is a [`Buffer`][] and `rinfo` is an object with the sender's -address information provided by the `address`, `family` and `port` properties: - -```js -socket.on('message', (msg, rinfo) => { - console.log('Received %d bytes from %s:%d\n', - msg.length, rinfo.address, rinfo.port); -}); -``` - -### socket.addMembership(multicastAddress[, multicastInterface]) - -* `multicastAddress` {String} -* `multicastInterface` {String}, Optional - -Tells the kernel to join a multicast group at the given `multicastAddress` -using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` -argument is not specified, the operating system will try to add membership to -all valid networking interfaces. - -### socket.address() - -Returns an object containing the address information for a socket. -For UDP sockets, this object will contain `address`, `family` and `port` -properties. - -### socket.bind([port][, address][, callback]) - -* `port` {Number} - Integer, Optional -* `address` {String}, Optional -* `callback` {Function} with no parameters, Optional. Called when - binding is complete. - -For UDP sockets, causes the `dgram.Socket` to listen for datagram messages on a -named `port` and optional `address`. If `port` is not specified, the operating -system will attempt to bind to a random port. If `address` is not specified, -the operating system will attempt to listen on all addresses. Once binding is -complete, a `'listening'` event is emitted and the optional `callback` function -is called. - -Note that specifying both a `'listening'` event listener and passing a -`callback` to the `socket.bind()` method is not harmful but not very -useful. - -A bound datagram socket keeps the Node.js process running to receive -datagram messages. - -If binding fails, an `'error'` event is generated. In rare case (e.g. -attempting to bind with a closed socket), an [`Error`][] may be thrown. - -Example of a UDP server listening on port 41234: - -```js -const dgram = require('dgram'); -const server = dgram.createSocket('udp4'); - -server.on('error', (err) => { - console.log(`server error:\n${err.stack}`); - server.close(); -}); - -server.on('message', (msg, rinfo) => { - console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); -}); - -server.on('listening', () => { - var address = server.address(); - console.log(`server listening ${address.address}:${address.port}`); -}); - -server.bind(41234); -// server listening 0.0.0.0:41234 -``` - -### socket.bind(options[, callback]) - -* `options` {Object} - Required. Supports the following properties: - * `port` {Number} - Required. - * `address` {String} - Optional. - * `exclusive` {Boolean} - Optional. -* `callback` {Function} - Optional. - -For UDP sockets, causes the `dgram.Socket` to listen for datagram messages on a -named `port` and optional `address` that are passed as properties of an -`options` object passed as the first argument. If `port` is not specified, the -operating system will attempt to bind to a random port. If `address` is not -specified, the operating system will attempt to listen on all addresses. Once -binding is complete, a `'listening'` event is emitted and the optional -`callback` function is called. - -The `options` object may contain an additional `exclusive` property that is -use when using `dgram.Socket` objects with the [`cluster`] module. When -`exclusive` is set to `false` (the default), cluster workers will use the same -underlying socket handle allowing connection handling duties to be shared. -When `exclusive` is `true`, however, the handle is not shared and attempted -port sharing results in an error. - -An example socket listening on an exclusive port is shown below. - -```js -socket.bind({ - address: 'localhost', - port: 8000, - exclusive: true -}); -``` - -### socket.close([callback]) - -Close the underlying socket and stop listening for data on it. If a callback is -provided, it is added as a listener for the [`'close'`][] event. - -### socket.dropMembership(multicastAddress[, multicastInterface]) - -* `multicastAddress` {String} -* `multicastInterface` {String}, Optional - -Instructs the kernel to leave a multicast group at `multicastAddress` using the -`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the -kernel when the socket is closed or the process terminates, so most apps will -never have reason to call this. - -If `multicastInterface` is not specified, the operating system will attempt to -drop membership on all valid interfaces. - -### socket.send(msg, [offset, length,] port, address[, callback]) - -* `msg` {Buffer|String|Array} Message to be sent -* `offset` {Number} Integer. Optional. Offset in the buffer where the message starts. -* `length` {Number} Integer. Optional. Number of bytes in the message. -* `port` {Number} Integer. Destination port. -* `address` {String} Destination hostname or IP address. -* `callback` {Function} Called when the message has been sent. Optional. - -Broadcasts a datagram on the socket. The destination `port` and `address` must -be specified. - -The `msg` argument contains the message to be sent. -Depending on its type, different behavior can apply. If `msg` is a `Buffer`, -the `offset` and `length` specify the offset within the `Buffer` where the -message begins and the number of bytes in the message, respectively. -If `msg` is a `String`, then it is automatically converted to a `Buffer` -with `'utf8'` encoding. With messages that -contain multi-byte characters, `offset` and `length` will be calculated with -respect to [byte length][] and not the character position. -If `msg` is an array, `offset` and `length` must not be specified. - -The `address` argument is a string. If the value of `address` is a host name, -DNS will be used to resolve the address of the host. If the `address` is not -specified or is an empty string, `'127.0.0.1'` or `'::1'` will be used instead. - -If the socket has not been previously bound with a call to `bind`, the socket -is assigned a random port number and is bound to the "all interfaces" address -(`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - -An optional `callback` function may be specified to as a way of reporting -DNS errors or for determining when it is safe to reuse the `buf` object. -Note that DNS lookups delay the time to send for at least one tick of the -Node.js event loop. - -The only way to know for sure that the datagram has been sent is by using a -`callback`. If an error occurs and a `callback` is given, the error will be -passed as the first argument to the `callback`. If a `callback` is not given, -the error is emitted as an `'error'` event on the `socket` object. - -Offset and length are optional, but if you specify one you would need to -specify the other. Also, they are supported only when the first -argument is a `Buffer`. - -Example of sending a UDP packet to a random port on `localhost`; - -```js -const dgram = require('dgram'); -const message = new Buffer('Some bytes'); -const client = dgram.createSocket('udp4'); -client.send(message, 41234, 'localhost', (err) => { - client.close(); -}); -``` - -Example of sending a UDP packet composed of multiple buffers to a random port on `localhost`; - -```js -const dgram = require('dgram'); -const buf1 = new Buffer('Some '); -const buf2 = new Buffer('bytes'); -const client = dgram.createSocket('udp4'); -client.send([buf1, buf2], 41234, 'localhost', (err) => { - client.close(); -}); -``` - -Sending multiple buffers might be faster or slower depending on your -application and operating system: benchmark it. Usually it is faster. - -**A Note about UDP datagram size** - -The maximum size of an `IPv4/v6` datagram depends on the `MTU` -(_Maximum Transmission Unit_) and on the `Payload Length` field size. - -- The `Payload Length` field is `16 bits` wide, which means that a normal - payload exceed 64K octets _including_ the internet header and data - (65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header); - this is generally true for loopback interfaces, but such long datagram - messages are impractical for most hosts and networks. - -- The `MTU` is the largest size a given link layer technology can support for - datagram messages. For any link, `IPv4` mandates a minimum `MTU` of `68` - octets, while the recommended `MTU` for IPv4 is `576` (typically recommended - as the `MTU` for dial-up type applications), whether they arrive whole or in - fragments. - - For `IPv6`, the minimum `MTU` is `1280` octets, however, the mandatory minimum - fragment reassembly buffer size is `1500` octets. The value of `68` octets is - very small, since most current link layer technologies, like Ethernet, have a - minimum `MTU` of `1500`. - -It is impossible to know in advance the MTU of each link through which -a packet might travel. Sending a datagram greater than the receiver `MTU` will -not work because the packet will get silently dropped without informing the -source that the data did not reach its intended recipient. - -### socket.setBroadcast(flag) - -* `flag` {Boolean} - -Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP -packets may be sent to a local interface's broadcast address. - -### socket.setMulticastLoopback(flag) - -* `flag` {Boolean} - -Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, -multicast packets will also be received on the local interface. - -### socket.setMulticastTTL(ttl) - -* `ttl` {Number} Integer - -Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for -"Time to Live", in this context it specifies the number of IP hops that a -packet is allowed to travel through, specifically for multicast traffic. Each -router or gateway that forwards a packet decrements the TTL. If the TTL is -decremented to 0 by a router, it will not be forwarded. - -The argument passed to to `socket.setMulticastTTL()` is a number of hops -between 0 and 255. The default on most systems is `1` but can vary. - -### socket.setTTL(ttl) - -* `ttl` {Number} Integer - -Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", -in this context it specifies the number of IP hops that a packet is allowed to -travel through. Each router or gateway that forwards a packet decrements the -TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. -Changing TTL values is typically done for network probes or when multicasting. - -The argument to `socket.setTTL()` is a number of hops between 1 and 255. -The default on most systems is 64 but can vary. - -### socket.ref() - -By default, binding a socket will cause it to block the Node.js process from -exiting as long as the socket is open. The `socket.unref()` method can be used -to exclude the socket from the reference counting that keeps the Node.js -process active. The `socket.ref()` method adds the socket back to the reference -counting and restores the default behavior. - -Calling `socket.ref()` multiples times will have no additional effect. - -The `socket.ref()` method returns a reference to the socket so calls can be -chained. - -### socket.unref() - -By default, binding a socket will cause it to block the Node.js process from -exiting as long as the socket is open. The `socket.unref()` method can be used -to exclude the socket from the reference counting that keeps the Node.js -process active, allowing the process to exit even if the socket is still -listening. - -Calling `socket.unref()` multiple times will have no addition effect. - -The `socket.unref()` method returns a reference to the socket so calls can be -chained. - -### Change to asynchronous `socket.bind()` behavior - -As of Node.js v0.10, [`dgram.Socket#bind()`][] changed to an asynchronous -execution model. Legacy code that assumes synchronous behavior, as in the -following example: - -```js -const s = dgram.createSocket('udp4'); -s.bind(1234); -s.addMembership('224.0.0.114'); -``` - -Must be changed to pass a callback function to the [`dgram.Socket#bind()`][] -function: - -```js -const s = dgram.createSocket('udp4'); -s.bind(1234, () => { - s.addMembership('224.0.0.114'); -}); -``` - -## `dgram` module functions - -### dgram.createSocket(options[, callback]) - -* `options` {Object} -* `callback` {Function} Attached as a listener to `'message'` events. -* Returns: {dgram.Socket} - -Creates a `dgram.Socket` object. The `options` argument is an object that -should contain a `type` field of either `udp4` or `udp6` and an optional -boolean `reuseAddr` field. - -When `reuseAddr` is `true` [`socket.bind()`][] will reuse the address, even if -another process has already bound a socket on it. `reuseAddr` defaults to -`false`. An optional `callback` function can be passed specified which is added -as a listener for `'message'` events. - -Once the socket is created, calling [`socket.bind()`][] will instruct the -socket to begin listening for datagram messages. When `address` and `port` are -not passed to [`socket.bind()`][] the method will bind the socket to the "all -interfaces" address on a random port (it does the right thing for both `udp4` -and `udp6` sockets). The bound address and port can be retrieved using -[`socket.address().address`][] and [`socket.address().port`][]. - -### dgram.createSocket(type[, callback]) - -* `type` {String} - Either 'udp4' or 'udp6' -* `callback` {Function} - Attached as a listener to `'message'` events. - Optional -* Returns: {dgram.Socket} - -Creates a `dgram.Socket` object of the specified `type`. The `type` argument -can be either `udp4` or `udp6`. An optional `callback` function can be passed -which is added as a listener for `'message'` events. - -Once the socket is created, calling [`socket.bind()`][] will instruct the -socket to begin listening for datagram messages. When `address` and `port` are -not passed to [`socket.bind()`][] the method will bind the socket to the "all -interfaces" address on a random port (it does the right thing for both `udp4` -and `udp6` sockets). The bound address and port can be retrieved using -[`socket.address().address`][] and [`socket.address().port`][]. - -[`EventEmitter`]: events.html -[`Buffer`]: buffer.html -[`'close'`]: #dgram_event_close -[`addMembership()`]: #dgram_socket_addmembership_multicastaddress_multicastinterface -[`close()`]: #dgram_socket_close_callback -[`dgram.createSocket()`]: #dgram_dgram_createsocket_options_callback -[`dgram.Socket#bind()`]: #dgram_socket_bind_options_callback -[`Error`]: errors.html#errors_class_error -[`socket.address().address`]: #dgram_socket_address -[`socket.address().port`]: #dgram_socket_address -[`socket.bind()`]: #dgram_socket_bind_port_address_callback -[byte length]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding diff --git a/doc/api/dgram.md b/doc/api/dgram.md new file mode 100644 index 00000000000000..7a09c9385a82a6 --- /dev/null +++ b/doc/api/dgram.md @@ -0,0 +1,435 @@ +# UDP / Datagram Sockets + + Stability: 2 - Stable + + + +The `dgram` module provides an implementation of UDP Datagram sockets. + +```js +const dgram = require('dgram'); +const server = dgram.createSocket('udp4'); + +server.on('error', (err) => { + console.log(`server error:\n${err.stack}`); + server.close(); +}); + +server.on('message', (msg, rinfo) => { + console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); +}); + +server.on('listening', () => { + var address = server.address(); + console.log(`server listening ${address.address}:${address.port}`); +}); + +server.bind(41234); +// server listening 0.0.0.0:41234 +``` + +## Class: dgram.Socket + +The `dgram.Socket` object is an [`EventEmitter`][] that encapsulates the +datagram functionality. + +New instances of `dgram.Socket` are created using [`dgram.createSocket()`][]. +The `new` keyword is not to be used to create `dgram.Socket` instances. + +### Event: 'close' + +The `'close'` event is emitted after a socket is closed with [`close()`][]. +Once triggered, no new `'message'` events will be emitted on this socket. + +### Event: 'error' + +* `exception` {Error} + +The `'error'` event is emitted whenever any error occurs. The event handler +function is passed a single Error object. + +### Event: 'listening' + +The `'listening'` event is emitted whenever a socket begins listening for +datagram messages. This occurs as soon as UDP sockets are created. + +### Event: 'message' + +* `msg` {Buffer} - The message +* `rinfo` {Object} - Remote address information + +The `'message'` event is emitted when a new datagram is available on a socket. +The event handler function is passed two arguments: `msg` and `rinfo`. The +`msg` argument is a [`Buffer`][] and `rinfo` is an object with the sender's +address information provided by the `address`, `family` and `port` properties: + +```js +socket.on('message', (msg, rinfo) => { + console.log('Received %d bytes from %s:%d\n', + msg.length, rinfo.address, rinfo.port); +}); +``` + +### socket.addMembership(multicastAddress[, multicastInterface]) + + +* `multicastAddress` {String} +* `multicastInterface` {String}, Optional + +Tells the kernel to join a multicast group at the given `multicastAddress` +using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` +argument is not specified, the operating system will try to add membership to +all valid networking interfaces. + +### socket.address() + +Returns an object containing the address information for a socket. +For UDP sockets, this object will contain `address`, `family` and `port` +properties. + +### socket.bind([port][, address][, callback]) + +* `port` {Number} - Integer, Optional +* `address` {String}, Optional +* `callback` {Function} with no parameters, Optional. Called when + binding is complete. + +For UDP sockets, causes the `dgram.Socket` to listen for datagram messages on a +named `port` and optional `address`. If `port` is not specified, the operating +system will attempt to bind to a random port. If `address` is not specified, +the operating system will attempt to listen on all addresses. Once binding is +complete, a `'listening'` event is emitted and the optional `callback` function +is called. + +Note that specifying both a `'listening'` event listener and passing a +`callback` to the `socket.bind()` method is not harmful but not very +useful. + +A bound datagram socket keeps the Node.js process running to receive +datagram messages. + +If binding fails, an `'error'` event is generated. In rare case (e.g. +attempting to bind with a closed socket), an [`Error`][] may be thrown. + +Example of a UDP server listening on port 41234: + +```js +const dgram = require('dgram'); +const server = dgram.createSocket('udp4'); + +server.on('error', (err) => { + console.log(`server error:\n${err.stack}`); + server.close(); +}); + +server.on('message', (msg, rinfo) => { + console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); +}); + +server.on('listening', () => { + var address = server.address(); + console.log(`server listening ${address.address}:${address.port}`); +}); + +server.bind(41234); +// server listening 0.0.0.0:41234 +``` + +### socket.bind(options[, callback]) + +* `options` {Object} - Required. Supports the following properties: + * `port` {Number} - Required. + * `address` {String} - Optional. + * `exclusive` {Boolean} - Optional. +* `callback` {Function} - Optional. + +For UDP sockets, causes the `dgram.Socket` to listen for datagram messages on a +named `port` and optional `address` that are passed as properties of an +`options` object passed as the first argument. If `port` is not specified, the +operating system will attempt to bind to a random port. If `address` is not +specified, the operating system will attempt to listen on all addresses. Once +binding is complete, a `'listening'` event is emitted and the optional +`callback` function is called. + +The `options` object may contain an additional `exclusive` property that is +use when using `dgram.Socket` objects with the [`cluster`] module. When +`exclusive` is set to `false` (the default), cluster workers will use the same +underlying socket handle allowing connection handling duties to be shared. +When `exclusive` is `true`, however, the handle is not shared and attempted +port sharing results in an error. + +An example socket listening on an exclusive port is shown below. + +```js +socket.bind({ + address: 'localhost', + port: 8000, + exclusive: true +}); +``` + +### socket.close([callback]) + +Close the underlying socket and stop listening for data on it. If a callback is +provided, it is added as a listener for the [`'close'`][] event. + +### socket.dropMembership(multicastAddress[, multicastInterface]) + + +* `multicastAddress` {String} +* `multicastInterface` {String}, Optional + +Instructs the kernel to leave a multicast group at `multicastAddress` using the +`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the +kernel when the socket is closed or the process terminates, so most apps will +never have reason to call this. + +If `multicastInterface` is not specified, the operating system will attempt to +drop membership on all valid interfaces. + +### socket.send(msg, [offset, length,] port, address[, callback]) + +* `msg` {Buffer|String|Array} Message to be sent +* `offset` {Number} Integer. Optional. Offset in the buffer where the message starts. +* `length` {Number} Integer. Optional. Number of bytes in the message. +* `port` {Number} Integer. Destination port. +* `address` {String} Destination hostname or IP address. +* `callback` {Function} Called when the message has been sent. Optional. + +Broadcasts a datagram on the socket. The destination `port` and `address` must +be specified. + +The `msg` argument contains the message to be sent. +Depending on its type, different behavior can apply. If `msg` is a `Buffer`, +the `offset` and `length` specify the offset within the `Buffer` where the +message begins and the number of bytes in the message, respectively. +If `msg` is a `String`, then it is automatically converted to a `Buffer` +with `'utf8'` encoding. With messages that +contain multi-byte characters, `offset` and `length` will be calculated with +respect to [byte length][] and not the character position. +If `msg` is an array, `offset` and `length` must not be specified. + +The `address` argument is a string. If the value of `address` is a host name, +DNS will be used to resolve the address of the host. If the `address` is not +specified or is an empty string, `'127.0.0.1'` or `'::1'` will be used instead. + +If the socket has not been previously bound with a call to `bind`, the socket +is assigned a random port number and is bound to the "all interfaces" address +(`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + +An optional `callback` function may be specified to as a way of reporting +DNS errors or for determining when it is safe to reuse the `buf` object. +Note that DNS lookups delay the time to send for at least one tick of the +Node.js event loop. + +The only way to know for sure that the datagram has been sent is by using a +`callback`. If an error occurs and a `callback` is given, the error will be +passed as the first argument to the `callback`. If a `callback` is not given, +the error is emitted as an `'error'` event on the `socket` object. + +Offset and length are optional, but if you specify one you would need to +specify the other. Also, they are supported only when the first +argument is a `Buffer`. + +Example of sending a UDP packet to a random port on `localhost`; + +```js +const dgram = require('dgram'); +const message = Buffer.from('Some bytes'); +const client = dgram.createSocket('udp4'); +client.send(message, 41234, 'localhost', (err) => { + client.close(); +}); +``` + +Example of sending a UDP packet composed of multiple buffers to a random port on `localhost`; + +```js +const dgram = require('dgram'); +const buf1 = Buffer.from('Some '); +const buf2 = Buffer.from('bytes'); +const client = dgram.createSocket('udp4'); +client.send([buf1, buf2], 41234, 'localhost', (err) => { + client.close(); +}); +``` + +Sending multiple buffers might be faster or slower depending on your +application and operating system: benchmark it. Usually it is faster. + +**A Note about UDP datagram size** + +The maximum size of an `IPv4/v6` datagram depends on the `MTU` +(_Maximum Transmission Unit_) and on the `Payload Length` field size. + +- The `Payload Length` field is `16 bits` wide, which means that a normal + payload exceed 64K octets _including_ the internet header and data + (65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header); + this is generally true for loopback interfaces, but such long datagram + messages are impractical for most hosts and networks. + +- The `MTU` is the largest size a given link layer technology can support for + datagram messages. For any link, `IPv4` mandates a minimum `MTU` of `68` + octets, while the recommended `MTU` for IPv4 is `576` (typically recommended + as the `MTU` for dial-up type applications), whether they arrive whole or in + fragments. + + For `IPv6`, the minimum `MTU` is `1280` octets, however, the mandatory minimum + fragment reassembly buffer size is `1500` octets. The value of `68` octets is + very small, since most current link layer technologies, like Ethernet, have a + minimum `MTU` of `1500`. + +It is impossible to know in advance the MTU of each link through which +a packet might travel. Sending a datagram greater than the receiver `MTU` will +not work because the packet will get silently dropped without informing the +source that the data did not reach its intended recipient. + +### socket.setBroadcast(flag) + + +* `flag` {Boolean} + +Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP +packets may be sent to a local interface's broadcast address. + +### socket.setMulticastLoopback(flag) + +* `flag` {Boolean} + +Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, +multicast packets will also be received on the local interface. + +### socket.setMulticastTTL(ttl) + +* `ttl` {Number} Integer + +Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for +"Time to Live", in this context it specifies the number of IP hops that a +packet is allowed to travel through, specifically for multicast traffic. Each +router or gateway that forwards a packet decrements the TTL. If the TTL is +decremented to 0 by a router, it will not be forwarded. + +The argument passed to to `socket.setMulticastTTL()` is a number of hops +between 0 and 255. The default on most systems is `1` but can vary. + +### socket.setTTL(ttl) + +* `ttl` {Number} Integer + +Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", +in this context it specifies the number of IP hops that a packet is allowed to +travel through. Each router or gateway that forwards a packet decrements the +TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. +Changing TTL values is typically done for network probes or when multicasting. + +The argument to `socket.setTTL()` is a number of hops between 1 and 255. +The default on most systems is 64 but can vary. + +### socket.ref() + +By default, binding a socket will cause it to block the Node.js process from +exiting as long as the socket is open. The `socket.unref()` method can be used +to exclude the socket from the reference counting that keeps the Node.js +process active. The `socket.ref()` method adds the socket back to the reference +counting and restores the default behavior. + +Calling `socket.ref()` multiples times will have no additional effect. + +The `socket.ref()` method returns a reference to the socket so calls can be +chained. + +### socket.unref() + +By default, binding a socket will cause it to block the Node.js process from +exiting as long as the socket is open. The `socket.unref()` method can be used +to exclude the socket from the reference counting that keeps the Node.js +process active, allowing the process to exit even if the socket is still +listening. + +Calling `socket.unref()` multiple times will have no addition effect. + +The `socket.unref()` method returns a reference to the socket so calls can be +chained. + +### Change to asynchronous `socket.bind()` behavior + +As of Node.js v0.10, [`dgram.Socket#bind()`][] changed to an asynchronous +execution model. Legacy code that assumes synchronous behavior, as in the +following example: + +```js +const s = dgram.createSocket('udp4'); +s.bind(1234); +s.addMembership('224.0.0.114'); +``` + +Must be changed to pass a callback function to the [`dgram.Socket#bind()`][] +function: + +```js +const s = dgram.createSocket('udp4'); +s.bind(1234, () => { + s.addMembership('224.0.0.114'); +}); +``` + +## `dgram` module functions + +### dgram.createSocket(options[, callback]) + +* `options` {Object} +* `callback` {Function} Attached as a listener to `'message'` events. +* Returns: {dgram.Socket} + +Creates a `dgram.Socket` object. The `options` argument is an object that +should contain a `type` field of either `udp4` or `udp6` and an optional +boolean `reuseAddr` field. + +When `reuseAddr` is `true` [`socket.bind()`][] will reuse the address, even if +another process has already bound a socket on it. `reuseAddr` defaults to +`false`. An optional `callback` function can be passed specified which is added +as a listener for `'message'` events. + +Once the socket is created, calling [`socket.bind()`][] will instruct the +socket to begin listening for datagram messages. When `address` and `port` are +not passed to [`socket.bind()`][] the method will bind the socket to the "all +interfaces" address on a random port (it does the right thing for both `udp4` +and `udp6` sockets). The bound address and port can be retrieved using +[`socket.address().address`][] and [`socket.address().port`][]. + +### dgram.createSocket(type[, callback]) + +* `type` {String} - Either 'udp4' or 'udp6' +* `callback` {Function} - Attached as a listener to `'message'` events. + Optional +* Returns: {dgram.Socket} + +Creates a `dgram.Socket` object of the specified `type`. The `type` argument +can be either `udp4` or `udp6`. An optional `callback` function can be passed +which is added as a listener for `'message'` events. + +Once the socket is created, calling [`socket.bind()`][] will instruct the +socket to begin listening for datagram messages. When `address` and `port` are +not passed to [`socket.bind()`][] the method will bind the socket to the "all +interfaces" address on a random port (it does the right thing for both `udp4` +and `udp6` sockets). The bound address and port can be retrieved using +[`socket.address().address`][] and [`socket.address().port`][]. + +[`EventEmitter`]: events.html +[`Buffer`]: buffer.html +[`'close'`]: #dgram_event_close +[`addMembership()`]: #dgram_socket_addmembership_multicastaddress_multicastinterface +[`close()`]: #dgram_socket_close_callback +[`dgram.createSocket()`]: #dgram_dgram_createsocket_options_callback +[`dgram.Socket#bind()`]: #dgram_socket_bind_options_callback +[`Error`]: errors.html#errors_class_error +[`socket.address().address`]: #dgram_socket_address +[`socket.address().port`]: #dgram_socket_address +[`socket.bind()`]: #dgram_socket_bind_port_address_callback +[byte length]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding diff --git a/doc/api/dns.markdown b/doc/api/dns.markdown deleted file mode 100644 index 13dee0a6cb4375..00000000000000 --- a/doc/api/dns.markdown +++ /dev/null @@ -1,367 +0,0 @@ -# DNS - - Stability: 2 - Stable - -The `dns` module contains functions belonging to two different categories: - -1) Functions that use the underlying operating system facilities to perform -name resolution, and that do not necessarily perform any network communication. -This category contains only one function: [`dns.lookup()`][]. __Developers -looking to perform name resolution in the same way that other applications on -the same operating system behave should use [`dns.lookup()`][].__ - -For example, looking up `nodejs.org`. - -```js -const dns = require('dns'); - -dns.lookup('nodejs.org', (err, addresses, family) => { - console.log('addresses:', addresses); -}); -``` - -2) Functions that connect to an actual DNS server to perform name resolution, -and that _always_ use the network to perform DNS queries. This category -contains all functions in the `dns` module _except_ [`dns.lookup()`][]. These -functions do not use the same set of configuration files used by -[`dns.lookup()`][] (e.g. `/etc/hosts`). These functions should be used by -developers who do not want to use the underlying operating system's facilities -for name resolution, and instead want to _always_ perform DNS queries. - -Below is an example that resolves `'nodejs.org'` then reverse resolves the IP -addresses that are returned. - -```js -const dns = require('dns'); - -dns.resolve4('nodejs.org', (err, addresses) => { - if (err) throw err; - - console.log(`addresses: ${JSON.stringify(addresses)}`); - - addresses.forEach((a) => { - dns.reverse(a, (err, hostnames) => { - if (err) { - throw err; - } - console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - }); - }); -}); -``` - -There are subtle consequences in choosing one over the other, please consult -the [Implementation considerations section][] for more information. - -## dns.getServers() - -Returns an array of IP address strings that are being used for name -resolution. - -## dns.lookup(hostname[, options], callback) - -Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or -AAAA (IPv6) record. `options` can be an object or integer. If `options` is -not provided, then IPv4 and IPv6 addresses are both valid. If `options` is -an integer, then it must be `4` or `6`. - -Alternatively, `options` can be an object containing these properties: - -* `family` {Number} - The record family. If present, must be the integer - `4` or `6`. If not provided, both IP v4 and v6 addresses are accepted. -* `hints`: {Number} - If present, it should be one or more of the supported - `getaddrinfo` flags. If `hints` is not provided, then no flags are passed to - `getaddrinfo`. Multiple flags can be passed through `hints` by logically - `OR`ing their values. - See [supported `getaddrinfo` flags][] for more information on supported - flags. -* `all`: {Boolean} - When `true`, the callback returns all resolved addresses - in an array, otherwise returns a single address. Defaults to `false`. - -All properties are optional. An example usage of options is shown below. - -``` -{ - family: 4, - hints: dns.ADDRCONFIG | dns.V4MAPPED, - all: false -} -``` - -The `callback` function has arguments `(err, address, family)`. `address` is a -string representation of an IPv4 or IPv6 address. `family` is either the -integer `4` or `6` and denotes the family of `address` (not necessarily the -value initially passed to `lookup`). - -With the `all` option set to `true`, the arguments change to -`(err, addresses)`, with `addresses` being an array of objects with the -properties `address` and `family`. - -On error, `err` is an [`Error`][] object, where `err.code` is the error code. -Keep in mind that `err.code` will be set to `'ENOENT'` not only when -the hostname does not exist but also when the lookup fails in other ways -such as no available file descriptors. - -`dns.lookup()` does not necessarily have anything to do with the DNS protocol. -The implementation uses an operating system facility that can associate names -with addresses, and vice versa. This implementation can have subtle but -important consequences on the behavior of any Node.js program. Please take some -time to consult the [Implementation considerations section][] before using -`dns.lookup()`. - -### Supported getaddrinfo flags - -The following flags can be passed as hints to [`dns.lookup()`][]. - -- `dns.ADDRCONFIG`: Returned address types are determined by the types -of addresses supported by the current system. For example, IPv4 addresses -are only returned if the current system has at least one IPv4 address -configured. Loopback addresses are not considered. -- `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were -found, then return IPv4 mapped IPv6 addresses. Note that it is not supported -on some operating systems (e.g FreeBSD 10.1). - -## dns.lookupService(address, port, callback) - -Resolves the given `address` and `port` into a hostname and service using -the operating system's underlying `getnameinfo` implementation. - -If `address` is not a valid IP address, a `TypeError` will be thrown. -The `port` will be coerced to a number. If it is not a legal port, a `TypeError` -will be thrown. - -The callback has arguments `(err, hostname, service)`. The `hostname` and -`service` arguments are strings (e.g. `'localhost'` and `'http'` respectively). - -On error, `err` is an [`Error`][] object, where `err.code` is the error code. - -```js -const dns = require('dns'); -dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - console.log(hostname, service); - // Prints: localhost ssh -}); -``` - -## dns.resolve(hostname[, rrtype], callback) - -Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an -array of the record types specified by `rrtype`. - -Valid values for `rrtype` are: - - * `'A'` - IPV4 addresses, default - * `'AAAA'` - IPV6 addresses - * `'MX'` - mail exchange records - * `'TXT'` - text records - * `'SRV'` - SRV records - * `'PTR'` - PTR records - * `'NS'` - name server records - * `'CNAME'` - canonical name records - * `'SOA'` - start of authority record - -The `callback` function has arguments `(err, addresses)`. When successful, -`addresses` will be an array. The type of each item in `addresses` is -determined by the record type, and described in the documentation for the -corresponding lookup methods. - -On error, `err` is an [`Error`][] object, where `err.code` is -one of the error codes listed [here](#dns_error_codes). - -## dns.resolve4(hostname, callback) - -Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the -`hostname`. The `addresses` argument passed to the `callback` function -will contain an array of IPv4 addresses (e.g. -`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - -## dns.resolve6(hostname, callback) - -Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the -`hostname`. The `addresses` argument passed to the `callback` function -will contain an array of IPv6 addresses. - -## dns.resolveCname(hostname, callback) - -Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The -`addresses` argument passed to the `callback` function -will contain an array of canonical name records available for the `hostname` -(e.g. `['bar.example.com']`). - -## dns.resolveMx(hostname, callback) - -Uses the DNS protocol to resolve mail exchange records (`MX` records) for the -`hostname`. The `addresses` argument passed to the `callback` function will -contain an array of objects containing both a `priority` and `exchange` -property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - -## dns.resolveNs(hostname, callback) - -Uses the DNS protocol to resolve name server records (`NS` records) for the -`hostname`. The `addresses` argument passed to the `callback` function will -contain an array of name server records available for `hostname` -(e.g., `['ns1.example.com', 'ns2.example.com']`). - -## dns.resolveSoa(hostname, callback) - -Uses the DNS protocol to resolve a start of authority record (`SOA` record) for -the `hostname`. The `addresses` argument passed to the `callback` function will -be an object with the following properties: - -* `nsname` -* `hostmaster` -* `serial` -* `refresh` -* `retry` -* `expire` -* `minttl` - -``` -{ - nsname: 'ns.example.com', - hostmaster: 'root.example.com', - serial: 2013101809, - refresh: 10000, - retry: 2400, - expire: 604800, - minttl: 3600 -} -``` - -## dns.resolveSrv(hostname, callback) - -Uses the DNS protocol to resolve service records (`SRV` records) for the -`hostname`. The `addresses` argument passed to the `callback` function will -be an array of objects with the following properties: - -* `priority` -* `weight` -* `port` -* `name` - -``` -{ - priority: 10, - weight: 5, - port: 21223, - name: 'service.example.com' -} -``` - -## dns.resolvePtr(hostname, callback) - -Uses the DNS protocol to resolve pointer records (`PTR` records) for the -`hostname`. The `addresses` argument passed to the `callback` function will -be an array of strings containing the reply records. - -## dns.resolveTxt(hostname, callback) - -Uses the DNS protocol to resolve text queries (`TXT` records) for the -`hostname`. The `addresses` argument passed to the `callback` function is -is a two-dimentional array of the text records available for `hostname` (e.g., -`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of -one record. Depending on the use case, these could be either joined together or -treated separately. - -## dns.reverse(ip, callback) - -Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an -array of hostnames. - -The `callback` function has arguments `(err, hostnames)`, where `hostnames` -is an array of resolved hostnames for the given `ip`. - -On error, `err` is an [`Error`][] object, where `err.code` is -one of the [DNS error codes][]. - -## dns.setServers(servers) - -Sets the IP addresses of the servers to be used when resolving. The `servers` -argument is an array of IPv4 or IPv6 addresses. - -If a port specified on the address it will be removed. - -An error will be thrown if an invalid address is provided. - -The `dns.setServers()` method must not be called while a DNS query is in -progress. - -## Error codes - -Each DNS query can return one of the following error codes: - -- `dns.NODATA`: DNS server returned answer with no data. -- `dns.FORMERR`: DNS server claims query was misformatted. -- `dns.SERVFAIL`: DNS server returned general failure. -- `dns.NOTFOUND`: Domain name not found. -- `dns.NOTIMP`: DNS server does not implement requested operation. -- `dns.REFUSED`: DNS server refused query. -- `dns.BADQUERY`: Misformatted DNS query. -- `dns.BADNAME`: Misformatted hostname. -- `dns.BADFAMILY`: Unsupported address family. -- `dns.BADRESP`: Misformatted DNS reply. -- `dns.CONNREFUSED`: Could not contact DNS servers. -- `dns.TIMEOUT`: Timeout while contacting DNS servers. -- `dns.EOF`: End of file. -- `dns.FILE`: Error reading file. -- `dns.NOMEM`: Out of memory. -- `dns.DESTRUCTION`: Channel is being destroyed. -- `dns.BADSTR`: Misformatted string. -- `dns.BADFLAGS`: Illegal flags specified. -- `dns.NONAME`: Given hostname is not numeric. -- `dns.BADHINTS`: Illegal hints flags specified. -- `dns.NOTINITIALIZED`: c-ares library initialization not yet performed. -- `dns.LOADIPHLPAPI`: Error loading iphlpapi.dll. -- `dns.ADDRGETNETWORKPARAMS`: Could not find GetNetworkParams function. -- `dns.CANCELLED`: DNS query cancelled. - -## Implementation considerations - -Although [`dns.lookup()`][] and the various `dns.resolve*()/dns.reverse()` -functions have the same goal of associating a network name with a network -address (or vice versa), their behavior is quite different. These differences -can have subtle but significant consequences on the behavior of Node.js -programs. - -### `dns.lookup()` - -Under the hood, [`dns.lookup()`][] uses the same operating system facilities -as most other programs. For instance, [`dns.lookup()`][] will almost always -resolve a given name the same way as the `ping` command. On most POSIX-like -operating systems, the behavior of the [`dns.lookup()`][] function can be -modified by changing settings in `nsswitch.conf(5)` and/or `resolv.conf(5)`, -but note that changing these files will change the behavior of _all other -programs running on the same operating system_. - -Though the call to `dns.lookup()` will be asynchronous from JavaScript's -perspective, it is implemented as a synchronous call to `getaddrinfo(3)` that -runs on libuv's threadpool. Because libuv's threadpool has a fixed size, it -means that if for whatever reason the call to `getaddrinfo(3)` takes a long -time, other operations that could run on libuv's threadpool (such as filesystem -operations) will experience degraded performance. In order to mitigate this -issue, one potential solution is to increase the size of libuv's threadpool by -setting the `'UV_THREADPOOL_SIZE'` environment variable to a value greater than -`4` (its current default value). For more information on libuv's threadpool, see -[the official libuv documentation][]. - -### `dns.resolve()`, `dns.resolve*()` and `dns.reverse()` - -These functions are implemented quite differently than [`dns.lookup()`][]. They -do not use `getaddrinfo(3)` and they _always_ perform a DNS query on the -network. This network communication is always done asynchronously, and does not -use libuv's threadpool. - -As a result, these functions cannot have the same negative impact on other -processing that happens on libuv's threadpool that [`dns.lookup()`][] can have. - -They do not use the same set of configuration files than what [`dns.lookup()`][] -uses. For instance, _they do not use the configuration from `/etc/hosts`_. - -[DNS error codes]: #dns_error_codes -[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback -[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback -[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback -[`Error`]: errors.html#errors_class_error -[Implementation considerations section]: #dns_implementation_considerations -[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags -[the official libuv documentation]: http://docs.libuv.org/en/latest/threadpool.html diff --git a/doc/api/dns.md b/doc/api/dns.md new file mode 100644 index 00000000000000..443bbfda122d68 --- /dev/null +++ b/doc/api/dns.md @@ -0,0 +1,395 @@ +# DNS + + Stability: 2 - Stable + +The `dns` module contains functions belonging to two different categories: + +1) Functions that use the underlying operating system facilities to perform +name resolution, and that do not necessarily perform any network communication. +This category contains only one function: [`dns.lookup()`][]. __Developers +looking to perform name resolution in the same way that other applications on +the same operating system behave should use [`dns.lookup()`][].__ + +For example, looking up `nodejs.org`. + +```js +const dns = require('dns'); + +dns.lookup('nodejs.org', (err, addresses, family) => { + console.log('addresses:', addresses); +}); +``` + +2) Functions that connect to an actual DNS server to perform name resolution, +and that _always_ use the network to perform DNS queries. This category +contains all functions in the `dns` module _except_ [`dns.lookup()`][]. These +functions do not use the same set of configuration files used by +[`dns.lookup()`][] (e.g. `/etc/hosts`). These functions should be used by +developers who do not want to use the underlying operating system's facilities +for name resolution, and instead want to _always_ perform DNS queries. + +Below is an example that resolves `'nodejs.org'` then reverse resolves the IP +addresses that are returned. + +```js +const dns = require('dns'); + +dns.resolve4('nodejs.org', (err, addresses) => { + if (err) throw err; + + console.log(`addresses: ${JSON.stringify(addresses)}`); + + addresses.forEach((a) => { + dns.reverse(a, (err, hostnames) => { + if (err) { + throw err; + } + console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + }); + }); +}); +``` + +There are subtle consequences in choosing one over the other, please consult +the [Implementation considerations section][] for more information. + +## dns.getServers() + +Returns an array of IP address strings that are being used for name +resolution. + +## dns.lookup(hostname[, options], callback) + +Resolves a hostname (e.g. `'nodejs.org'`) into the first found A (IPv4) or +AAAA (IPv6) record. `options` can be an object or integer. If `options` is +not provided, then IPv4 and IPv6 addresses are both valid. If `options` is +an integer, then it must be `4` or `6`. + +Alternatively, `options` can be an object containing these properties: + +* `family` {Number} - The record family. If present, must be the integer + `4` or `6`. If not provided, both IP v4 and v6 addresses are accepted. +* `hints`: {Number} - If present, it should be one or more of the supported + `getaddrinfo` flags. If `hints` is not provided, then no flags are passed to + `getaddrinfo`. Multiple flags can be passed through `hints` by logically + `OR`ing their values. + See [supported `getaddrinfo` flags][] for more information on supported + flags. +* `all`: {Boolean} - When `true`, the callback returns all resolved addresses + in an array, otherwise returns a single address. Defaults to `false`. + +All properties are optional. An example usage of options is shown below. + +``` +{ + family: 4, + hints: dns.ADDRCONFIG | dns.V4MAPPED, + all: false +} +``` + +The `callback` function has arguments `(err, address, family)`. `address` is a +string representation of an IPv4 or IPv6 address. `family` is either the +integer `4` or `6` and denotes the family of `address` (not necessarily the +value initially passed to `lookup`). + +With the `all` option set to `true`, the arguments change to +`(err, addresses)`, with `addresses` being an array of objects with the +properties `address` and `family`. + +On error, `err` is an [`Error`][] object, where `err.code` is the error code. +Keep in mind that `err.code` will be set to `'ENOENT'` not only when +the hostname does not exist but also when the lookup fails in other ways +such as no available file descriptors. + +`dns.lookup()` does not necessarily have anything to do with the DNS protocol. +The implementation uses an operating system facility that can associate names +with addresses, and vice versa. This implementation can have subtle but +important consequences on the behavior of any Node.js program. Please take some +time to consult the [Implementation considerations section][] before using +`dns.lookup()`. + +### Supported getaddrinfo flags + +The following flags can be passed as hints to [`dns.lookup()`][]. + +- `dns.ADDRCONFIG`: Returned address types are determined by the types +of addresses supported by the current system. For example, IPv4 addresses +are only returned if the current system has at least one IPv4 address +configured. Loopback addresses are not considered. +- `dns.V4MAPPED`: If the IPv6 family was specified, but no IPv6 addresses were +found, then return IPv4 mapped IPv6 addresses. Note that it is not supported +on some operating systems (e.g FreeBSD 10.1). + +## dns.lookupService(address, port, callback) + +Resolves the given `address` and `port` into a hostname and service using +the operating system's underlying `getnameinfo` implementation. + +If `address` is not a valid IP address, a `TypeError` will be thrown. +The `port` will be coerced to a number. If it is not a legal port, a `TypeError` +will be thrown. + +The callback has arguments `(err, hostname, service)`. The `hostname` and +`service` arguments are strings (e.g. `'localhost'` and `'http'` respectively). + +On error, `err` is an [`Error`][] object, where `err.code` is the error code. + +```js +const dns = require('dns'); +dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + console.log(hostname, service); + // Prints: localhost ssh +}); +``` + +## dns.resolve(hostname[, rrtype], callback) + +Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an +array of the record types specified by `rrtype`. + +Valid values for `rrtype` are: + + * `'A'` - IPV4 addresses, default + * `'AAAA'` - IPV6 addresses + * `'MX'` - mail exchange records + * `'TXT'` - text records + * `'SRV'` - SRV records + * `'PTR'` - PTR records + * `'NS'` - name server records + * `'CNAME'` - canonical name records + * `'SOA'` - start of authority record + * `'NAPTR'` - name authority pointer record + +The `callback` function has arguments `(err, addresses)`. When successful, +`addresses` will be an array. The type of each item in `addresses` is +determined by the record type, and described in the documentation for the +corresponding lookup methods. + +On error, `err` is an [`Error`][] object, where `err.code` is +one of the error codes listed [here](#dns_error_codes). + +## dns.resolve4(hostname, callback) + +Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the +`hostname`. The `addresses` argument passed to the `callback` function +will contain an array of IPv4 addresses (e.g. +`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + +## dns.resolve6(hostname, callback) + +Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the +`hostname`. The `addresses` argument passed to the `callback` function +will contain an array of IPv6 addresses. + +## dns.resolveCname(hostname, callback) + +Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The +`addresses` argument passed to the `callback` function +will contain an array of canonical name records available for the `hostname` +(e.g. `['bar.example.com']`). + +## dns.resolveMx(hostname, callback) + +Uses the DNS protocol to resolve mail exchange records (`MX` records) for the +`hostname`. The `addresses` argument passed to the `callback` function will +contain an array of objects containing both a `priority` and `exchange` +property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + +## dns.resolveNaptr(hostname, callback) + +Uses the DNS protocol to resolve regular expression based records (`NAPTR` +records) for the `hostname`. The `callback` function has arguments +`(err, addresses)`. The `addresses` argument passed to the `callback` function +will contain an array of objects with the following properties: + +* `flags` +* `service` +* `regexp` +* `replacement` +* `order` +* `preference` + +For example: + +```js +{ + flags: 's', + service: 'SIP+D2U', + regexp: '', + replacement: '_sip._udp.example.com', + order: 30, + preference: 100 +} +``` + +## dns.resolveNs(hostname, callback) + +Uses the DNS protocol to resolve name server records (`NS` records) for the +`hostname`. The `addresses` argument passed to the `callback` function will +contain an array of name server records available for `hostname` +(e.g., `['ns1.example.com', 'ns2.example.com']`). + +## dns.resolveSoa(hostname, callback) + +Uses the DNS protocol to resolve a start of authority record (`SOA` record) for +the `hostname`. The `addresses` argument passed to the `callback` function will +be an object with the following properties: + +* `nsname` +* `hostmaster` +* `serial` +* `refresh` +* `retry` +* `expire` +* `minttl` + +``` +{ + nsname: 'ns.example.com', + hostmaster: 'root.example.com', + serial: 2013101809, + refresh: 10000, + retry: 2400, + expire: 604800, + minttl: 3600 +} +``` + +## dns.resolveSrv(hostname, callback) + +Uses the DNS protocol to resolve service records (`SRV` records) for the +`hostname`. The `addresses` argument passed to the `callback` function will +be an array of objects with the following properties: + +* `priority` +* `weight` +* `port` +* `name` + +``` +{ + priority: 10, + weight: 5, + port: 21223, + name: 'service.example.com' +} +``` + +## dns.resolvePtr(hostname, callback) + +Uses the DNS protocol to resolve pointer records (`PTR` records) for the +`hostname`. The `addresses` argument passed to the `callback` function will +be an array of strings containing the reply records. + +## dns.resolveTxt(hostname, callback) + +Uses the DNS protocol to resolve text queries (`TXT` records) for the +`hostname`. The `addresses` argument passed to the `callback` function is +is a two-dimentional array of the text records available for `hostname` (e.g., +`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of +one record. Depending on the use case, these could be either joined together or +treated separately. + +## dns.reverse(ip, callback) + +Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an +array of hostnames. + +The `callback` function has arguments `(err, hostnames)`, where `hostnames` +is an array of resolved hostnames for the given `ip`. + +On error, `err` is an [`Error`][] object, where `err.code` is +one of the [DNS error codes][]. + +## dns.setServers(servers) + +Sets the IP addresses of the servers to be used when resolving. The `servers` +argument is an array of IPv4 or IPv6 addresses. + +If a port specified on the address it will be removed. + +An error will be thrown if an invalid address is provided. + +The `dns.setServers()` method must not be called while a DNS query is in +progress. + +## Error codes + +Each DNS query can return one of the following error codes: + +- `dns.NODATA`: DNS server returned answer with no data. +- `dns.FORMERR`: DNS server claims query was misformatted. +- `dns.SERVFAIL`: DNS server returned general failure. +- `dns.NOTFOUND`: Domain name not found. +- `dns.NOTIMP`: DNS server does not implement requested operation. +- `dns.REFUSED`: DNS server refused query. +- `dns.BADQUERY`: Misformatted DNS query. +- `dns.BADNAME`: Misformatted hostname. +- `dns.BADFAMILY`: Unsupported address family. +- `dns.BADRESP`: Misformatted DNS reply. +- `dns.CONNREFUSED`: Could not contact DNS servers. +- `dns.TIMEOUT`: Timeout while contacting DNS servers. +- `dns.EOF`: End of file. +- `dns.FILE`: Error reading file. +- `dns.NOMEM`: Out of memory. +- `dns.DESTRUCTION`: Channel is being destroyed. +- `dns.BADSTR`: Misformatted string. +- `dns.BADFLAGS`: Illegal flags specified. +- `dns.NONAME`: Given hostname is not numeric. +- `dns.BADHINTS`: Illegal hints flags specified. +- `dns.NOTINITIALIZED`: c-ares library initialization not yet performed. +- `dns.LOADIPHLPAPI`: Error loading iphlpapi.dll. +- `dns.ADDRGETNETWORKPARAMS`: Could not find GetNetworkParams function. +- `dns.CANCELLED`: DNS query cancelled. + +## Implementation considerations + +Although [`dns.lookup()`][] and the various `dns.resolve*()/dns.reverse()` +functions have the same goal of associating a network name with a network +address (or vice versa), their behavior is quite different. These differences +can have subtle but significant consequences on the behavior of Node.js +programs. + +### `dns.lookup()` + +Under the hood, [`dns.lookup()`][] uses the same operating system facilities +as most other programs. For instance, [`dns.lookup()`][] will almost always +resolve a given name the same way as the `ping` command. On most POSIX-like +operating systems, the behavior of the [`dns.lookup()`][] function can be +modified by changing settings in `nsswitch.conf(5)` and/or `resolv.conf(5)`, +but note that changing these files will change the behavior of _all other +programs running on the same operating system_. + +Though the call to `dns.lookup()` will be asynchronous from JavaScript's +perspective, it is implemented as a synchronous call to `getaddrinfo(3)` that +runs on libuv's threadpool. Because libuv's threadpool has a fixed size, it +means that if for whatever reason the call to `getaddrinfo(3)` takes a long +time, other operations that could run on libuv's threadpool (such as filesystem +operations) will experience degraded performance. In order to mitigate this +issue, one potential solution is to increase the size of libuv's threadpool by +setting the `'UV_THREADPOOL_SIZE'` environment variable to a value greater than +`4` (its current default value). For more information on libuv's threadpool, see +[the official libuv documentation][]. + +### `dns.resolve()`, `dns.resolve*()` and `dns.reverse()` + +These functions are implemented quite differently than [`dns.lookup()`][]. They +do not use `getaddrinfo(3)` and they _always_ perform a DNS query on the +network. This network communication is always done asynchronously, and does not +use libuv's threadpool. + +As a result, these functions cannot have the same negative impact on other +processing that happens on libuv's threadpool that [`dns.lookup()`][] can have. + +They do not use the same set of configuration files than what [`dns.lookup()`][] +uses. For instance, _they do not use the configuration from `/etc/hosts`_. + +[DNS error codes]: #dns_error_codes +[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback +[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback +[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback +[`Error`]: errors.html#errors_class_error +[Implementation considerations section]: #dns_implementation_considerations +[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags +[the official libuv documentation]: http://docs.libuv.org/en/latest/threadpool.html diff --git a/doc/api/documentation.markdown b/doc/api/documentation.markdown deleted file mode 100644 index 4d357e39efab37..00000000000000 --- a/doc/api/documentation.markdown +++ /dev/null @@ -1,91 +0,0 @@ -# About this Documentation - - - -The goal of this documentation is to comprehensively explain the Node.js -API, both from a reference as well as a conceptual point of view. Each -section describes a built-in module or high-level concept. - -Where appropriate, property types, method arguments, and the arguments -provided to event handlers are detailed in a list underneath the topic -heading. - -Every `.html` document has a corresponding `.json` document presenting -the same information in a structured manner. This feature is -experimental, and added for the benefit of IDEs and other utilities that -wish to do programmatic things with the documentation. - -Every `.html` and `.json` file is generated based on the corresponding -`.markdown` file in the `doc/api/` folder in Node.js's source tree. The -documentation is generated using the `tools/doc/generate.js` program. -The HTML template is located at `doc/template.html`. - - -If you find a error in this documentation, please [submit an issue][] -or see [the contributing guide][] for directions on how to submit a patch. - -## Stability Index - - - -Throughout the documentation, you will see indications of a section's -stability. The Node.js API is still somewhat changing, and as it -matures, certain parts are more reliable than others. Some are so -proven, and so relied upon, that they are unlikely to ever change at -all. Others are brand new and experimental, or known to be hazardous -and in the process of being redesigned. - -The stability indices are as follows: - -``` -Stability: 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. -``` - -``` -Stability: 1 - Experimental -This feature is subject to change, and is gated by a command line flag. -It may change or be removed in future versions. -``` - -``` -Stability: 2 - Stable -The API has proven satisfactory. Compatibility with the npm ecosystem -is a high priority, and will not be broken unless absolutely necessary. -``` - -``` -Stability: 3 - Locked -Only fixes related to security, performance, or bug fixes will be accepted. -Please do not suggest API changes in this area; they will be refused. -``` - -## JSON Output - - Stability: 1 - Experimental - -Every HTML file in the markdown has a corresponding JSON file with the -same data. - -This feature was added in Node.js v0.6.12. It is experimental. - -## Syscalls and man pages - -System calls like open(2) and read(2) define the interface between user programs -and the underlying operating system. Node functions which simply wrap a syscall, -like `fs.open()`, will document that. The docs link to the corresponding man -pages (short for manual pages) which describe how the syscalls work. - -**Caveat:** some syscalls, like lchown(2), are BSD-specific. That means, for -example, that `fs.lchown()` only works on Mac OS X and other BSD-derived systems, -and is not available on Linux. - -Most Unix syscalls have Windows equivalents, but behavior may differ on Windows -relative to Linux and OS X. For an example of the subtle ways in which it's -sometimes impossible to replace Unix syscall semantics on Windows, see [Node -issue 4760](https://github.com/nodejs/node/issues/4760). - -[submit an issue]: https://github.com/nodejs/node/issues/new -[the contributing guide]: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md diff --git a/doc/api/documentation.md b/doc/api/documentation.md new file mode 100644 index 00000000000000..61d623fe3e054a --- /dev/null +++ b/doc/api/documentation.md @@ -0,0 +1,91 @@ +# About this Documentation + + + +The goal of this documentation is to comprehensively explain the Node.js +API, both from a reference as well as a conceptual point of view. Each +section describes a built-in module or high-level concept. + +Where appropriate, property types, method arguments, and the arguments +provided to event handlers are detailed in a list underneath the topic +heading. + +Every `.html` document has a corresponding `.json` document presenting +the same information in a structured manner. This feature is +experimental, and added for the benefit of IDEs and other utilities that +wish to do programmatic things with the documentation. + +Every `.html` and `.json` file is generated based on the corresponding +`.md` file in the `doc/api/` folder in Node.js's source tree. The +documentation is generated using the `tools/doc/generate.js` program. +The HTML template is located at `doc/template.html`. + + +If you find an error in this documentation, please [submit an issue][] +or see [the contributing guide][] for directions on how to submit a patch. + +## Stability Index + + + +Throughout the documentation, you will see indications of a section's +stability. The Node.js API is still somewhat changing, and as it +matures, certain parts are more reliable than others. Some are so +proven, and so relied upon, that they are unlikely to ever change at +all. Others are brand new and experimental, or known to be hazardous +and in the process of being redesigned. + +The stability indices are as follows: + +``` +Stability: 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. +``` + +``` +Stability: 1 - Experimental +This feature is subject to change, and is gated by a command line flag. +It may change or be removed in future versions. +``` + +``` +Stability: 2 - Stable +The API has proven satisfactory. Compatibility with the npm ecosystem +is a high priority, and will not be broken unless absolutely necessary. +``` + +``` +Stability: 3 - Locked +Only fixes related to security, performance, or bug fixes will be accepted. +Please do not suggest API changes in this area; they will be refused. +``` + +## JSON Output + + Stability: 1 - Experimental + +Every HTML file in the markdown has a corresponding JSON file with the +same data. + +This feature was added in Node.js v0.6.12. It is experimental. + +## Syscalls and man pages + +System calls like open(2) and read(2) define the interface between user programs +and the underlying operating system. Node functions which simply wrap a syscall, +like `fs.open()`, will document that. The docs link to the corresponding man +pages (short for manual pages) which describe how the syscalls work. + +**Caveat:** some syscalls, like lchown(2), are BSD-specific. That means, for +example, that `fs.lchown()` only works on Mac OS X and other BSD-derived systems, +and is not available on Linux. + +Most Unix syscalls have Windows equivalents, but behavior may differ on Windows +relative to Linux and OS X. For an example of the subtle ways in which it's +sometimes impossible to replace Unix syscall semantics on Windows, see [Node +issue 4760](https://github.com/nodejs/node/issues/4760). + +[submit an issue]: https://github.com/nodejs/node/issues/new +[the contributing guide]: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md diff --git a/doc/api/domain.markdown b/doc/api/domain.markdown deleted file mode 100644 index 41d27c5625f896..00000000000000 --- a/doc/api/domain.markdown +++ /dev/null @@ -1,454 +0,0 @@ -# Domain - - Stability: 0 - Deprecated - -**This module is pending deprecation**. Once a replacement API has been -finalized, this module will be fully deprecated. Most end users should -**not** have cause to use this module. Users who absolutely must have -the functionality that domains provide may rely on it for the time being -but should expect to have to migrate to a different solution -in the future. - -Domains provide a way to handle multiple different IO operations as a -single group. If any of the event emitters or callbacks registered to a -domain emit an `'error'` event, or throw an error, then the domain object -will be notified, rather than losing the context of the error in the -`process.on('uncaughtException')` handler, or causing the program to -exit immediately with an error code. - -## Warning: Don't Ignore Errors! - - - -Domain error handlers are not a substitute for closing down your -process when an error occurs. - -By the very nature of how [`throw`][] works in JavaScript, there is almost -never any way to safely "pick up where you left off", without leaking -references, or creating some other sort of undefined brittle state. - -The safest way to respond to a thrown error is to shut down the -process. Of course, in a normal web server, you might have many -connections open, and it is not reasonable to abruptly shut those down -because an error was triggered by someone else. - -The better approach is to send an error response to the request that -triggered the error, while letting the others finish in their normal -time, and stop listening for new requests in that worker. - -In this way, `domain` usage goes hand-in-hand with the cluster module, -since the master process can fork a new worker when a worker -encounters an error. For Node.js programs that scale to multiple -machines, the terminating proxy or service registry can take note of -the failure, and react accordingly. - -For example, this is not a good idea: - -```js -// XXX WARNING! BAD IDEA! - -var d = require('domain').create(); -d.on('error', (er) => { - // The error won't crash the process, but what it does is worse! - // Though we've prevented abrupt process restarting, we are leaking - // resources like crazy if this ever happens. - // This is no better than process.on('uncaughtException')! - console.log('error, but oh well', er.message); -}); -d.run(() => { - require('http').createServer((req, res) => { - handleRequest(req, res); - }).listen(PORT); -}); -``` - -By using the context of a domain, and the resilience of separating our -program into multiple worker processes, we can react more -appropriately, and handle errors with much greater safety. - -```js -// Much better! - -const cluster = require('cluster'); -const PORT = +process.env.PORT || 1337; - -if (cluster.isMaster) { - // In real life, you'd probably use more than just 2 workers, - // and perhaps not put the master and worker in the same file. - // - // You can also of course get a bit fancier about logging, and - // implement whatever custom logic you need to prevent DoS - // attacks and other bad behavior. - // - // See the options in the cluster documentation. - // - // The important thing is that the master does very little, - // increasing our resilience to unexpected errors. - - cluster.fork(); - cluster.fork(); - - cluster.on('disconnect', (worker) => { - console.error('disconnect!'); - cluster.fork(); - }); - -} else { - // the worker - // - // This is where we put our bugs! - - const domain = require('domain'); - - // See the cluster documentation for more details about using - // worker processes to serve requests. How it works, caveats, etc. - - const server = require('http').createServer((req, res) => { - var d = domain.create(); - d.on('error', (er) => { - console.error('error', er.stack); - - // Note: we're in dangerous territory! - // By definition, something unexpected occurred, - // which we probably didn't want. - // Anything can happen now! Be very careful! - - try { - // make sure we close down within 30 seconds - var killtimer = setTimeout(() => { - process.exit(1); - }, 30000); - // But don't keep the process open just for that! - killtimer.unref(); - - // stop taking new requests. - server.close(); - - // Let the master know we're dead. This will trigger a - // 'disconnect' in the cluster master, and then it will fork - // a new worker. - cluster.worker.disconnect(); - - // try to send an error to the request that triggered the problem - res.statusCode = 500; - res.setHeader('content-type', 'text/plain'); - res.end('Oops, there was a problem!\n'); - } catch (er2) { - // oh well, not much we can do at this point. - console.error('Error sending 500!', er2.stack); - } - }); - - // Because req and res were created before this domain existed, - // we need to explicitly add them. - // See the explanation of implicit vs explicit binding below. - d.add(req); - d.add(res); - - // Now run the handler function in the domain. - d.run(() => { - handleRequest(req, res); - }); - }); - server.listen(PORT); -} - -// This part isn't important. Just an example routing thing. -// You'd put your fancy application logic here. -function handleRequest(req, res) { - switch(req.url) { - case '/error': - // We do some async stuff, and then... - setTimeout(() => { - // Whoops! - flerb.bark(); - }); - break; - default: - res.end('ok'); - } -} -``` - -## Additions to Error objects - - - -Any time an `Error` object is routed through a domain, a few extra fields -are added to it. - -* `error.domain` The domain that first handled the error. -* `error.domainEmitter` The event emitter that emitted an `'error'` event - with the error object. -* `error.domainBound` The callback function which was bound to the - domain, and passed an error as its first argument. -* `error.domainThrown` A boolean indicating whether the error was - thrown, emitted, or passed to a bound callback function. - -## Implicit Binding - - - -If domains are in use, then all **new** EventEmitter objects (including -Stream objects, requests, responses, etc.) will be implicitly bound to -the active domain at the time of their creation. - -Additionally, callbacks passed to lowlevel event loop requests (such as -to fs.open, or other callback-taking methods) will automatically be -bound to the active domain. If they throw, then the domain will catch -the error. - -In order to prevent excessive memory usage, Domain objects themselves -are not implicitly added as children of the active domain. If they -were, then it would be too easy to prevent request and response objects -from being properly garbage collected. - -If you *want* to nest Domain objects as children of a parent Domain, -then you must explicitly add them. - -Implicit binding routes thrown errors and `'error'` events to the -Domain's `'error'` event, but does not register the EventEmitter on the -Domain, so [`domain.dispose()`][] will not shut down the EventEmitter. -Implicit binding only takes care of thrown errors and `'error'` events. - -## Explicit Binding - - - -Sometimes, the domain in use is not the one that ought to be used for a -specific event emitter. Or, the event emitter could have been created -in the context of one domain, but ought to instead be bound to some -other domain. - -For example, there could be one domain in use for an HTTP server, but -perhaps we would like to have a separate domain to use for each request. - -That is possible via explicit binding. - -For example: - -```js -// create a top-level domain for the server -const domain = require('domain'); -const http = require('http'); -const serverDomain = domain.create(); - -serverDomain.run(() => { - // server is created in the scope of serverDomain - http.createServer((req, res) => { - // req and res are also created in the scope of serverDomain - // however, we'd prefer to have a separate domain for each request. - // create it first thing, and add req and res to it. - var reqd = domain.create(); - reqd.add(req); - reqd.add(res); - reqd.on('error', (er) => { - console.error('Error', er, req.url); - try { - res.writeHead(500); - res.end('Error occurred, sorry.'); - } catch (er) { - console.error('Error sending 500', er, req.url); - } - }); - }).listen(1337); -}); -``` - -## domain.create() - -* return: {Domain} - -Returns a new Domain object. - -## Class: Domain - -The Domain class encapsulates the functionality of routing errors and -uncaught exceptions to the active Domain object. - -Domain is a child class of [`EventEmitter`][]. To handle the errors that it -catches, listen to its `'error'` event. - -### domain.run(fn[, arg][, ...]) - -* `fn` {Function} - -Run the supplied function in the context of the domain, implicitly -binding all event emitters, timers, and lowlevel requests that are -created in that context. Optionally, arguments can be passed to -the function. - -This is the most basic way to use a domain. - -Example: - -```js -const domain = require('domain'); -const fs = require('fs'); -const d = domain.create(); -d.on('error', (er) => { - console.error('Caught error!', er); -}); -d.run(() => { - process.nextTick(() => { - setTimeout(() => { // simulating some various async stuff - fs.open('non-existent file', 'r', (er, fd) => { - if (er) throw er; - // proceed... - }); - }, 100); - }); -}); -``` - -In this example, the `d.on('error')` handler will be triggered, rather -than crashing the program. - -### domain.members - -* {Array} - -An array of timers and event emitters that have been explicitly added -to the domain. - -### domain.add(emitter) - -* `emitter` {EventEmitter|Timer} emitter or timer to be added to the domain - -Explicitly adds an emitter to the domain. If any event handlers called by -the emitter throw an error, or if the emitter emits an `'error'` event, it -will be routed to the domain's `'error'` event, just like with implicit -binding. - -This also works with timers that are returned from [`setInterval()`][] and -[`setTimeout()`][]. If their callback function throws, it will be caught by -the domain 'error' handler. - -If the Timer or EventEmitter was already bound to a domain, it is removed -from that one, and bound to this one instead. - -### domain.remove(emitter) - -* `emitter` {EventEmitter|Timer} emitter or timer to be removed from the domain - -The opposite of [`domain.add(emitter)`][]. Removes domain handling from the -specified emitter. - -### domain.bind(callback) - -* `callback` {Function} The callback function -* return: {Function} The bound function - -The returned function will be a wrapper around the supplied callback -function. When the returned function is called, any errors that are -thrown will be routed to the domain's `'error'` event. - -#### Example - -```js -const d = domain.create(); - -function readSomeFile(filename, cb) { - fs.readFile(filename, 'utf8', d.bind((er, data) => { - // if this throws, it will also be passed to the domain - return cb(er, data ? JSON.parse(data) : null); - })); -} - -d.on('error', (er) => { - // an error occurred somewhere. - // if we throw it now, it will crash the program - // with the normal line number and stack message. -}); -``` - -### domain.intercept(callback) - -* `callback` {Function} The callback function -* return: {Function} The intercepted function - -This method is almost identical to [`domain.bind(callback)`][]. However, in -addition to catching thrown errors, it will also intercept [`Error`][] -objects sent as the first argument to the function. - -In this way, the common `if (err) return callback(err);` pattern can be replaced -with a single error handler in a single place. - -#### Example - -```js -const d = domain.create(); - -function readSomeFile(filename, cb) { - fs.readFile(filename, 'utf8', d.intercept((data) => { - // note, the first argument is never passed to the - // callback since it is assumed to be the 'Error' argument - // and thus intercepted by the domain. - - // if this throws, it will also be passed to the domain - // so the error-handling logic can be moved to the 'error' - // event on the domain instead of being repeated throughout - // the program. - return cb(null, JSON.parse(data)); - })); -} - -d.on('error', (er) => { - // an error occurred somewhere. - // if we throw it now, it will crash the program - // with the normal line number and stack message. -}); -``` - -### domain.enter() - -The `enter` method is plumbing used by the `run`, `bind`, and `intercept` -methods to set the active domain. It sets `domain.active` and `process.domain` -to the domain, and implicitly pushes the domain onto the domain stack managed -by the domain module (see [`domain.exit()`][] for details on the domain stack). The -call to `enter` delimits the beginning of a chain of asynchronous calls and I/O -operations bound to a domain. - -Calling `enter` changes only the active domain, and does not alter the domain -itself. `enter` and `exit` can be called an arbitrary number of times on a -single domain. - -If the domain on which `enter` is called has been disposed, `enter` will return -without setting the domain. - -### domain.exit() - -The `exit` method exits the current domain, popping it off the domain stack. -Any time execution is going to switch to the context of a different chain of -asynchronous calls, it's important to ensure that the current domain is exited. -The call to `exit` delimits either the end of or an interruption to the chain -of asynchronous calls and I/O operations bound to a domain. - -If there are multiple, nested domains bound to the current execution context, -`exit` will exit any domains nested within this domain. - -Calling `exit` changes only the active domain, and does not alter the domain -itself. `enter` and `exit` can be called an arbitrary number of times on a -single domain. - -If the domain on which `exit` is called has been disposed, `exit` will return -without exiting the domain. - -### domain.dispose() - - Stability: 0 - Deprecated. Please recover from failed IO actions - explicitly via error event handlers set on the domain. - -Once `dispose` has been called, the domain will no longer be used by callbacks -bound into the domain via `run`, `bind`, or `intercept`, and a `'dispose'` event -is emitted. - -[`domain.add(emitter)`]: #domain_domain_add_emitter -[`domain.bind(callback)`]: #domain_domain_bind_callback -[`domain.dispose()`]: #domain_domain_dispose -[`domain.exit()`]: #domain_domain_exit -[`Error`]: errors.html#errors_class_error -[`EventEmitter`]: events.html#events_class_events_eventemitter -[`setInterval()`]: timers.html#timers_setinterval_callback_delay_arg -[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_arg -[`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw diff --git a/doc/api/domain.md b/doc/api/domain.md new file mode 100644 index 00000000000000..c556e2533c0be3 --- /dev/null +++ b/doc/api/domain.md @@ -0,0 +1,454 @@ +# Domain + + Stability: 0 - Deprecated + +**This module is pending deprecation**. Once a replacement API has been +finalized, this module will be fully deprecated. Most end users should +**not** have cause to use this module. Users who absolutely must have +the functionality that domains provide may rely on it for the time being +but should expect to have to migrate to a different solution +in the future. + +Domains provide a way to handle multiple different IO operations as a +single group. If any of the event emitters or callbacks registered to a +domain emit an `'error'` event, or throw an error, then the domain object +will be notified, rather than losing the context of the error in the +`process.on('uncaughtException')` handler, or causing the program to +exit immediately with an error code. + +## Warning: Don't Ignore Errors! + + + +Domain error handlers are not a substitute for closing down your +process when an error occurs. + +By the very nature of how [`throw`][] works in JavaScript, there is almost +never any way to safely "pick up where you left off", without leaking +references, or creating some other sort of undefined brittle state. + +The safest way to respond to a thrown error is to shut down the +process. Of course, in a normal web server, you might have many +connections open, and it is not reasonable to abruptly shut those down +because an error was triggered by someone else. + +The better approach is to send an error response to the request that +triggered the error, while letting the others finish in their normal +time, and stop listening for new requests in that worker. + +In this way, `domain` usage goes hand-in-hand with the cluster module, +since the master process can fork a new worker when a worker +encounters an error. For Node.js programs that scale to multiple +machines, the terminating proxy or service registry can take note of +the failure, and react accordingly. + +For example, this is not a good idea: + +```js +// XXX WARNING! BAD IDEA! + +var d = require('domain').create(); +d.on('error', (er) => { + // The error won't crash the process, but what it does is worse! + // Though we've prevented abrupt process restarting, we are leaking + // resources like crazy if this ever happens. + // This is no better than process.on('uncaughtException')! + console.log('error, but oh well', er.message); +}); +d.run(() => { + require('http').createServer((req, res) => { + handleRequest(req, res); + }).listen(PORT); +}); +``` + +By using the context of a domain, and the resilience of separating our +program into multiple worker processes, we can react more +appropriately, and handle errors with much greater safety. + +```js +// Much better! + +const cluster = require('cluster'); +const PORT = +process.env.PORT || 1337; + +if (cluster.isMaster) { + // In real life, you'd probably use more than just 2 workers, + // and perhaps not put the master and worker in the same file. + // + // You can also of course get a bit fancier about logging, and + // implement whatever custom logic you need to prevent DoS + // attacks and other bad behavior. + // + // See the options in the cluster documentation. + // + // The important thing is that the master does very little, + // increasing our resilience to unexpected errors. + + cluster.fork(); + cluster.fork(); + + cluster.on('disconnect', (worker) => { + console.error('disconnect!'); + cluster.fork(); + }); + +} else { + // the worker + // + // This is where we put our bugs! + + const domain = require('domain'); + + // See the cluster documentation for more details about using + // worker processes to serve requests. How it works, caveats, etc. + + const server = require('http').createServer((req, res) => { + var d = domain.create(); + d.on('error', (er) => { + console.error('error', er.stack); + + // Note: we're in dangerous territory! + // By definition, something unexpected occurred, + // which we probably didn't want. + // Anything can happen now! Be very careful! + + try { + // make sure we close down within 30 seconds + var killtimer = setTimeout(() => { + process.exit(1); + }, 30000); + // But don't keep the process open just for that! + killtimer.unref(); + + // stop taking new requests. + server.close(); + + // Let the master know we're dead. This will trigger a + // 'disconnect' in the cluster master, and then it will fork + // a new worker. + cluster.worker.disconnect(); + + // try to send an error to the request that triggered the problem + res.statusCode = 500; + res.setHeader('content-type', 'text/plain'); + res.end('Oops, there was a problem!\n'); + } catch (er2) { + // oh well, not much we can do at this point. + console.error('Error sending 500!', er2.stack); + } + }); + + // Because req and res were created before this domain existed, + // we need to explicitly add them. + // See the explanation of implicit vs explicit binding below. + d.add(req); + d.add(res); + + // Now run the handler function in the domain. + d.run(() => { + handleRequest(req, res); + }); + }); + server.listen(PORT); +} + +// This part isn't important. Just an example routing thing. +// You'd put your fancy application logic here. +function handleRequest(req, res) { + switch(req.url) { + case '/error': + // We do some async stuff, and then... + setTimeout(() => { + // Whoops! + flerb.bark(); + }); + break; + default: + res.end('ok'); + } +} +``` + +## Additions to Error objects + + + +Any time an `Error` object is routed through a domain, a few extra fields +are added to it. + +* `error.domain` The domain that first handled the error. +* `error.domainEmitter` The event emitter that emitted an `'error'` event + with the error object. +* `error.domainBound` The callback function which was bound to the + domain, and passed an error as its first argument. +* `error.domainThrown` A boolean indicating whether the error was + thrown, emitted, or passed to a bound callback function. + +## Implicit Binding + + + +If domains are in use, then all **new** EventEmitter objects (including +Stream objects, requests, responses, etc.) will be implicitly bound to +the active domain at the time of their creation. + +Additionally, callbacks passed to lowlevel event loop requests (such as +to fs.open, or other callback-taking methods) will automatically be +bound to the active domain. If they throw, then the domain will catch +the error. + +In order to prevent excessive memory usage, Domain objects themselves +are not implicitly added as children of the active domain. If they +were, then it would be too easy to prevent request and response objects +from being properly garbage collected. + +If you *want* to nest Domain objects as children of a parent Domain, +then you must explicitly add them. + +Implicit binding routes thrown errors and `'error'` events to the +Domain's `'error'` event, but does not register the EventEmitter on the +Domain, so [`domain.dispose()`][] will not shut down the EventEmitter. +Implicit binding only takes care of thrown errors and `'error'` events. + +## Explicit Binding + + + +Sometimes, the domain in use is not the one that ought to be used for a +specific event emitter. Or, the event emitter could have been created +in the context of one domain, but ought to instead be bound to some +other domain. + +For example, there could be one domain in use for an HTTP server, but +perhaps we would like to have a separate domain to use for each request. + +That is possible via explicit binding. + +For example: + +```js +// create a top-level domain for the server +const domain = require('domain'); +const http = require('http'); +const serverDomain = domain.create(); + +serverDomain.run(() => { + // server is created in the scope of serverDomain + http.createServer((req, res) => { + // req and res are also created in the scope of serverDomain + // however, we'd prefer to have a separate domain for each request. + // create it first thing, and add req and res to it. + var reqd = domain.create(); + reqd.add(req); + reqd.add(res); + reqd.on('error', (er) => { + console.error('Error', er, req.url); + try { + res.writeHead(500); + res.end('Error occurred, sorry.'); + } catch (er) { + console.error('Error sending 500', er, req.url); + } + }); + }).listen(1337); +}); +``` + +## domain.create() + +* return: {Domain} + +Returns a new Domain object. + +## Class: Domain + +The Domain class encapsulates the functionality of routing errors and +uncaught exceptions to the active Domain object. + +Domain is a child class of [`EventEmitter`][]. To handle the errors that it +catches, listen to its `'error'` event. + +### domain.run(fn[, arg][, ...]) + +* `fn` {Function} + +Run the supplied function in the context of the domain, implicitly +binding all event emitters, timers, and lowlevel requests that are +created in that context. Optionally, arguments can be passed to +the function. + +This is the most basic way to use a domain. + +Example: + +```js +const domain = require('domain'); +const fs = require('fs'); +const d = domain.create(); +d.on('error', (er) => { + console.error('Caught error!', er); +}); +d.run(() => { + process.nextTick(() => { + setTimeout(() => { // simulating some various async stuff + fs.open('non-existent file', 'r', (er, fd) => { + if (er) throw er; + // proceed... + }); + }, 100); + }); +}); +``` + +In this example, the `d.on('error')` handler will be triggered, rather +than crashing the program. + +### domain.members + +* {Array} + +An array of timers and event emitters that have been explicitly added +to the domain. + +### domain.add(emitter) + +* `emitter` {EventEmitter|Timer} emitter or timer to be added to the domain + +Explicitly adds an emitter to the domain. If any event handlers called by +the emitter throw an error, or if the emitter emits an `'error'` event, it +will be routed to the domain's `'error'` event, just like with implicit +binding. + +This also works with timers that are returned from [`setInterval()`][] and +[`setTimeout()`][]. If their callback function throws, it will be caught by +the domain 'error' handler. + +If the Timer or EventEmitter was already bound to a domain, it is removed +from that one, and bound to this one instead. + +### domain.remove(emitter) + +* `emitter` {EventEmitter|Timer} emitter or timer to be removed from the domain + +The opposite of [`domain.add(emitter)`][]. Removes domain handling from the +specified emitter. + +### domain.bind(callback) + +* `callback` {Function} The callback function +* return: {Function} The bound function + +The returned function will be a wrapper around the supplied callback +function. When the returned function is called, any errors that are +thrown will be routed to the domain's `'error'` event. + +#### Example + +```js +const d = domain.create(); + +function readSomeFile(filename, cb) { + fs.readFile(filename, 'utf8', d.bind((er, data) => { + // if this throws, it will also be passed to the domain + return cb(er, data ? JSON.parse(data) : null); + })); +} + +d.on('error', (er) => { + // an error occurred somewhere. + // if we throw it now, it will crash the program + // with the normal line number and stack message. +}); +``` + +### domain.intercept(callback) + +* `callback` {Function} The callback function +* return: {Function} The intercepted function + +This method is almost identical to [`domain.bind(callback)`][]. However, in +addition to catching thrown errors, it will also intercept [`Error`][] +objects sent as the first argument to the function. + +In this way, the common `if (err) return callback(err);` pattern can be replaced +with a single error handler in a single place. + +#### Example + +```js +const d = domain.create(); + +function readSomeFile(filename, cb) { + fs.readFile(filename, 'utf8', d.intercept((data) => { + // note, the first argument is never passed to the + // callback since it is assumed to be the 'Error' argument + // and thus intercepted by the domain. + + // if this throws, it will also be passed to the domain + // so the error-handling logic can be moved to the 'error' + // event on the domain instead of being repeated throughout + // the program. + return cb(null, JSON.parse(data)); + })); +} + +d.on('error', (er) => { + // an error occurred somewhere. + // if we throw it now, it will crash the program + // with the normal line number and stack message. +}); +``` + +### domain.enter() + +The `enter` method is plumbing used by the `run`, `bind`, and `intercept` +methods to set the active domain. It sets `domain.active` and `process.domain` +to the domain, and implicitly pushes the domain onto the domain stack managed +by the domain module (see [`domain.exit()`][] for details on the domain stack). The +call to `enter` delimits the beginning of a chain of asynchronous calls and I/O +operations bound to a domain. + +Calling `enter` changes only the active domain, and does not alter the domain +itself. `enter` and `exit` can be called an arbitrary number of times on a +single domain. + +If the domain on which `enter` is called has been disposed, `enter` will return +without setting the domain. + +### domain.exit() + +The `exit` method exits the current domain, popping it off the domain stack. +Any time execution is going to switch to the context of a different chain of +asynchronous calls, it's important to ensure that the current domain is exited. +The call to `exit` delimits either the end of or an interruption to the chain +of asynchronous calls and I/O operations bound to a domain. + +If there are multiple, nested domains bound to the current execution context, +`exit` will exit any domains nested within this domain. + +Calling `exit` changes only the active domain, and does not alter the domain +itself. `enter` and `exit` can be called an arbitrary number of times on a +single domain. + +If the domain on which `exit` is called has been disposed, `exit` will return +without exiting the domain. + +### domain.dispose() + + Stability: 0 - Deprecated. Please recover from failed IO actions + explicitly via error event handlers set on the domain. + +Once `dispose` has been called, the domain will no longer be used by callbacks +bound into the domain via `run`, `bind`, or `intercept`, and a `'dispose'` event +is emitted. + +[`domain.add(emitter)`]: #domain_domain_add_emitter +[`domain.bind(callback)`]: #domain_domain_bind_callback +[`domain.dispose()`]: #domain_domain_dispose +[`domain.exit()`]: #domain_domain_exit +[`Error`]: errors.html#errors_class_error +[`EventEmitter`]: events.html#events_class_eventemitter +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_arg +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_arg +[`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw diff --git a/doc/api/errors.markdown b/doc/api/errors.markdown deleted file mode 100644 index 810a8b7e3678ab..00000000000000 --- a/doc/api/errors.markdown +++ /dev/null @@ -1,548 +0,0 @@ -# Errors - - - -Applications running in Node.js will generally experience four categories of -errors: - -- Standard JavaScript errors such as: - - [`EvalError`][]: thrown when a call to `eval()` fails. - - [`SyntaxError`][]: thrown in response to improper JavaScript language - syntax. - - [`RangeError`][]: thrown when a value is not within an expected range - - [`ReferenceError`][]: thrown when using undefined variables - - [`TypeError`][]: thrown when passing arguments of the wrong type - - [`URIError`][]: thrown when a global URI handling function is misused. -- System errors triggered by underlying operating system constraints such - as attempting to open a file that does not exist, attempting to send data - over a closed socket, etc; -- And User-specified errors triggered by application code. -- Assertion Errors are a special class of error that can be triggered whenever - Node.js detects an exceptional logic violation that should never occur. These - are raised typically by the `assert` module. - -All JavaScript and System errors raised by Node.js inherit from, or are -instances of, the standard JavaScript [`Error`][] class and are guaranteed -to provide *at least* the properties available on that class. - -## Error Propagation and Interception - - - -Node.js supports several mechanisms for propagating and handling errors that -occur while an application is running. How these errors are reported and -handled depends entirely on the type of Error and the style of the API that is -called. - -All JavaScript errors are handled as exceptions that *immediately* generate -and throw an error using the standard JavaScript `throw` mechanism. These -are handled using the [`try / catch` construct][] provided by the JavaScript -language. - -```js -// Throws with a ReferenceError because z is undefined -try { - const m = 1; - const n = m + z; -} catch (err) { - // Handle the error here. -} -``` - -Any use of the JavaScript `throw` mechanism will raise an exception that -*must* be handled using `try / catch` or the Node.js process will exit -immediately. - -With few exceptions, _Synchronous_ APIs (any blocking method that does not -accept a `callback` function, such as [`fs.readFileSync`][]), will use `throw` -to report errors. - -Errors that occur within _Asynchronous APIs_ may be reported in multiple ways: - -- Most asynchronous methods that accept a `callback` function will accept an - `Error` object passed as the first argument to that function. If that first - argument is not `null` and is an instance of `Error`, then an error occurred - that should be handled. - - ```js - const fs = require('fs'); - fs.readFile('a file that does not exist', (err, data) => { - if (err) { - console.error('There was an error reading the file!', err); - return; - } - // Otherwise handle the data - }); - ``` -- When an asynchronous method is called on an object that is an `EventEmitter`, - errors can be routed to that object's `'error'` event. - - ```js - const net = require('net'); - const connection = net.connect('localhost'); - - // Adding an 'error' event handler to a stream: - connection.on('error', (err) => { - // If the connection is reset by the server, or if it can't - // connect at all, or on any sort of error encountered by - // the connection, the error will be sent here. - console.error(err); - }); - - connection.pipe(process.stdout); - ``` - -- A handful of typically asynchronous methods in the Node.js API may still - use the `throw` mechanism to raise exceptions that must be handled using - `try / catch`. There is no comprehensive list of such methods; please - refer to the documentation of each method to determine the appropriate - error handling mechanism required. - -The use of the `'error'` event mechanism is most common for [stream-based][] -and [event emitter-based][] APIs, which themselves represent a series of -asynchronous operations over time (as opposed to a single operation that may -pass or fail). - -For *all* `EventEmitter` objects, if an `'error'` event handler is not -provided, the error will be thrown, causing the Node.js process to report an -unhandled exception and crash unless either: The [`domain`][] module is used -appropriately or a handler has been registered for the -[`process.on('uncaughtException')`][] event. - -```js -const EventEmitter = require('events'); -const ee = new EventEmitter(); - -setImmediate(() => { - // This will crash the process because no 'error' event - // handler has been added. - ee.emit('error', new Error('This will crash')); -}); -``` - -Errors generated in this way *cannot* be intercepted using `try / catch` as -they are thrown *after* the calling code has already exited. - -Developers must refer to the documentation for each method to determine -exactly how errors raised by those methods are propagated. - -### Node.js style callbacks - - - -Most asynchronous methods exposed by the Node.js core API follow an idiomatic -pattern referred to as a "Node.js style callback". With this pattern, a -callback function is passed to the method as an argument. When the operation -either completes or an error is raised, the callback function is called with -the Error object (if any) passed as the first argument. If no error was raised, -the first argument will be passed as `null`. - -```js -const fs = require('fs'); - -function nodeStyleCallback(err, data) { - if (err) { - console.error('There was an error', err); - return; - } - console.log(data); -} - -fs.readFile('/some/file/that/does-not-exist', nodeStyleCallback); -fs.readFile('/some/file/that/does-exist', nodeStyleCallback) -``` - -The JavaScript `try / catch` mechanism **cannot** be used to intercept errors -generated by asynchronous APIs. A common mistake for beginners is to try to -use `throw` inside a Node.js style callback: - -```js -// THIS WILL NOT WORK: -const fs = require('fs'); - -try { - fs.readFile('/some/file/that/does-not-exist', (err, data) => { - // mistaken assumption: throwing here... - if (err) { - throw err; - } - }); -} catch(err) { - // This will not catch the throw! - console.log(err); -} -``` - -This will not work because the callback function passed to `fs.readFile()` is -called asynchronously. By the time the callback has been called, the -surrounding code (including the `try { } catch(err) { }` block will have -already exited. Throwing an error inside the callback **can crash the Node.js -process** in most cases. If [domains][] are enabled, or a handler has been -registered with `process.on('uncaughtException')`, such errors can be -intercepted. - -## Class: Error - - - -A generic JavaScript `Error` object that does not denote any specific -circumstance of why the error occurred. `Error` objects capture a "stack trace" -detailing the point in the code at which the `Error` was instantiated, and may -provide a text description of the error. - -All errors generated by Node.js, including all System and JavaScript errors, -will either be instances of, or inherit from, the `Error` class. - -### new Error(message) - -Creates a new `Error` object and sets the `error.message` property to the -provided text message. If an object is passed as `message`, the text message -is generated by calling `message.toString()`. The `error.stack` property will -represent the point in the code at which `new Error()` was called. Stack traces -are dependent on [V8's stack trace API][]. Stack traces extend only to either -(a) the beginning of *synchronous code execution*, or (b) the number of frames -given by the property `Error.stackTraceLimit`, whichever is smaller. - -### Error.captureStackTrace(targetObject[, constructorOpt]) - -Creates a `.stack` property on `targetObject`, which when accessed returns -a string representing the location in the code at which -`Error.captureStackTrace()` was called. - -```js -const myObject = {}; -Error.captureStackTrace(myObject); -myObject.stack // similar to `new Error().stack` -``` - -The first line of the trace, instead of being prefixed with `ErrorType: -message`, will be the result of calling `targetObject.toString()`. - -The optional `constructorOpt` argument accepts a function. If given, all frames -above `constructorOpt`, including `constructorOpt`, will be omitted from the -generated stack trace. - -The `constructorOpt` argument is useful for hiding implementation -details of error generation from an end user. For instance: - -```js -function MyError() { - Error.captureStackTrace(this, MyError); -} - -// Without passing MyError to captureStackTrace, the MyError -// frame would should up in the .stack property. by passing -// the constructor, we omit that frame and all frames above it. -new MyError().stack -``` - -### Error.stackTraceLimit - -The `Error.stackTraceLimit` property specifies the number of stack frames -collected by a stack trace (whether generated by `new Error().stack` or -`Error.captureStackTrace(obj)`). - -The default value is `10` but may be set to any valid JavaScript number. Changes -will affect any stack trace captured *after* the value has been changed. - -If set to a non-number value, or set to a negative number, stack traces will -not capture any frames. - -#### error.message - -Returns the string description of error as set by calling `new Error(message)`. -The `message` passed to the constructor will also appear in the first line of -the stack trace of the `Error`, however changing this property after the -`Error` object is created *may not* change the first line of the stack trace. - -```js -const err = new Error('The message'); -console.log(err.message); - // Prints: The message -``` - -#### error.stack - -Returns a string describing the point in the code at which the `Error` was -instantiated. - -For example: - -``` -Error: Things keep happening! - at /home/gbusey/file.js:525:2 - at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21) - at Actor. (/home/gbusey/actors.js:400:8) - at increaseSynergy (/home/gbusey/actors.js:701:6) -``` - -The first line is formatted as `: `, and -is followed by a series of stack frames (each line beginning with "at "). -Each frame describes a call site within the code that lead to the error being -generated. V8 attempts to display a name for each function (by variable name, -function name, or object method name), but occasionally it will not be able to -find a suitable name. If V8 cannot determine a name for the function, only -location information will be displayed for that frame. Otherwise, the -determined function name will be displayed with location information appended -in parentheses. - -It is important to note that frames are **only** generated for JavaScript -functions. If, for example, execution synchronously passes through a C++ addon -function called `cheetahify`, which itself calls a JavaScript function, the -frame representing the `cheetahify` call will **not** be present in the stack -traces: - -```js -const cheetahify = require('./native-binding.node'); - -function makeFaster() { - // cheetahify *synchronously* calls speedy. - cheetahify(function speedy() { - throw new Error('oh no!'); - }); -} - -makeFaster(); // will throw: - // /home/gbusey/file.js:6 - // throw new Error('oh no!'); - // ^ - // Error: oh no! - // at speedy (/home/gbusey/file.js:6:11) - // at makeFaster (/home/gbusey/file.js:5:3) - // at Object. (/home/gbusey/file.js:10:1) - // at Module._compile (module.js:456:26) - // at Object.Module._extensions..js (module.js:474:10) - // at Module.load (module.js:356:32) - // at Function.Module._load (module.js:312:12) - // at Function.Module.runMain (module.js:497:10) - // at startup (node.js:119:16) - // at node.js:906:3 -``` - -The location information will be one of: - -* `native`, if the frame represents a call internal to V8 (as in `[].forEach`). -* `plain-filename.js:line:column`, if the frame represents a call internal - to Node.js. -* `/absolute/path/to/file.js:line:column`, if the frame represents a call in - a user program, or its dependencies. - -The string representing the stack trace is lazily generated when the -`error.stack` property is **accessed**. - -The number of frames captured by the stack trace is bounded by the smaller of -`Error.stackTraceLimit` or the number of available frames on the current event -loop tick. - -System-level errors are generated as augmented `Error` instances, which are -detailed [here](#errors_system_errors). - -## Class: RangeError - -A subclass of `Error` that indicates that a provided argument was not within the -set or range of acceptable values for a function; whether that is a numeric -range, or outside the set of options for a given function parameter. - -For example: - -```js -require('net').connect(-1); - // throws RangeError, port should be > 0 && < 65536 -``` - -Node.js will generate and throw `RangeError` instances *immediately* as a form -of argument validation. - -## Class: ReferenceError - -A subclass of `Error` that indicates that an attempt is being made to access a -variable that is not defined. Such errors commonly indicate typos in code, or -an otherwise broken program. - -While client code may generate and propagate these errors, in practice, only V8 -will do so. - -```js -doesNotExist; - // throws ReferenceError, doesNotExist is not a variable in this program. -``` - -`ReferenceError` instances will have an `error.arguments` property whose value -is an array containing a single element: a string representing the variable -that was not defined. - -```js -const assert = require('assert'); -try { - doesNotExist; -} catch(err) { - assert(err.arguments[0], 'doesNotExist'); -} -``` - -Unless an application is dynamically generating and running code, -`ReferenceError` instances should always be considered a bug in the code -or its dependencies. - -## Class: SyntaxError - -A subclass of `Error` that indicates that a program is not valid JavaScript. -These errors may only be generated and propagated as a result of code -evaluation. Code evaluation may happen as a result of `eval`, `Function`, -`require`, or [vm][]. These errors are almost always indicative of a broken -program. - -```js -try { - require('vm').runInThisContext('binary ! isNotOk'); -} catch(err) { - // err will be a SyntaxError -} -``` - -`SyntaxError` instances are unrecoverable in the context that created them – -they may only be caught by other contexts. - -## Class: TypeError - -A subclass of `Error` that indicates that a provided argument is not an -allowable type. For example, passing a function to a parameter which expects a -string would be considered a TypeError. - -```js -require('url').parse(function() { }); - // throws TypeError, since it expected a string -``` - -Node.js will generate and throw `TypeError` instances *immediately* as a form -of argument validation. - -## Exceptions vs. Errors - - - -A JavaScript exception is a value that is thrown as a result of an invalid -operation or as the target of a `throw` statement. While it is not required -that these values are instances of `Error` or classes which inherit from -`Error`, all exceptions thrown by Node.js or the JavaScript runtime *will* be -instances of Error. - -Some exceptions are *unrecoverable* at the JavaScript layer. Such exceptions -will *always* cause the Node.js process to crash. Examples include `assert()` -checks or `abort()` calls in the C++ layer. - -## System Errors - -System errors are generated when exceptions occur within the program's -runtime environment. Typically, these are operational errors that occur -when an application violates an operating system constraint such as attempting -to read a file that does not exist or when the user does not have sufficient -permissions. - -System errors are typically generated at the syscall level: an exhaustive list -of error codes and their meanings is available by running `man 2 intro` or -`man 3 errno` on most Unices; or [online][]. - -In Node.js, system errors are represented as augmented `Error` objects with -added properties. - -### Class: System Error - -#### error.code -#### error.errno - -Returns a string representing the error code, which is always `E` followed by -a sequence of capital letters, and may be referenced in `man 2 intro`. - -The properties `error.code` and `error.errno` are aliases of one another and -return the same value. - -#### error.syscall - -Returns a string describing the [syscall][] that failed. - -### Common System Errors - -This list is **not exhaustive**, but enumerates many of the common system -errors encountered when writing a Node.js program. An exhaustive list may be -found [here][online]. - -- `EACCES` (Permission denied): An attempt was made to access a file in a way - forbidden by its file access permissions. - -- `EADDRINUSE` (Address already in use): An attempt to bind a server - ([`net`][], [`http`][], or [`https`][]) to a local address failed due to - another server on the local system already occupying that address. - -- `ECONNREFUSED` (Connection refused): No connection could be made because the - target machine actively refused it. This usually results from trying to - connect to a service that is inactive on the foreign host. - -- `ECONNRESET` (Connection reset by peer): A connection was forcibly closed by - a peer. This normally results from a loss of the connection on the remote - socket due to a timeout or reboot. Commonly encountered via the [`http`][] - and [`net`][] modules. - -- `EEXIST` (File exists): An existing file was the target of an operation that - required that the target not exist. - -- `EISDIR` (Is a directory): An operation expected a file, but the given - pathname was a directory. - -- `EMFILE` (Too many open files in system): Maximum number of - [file descriptors][] allowable on the system has been reached, and - requests for another descriptor cannot be fulfilled until at least one - has been closed. This is encountered when opening many files at once in - parallel, especially on systems (in particular, OS X) where there is a low - file descriptor limit for processes. To remedy a low limit, run - `ulimit -n 2048` in the same shell that will run the Node.js process. - -- `ENOENT` (No such file or directory): Commonly raised by [`fs`][] operations - to indicate that a component of the specified pathname does not exist -- no - entity (file or directory) could be found by the given path. - -- `ENOTDIR` (Not a directory): A component of the given pathname existed, but - was not a directory as expected. Commonly raised by [`fs.readdir`][]. - -- `ENOTEMPTY` (Directory not empty): A directory with entries was the target - of an operation that requires an empty directory -- usually [`fs.unlink`][]. - -- `EPERM` (Operation not permitted): An attempt was made to perform an - operation that requires elevated privileges. - -- `EPIPE` (Broken pipe): A write on a pipe, socket, or FIFO for which there is - no process to read the data. Commonly encountered at the [`net`][] and - [`http`][] layers, indicative that the remote side of the stream being - written to has been closed. - -- `ETIMEDOUT` (Operation timed out): A connect or send request failed because - the connected party did not properly respond after a period of time. Usually - encountered by [`http`][] or [`net`][] -- often a sign that a `socket.end()` - was not properly called. - -[`domain`]: domain.html -[`EvalError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError -[`Error`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error -[`fs.readdir`]: fs.html#fs_fs_readdir_path_callback -[`fs.readFileSync`]: fs.html#fs_fs_readfilesync_file_options -[`fs.unlink`]: fs.html#fs_fs_unlink_path_callback -[`fs`]: fs.html -[`http`]: http.html -[`https`]: https.html -[`net`]: net.html -[`process.on('uncaughtException')`]: process.html#process_event_uncaughtexception -[`try / catch` construct]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch -[`try { } catch(err) { }`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch -[domains]: domain.html -[event emitter-based]: events.html#events_class_events_eventemitter -[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor -[online]: http://man7.org/linux/man-pages/man3/errno.3.html -[stream-based]: stream.html -[syscall]: http://man7.org/linux/man-pages/man2/syscall.2.html -[V8's stack trace API]: https://github.com/v8/v8/wiki/Stack-Trace-API -[vm]: vm.html -[`SyntaxError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError -[`RangeError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError -[`ReferenceError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError -[`TypeError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError -[`URIError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError diff --git a/doc/api/errors.md b/doc/api/errors.md new file mode 100644 index 00000000000000..e80dabe609400a --- /dev/null +++ b/doc/api/errors.md @@ -0,0 +1,539 @@ +# Errors + + + +Applications running in Node.js will generally experience four categories of +errors: + +- Standard JavaScript errors such as: + - {EvalError} : thrown when a call to `eval()` fails. + - {SyntaxError} : thrown in response to improper JavaScript language + syntax. + - {RangeError} : thrown when a value is not within an expected range + - {ReferenceError} : thrown when using undefined variables + - {TypeError} : thrown when passing arguments of the wrong type + - {URIError} : thrown when a global URI handling function is misused. +- System errors triggered by underlying operating system constraints such + as attempting to open a file that does not exist, attempting to send data + over a closed socket, etc; +- And User-specified errors triggered by application code. +- Assertion Errors are a special class of error that can be triggered whenever + Node.js detects an exceptional logic violation that should never occur. These + are raised typically by the `assert` module. + +All JavaScript and System errors raised by Node.js inherit from, or are +instances of, the standard JavaScript {Error} class and are guaranteed +to provide *at least* the properties available on that class. + +## Error Propagation and Interception + + + +Node.js supports several mechanisms for propagating and handling errors that +occur while an application is running. How these errors are reported and +handled depends entirely on the type of Error and the style of the API that is +called. + +All JavaScript errors are handled as exceptions that *immediately* generate +and throw an error using the standard JavaScript `throw` mechanism. These +are handled using the [`try / catch` construct][try-catch] provided by the JavaScript +language. + +```js +// Throws with a ReferenceError because z is undefined +try { + const m = 1; + const n = m + z; +} catch (err) { + // Handle the error here. +} +``` + +Any use of the JavaScript `throw` mechanism will raise an exception that +*must* be handled using `try / catch` or the Node.js process will exit +immediately. + +With few exceptions, _Synchronous_ APIs (any blocking method that does not +accept a `callback` function, such as [`fs.readFileSync`][]), will use `throw` +to report errors. + +Errors that occur within _Asynchronous APIs_ may be reported in multiple ways: + +- Most asynchronous methods that accept a `callback` function will accept an + `Error` object passed as the first argument to that function. If that first + argument is not `null` and is an instance of `Error`, then an error occurred + that should be handled. + + ```js + const fs = require('fs'); + fs.readFile('a file that does not exist', (err, data) => { + if (err) { + console.error('There was an error reading the file!', err); + return; + } + // Otherwise handle the data + }); + ``` +- When an asynchronous method is called on an object that is an `EventEmitter`, + errors can be routed to that object's `'error'` event. + + ```js + const net = require('net'); + const connection = net.connect('localhost'); + + // Adding an 'error' event handler to a stream: + connection.on('error', (err) => { + // If the connection is reset by the server, or if it can't + // connect at all, or on any sort of error encountered by + // the connection, the error will be sent here. + console.error(err); + }); + + connection.pipe(process.stdout); + ``` + +- A handful of typically asynchronous methods in the Node.js API may still + use the `throw` mechanism to raise exceptions that must be handled using + `try / catch`. There is no comprehensive list of such methods; please + refer to the documentation of each method to determine the appropriate + error handling mechanism required. + +The use of the `'error'` event mechanism is most common for [stream-based][] +and [event emitter-based][] APIs, which themselves represent a series of +asynchronous operations over time (as opposed to a single operation that may +pass or fail). + +For *all* `EventEmitter` objects, if an `'error'` event handler is not +provided, the error will be thrown, causing the Node.js process to report an +unhandled exception and crash unless either: The [`domain`][domains] module is used +appropriately or a handler has been registered for the +[`process.on('uncaughtException')`][] event. + +```js +const EventEmitter = require('events'); +const ee = new EventEmitter(); + +setImmediate(() => { + // This will crash the process because no 'error' event + // handler has been added. + ee.emit('error', new Error('This will crash')); +}); +``` + +Errors generated in this way *cannot* be intercepted using `try / catch` as +they are thrown *after* the calling code has already exited. + +Developers must refer to the documentation for each method to determine +exactly how errors raised by those methods are propagated. + +### Node.js style callbacks + + + +Most asynchronous methods exposed by the Node.js core API follow an idiomatic +pattern referred to as a "Node.js style callback". With this pattern, a +callback function is passed to the method as an argument. When the operation +either completes or an error is raised, the callback function is called with +the Error object (if any) passed as the first argument. If no error was raised, +the first argument will be passed as `null`. + +```js +const fs = require('fs'); + +function nodeStyleCallback(err, data) { + if (err) { + console.error('There was an error', err); + return; + } + console.log(data); +} + +fs.readFile('/some/file/that/does-not-exist', nodeStyleCallback); +fs.readFile('/some/file/that/does-exist', nodeStyleCallback) +``` + +The JavaScript `try / catch` mechanism **cannot** be used to intercept errors +generated by asynchronous APIs. A common mistake for beginners is to try to +use `throw` inside a Node.js style callback: + +```js +// THIS WILL NOT WORK: +const fs = require('fs'); + +try { + fs.readFile('/some/file/that/does-not-exist', (err, data) => { + // mistaken assumption: throwing here... + if (err) { + throw err; + } + }); +} catch(err) { + // This will not catch the throw! + console.log(err); +} +``` + +This will not work because the callback function passed to `fs.readFile()` is +called asynchronously. By the time the callback has been called, the +surrounding code (including the `try { } catch(err) { }` block will have +already exited. Throwing an error inside the callback **can crash the Node.js +process** in most cases. If [domains][] are enabled, or a handler has been +registered with `process.on('uncaughtException')`, such errors can be +intercepted. + +## Class: Error + + + +A generic JavaScript `Error` object that does not denote any specific +circumstance of why the error occurred. `Error` objects capture a "stack trace" +detailing the point in the code at which the `Error` was instantiated, and may +provide a text description of the error. + +All errors generated by Node.js, including all System and JavaScript errors, +will either be instances of, or inherit from, the `Error` class. + +### new Error(message) + +Creates a new `Error` object and sets the `error.message` property to the +provided text message. If an object is passed as `message`, the text message +is generated by calling `message.toString()`. The `error.stack` property will +represent the point in the code at which `new Error()` was called. Stack traces +are dependent on [V8's stack trace API][]. Stack traces extend only to either +(a) the beginning of *synchronous code execution*, or (b) the number of frames +given by the property `Error.stackTraceLimit`, whichever is smaller. + +### Error.captureStackTrace(targetObject[, constructorOpt]) + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack // similar to `new Error().stack` +``` + +The first line of the trace, instead of being prefixed with `ErrorType: +message`, will be the result of calling `targetObject.toString()`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from an end user. For instance: + +```js +function MyError() { + Error.captureStackTrace(this, MyError); +} + +// Without passing MyError to captureStackTrace, the MyError +// frame would show up in the .stack property. By passing +// the constructor, we omit that frame and all frames above it. +new MyError().stack +``` + +### Error.stackTraceLimit + +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). + +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured *after* the value has been changed. + +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. + +#### error.message + +Returns the string description of error as set by calling `new Error(message)`. +The `message` passed to the constructor will also appear in the first line of +the stack trace of the `Error`, however changing this property after the +`Error` object is created *may not* change the first line of the stack trace. + +```js +const err = new Error('The message'); +console.log(err.message); + // Prints: The message +``` + +#### error.stack + +Returns a string describing the point in the code at which the `Error` was +instantiated. + +For example: + +``` +Error: Things keep happening! + at /home/gbusey/file.js:525:2 + at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21) + at Actor. (/home/gbusey/actors.js:400:8) + at increaseSynergy (/home/gbusey/actors.js:701:6) +``` + +The first line is formatted as `: `, and +is followed by a series of stack frames (each line beginning with "at "). +Each frame describes a call site within the code that lead to the error being +generated. V8 attempts to display a name for each function (by variable name, +function name, or object method name), but occasionally it will not be able to +find a suitable name. If V8 cannot determine a name for the function, only +location information will be displayed for that frame. Otherwise, the +determined function name will be displayed with location information appended +in parentheses. + +It is important to note that frames are **only** generated for JavaScript +functions. If, for example, execution synchronously passes through a C++ addon +function called `cheetahify`, which itself calls a JavaScript function, the +frame representing the `cheetahify` call will **not** be present in the stack +traces: + +```js +const cheetahify = require('./native-binding.node'); + +function makeFaster() { + // cheetahify *synchronously* calls speedy. + cheetahify(function speedy() { + throw new Error('oh no!'); + }); +} + +makeFaster(); // will throw: + // /home/gbusey/file.js:6 + // throw new Error('oh no!'); + // ^ + // Error: oh no! + // at speedy (/home/gbusey/file.js:6:11) + // at makeFaster (/home/gbusey/file.js:5:3) + // at Object. (/home/gbusey/file.js:10:1) + // at Module._compile (module.js:456:26) + // at Object.Module._extensions..js (module.js:474:10) + // at Module.load (module.js:356:32) + // at Function.Module._load (module.js:312:12) + // at Function.Module.runMain (module.js:497:10) + // at startup (node.js:119:16) + // at node.js:906:3 +``` + +The location information will be one of: + +* `native`, if the frame represents a call internal to V8 (as in `[].forEach`). +* `plain-filename.js:line:column`, if the frame represents a call internal + to Node.js. +* `/absolute/path/to/file.js:line:column`, if the frame represents a call in + a user program, or its dependencies. + +The string representing the stack trace is lazily generated when the +`error.stack` property is **accessed**. + +The number of frames captured by the stack trace is bounded by the smaller of +`Error.stackTraceLimit` or the number of available frames on the current event +loop tick. + +System-level errors are generated as augmented `Error` instances, which are +detailed [here](#errors_system_errors). + +## Class: RangeError + +A subclass of `Error` that indicates that a provided argument was not within the +set or range of acceptable values for a function; whether that is a numeric +range, or outside the set of options for a given function parameter. + +For example: + +```js +require('net').connect(-1); + // throws RangeError, port should be > 0 && < 65536 +``` + +Node.js will generate and throw `RangeError` instances *immediately* as a form +of argument validation. + +## Class: ReferenceError + +A subclass of `Error` that indicates that an attempt is being made to access a +variable that is not defined. Such errors commonly indicate typos in code, or +an otherwise broken program. + +While client code may generate and propagate these errors, in practice, only V8 +will do so. + +```js +doesNotExist; + // throws ReferenceError, doesNotExist is not a variable in this program. +``` + +`ReferenceError` instances will have an `error.arguments` property whose value +is an array containing a single element: a string representing the variable +that was not defined. + +```js +const assert = require('assert'); +try { + doesNotExist; +} catch(err) { + assert(err.arguments[0], 'doesNotExist'); +} +``` + +Unless an application is dynamically generating and running code, +`ReferenceError` instances should always be considered a bug in the code +or its dependencies. + +## Class: SyntaxError + +A subclass of `Error` that indicates that a program is not valid JavaScript. +These errors may only be generated and propagated as a result of code +evaluation. Code evaluation may happen as a result of `eval`, `Function`, +`require`, or [vm][]. These errors are almost always indicative of a broken +program. + +```js +try { + require('vm').runInThisContext('binary ! isNotOk'); +} catch(err) { + // err will be a SyntaxError +} +``` + +`SyntaxError` instances are unrecoverable in the context that created them – +they may only be caught by other contexts. + +## Class: TypeError + +A subclass of `Error` that indicates that a provided argument is not an +allowable type. For example, passing a function to a parameter which expects a +string would be considered a TypeError. + +```js +require('url').parse(() => { }); + // throws TypeError, since it expected a string +``` + +Node.js will generate and throw `TypeError` instances *immediately* as a form +of argument validation. + +## Exceptions vs. Errors + + + +A JavaScript exception is a value that is thrown as a result of an invalid +operation or as the target of a `throw` statement. While it is not required +that these values are instances of `Error` or classes which inherit from +`Error`, all exceptions thrown by Node.js or the JavaScript runtime *will* be +instances of Error. + +Some exceptions are *unrecoverable* at the JavaScript layer. Such exceptions +will *always* cause the Node.js process to crash. Examples include `assert()` +checks or `abort()` calls in the C++ layer. + +## System Errors + +System errors are generated when exceptions occur within the program's +runtime environment. Typically, these are operational errors that occur +when an application violates an operating system constraint such as attempting +to read a file that does not exist or when the user does not have sufficient +permissions. + +System errors are typically generated at the syscall level: an exhaustive list +of error codes and their meanings is available by running `man 2 intro` or +`man 3 errno` on most Unices; or [online][]. + +In Node.js, system errors are represented as augmented `Error` objects with +added properties. + +### Class: System Error + +#### error.code +#### error.errno + +Returns a string representing the error code, which is always `E` followed by +a sequence of capital letters, and may be referenced in `man 2 intro`. + +The properties `error.code` and `error.errno` are aliases of one another and +return the same value. + +#### error.syscall + +Returns a string describing the [syscall][] that failed. + +### Common System Errors + +This list is **not exhaustive**, but enumerates many of the common system +errors encountered when writing a Node.js program. An exhaustive list may be +found [here][online]. + +- `EACCES` (Permission denied): An attempt was made to access a file in a way + forbidden by its file access permissions. + +- `EADDRINUSE` (Address already in use): An attempt to bind a server + ([`net`][], [`http`][], or [`https`][]) to a local address failed due to + another server on the local system already occupying that address. + +- `ECONNREFUSED` (Connection refused): No connection could be made because the + target machine actively refused it. This usually results from trying to + connect to a service that is inactive on the foreign host. + +- `ECONNRESET` (Connection reset by peer): A connection was forcibly closed by + a peer. This normally results from a loss of the connection on the remote + socket due to a timeout or reboot. Commonly encountered via the [`http`][] + and [`net`][] modules. + +- `EEXIST` (File exists): An existing file was the target of an operation that + required that the target not exist. + +- `EISDIR` (Is a directory): An operation expected a file, but the given + pathname was a directory. + +- `EMFILE` (Too many open files in system): Maximum number of + [file descriptors][] allowable on the system has been reached, and + requests for another descriptor cannot be fulfilled until at least one + has been closed. This is encountered when opening many files at once in + parallel, especially on systems (in particular, OS X) where there is a low + file descriptor limit for processes. To remedy a low limit, run + `ulimit -n 2048` in the same shell that will run the Node.js process. + +- `ENOENT` (No such file or directory): Commonly raised by [`fs`][] operations + to indicate that a component of the specified pathname does not exist -- no + entity (file or directory) could be found by the given path. + +- `ENOTDIR` (Not a directory): A component of the given pathname existed, but + was not a directory as expected. Commonly raised by [`fs.readdir`][]. + +- `ENOTEMPTY` (Directory not empty): A directory with entries was the target + of an operation that requires an empty directory -- usually [`fs.unlink`][]. + +- `EPERM` (Operation not permitted): An attempt was made to perform an + operation that requires elevated privileges. + +- `EPIPE` (Broken pipe): A write on a pipe, socket, or FIFO for which there is + no process to read the data. Commonly encountered at the [`net`][] and + [`http`][] layers, indicative that the remote side of the stream being + written to has been closed. + +- `ETIMEDOUT` (Operation timed out): A connect or send request failed because + the connected party did not properly respond after a period of time. Usually + encountered by [`http`][] or [`net`][] -- often a sign that a `socket.end()` + was not properly called. + +[`fs.readdir`]: fs.html#fs_fs_readdir_path_options_callback +[`fs.readFileSync`]: fs.html#fs_fs_readfilesync_file_options +[`fs.unlink`]: fs.html#fs_fs_unlink_path_callback +[`fs`]: fs.html +[`http`]: http.html +[`https`]: https.html +[`net`]: net.html +[`process.on('uncaughtException')`]: process.html#process_event_uncaughtexception +[domains]: domain.html +[event emitter-based]: events.html#events_class_eventemitter +[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor +[online]: http://man7.org/linux/man-pages/man3/errno.3.html +[stream-based]: stream.html +[syscall]: http://man7.org/linux/man-pages/man2/syscall.2.html +[try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch +[V8's stack trace API]: https://github.com/v8/v8/wiki/Stack-Trace-API +[vm]: vm.html diff --git a/doc/api/events.markdown b/doc/api/events.markdown deleted file mode 100644 index 393a69ee02a8eb..00000000000000 --- a/doc/api/events.markdown +++ /dev/null @@ -1,462 +0,0 @@ -# Events - - Stability: 2 - Stable - - - -Much of the Node.js core API is built around an idiomatic asynchronous -event-driven architecture in which certain kinds of objects (called "emitters") -periodically emit named events that cause Function objects ("listeners") to be -called. - -For instance: a [`net.Server`][] object emits an event each time a peer -connects to it; a [`fs.ReadStream`][] emits an event when the file is opened; -a [stream][] emits an event whenever data is available to be read. - -All objects that emit events are instances of the `EventEmitter` class. These -objects expose an `eventEmitter.on()` function that allows one or more -Functions to be attached to named events emitted by the object. Typically, -event names are camel-cased strings but any valid JavaScript property key -can be used. - -When the `EventEmitter` object emits an event, all of the Functions attached -to that specific event are called _synchronously_. Any values returned by the -called listeners are _ignored_ and will be discarded. - -The following example shows a simple `EventEmitter` instance with a single -listener. The `eventEmitter.on()` method is used to register listeners, while -the `eventEmitter.emit()` method is used to trigger the event. - -```js -const EventEmitter = require('events'); -const util = require('util'); - -function MyEmitter() { - EventEmitter.call(this); -} -util.inherits(MyEmitter, EventEmitter); - -const myEmitter = new MyEmitter(); -myEmitter.on('event', () => { - console.log('an event occurred!'); -}); -myEmitter.emit('event'); -``` - -Any object can become an `EventEmitter` through inheritance. The example above -uses the traditional Node.js style prototypical inheritance using -the `util.inherits()` method. It is, however, possible to use ES6 classes as -well: - -```js -const EventEmitter = require('events'); - -class MyEmitter extends EventEmitter {} - -const myEmitter = new MyEmitter(); -myEmitter.on('event', () => { - console.log('an event occurred!'); -}); -myEmitter.emit('event'); -``` - -## Passing arguments and `this` to listeners - -The `eventEmitter.emit()` method allows an arbitrary set of arguments to be -passed to the listener functions. It is important to keep in mind that when an -ordinary listener function is called by the `EventEmitter`, the standard `this` -keyword is intentionally set to reference the `EventEmitter` to which the -listener is attached. - -```js -const myEmitter = new MyEmitter(); -myEmitter.on('event', function(a, b) { - console.log(a, b, this); - // Prints: - // a b MyEmitter { - // domain: null, - // _events: { event: [Function] }, - // _eventsCount: 1, - // _maxListeners: undefined } -}); -myEmitter.emit('event', 'a', 'b'); -``` - -It is possible to use ES6 Arrow Functions as listeners, however, when doing so, -the `this` keyword will no longer reference the `EventEmitter` instance: - -```js -const myEmitter = new MyEmitter(); -myEmitter.on('event', (a, b) => { - console.log(a, b, this); - // Prints: a b {} -}); -myEmitter.emit('event', 'a', 'b'); -``` - -## Asynchronous vs. Synchronous - -The `EventListener` calls all listeners synchronously in the order in which -they were registered. This is important to ensure the proper sequencing of -events and to avoid race conditions or logic errors. When appropriate, -listener functions can switch to an asynchronous mode of operation using -the `setImmediate()` or `process.nextTick()` methods: - -```js -const myEmitter = new MyEmitter(); -myEmitter.on('event', (a, b) => { - setImmediate(() => { - console.log('this happens asynchronously'); - }); -}); -myEmitter.emit('event', 'a', 'b'); -``` - -## Handling events only once - -When a listener is registered using the `eventEmitter.on()` method, that -listener will be invoked _every time_ the named event is emitted. - -```js -const myEmitter = new MyEmitter(); -var m = 0; -myEmitter.on('event', () => { - console.log(++m); -}); -myEmitter.emit('event'); - // Prints: 1 -myEmitter.emit('event'); - // Prints: 2 -``` - -Using the `eventEmitter.once()` method, it is possible to register a listener -that is immediately unregistered after it is called. - -```js -const myEmitter = new MyEmitter(); -var m = 0; -myEmitter.once('event', () => { - console.log(++m); -}); -myEmitter.emit('event'); - // Prints: 1 -myEmitter.emit('event'); - // Ignored -``` - -## Error events - -When an error occurs within an `EventEmitter` instance, the typical action is -for an `'error'` event to be emitted. These are treated as a special case -within Node.js. - -If an `EventEmitter` does _not_ have at least one listener registered for the -`'error'` event, and an `'error'` event is emitted, the error is thrown, a -stack trace is printed, and the Node.js process exits. - -```js -const myEmitter = new MyEmitter(); -myEmitter.emit('error', new Error('whoops!')); - // Throws and crashes Node.js -``` - -To guard against crashing the Node.js process, developers can either register -a listener for the `process.on('uncaughtException')` event or use the -[`domain`][] module (_Note, however, that the `domain` module has been -deprecated_). - -```js -const myEmitter = new MyEmitter(); - -process.on('uncaughtException', (err) => { - console.log('whoops! there was an error'); -}); - -myEmitter.emit('error', new Error('whoops!')); - // Prints: whoops! there was an error -``` - -As a best practice, developers should always register listeners for the -`'error'` event: - -```js -const myEmitter = new MyEmitter(); -myEmitter.on('error', (err) => { - console.log('whoops! there was an error'); -}); -myEmitter.emit('error', new Error('whoops!')); - // Prints: whoops! there was an error -``` - -## Class: EventEmitter - -The `EventEmitter` class is defined and exposed by the `events` module: - -```js -const EventEmitter = require('events'); -``` - -All EventEmitters emit the event `'newListener'` when new listeners are -added and `'removeListener'` when a listener is removed. - -### Event: 'newListener' - -* `eventName` {String|Symbol} The name of the event being listened for -* `listener` {Function} The event handler function - -The `EventEmitter` instance will emit it's own `'newListener'` event *before* -a listener is added to it's internal array of listeners. - -Listeners registered for the `'newListener'` event will be passed the event -name and a reference to the listener being added. - -The fact that the event is triggered before adding the listener has a subtle -but important side effect: any *additional* listeners registered to the same -`name` *within* the `'newListener'` callback will be inserted *before* the -listener that is in the process of being added. - -```js -const myEmitter = new MyEmitter(); -// Only do this once so we don't loop forever -myEmitter.once('newListener', (event, listener) => { - if (event === 'event') { - // Insert a new listener in front - myEmitter.on('event', () => { - console.log('B'); - }); - } -}); -myEmitter.on('event', () => { - console.log('A'); -}); -myEmitter.emit('event'); - // Prints: - // B - // A -``` - -### Event: 'removeListener' - -* `eventName` {String|Symbol} The event name -* `listener` {Function} The event handler function - -The `'removeListener'` event is emitted *after* a listener is removed. - -### EventEmitter.listenerCount(emitter, eventName) - - Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. - -A class method that returns the number of listeners for the given `eventName` -registered on the given `emitter`. - -```js -const myEmitter = new MyEmitter(); -myEmitter.on('event', () => {}); -myEmitter.on('event', () => {}); -console.log(EventEmitter.listenerCount(myEmitter, 'event')); - // Prints: 2 -``` - -### EventEmitter.defaultMaxListeners - -By default, a maximum of `10` listeners can be registered for any single -event. This limit can be changed for individual `EventEmitter` instances -using the [`emitter.setMaxListeners(n)`][] method. To change the default -for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners` -property can be used. - -Take caution when setting the `EventEmitter.defaultMaxListeners` because the -change effects *all* `EventEmitter` instances, including those created before -the change is made. However, calling [`emitter.setMaxListeners(n)`][] still has -precedence over `EventEmitter.defaultMaxListeners`. - -Note that this is not a hard limit. The `EventEmitter` instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a `possible EventEmitter memory leak` has been detected. For any single -`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` -methods can be used to temporarily avoid this warning: - -```js -emitter.setMaxListeners(emitter.getMaxListeners() + 1); -emitter.once('event', () => { - // do stuff - emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); -}); -``` - -### emitter.addListener(eventName, listener) - -Alias for `emitter.on(eventName, listener)`. - -### emitter.emit(eventName[, arg1][, arg2][, ...]) - -Synchronously calls each of the listeners registered for the event named -`eventName`, in the order they were registered, passing the supplied arguments -to each. - -Returns `true` if the event had listeners, `false` otherwise. - -### emitter.eventNames() - -Returns an array listing the events for which the emitter has registered -listeners. The values in the array will be strings or Symbols. - -```js -const EventEmitter = require('events'); -const myEE = new EventEmitter(); -myEE.on('foo', () => {}); -myEE.on('bar', () => {}); - -const sym = Symbol('symbol'); -myEE.on(sym, () => {}); - -console.log(myErr.eventNames()); - // Prints ['foo', 'bar', Symbol('symbol')] -``` - -### emitter.getMaxListeners() - -Returns the current max listener value for the `EventEmitter` which is either -set by [`emitter.setMaxListeners(n)`][] or defaults to -[`EventEmitter.defaultMaxListeners`][]. - -### emitter.listenerCount(eventName) - -* `eventName` {Value} The name of the event being listened for - -Returns the number of listeners listening to the event named `eventName`. - -### emitter.listeners(eventName) - -Returns a copy of the array of listeners for the event named `eventName`. - -```js -server.on('connection', (stream) => { - console.log('someone connected!'); -}); -console.log(util.inspect(server.listeners('connection'))); - // Prints: [ [Function] ] -``` - -### emitter.on(eventName, listener) - -Adds the `listener` function to the end of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName` -and `listener` will result in the `listener` being added, and called, multiple -times. - -```js -server.on('connection', (stream) => { - console.log('someone connected!'); -}); -``` - -Returns a reference to the `EventEmitter` so calls can be chained. - -### emitter.once(eventName, listener) - -Adds a **one time** `listener` function for the event named `eventName`. This -listener is invoked only the next time `eventName` is triggered, after which -it is removed. - -```js -server.once('connection', (stream) => { - console.log('Ah, we have our first user!'); -}); -``` - -Returns a reference to the `EventEmitter` so calls can be chained. - -### emitter.removeAllListeners([eventName]) - -Removes all listeners, or those of the specified `eventName`. - -Note that it is bad practice to remove listeners added elsewhere in the code, -particularly when the `EventEmitter` instance was created by some other -component or module (e.g. sockets or file streams). - -Returns a reference to the `EventEmitter` so calls can be chained. - -### emitter.removeListener(eventName, listener) - -Removes the specified `listener` from the listener array for the event named -`eventName`. - -```js -var callback = (stream) => { - console.log('someone connected!'); -}; -server.on('connection', callback); -// ... -server.removeListener('connection', callback); -``` - -`removeListener` will remove, at most, one instance of a listener from the -listener array. If any single listener has been added multiple times to the -listener array for the specified `eventName`, then `removeListener` must be -called multiple times to remove each instance. - -Note that once an event has been emitted, all listeners attached to it at the -time of emitting will be called in order. This implies that any `removeListener()` -or `removeAllListeners()` calls *after* emitting and *before* the last listener -finishes execution will not remove them from `emit()` in progress. Subsequent -events will behave as expected. - -```js -const myEmitter = new MyEmitter(); - -var callbackA = () => { - console.log('A'); - myEmitter.removeListener('event', callbackB); -}; - -var callbackB = () => { - console.log('B'); -}; - -myEmitter.on('event', callbackA); - -myEmitter.on('event', callbackB); - -// callbackA removes listener callbackB but it will still be called. -// Internal listener array at time of emit [callbackA, callbackB] -myEmitter.emit('event'); - // Prints: - // A - // B - -// callbackB is now removed. -// Internal listener array [callbackA] -myEmitter.emit('event'); - // Prints: - // A - -``` - -Because listeners are managed using an internal array, calling this will -change the position indices of any listener registered *after* the listener -being removed. This will not impact the order in which listeners are called, -but it will means that any copies of the listener array as returned by -the `emitter.listeners()` method will need to be recreated. - -Returns a reference to the `EventEmitter` so calls can be chained. - -### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than `10` listeners are -added for a particular event. This is a useful default that helps finding -memory leaks. Obviously, not all events should be limited to just 10 listeners. -The `emitter.setMaxListeners()` method allows the limit to be modified for this -specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) -for to indicate an unlimited number of listeners. - -Returns a reference to the `EventEmitter` so calls can be chained. - -[`net.Server`]: net.html#net_class_net_server -[`fs.ReadStream`]: fs.html#fs_class_fs_readstream -[`emitter.setMaxListeners(n)`]: #events_emitter_setmaxlisteners_n -[`EventEmitter.defaultMaxListeners`]: #events_eventemitter_defaultmaxlisteners -[`emitter.listenerCount()`]: #events_emitter_listenercount_event -[`domain`]: domain.html -[stream]: stream.html diff --git a/doc/api/events.md b/doc/api/events.md new file mode 100644 index 00000000000000..92a4e829c8e72e --- /dev/null +++ b/doc/api/events.md @@ -0,0 +1,510 @@ +# Events + + Stability: 2 - Stable + + + +Much of the Node.js core API is built around an idiomatic asynchronous +event-driven architecture in which certain kinds of objects (called "emitters") +periodically emit named events that cause Function objects ("listeners") to be +called. + +For instance: a [`net.Server`][] object emits an event each time a peer +connects to it; a [`fs.ReadStream`][] emits an event when the file is opened; +a [stream][] emits an event whenever data is available to be read. + +All objects that emit events are instances of the `EventEmitter` class. These +objects expose an `eventEmitter.on()` function that allows one or more +Functions to be attached to named events emitted by the object. Typically, +event names are camel-cased strings but any valid JavaScript property key +can be used. + +When the `EventEmitter` object emits an event, all of the Functions attached +to that specific event are called _synchronously_. Any values returned by the +called listeners are _ignored_ and will be discarded. + +The following example shows a simple `EventEmitter` instance with a single +listener. The `eventEmitter.on()` method is used to register listeners, while +the `eventEmitter.emit()` method is used to trigger the event. + +```js +const EventEmitter = require('events'); + +class MyEmitter extends EventEmitter {} + +const myEmitter = new MyEmitter(); +myEmitter.on('event', () => { + console.log('an event occurred!'); +}); +myEmitter.emit('event'); +``` + +## Passing arguments and `this` to listeners + +The `eventEmitter.emit()` method allows an arbitrary set of arguments to be +passed to the listener functions. It is important to keep in mind that when an +ordinary listener function is called by the `EventEmitter`, the standard `this` +keyword is intentionally set to reference the `EventEmitter` to which the +listener is attached. + +```js +const myEmitter = new MyEmitter(); +myEmitter.on('event', function(a, b) { + console.log(a, b, this); + // Prints: + // a b MyEmitter { + // domain: null, + // _events: { event: [Function] }, + // _eventsCount: 1, + // _maxListeners: undefined } +}); +myEmitter.emit('event', 'a', 'b'); +``` + +It is possible to use ES6 Arrow Functions as listeners, however, when doing so, +the `this` keyword will no longer reference the `EventEmitter` instance: + +```js +const myEmitter = new MyEmitter(); +myEmitter.on('event', (a, b) => { + console.log(a, b, this); + // Prints: a b {} +}); +myEmitter.emit('event', 'a', 'b'); +``` + +## Asynchronous vs. Synchronous + +The `EventListener` calls all listeners synchronously in the order in which +they were registered. This is important to ensure the proper sequencing of +events and to avoid race conditions or logic errors. When appropriate, +listener functions can switch to an asynchronous mode of operation using +the `setImmediate()` or `process.nextTick()` methods: + +```js +const myEmitter = new MyEmitter(); +myEmitter.on('event', (a, b) => { + setImmediate(() => { + console.log('this happens asynchronously'); + }); +}); +myEmitter.emit('event', 'a', 'b'); +``` + +## Handling events only once + +When a listener is registered using the `eventEmitter.on()` method, that +listener will be invoked _every time_ the named event is emitted. + +```js +const myEmitter = new MyEmitter(); +var m = 0; +myEmitter.on('event', () => { + console.log(++m); +}); +myEmitter.emit('event'); + // Prints: 1 +myEmitter.emit('event'); + // Prints: 2 +``` + +Using the `eventEmitter.once()` method, it is possible to register a listener +that is unregistered before it is called. + +```js +const myEmitter = new MyEmitter(); +var m = 0; +myEmitter.once('event', () => { + console.log(++m); +}); +myEmitter.emit('event'); + // Prints: 1 +myEmitter.emit('event'); + // Ignored +``` + +## Error events + +When an error occurs within an `EventEmitter` instance, the typical action is +for an `'error'` event to be emitted. These are treated as a special case +within Node.js. + +If an `EventEmitter` does _not_ have at least one listener registered for the +`'error'` event, and an `'error'` event is emitted, the error is thrown, a +stack trace is printed, and the Node.js process exits. + +```js +const myEmitter = new MyEmitter(); +myEmitter.emit('error', new Error('whoops!')); + // Throws and crashes Node.js +``` + +To guard against crashing the Node.js process, developers can either register +a listener for the `process.on('uncaughtException')` event or use the +[`domain`][] module (_Note, however, that the `domain` module has been +deprecated_). + +```js +const myEmitter = new MyEmitter(); + +process.on('uncaughtException', (err) => { + console.log('whoops! there was an error'); +}); + +myEmitter.emit('error', new Error('whoops!')); + // Prints: whoops! there was an error +``` + +As a best practice, developers should always register listeners for the +`'error'` event: + +```js +const myEmitter = new MyEmitter(); +myEmitter.on('error', (err) => { + console.log('whoops! there was an error'); +}); +myEmitter.emit('error', new Error('whoops!')); + // Prints: whoops! there was an error +``` + +## Class: EventEmitter + +The `EventEmitter` class is defined and exposed by the `events` module: + +```js +const EventEmitter = require('events'); +``` + +All EventEmitters emit the event `'newListener'` when new listeners are +added and `'removeListener'` when a listener is removed. + +### Event: 'newListener' + +* `eventName` {String|Symbol} The name of the event being listened for +* `listener` {Function} The event handler function + +The `EventEmitter` instance will emit it's own `'newListener'` event *before* +a listener is added to it's internal array of listeners. + +Listeners registered for the `'newListener'` event will be passed the event +name and a reference to the listener being added. + +The fact that the event is triggered before adding the listener has a subtle +but important side effect: any *additional* listeners registered to the same +`name` *within* the `'newListener'` callback will be inserted *before* the +listener that is in the process of being added. + +```js +const myEmitter = new MyEmitter(); +// Only do this once so we don't loop forever +myEmitter.once('newListener', (event, listener) => { + if (event === 'event') { + // Insert a new listener in front + myEmitter.on('event', () => { + console.log('B'); + }); + } +}); +myEmitter.on('event', () => { + console.log('A'); +}); +myEmitter.emit('event'); + // Prints: + // B + // A +``` + +### Event: 'removeListener' + +* `eventName` {String|Symbol} The event name +* `listener` {Function} The event handler function + +The `'removeListener'` event is emitted *after* a listener is removed. + +### EventEmitter.listenerCount(emitter, eventName) + + Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. + +A class method that returns the number of listeners for the given `eventName` +registered on the given `emitter`. + +```js +const myEmitter = new MyEmitter(); +myEmitter.on('event', () => {}); +myEmitter.on('event', () => {}); +console.log(EventEmitter.listenerCount(myEmitter, 'event')); + // Prints: 2 +``` + +### EventEmitter.defaultMaxListeners + +By default, a maximum of `10` listeners can be registered for any single +event. This limit can be changed for individual `EventEmitter` instances +using the [`emitter.setMaxListeners(n)`][] method. To change the default +for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners` +property can be used. + +Take caution when setting the `EventEmitter.defaultMaxListeners` because the +change effects *all* `EventEmitter` instances, including those created before +the change is made. However, calling [`emitter.setMaxListeners(n)`][] still has +precedence over `EventEmitter.defaultMaxListeners`. + +Note that this is not a hard limit. The `EventEmitter` instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a `possible EventEmitter memory leak` has been detected. For any single +`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` +methods can be used to temporarily avoid this warning: + +```js +emitter.setMaxListeners(emitter.getMaxListeners() + 1); +emitter.once('event', () => { + // do stuff + emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); +}); +``` + +### emitter.addListener(eventName, listener) + +Alias for `emitter.on(eventName, listener)`. + +### emitter.emit(eventName[, arg1][, arg2][, ...]) + +Synchronously calls each of the listeners registered for the event named +`eventName`, in the order they were registered, passing the supplied arguments +to each. + +Returns `true` if the event had listeners, `false` otherwise. + +### emitter.eventNames() + +Returns an array listing the events for which the emitter has registered +listeners. The values in the array will be strings or Symbols. + +```js +const EventEmitter = require('events'); +const myEE = new EventEmitter(); +myEE.on('foo', () => {}); +myEE.on('bar', () => {}); + +const sym = Symbol('symbol'); +myEE.on(sym, () => {}); + +console.log(myEE.eventNames()); + // Prints [ 'foo', 'bar', Symbol(symbol) ] +``` + +### emitter.getMaxListeners() + +Returns the current max listener value for the `EventEmitter` which is either +set by [`emitter.setMaxListeners(n)`][] or defaults to +[`EventEmitter.defaultMaxListeners`][]. + +### emitter.listenerCount(eventName) + +* `eventName` {Value} The name of the event being listened for + +Returns the number of listeners listening to the event named `eventName`. + +### emitter.listeners(eventName) + +Returns a copy of the array of listeners for the event named `eventName`. + +```js +server.on('connection', (stream) => { + console.log('someone connected!'); +}); +console.log(util.inspect(server.listeners('connection'))); + // Prints: [ [Function] ] +``` + +### emitter.on(eventName, listener) + +* `eventName` {string|Symbol} The name of the event. +* `listener` {Function} The callback function + +Adds the `listener` function to the end of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple +times. + +```js +server.on('connection', (stream) => { + console.log('someone connected!'); +}); +``` + +Returns a reference to the `EventEmitter` so calls can be chained. + +By default, event listeners are invoked in the order they are added. The +`emitter.prependListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +const myEE = new EventEmitter(); +myEE.on('foo', () => console.log('a')); +myEE.prependListener('foo', () => console.log('b')); +myEE.emit('foo'); + // Prints: + // b + // a +``` + +### emitter.once(eventName, listener) + +* `eventName` {string|Symbol} The name of the event. +* `listener` {Function} The callback function + +Adds a **one time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. + +```js +server.once('connection', (stream) => { + console.log('Ah, we have our first user!'); +}); +``` + +Returns a reference to the `EventEmitter` so calls can be chained. + +By default, event listeners are invoked in the order they are added. The +`emitter.prependOnceListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +const myEE = new EventEmitter(); +myEE.once('foo', () => console.log('a')); +myEE.prependOnceListener('foo', () => console.log('b')); +myEE.emit('foo'); + // Prints: + // b + // a +``` + +### emitter.prependListener(eventName, listener) + +* `eventName` {string|Symbol} The name of the event. +* `listener` {Function} The callback function + +Adds the `listener` function to the *beginning* of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple +times. + +```js +server.prependListener('connection', (stream) => { + console.log('someone connected!'); +}); +``` + +Returns a reference to the `EventEmitter` so calls can be chained. + +### emitter.prependOnceListener(eventName, listener) + +* `eventName` {string|Symbol} The name of the event. +* `listener` {Function} The callback function + +Adds a **one time** `listener` function for the event named `eventName` to the +*beginning* of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. + +```js +server.prependOnceListener('connection', (stream) => { + console.log('Ah, we have our first user!'); +}); +``` + +Returns a reference to the `EventEmitter` so calls can be chained. + +### emitter.removeAllListeners([eventName]) + +Removes all listeners, or those of the specified `eventName`. + +Note that it is bad practice to remove listeners added elsewhere in the code, +particularly when the `EventEmitter` instance was created by some other +component or module (e.g. sockets or file streams). + +Returns a reference to the `EventEmitter` so calls can be chained. + +### emitter.removeListener(eventName, listener) + +Removes the specified `listener` from the listener array for the event named +`eventName`. + +```js +var callback = (stream) => { + console.log('someone connected!'); +}; +server.on('connection', callback); +// ... +server.removeListener('connection', callback); +``` + +`removeListener` will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified `eventName`, then `removeListener` must be +called multiple times to remove each instance. + +Note that once an event has been emitted, all listeners attached to it at the +time of emitting will be called in order. This implies that any `removeListener()` +or `removeAllListeners()` calls *after* emitting and *before* the last listener +finishes execution will not remove them from `emit()` in progress. Subsequent +events will behave as expected. + +```js +const myEmitter = new MyEmitter(); + +var callbackA = () => { + console.log('A'); + myEmitter.removeListener('event', callbackB); +}; + +var callbackB = () => { + console.log('B'); +}; + +myEmitter.on('event', callbackA); + +myEmitter.on('event', callbackB); + +// callbackA removes listener callbackB but it will still be called. +// Internal listener array at time of emit [callbackA, callbackB] +myEmitter.emit('event'); + // Prints: + // A + // B + +// callbackB is now removed. +// Internal listener array [callbackA] +myEmitter.emit('event'); + // Prints: + // A + +``` + +Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered *after* the listener +being removed. This will not impact the order in which listeners are called, +but it will means that any copies of the listener array as returned by +the `emitter.listeners()` method will need to be recreated. + +Returns a reference to the `EventEmitter` so calls can be chained. + +### emitter.setMaxListeners(n) + +By default EventEmitters will print a warning if more than `10` listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. Obviously, not all events should be limited to just 10 listeners. +The `emitter.setMaxListeners()` method allows the limit to be modified for this +specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) +for to indicate an unlimited number of listeners. + +Returns a reference to the `EventEmitter` so calls can be chained. + +[`net.Server`]: net.html#net_class_net_server +[`fs.ReadStream`]: fs.html#fs_class_fs_readstream +[`emitter.setMaxListeners(n)`]: #events_emitter_setmaxlisteners_n +[`EventEmitter.defaultMaxListeners`]: #events_eventemitter_defaultmaxlisteners +[`emitter.listenerCount()`]: #events_emitter_listenercount_eventname +[`domain`]: domain.html +[stream]: stream.html diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown deleted file mode 100644 index 6fdea6f7f0edf4..00000000000000 --- a/doc/api/fs.markdown +++ /dev/null @@ -1,1380 +0,0 @@ -# File System - - Stability: 2 - Stable - - - -File I/O is provided by simple wrappers around standard POSIX functions. To -use this module do `require('fs')`. All the methods have asynchronous and -synchronous forms. - -The asynchronous form always takes a completion callback as its last argument. -The arguments passed to the completion callback depend on the method, but the -first argument is always reserved for an exception. If the operation was -completed successfully, then the first argument will be `null` or `undefined`. - -When using the synchronous form any exceptions are immediately thrown. -You can use try/catch to handle exceptions or allow them to bubble up. - -Here is an example of the asynchronous version: - -```js -const fs = require('fs'); - -fs.unlink('/tmp/hello', (err) => { - if (err) throw err; - console.log('successfully deleted /tmp/hello'); -}); -``` - -Here is the synchronous version: - -```js -const fs = require('fs'); - -fs.unlinkSync('/tmp/hello'); -console.log('successfully deleted /tmp/hello'); -``` - -With the asynchronous methods there is no guaranteed ordering. So the -following is prone to error: - -```js -fs.rename('/tmp/hello', '/tmp/world', (err) => { - if (err) throw err; - console.log('renamed complete'); -}); -fs.stat('/tmp/world', (err, stats) => { - if (err) throw err; - console.log(`stats: ${JSON.stringify(stats)}`); -}); -``` - -It could be that `fs.stat` is executed before `fs.rename`. -The correct way to do this is to chain the callbacks. - -```js -fs.rename('/tmp/hello', '/tmp/world', (err) => { - if (err) throw err; - fs.stat('/tmp/world', (err, stats) => { - if (err) throw err; - console.log(`stats: ${JSON.stringify(stats)}`); - }); -}); -``` - -In busy processes, the programmer is _strongly encouraged_ to use the -asynchronous versions of these calls. The synchronous versions will block -the entire process until they complete--halting all connections. - -The relative path to a filename can be used. Remember, however, that this path -will be relative to `process.cwd()`. - -Most fs functions let you omit the callback argument. If you do, a default -callback is used that rethrows errors. To get a trace to the original call -site, set the `NODE_DEBUG` environment variable: - -``` -$ cat script.js -function bad() { - require('fs').readFile('/'); -} -bad(); - -$ env NODE_DEBUG=fs node script.js -fs.js:66 - throw err; - ^ -Error: EISDIR, read - at rethrow (fs.js:61:21) - at maybeCallback (fs.js:79:42) - at Object.fs.readFile (fs.js:153:18) - at bad (/path/to/script.js:2:17) - at Object. (/path/to/script.js:5:1) - -``` - -## Class: fs.FSWatcher - -Objects returned from `fs.watch()` are of this type. - -### Event: 'change' - -* `event` {String} The type of fs change -* `filename` {String | Buffer} The filename that changed (if relevant/available) - -Emitted when something changes in a watched directory or file. -See more details in [`fs.watch()`][]. - -The `filename` argument may not be provided depending on operating system -support. If `filename` is provided, it will be provided as a `Buffer` if -`fs.watch()` is called with it's `encoding` option set to `'buffer'`, otherwise -`filename` will be a string. - -```js -fs.watch('./tmp', {encoding: 'buffer'}, (event, filename) => { - if (filename) - console.log(filename); - // Prints: -}); -``` - -### Event: 'error' - -* `error` {Error} - -Emitted when an error occurs. - -### watcher.close() - -Stop watching for changes on the given `fs.FSWatcher`. - -## Class: fs.ReadStream - -`ReadStream` is a [Readable Stream][]. - -### Event: 'open' - -* `fd` {Integer} Integer file descriptor used by the ReadStream. - -Emitted when the ReadStream's file is opened. - -### readStream.path - -The path to the file the stream is reading from as specified in the first -argument to `fs.createReadStream()`. If `path` is passed as a string, then -`readStream.path` will be a string. If `path` is passed as a `Buffer`, then -`readStream.path` will be a `Buffer`. - -## Class: fs.Stats - -Objects returned from [`fs.stat()`][], [`fs.lstat()`][] and [`fs.fstat()`][] and their -synchronous counterparts are of this type. - - - `stats.isFile()` - - `stats.isDirectory()` - - `stats.isBlockDevice()` - - `stats.isCharacterDevice()` - - `stats.isSymbolicLink()` (only valid with [`fs.lstat()`][]) - - `stats.isFIFO()` - - `stats.isSocket()` - -For a regular file [`util.inspect(stats)`][] would return a string very -similar to this: - -```js -{ - dev: 2114, - ino: 48064969, - mode: 33188, - nlink: 1, - uid: 85, - gid: 100, - rdev: 0, - size: 527, - blksize: 4096, - blocks: 8, - atime: Mon, 10 Oct 2011 23:24:11 GMT, - mtime: Mon, 10 Oct 2011 23:24:11 GMT, - ctime: Mon, 10 Oct 2011 23:24:11 GMT, - birthtime: Mon, 10 Oct 2011 23:24:11 GMT -} -``` - -Please note that `atime`, `mtime`, `birthtime`, and `ctime` are -instances of [`Date`][MDN-Date] object and to compare the values of -these objects you should use appropriate methods. For most general -uses [`getTime()`][MDN-Date-getTime] will return the number of -milliseconds elapsed since _1 January 1970 00:00:00 UTC_ and this -integer should be sufficient for any comparison, however there are -additional methods which can be used for displaying fuzzy information. -More details can be found in the [MDN JavaScript Reference][MDN-Date] -page. - -### Stat Time Values - -The times in the stat object have the following semantics: - -* `atime` "Access Time" - Time when file data last accessed. Changed - by the `mknod(2)`, `utimes(2)`, and `read(2)` system calls. -* `mtime` "Modified Time" - Time when file data last modified. - Changed by the `mknod(2)`, `utimes(2)`, and `write(2)` system calls. -* `ctime` "Change Time" - Time when file status was last changed - (inode data modification). Changed by the `chmod(2)`, `chown(2)`, - `link(2)`, `mknod(2)`, `rename(2)`, `unlink(2)`, `utimes(2)`, - `read(2)`, and `write(2)` system calls. -* `birthtime` "Birth Time" - Time of file creation. Set once when the - file is created. On filesystems where birthtime is not available, - this field may instead hold either the `ctime` or - `1970-01-01T00:00Z` (ie, unix epoch timestamp `0`). Note that this - value may be greater than `atime` or `mtime` in this case. On Darwin - and other FreeBSD variants, also set if the `atime` is explicitly - set to an earlier value than the current `birthtime` using the - `utimes(2)` system call. - -Prior to Node v0.12, the `ctime` held the `birthtime` on Windows -systems. Note that as of v0.12, `ctime` is not "creation time", and -on Unix systems, it never was. - -## Class: fs.WriteStream - -`WriteStream` is a [Writable Stream][]. - -### Event: 'open' - -* `fd` {Integer} Integer file descriptor used by the WriteStream. - -Emitted when the WriteStream's file is opened. - -### writeStream.bytesWritten - -The number of bytes written so far. Does not include data that is still queued -for writing. - -### writeStream.path - -The path to the file the stream is writing to as specified in the first -argument to `fs.createWriteStream()`. If `path` is passed as a string, then -`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then -`writeStream.path` will be a `Buffer`. - -## fs.access(path[, mode], callback) - -* `path` {String | Buffer} -* `mode` {Integer} -* `callback` {Function} - -Tests a user's permissions for the file specified by `path`. `mode` is an -optional integer that specifies the accessibility checks to be performed. The -following constants define the possible values of `mode`. It is possible to -create a mask consisting of the bitwise OR of two or more values. - -- `fs.F_OK` - File is visible to the calling process. This is useful for -determining if a file exists, but says nothing about `rwx` permissions. -Default if no `mode` is specified. -- `fs.R_OK` - File can be read by the calling process. -- `fs.W_OK` - File can be written by the calling process. -- `fs.X_OK` - File can be executed by the calling process. This has no effect -on Windows (will behave like `fs.F_OK`). - -The final argument, `callback`, is a callback function that is invoked with -a possible error argument. If any of the accessibility checks fail, the error -argument will be populated. The following example checks if the file -`/etc/passwd` can be read and written by the current process. - -```js -fs.access('/etc/passwd', fs.R_OK | fs.W_OK, (err) => { - console.log(err ? 'no access!' : 'can read/write'); -}); -``` - -## fs.accessSync(path[, mode]) - -* `path` {String | Buffer} -* `mode` {Integer} - -Synchronous version of [`fs.access()`][]. This throws if any accessibility checks -fail, and does nothing otherwise. - -## fs.appendFile(file, data[, options], callback) - -* `file` {String | Buffer | Number} filename or file descriptor -* `data` {String | Buffer} -* `options` {Object | String} - * `encoding` {String | Null} default = `'utf8'` - * `mode` {Integer} default = `0o666` - * `flag` {String} default = `'a'` -* `callback` {Function} - -Asynchronously append data to a file, creating the file if it does not yet exist. -`data` can be a string or a buffer. - -Example: - -```js -fs.appendFile('message.txt', 'data to append', (err) => { - if (err) throw err; - console.log('The "data to append" was appended to file!'); -}); -``` - -If `options` is a string, then it specifies the encoding. Example: - -```js -fs.appendFile('message.txt', 'data to append', 'utf8', callback); -``` - -Any specified file descriptor has to have been opened for appending. - -_Note: Specified file descriptors will not be closed automatically._ - -## fs.appendFileSync(file, data[, options]) - -* `file` {String | Buffer} -* `data` {String | Buffer} -* `options` {Object | String} - * `encoding` {String | Null} default = `'utf8'` - * `mode` {Integer} default = `0o666` - * `flag` {String} default = `'a'` - -The synchronous version of [`fs.appendFile()`][]. Returns `undefined`. - -## fs.chmod(path, mode, callback) - -* `path` {String | Buffer} -* `mode` {Integer} -* `callback` {Function} - -Asynchronous chmod(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.chmodSync(path, mode) - -* `path` {String | Buffer} -* `mode` {Integer} - -Synchronous chmod(2). Returns `undefined`. - -## fs.chown(path, uid, gid, callback) - -* `path` {String | Buffer} -* `uid` {Integer} -* `gid` {Integer} -* `callback` {Function} - -Asynchronous chown(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.chownSync(path, uid, gid) - -* `path` {String | Buffer} -* `uid` {Integer} -* `gid` {Integer} - -Synchronous chown(2). Returns `undefined`. - -## fs.close(fd, callback) - -* `fd` {Integer} -* `callback` {Function} - -Asynchronous close(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.closeSync(fd) - -* `fd` {Integer} - -Synchronous close(2). Returns `undefined`. - -## fs.createReadStream(path[, options]) - -* `path` {String | Buffer} -* `options` {String | Object} - * `flags` {String} - * `encoding` {String} - * `fd` {Integer} - * `mode` {Integer} - * `autoClose` {Boolean} - * `start` {Integer} - * `end` {Integer} - -Returns a new [`ReadStream`][] object. (See [Readable Stream][]). - -Be aware that, unlike the default value set for `highWaterMark` on a -readable stream (16 kb), the stream returned by this method has a -default value of 64 kb for the same parameter. - -`options` is an object or string with the following defaults: - -```js -{ - flags: 'r', - encoding: null, - fd: null, - mode: 0o666, - autoClose: true -} -``` - -`options` can include `start` and `end` values to read a range of bytes from -the file instead of the entire file. Both `start` and `end` are inclusive and -start at 0. The `encoding` can be any one of those accepted by [`Buffer`][]. - -If `fd` is specified, `ReadStream` will ignore the `path` argument and will use -the specified file descriptor. This means that no `'open'` event will be emitted. -Note that `fd` should be blocking; non-blocking `fd`s should be passed to -[`net.Socket`][]. - -If `autoClose` is false, then the file descriptor won't be closed, even if -there's an error. It is your responsibility to close it and make sure -there's no file descriptor leak. If `autoClose` is set to true (default -behavior), on `error` or `end` the file descriptor will be closed -automatically. - -`mode` sets the file mode (permission and sticky bits), but only if the -file was created. - -An example to read the last 10 bytes of a file which is 100 bytes long: - -```js -fs.createReadStream('sample.txt', {start: 90, end: 99}); -``` - -If `options` is a string, then it specifies the encoding. - -## fs.createWriteStream(path[, options]) - -* `path` {String | Buffer} -* `options` {String | Object} - * `flags` {String} - * `defaultEncoding` {String} - * `fd` {Integer} - * `mode` {Integer} - * `autoClose` {Boolean} - * `start` {Integer} - -Returns a new [`WriteStream`][] object. (See [Writable Stream][]). - -`options` is an object or string with the following defaults: - -```js -{ - flags: 'w', - defaultEncoding: 'utf8', - fd: null, - mode: 0o666, - autoClose: true -} -``` - -`options` may also include a `start` option to allow writing data at -some position past the beginning of the file. Modifying a file rather -than replacing it may require a `flags` mode of `r+` rather than the -default mode `w`. The `defaultEncoding` can be any one of those accepted by [`Buffer`][]. - -If `autoClose` is set to true (default behavior) on `error` or `end` -the file descriptor will be closed automatically. If `autoClose` is false, -then the file descriptor won't be closed, even if there's an error. -It is your responsibility to close it and make sure -there's no file descriptor leak. - -Like [`ReadStream`][], if `fd` is specified, `WriteStream` will ignore the -`path` argument and will use the specified file descriptor. This means that no -`'open'` event will be emitted. Note that `fd` should be blocking; non-blocking -`fd`s should be passed to [`net.Socket`][]. - -If `options` is a string, then it specifies the encoding. - -## fs.exists(path, callback) - - Stability: 0 - Deprecated: Use [`fs.stat()`][] or [`fs.access()`][] instead. - -* `path` {String | Buffer} -* `callback` {Function} - -Test whether or not the given path exists by checking with the file system. -Then call the `callback` argument with either true or false. Example: - -```js -fs.exists('/etc/passwd', (exists) => { - console.log(exists ? 'it\'s there' : 'no passwd!'); -}); -``` - -`fs.exists()` should not be used to check if a file exists before calling -`fs.open()`. Doing so introduces a race condition since other processes may -change the file's state between the two calls. Instead, user code should -call `fs.open()` directly and handle the error raised if the file is -non-existent. - -## fs.existsSync(path) - - Stability: 0 - Deprecated: Use [`fs.statSync()`][] or [`fs.accessSync()`][] instead. - -* `path` {String | Buffer} - -Synchronous version of [`fs.exists()`][]. -Returns `true` if the file exists, `false` otherwise. - -## fs.fchmod(fd, mode, callback) - -* `fd` {Integer} -* `mode` {Integer} -* `callback` {Function} - -Asynchronous fchmod(2). No arguments other than a possible exception -are given to the completion callback. - -## fs.fchmodSync(fd, mode) - -* `fd` {Integer} -* `mode` {Integer} - -Synchronous fchmod(2). Returns `undefined`. - -## fs.fchown(fd, uid, gid, callback) - -* `fd` {Integer} -* `uid` {Integer} -* `gid` {Integer} -* `callback` {Function} - -Asynchronous fchown(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.fchownSync(fd, uid, gid) - -* `fd` {Integer} -* `uid` {Integer} -* `gid` {Integer} - -Synchronous fchown(2). Returns `undefined`. - -## fs.fdatasync(fd, callback) - -* `fd` {Integer} -* `callback` {Function} - -Asynchronous fdatasync(2). No arguments other than a possible exception are -given to the completion callback. - -## fs.fdatasyncSync(fd) - -* `fd` {Integer} - -Synchronous fdatasync(2). Returns `undefined`. - -## fs.fstat(fd, callback) - -* `fd` {Integer} -* `callback` {Function} - -Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where -`stats` is a `fs.Stats` object. `fstat()` is identical to [`stat()`][], except that -the file to be stat-ed is specified by the file descriptor `fd`. - -## fs.fstatSync(fd) - -* `fd` {Integer} - -Synchronous fstat(2). Returns an instance of `fs.Stats`. - -## fs.fsync(fd, callback) - -* `fd` {Integer} -* `callback` {Function} - -Asynchronous fsync(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.fsyncSync(fd) - -* `fd` {Integer} - -Synchronous fsync(2). Returns `undefined`. - -## fs.ftruncate(fd, len, callback) - -* `fd` {Integer} -* `len` {Integer} -* `callback` {Function} - -Asynchronous ftruncate(2). No arguments other than a possible exception are -given to the completion callback. - -## fs.ftruncateSync(fd, len) - -* `fd` {Integer} -* `len` {Integer} - -Synchronous ftruncate(2). Returns `undefined`. - -## fs.futimes(fd, atime, mtime, callback) - -* `fd` {Integer} -* `atime` {Integer} -* `mtime` {Integer} -* `callback` {Function} - -Change the file timestamps of a file referenced by the supplied file -descriptor. - -## fs.futimesSync(fd, atime, mtime) - -* `fd` {Integer} -* `atime` {Integer} -* `mtime` {Integer} - -Synchronous version of [`fs.futimes()`][]. Returns `undefined`. - -## fs.lchmod(path, mode, callback) - -* `path` {String | Buffer} -* `mode` {Integer} -* `callback` {Function} - -Asynchronous lchmod(2). No arguments other than a possible exception -are given to the completion callback. - -Only available on Mac OS X. - -## fs.lchmodSync(path, mode) - -* `path` {String | Buffer} -* `mode` {Integer} - -Synchronous lchmod(2). Returns `undefined`. - -## fs.lchown(path, uid, gid, callback) - -* `path` {String | Buffer} -* `uid` {Integer} -* `gid` {Integer} -* `callback` {Function} - -Asynchronous lchown(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.lchownSync(path, uid, gid) - -* `path` {String | Buffer} -* `uid` {Integer} -* `gid` {Integer} - -Synchronous lchown(2). Returns `undefined`. - -## fs.link(srcpath, dstpath, callback) - -* `srcpath` {String | Buffer} -* `dstpath` {String | Buffer} -* `callback` {Function} - -Asynchronous link(2). No arguments other than a possible exception are given to -the completion callback. - -## fs.linkSync(srcpath, dstpath) - -* `srcpath` {String | Buffer} -* `dstpath` {String | Buffer} - -Synchronous link(2). Returns `undefined`. - -## fs.lstat(path, callback) - -* `path` {String | Buffer} -* `callback` {Function} - -Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where -`stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if -`path` is a symbolic link, then the link itself is stat-ed, not the file that it -refers to. - -## fs.lstatSync(path) - -* `path` {String | Buffer} - -Synchronous lstat(2). Returns an instance of `fs.Stats`. - -## fs.mkdir(path[, mode], callback) - -* `path` {String | Buffer} -* `mode` {Integer} -* `callback` {Function} - -Asynchronous mkdir(2). No arguments other than a possible exception are given -to the completion callback. `mode` defaults to `0o777`. - -## fs.mkdirSync(path[, mode]) - -* `path` {String | Buffer} -* `mode` {Integer} - -Synchronous mkdir(2). Returns `undefined`. - -## fs.mkdtemp(prefix, callback) - -Creates a unique temporary directory. - -Generates six random characters to be appended behind a required -`prefix` to create a unique temporary directory. - -The created folder path is passed as a string to the callback's second -parameter. - -Example: - -```js -fs.mkdtemp('/tmp/foo-', (err, folder) => { - console.log(folder); - // Prints: /tmp/foo-itXde2 -}); -``` - -## fs.mkdtempSync(template) - -The synchronous version of [`fs.mkdtemp()`][]. Returns the created -folder path. - -## fs.open(path, flags[, mode], callback) - -* `path` {String | Buffer} -* `flags` {String | Number} -* `mode` {Integer} -* `callback` {Function} - -Asynchronous file open. See open(2). `flags` can be: - -* `'r'` - Open file for reading. -An exception occurs if the file does not exist. - -* `'r+'` - Open file for reading and writing. -An exception occurs if the file does not exist. - -* `'rs'` - Open file for reading in synchronous mode. Instructs the operating - system to bypass the local file system cache. - - This is primarily useful for opening files on NFS mounts as it allows you to - skip the potentially stale local cache. It has a very real impact on I/O - performance so don't use this flag unless you need it. - - Note that this doesn't turn `fs.open()` into a synchronous blocking call. - If that's what you want then you should be using `fs.openSync()` - -* `'rs+'` - Open file for reading and writing, telling the OS to open it - synchronously. See notes for `'rs'` about using this with caution. - -* `'w'` - Open file for writing. -The file is created (if it does not exist) or truncated (if it exists). - -* `'wx'` - Like `'w'` but fails if `path` exists. - -* `'w+'` - Open file for reading and writing. -The file is created (if it does not exist) or truncated (if it exists). - -* `'wx+'` - Like `'w+'` but fails if `path` exists. - -* `'a'` - Open file for appending. -The file is created if it does not exist. - -* `'ax'` - Like `'a'` but fails if `path` exists. - -* `'a+'` - Open file for reading and appending. -The file is created if it does not exist. - -* `'ax+'` - Like `'a+'` but fails if `path` exists. - -`mode` sets the file mode (permission and sticky bits), but only if the file was -created. It defaults to `0666`, readable and writable. - -The callback gets two arguments `(err, fd)`. - -The exclusive flag `'x'` (`O_EXCL` flag in open(2)) ensures that `path` is newly -created. On POSIX systems, `path` is considered to exist even if it is a symlink -to a non-existent file. The exclusive flag may or may not work with network file -systems. - -`flags` can also be a number as documented by open(2); commonly used constants -are available from `require('constants')`. On Windows, flags are translated to -their equivalent ones where applicable, e.g. `O_WRONLY` to `FILE_GENERIC_WRITE`, -or `O_EXCL|O_CREAT` to `CREATE_NEW`, as accepted by CreateFileW. - -On Linux, positional writes don't work when the file is opened in append mode. -The kernel ignores the position argument and always appends the data to -the end of the file. - -## fs.openSync(path, flags[, mode]) - -* `path` {String | Buffer} -* `flags` {String | Number} -* `mode` {Integer} - -Synchronous version of [`fs.open()`][]. Returns an integer representing the file -descriptor. - -## fs.read(fd, buffer, offset, length, position, callback) - -* `fd` {Integer} -* `buffer` {String | Buffer} -* `offset` {Integer} -* `length` {Integer} -* `position` {Integer} -* `callback` {Function} - -Read data from the file specified by `fd`. - -`buffer` is the buffer that the data will be written to. - -`offset` is the offset in the buffer to start writing at. - -`length` is an integer specifying the number of bytes to read. - -`position` is an integer specifying where to begin reading from in the file. -If `position` is `null`, data will be read from the current file position. - -The callback is given the three arguments, `(err, bytesRead, buffer)`. - -## fs.readdir(path[, options], callback) - -* `path` {String | Buffer} -* `options` {String | Object} - * `encoding` {String} default = `'utf8'` -* `callback` {Function} - -Asynchronous readdir(3). Reads the contents of a directory. -The callback gets two arguments `(err, files)` where `files` is an array of -the names of the files in the directory excluding `'.'` and `'..'`. - -The optional `options` argument can be a string specifying an encoding, or an -object with an `encoding` property specifying the character encoding to use for -the filenames passed to the callback. If the `encoding` is set to `'buffer'`, -the filenames returned will be passed as `Buffer` objects. - -## fs.readdirSync(path[, options]) - -* `path` {String | Buffer} -* `options` {String | Object} - * `encoding` {String} default = `'utf8'` - -Synchronous readdir(3). Returns an array of filenames excluding `'.'` and -`'..'`. - -The optional `options` argument can be a string specifying an encoding, or an -object with an `encoding` property specifying the character encoding to use for -the filenames passed to the callback. If the `encoding` is set to `'buffer'`, -the filenames returned will be passed as `Buffer` objects. - -## fs.readFile(file[, options], callback) - -* `file` {String | Buffer | Integer} filename or file descriptor -* `options` {Object | String} - * `encoding` {String | Null} default = `null` - * `flag` {String} default = `'r'` -* `callback` {Function} - -Asynchronously reads the entire contents of a file. Example: - -```js -fs.readFile('/etc/passwd', (err, data) => { - if (err) throw err; - console.log(data); -}); -``` - -The callback is passed two arguments `(err, data)`, where `data` is the -contents of the file. - -If no encoding is specified, then the raw buffer is returned. - -If `options` is a string, then it specifies the encoding. Example: - -```js -fs.readFile('/etc/passwd', 'utf8', callback); -``` - -Any specified file descriptor has to support reading. - -_Note: Specified file descriptors will not be closed automatically._ - -## fs.readFileSync(file[, options]) - -* `file` {String | Buffer | Integer} filename or file descriptor -* `options` {Object | String} - * `encoding` {String | Null} default = `null` - * `flag` {String} default = `'r'` - -Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`. - -If the `encoding` option is specified then this function returns a -string. Otherwise it returns a buffer. - -## fs.readlink(path[, options], callback) - -* `path` {String | Buffer} -* `options` {String | Object} - * `encoding` {String} default = `'utf8'` -* `callback` {Function} - -Asynchronous readlink(2). The callback gets two arguments `(err, -linkString)`. - -The optional `options` argument can be a string specifying an encoding, or an -object with an `encoding` property specifying the character encoding to use for -the link path passed to the callback. If the `encoding` is set to `'buffer'`, -the link path returned will be passed as a `Buffer` object. - -## fs.readlinkSync(path[, options]) - -* `path` {String | Buffer} -* `options` {String | Object} - * `encoding` {String} default = `'utf8'` - -Synchronous readlink(2). Returns the symbolic link's string value. - -The optional `options` argument can be a string specifying an encoding, or an -object with an `encoding` property specifying the character encoding to use for -the link path passed to the callback. If the `encoding` is set to `'buffer'`, -the link path returned will be passed as a `Buffer` object. - -## fs.realpath(path[, cache], callback) - -* `path` {String | Buffer} -* `cache` {Object} -* `callback` {Function} - -Asynchronous realpath(2). The `callback` gets two arguments `(err, -resolvedPath)`. May use `process.cwd` to resolve relative paths. `cache` is an -object literal of mapped paths that can be used to force a specific path -resolution or avoid additional `fs.stat` calls for known real paths. - -Example: - -```js -var cache = {'/etc':'/private/etc'}; -fs.realpath('/etc/passwd', cache, (err, resolvedPath) => { - if (err) throw err; - console.log(resolvedPath); -}); -``` - -## fs.readSync(fd, buffer, offset, length, position) - -* `fd` {Integer} -* `buffer` {String | Buffer} -* `offset` {Integer} -* `length` {Integer} -* `position` {Integer} - -Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. - -## fs.realpathSync(path[, cache]) - -* `path` {String | Buffer}; -* `cache` {Object} - -Synchronous realpath(2). Returns the resolved path. `cache` is an -object literal of mapped paths that can be used to force a specific path -resolution or avoid additional `fs.stat` calls for known real paths. - -## fs.rename(oldPath, newPath, callback) - -* `oldPath` {String | Buffer} -* `newPath` {String | Buffer} -* `callback` {Function} - -Asynchronous rename(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.renameSync(oldPath, newPath) - -* `oldPath` {String | Buffer} -* `newPath` {String | Buffer} - -Synchronous rename(2). Returns `undefined`. - -## fs.rmdir(path, callback) - -* `path` {String | Buffer} -* `callback` {Function} - -Asynchronous rmdir(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.rmdirSync(path) - -* `path` {String | Buffer} - -Synchronous rmdir(2). Returns `undefined`. - -## fs.stat(path, callback) - -* `path` {String | Buffer} -* `callback` {Function} - -Asynchronous stat(2). The callback gets two arguments `(err, stats)` where -`stats` is a [`fs.Stats`][] object. See the [`fs.Stats`][] section for more -information. - -## fs.statSync(path) - -* `path` {String | Buffer} - -Synchronous stat(2). Returns an instance of [`fs.Stats`][]. - -## fs.symlink(target, path[, type], callback) - -* `target` {String | Buffer} -* `path` {String | Buffer} -* `type` {String} -* `callback` {Function} - -Asynchronous symlink(2). No arguments other than a possible exception are given -to the completion callback. -The `type` argument can be set to `'dir'`, `'file'`, or `'junction'` (default -is `'file'`) and is only available on Windows (ignored on other platforms). -Note that Windows junction points require the destination path to be absolute. When using -`'junction'`, the `target` argument will automatically be normalized to absolute path. - -Here is an example below: - -```js -fs.symlink('./foo', './new-port'); -``` - -It creates a symbolic link named "new-port" that points to "foo". - -## fs.symlinkSync(target, path[, type]) - -* `target` {String | Buffer} -* `path` {String | Buffer} -* `type` {String} - -Synchronous symlink(2). Returns `undefined`. - -## fs.truncate(path, len, callback) - -* `path` {String | Buffer} -* `len` {Integer} -* `callback` {Function} - -Asynchronous truncate(2). No arguments other than a possible exception are -given to the completion callback. A file descriptor can also be passed as the -first argument. In this case, `fs.ftruncate()` is called. - -## fs.truncateSync(path, len) - -* `path` {String | Buffer} -* `len` {Integer} - -Synchronous truncate(2). Returns `undefined`. - -## fs.unlink(path, callback) - -* `path` {String | Buffer} -* `callback` {Function} - -Asynchronous unlink(2). No arguments other than a possible exception are given -to the completion callback. - -## fs.unlinkSync(path) - -* `path` {String | Buffer} - -Synchronous unlink(2). Returns `undefined`. - -## fs.unwatchFile(filename[, listener]) - -* `filename` {String | Buffer} -* `listener` {Function} - -Stop watching for changes on `filename`. If `listener` is specified, only that -particular listener is removed. Otherwise, *all* listeners are removed and you -have effectively stopped watching `filename`. - -Calling `fs.unwatchFile()` with a filename that is not being watched is a -no-op, not an error. - -_Note: [`fs.watch()`][] is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. -`fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` -when possible._ - -## fs.utimes(path, atime, mtime, callback) - -* `path` {String | Buffer} -* `atime` {Integer} -* `mtime` {Integer} -* `callback` {Function} - -Change file timestamps of the file referenced by the supplied path. - -Note: the arguments `atime` and `mtime` of the following related functions does -follow the below rules: - -- If the value is a numberable string like `'123456789'`, the value would get - converted to corresponding number. -- If the value is `NaN` or `Infinity`, the value would get converted to - `Date.now()`. - -## fs.utimesSync(path, atime, mtime) - -* `path` {String | Buffer} -* `atime` {Integer} -* `mtime` {Integer} - -Synchronous version of [`fs.utimes()`][]. Returns `undefined`. - -## fs.watch(filename[, options][, listener]) - -* `filename` {String | Buffer} -* `options` {String | Object} - * `persistent` {Boolean} Indicates whether the process should continue to run - as long as files are being watched. default = `true` - * `recursive` {Boolean} Indicates whether all subdirectories should be - watched, or only the current directory. The applies when a directory is - specified, and only on supported platforms (See [Caveats][]). default = - `false` - * `encoding` {String} Specifies the character encoding to be used for the - filename passed to the listener. default = `'utf8'` -* `listener` {Function} - -Watch for changes on `filename`, where `filename` is either a file or a -directory. The returned object is a [`fs.FSWatcher`][]. - -The second argument is optional. If `options` is provided as a string, it -specifies the `encoding`. Otherwise `options` should be passed as an object. - -The listener callback gets two arguments `(event, filename)`. `event` is either -`'rename'` or `'change'`, and `filename` is the name of the file which triggered -the event. - -### Caveats - - - -The `fs.watch` API is not 100% consistent across platforms, and is -unavailable in some situations. - -The recursive option is only supported on OS X and Windows. - -#### Availability - - - -This feature depends on the underlying operating system providing a way -to be notified of filesystem changes. - -* On Linux systems, this uses `inotify`. -* On BSD systems, this uses `kqueue`. -* On OS X, this uses `kqueue` for files and 'FSEvents' for directories. -* On SunOS systems (including Solaris and SmartOS), this uses `event ports`. -* On Windows systems, this feature depends on `ReadDirectoryChangesW`. - -If the underlying functionality is not available for some reason, then -`fs.watch` will not be able to function. For example, watching files or -directories on network file systems (NFS, SMB, etc.) often doesn't work -reliably or at all. - -You can still use `fs.watchFile`, which uses stat polling, but it is slower and -less reliable. - -#### Filename Argument - - - -Providing `filename` argument in the callback is only supported on Linux and -Windows. Even on supported platforms, `filename` is not always guaranteed to -be provided. Therefore, don't assume that `filename` argument is always -provided in the callback, and have some fallback logic if it is null. - -```js -fs.watch('somedir', (event, filename) => { - console.log(`event is: ${event}`); - if (filename) { - console.log(`filename provided: ${filename}`); - } else { - console.log('filename not provided'); - } -}); -``` - -## fs.watchFile(filename[, options], listener) - -* `filename` {String | Buffer} -* `options` {Object} - * `persistent` {Boolean} - * `interval` {Integer} -* `listener` {Function} - -Watch for changes on `filename`. The callback `listener` will be called each -time the file is accessed. - -The `options` argument may be omitted. If provided, it should be an object. The -`options` object may contain a boolean named `persistent` that indicates -whether the process should continue to run as long as files are being watched. -The `options` object may specify an `interval` property indicating how often the -target should be polled in milliseconds. The default is -`{ persistent: true, interval: 5007 }`. - -The `listener` gets two arguments the current stat object and the previous -stat object: - -```js -fs.watchFile('message.text', (curr, prev) => { - console.log(`the current mtime is: ${curr.mtime}`); - console.log(`the previous mtime was: ${prev.mtime}`); -}); -``` - -These stat objects are instances of `fs.Stat`. - -If you want to be notified when the file was modified, not just accessed, -you need to compare `curr.mtime` and `prev.mtime`. - -_Note: when an `fs.watchFile` operation results in an `ENOENT` error, it will - invoke the listener once, with all the fields zeroed (or, for dates, the Unix - Epoch). In Windows, `blksize` and `blocks` fields will be `undefined`, instead - of zero. If the file is created later on, the listener will be called again, - with the latest stat objects. This is a change in functionality since v0.10._ - -_Note: [`fs.watch()`][] is more efficient than `fs.watchFile` and `fs.unwatchFile`. -`fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` -when possible._ - -## fs.write(fd, buffer, offset, length[, position], callback) - -* `fd` {Integer} -* `buffer` {String | Buffer} -* `offset` {Integer} -* `length` {Integer} -* `position` {Integer} -* `callback` {Function} - -Write `buffer` to the file specified by `fd`. - -`offset` and `length` determine the part of the buffer to be written. - -`position` refers to the offset from the beginning of the file where this data -should be written. If `typeof position !== 'number'`, the data will be written -at the current position. See pwrite(2). - -The callback will be given three arguments `(err, written, buffer)` where -`written` specifies how many _bytes_ were written from `buffer`. - -Note that it is unsafe to use `fs.write` multiple times on the same file -without waiting for the callback. For this scenario, -`fs.createWriteStream` is strongly recommended. - -On Linux, positional writes don't work when the file is opened in append mode. -The kernel ignores the position argument and always appends the data to -the end of the file. - -## fs.write(fd, data[, position[, encoding]], callback) - -* `fd` {Integer} -* `data` {String | Buffer} -* `position` {Integer} -* `encoding` {String} -* `callback` {Function} - -Write `data` to the file specified by `fd`. If `data` is not a Buffer instance -then the value will be coerced to a string. - -`position` refers to the offset from the beginning of the file where this data -should be written. If `typeof position !== 'number'` the data will be written at -the current position. See pwrite(2). - -`encoding` is the expected string encoding. - -The callback will receive the arguments `(err, written, string)` where `written` -specifies how many _bytes_ the passed string required to be written. Note that -bytes written is not the same as string characters. See [`Buffer.byteLength`][]. - -Unlike when writing `buffer`, the entire string must be written. No substring -may be specified. This is because the byte offset of the resulting data may not -be the same as the string offset. - -Note that it is unsafe to use `fs.write` multiple times on the same file -without waiting for the callback. For this scenario, -`fs.createWriteStream` is strongly recommended. - -On Linux, positional writes don't work when the file is opened in append mode. -The kernel ignores the position argument and always appends the data to -the end of the file. - -## fs.writeFile(file, data[, options], callback) - -* `file` {String | Buffer | Integer} filename or file descriptor -* `data` {String | Buffer} -* `options` {Object | String} - * `encoding` {String | Null} default = `'utf8'` - * `mode` {Integer} default = `0o666` - * `flag` {String} default = `'w'` -* `callback` {Function} - -Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string or a buffer. - -The `encoding` option is ignored if `data` is a buffer. It defaults -to `'utf8'`. - -Example: - -```js -fs.writeFile('message.txt', 'Hello Node.js', (err) => { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -If `options` is a string, then it specifies the encoding. Example: - -```js -fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback); -``` - -Any specified file descriptor has to support writing. - -Note that it is unsafe to use `fs.writeFile` multiple times on the same file -without waiting for the callback. For this scenario, -`fs.createWriteStream` is strongly recommended. - -_Note: Specified file descriptors will not be closed automatically._ - -## fs.writeFileSync(file, data[, options]) - -* `file` {String | Buffer | Integer} filename or file descriptor -* `data` {String | Buffer} -* `options` {Object | String} - * `encoding` {String | Null} default = `'utf8'` - * `mode` {Integer} default = `0o666` - * `flag` {String} default = `'w'` - -The synchronous version of [`fs.writeFile()`][]. Returns `undefined`. - -## fs.writeSync(fd, buffer, offset, length[, position]) - -* `fd` {Integer} -* `buffer` {String | Buffer} -* `offset` {Integer} -* `length` {Integer} -* `position` {Integer} - -## fs.writeSync(fd, data[, position[, encoding]]) - -* `fd` {Integer} -* `data` {String | Buffer} -* `position` {Integer} -* `encoding` {String} - -Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. - -[`Buffer.byteLength`]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding -[`Buffer`]: buffer.html#buffer_buffer -[Caveats]: #fs_caveats -[`fs.access()`]: #fs_fs_access_path_mode_callback -[`fs.accessSync()`]: #fs_fs_accesssync_path_mode -[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback -[`fs.exists()`]: fs.html#fs_fs_exists_path_callback -[`fs.fstat()`]: #fs_fs_fstat_fd_callback -[`fs.FSWatcher`]: #fs_class_fs_fswatcher -[`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback -[`fs.lstat()`]: #fs_fs_lstat_path_callback -[`fs.open()`]: #fs_fs_open_path_flags_mode_callback -[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback -[`fs.readFile`]: #fs_fs_readfile_file_options_callback -[`fs.stat()`]: #fs_fs_stat_path_callback -[`fs.Stats`]: #fs_class_fs_stats -[`fs.statSync()`]: #fs_fs_statsync_path -[`fs.utimes()`]: #fs_fs_futimes_fd_atime_mtime_callback -[`fs.watch()`]: #fs_fs_watch_filename_options_listener -[`fs.write()`]: #fs_fs_write_fd_buffer_offset_length_position_callback -[`fs.writeFile()`]: #fs_fs_writefile_file_data_options_callback -[`net.Socket`]: net.html#net_class_net_socket -[`ReadStream`]: #fs_class_fs_readstream -[`stat()`]: fs.html#fs_fs_stat_path_callback -[`util.inspect(stats)`]: util.html#util_util_inspect_object_options -[`WriteStream`]: #fs_class_fs_writestream -[MDN-Date-getTime]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime -[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date -[Readable Stream]: stream.html#stream_class_stream_readable -[Writable Stream]: stream.html#stream_class_stream_writable diff --git a/doc/api/fs.md b/doc/api/fs.md new file mode 100644 index 00000000000000..1e2b85ae6e4210 --- /dev/null +++ b/doc/api/fs.md @@ -0,0 +1,1726 @@ +# File System + + Stability: 2 - Stable + + + +File I/O is provided by simple wrappers around standard POSIX functions. To +use this module do `require('fs')`. All the methods have asynchronous and +synchronous forms. + +The asynchronous form always takes a completion callback as its last argument. +The arguments passed to the completion callback depend on the method, but the +first argument is always reserved for an exception. If the operation was +completed successfully, then the first argument will be `null` or `undefined`. + +When using the synchronous form any exceptions are immediately thrown. +You can use try/catch to handle exceptions or allow them to bubble up. + +Here is an example of the asynchronous version: + +```js +const fs = require('fs'); + +fs.unlink('/tmp/hello', (err) => { + if (err) throw err; + console.log('successfully deleted /tmp/hello'); +}); +``` + +Here is the synchronous version: + +```js +const fs = require('fs'); + +fs.unlinkSync('/tmp/hello'); +console.log('successfully deleted /tmp/hello'); +``` + +With the asynchronous methods there is no guaranteed ordering. So the +following is prone to error: + +```js +fs.rename('/tmp/hello', '/tmp/world', (err) => { + if (err) throw err; + console.log('renamed complete'); +}); +fs.stat('/tmp/world', (err, stats) => { + if (err) throw err; + console.log(`stats: ${JSON.stringify(stats)}`); +}); +``` + +It could be that `fs.stat` is executed before `fs.rename`. +The correct way to do this is to chain the callbacks. + +```js +fs.rename('/tmp/hello', '/tmp/world', (err) => { + if (err) throw err; + fs.stat('/tmp/world', (err, stats) => { + if (err) throw err; + console.log(`stats: ${JSON.stringify(stats)}`); + }); +}); +``` + +In busy processes, the programmer is _strongly encouraged_ to use the +asynchronous versions of these calls. The synchronous versions will block +the entire process until they complete--halting all connections. + +The relative path to a filename can be used. Remember, however, that this path +will be relative to `process.cwd()`. + +Most fs functions let you omit the callback argument. If you do, a default +callback is used that rethrows errors. To get a trace to the original call +site, set the `NODE_DEBUG` environment variable: + +``` +$ cat script.js +function bad() { + require('fs').readFile('/'); +} +bad(); + +$ env NODE_DEBUG=fs node script.js +fs.js:88 + throw backtrace; + ^ +Error: EISDIR: illegal operation on a directory, read + +``` + +## Buffer API + + +`fs` functions support passing and receiving paths as both strings +and Buffers. The latter is intended to make it possible to work with +filesystems that allow for non-UTF-8 filenames. For most typical +uses, working with paths as Buffers will be unnecessary, as the string +API converts to and from UTF-8 automatically. + +*Note* that on certain file systems (such as NTFS and HFS+) filenames +will always be encoded as UTF-8. On such file systems, passing +non-UTF-8 encoded Buffers to `fs` functions will not work as expected. + +## Class: fs.FSWatcher + + +Objects returned from `fs.watch()` are of this type. + +### Event: 'change' + + +* `event` {String} The type of fs change +* `filename` {String | Buffer} The filename that changed (if relevant/available) + +Emitted when something changes in a watched directory or file. +See more details in [`fs.watch()`][]. + +The `filename` argument may not be provided depending on operating system +support. If `filename` is provided, it will be provided as a `Buffer` if +`fs.watch()` is called with it's `encoding` option set to `'buffer'`, otherwise +`filename` will be a string. + +```js +fs.watch('./tmp', {encoding: 'buffer'}, (event, filename) => { + if (filename) + console.log(filename); + // Prints: +}); +``` + +### Event: 'error' + + +* `error` {Error} + +Emitted when an error occurs. + +### watcher.close() + + +Stop watching for changes on the given `fs.FSWatcher`. + +## Class: fs.ReadStream + + +`ReadStream` is a [Readable Stream][]. + +### Event: 'open' + + +* `fd` {Integer} Integer file descriptor used by the ReadStream. + +Emitted when the ReadStream's file is opened. + +### Event: 'close' + + +Emitted when the `ReadStream`'s underlying file descriptor has been closed +using the `fs.close()` method. + +### readStream.path + + +The path to the file the stream is reading from as specified in the first +argument to `fs.createReadStream()`. If `path` is passed as a string, then +`readStream.path` will be a string. If `path` is passed as a `Buffer`, then +`readStream.path` will be a `Buffer`. + +## Class: fs.Stats + + +Objects returned from [`fs.stat()`][], [`fs.lstat()`][] and [`fs.fstat()`][] and their +synchronous counterparts are of this type. + + - `stats.isFile()` + - `stats.isDirectory()` + - `stats.isBlockDevice()` + - `stats.isCharacterDevice()` + - `stats.isSymbolicLink()` (only valid with [`fs.lstat()`][]) + - `stats.isFIFO()` + - `stats.isSocket()` + +For a regular file [`util.inspect(stats)`][] would return a string very +similar to this: + +```js +{ + dev: 2114, + ino: 48064969, + mode: 33188, + nlink: 1, + uid: 85, + gid: 100, + rdev: 0, + size: 527, + blksize: 4096, + blocks: 8, + atime: Mon, 10 Oct 2011 23:24:11 GMT, + mtime: Mon, 10 Oct 2011 23:24:11 GMT, + ctime: Mon, 10 Oct 2011 23:24:11 GMT, + birthtime: Mon, 10 Oct 2011 23:24:11 GMT +} +``` + +Please note that `atime`, `mtime`, `birthtime`, and `ctime` are +instances of [`Date`][MDN-Date] object and to compare the values of +these objects you should use appropriate methods. For most general +uses [`getTime()`][MDN-Date-getTime] will return the number of +milliseconds elapsed since _1 January 1970 00:00:00 UTC_ and this +integer should be sufficient for any comparison, however there are +additional methods which can be used for displaying fuzzy information. +More details can be found in the [MDN JavaScript Reference][MDN-Date] +page. + +### Stat Time Values + +The times in the stat object have the following semantics: + +* `atime` "Access Time" - Time when file data last accessed. Changed + by the `mknod(2)`, `utimes(2)`, and `read(2)` system calls. +* `mtime` "Modified Time" - Time when file data last modified. + Changed by the `mknod(2)`, `utimes(2)`, and `write(2)` system calls. +* `ctime` "Change Time" - Time when file status was last changed + (inode data modification). Changed by the `chmod(2)`, `chown(2)`, + `link(2)`, `mknod(2)`, `rename(2)`, `unlink(2)`, `utimes(2)`, + `read(2)`, and `write(2)` system calls. +* `birthtime` "Birth Time" - Time of file creation. Set once when the + file is created. On filesystems where birthtime is not available, + this field may instead hold either the `ctime` or + `1970-01-01T00:00Z` (ie, unix epoch timestamp `0`). Note that this + value may be greater than `atime` or `mtime` in this case. On Darwin + and other FreeBSD variants, also set if the `atime` is explicitly + set to an earlier value than the current `birthtime` using the + `utimes(2)` system call. + +Prior to Node v0.12, the `ctime` held the `birthtime` on Windows +systems. Note that as of v0.12, `ctime` is not "creation time", and +on Unix systems, it never was. + +## Class: fs.WriteStream + + +`WriteStream` is a [Writable Stream][]. + +### Event: 'open' + + +* `fd` {Integer} Integer file descriptor used by the WriteStream. + +Emitted when the WriteStream's file is opened. + +### Event: 'close' + + +Emitted when the `WriteStream`'s underlying file descriptor has been closed +using the `fs.close()` method. + +### writeStream.bytesWritten + + +The number of bytes written so far. Does not include data that is still queued +for writing. + +### writeStream.path + + +The path to the file the stream is writing to as specified in the first +argument to `fs.createWriteStream()`. If `path` is passed as a string, then +`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then +`writeStream.path` will be a `Buffer`. + +## fs.access(path[, mode], callback) + + +* `path` {String | Buffer} +* `mode` {Integer} +* `callback` {Function} + +Tests a user's permissions for the file specified by `path`. `mode` is an +optional integer that specifies the accessibility checks to be performed. The +following constants define the possible values of `mode`. It is possible to +create a mask consisting of the bitwise OR of two or more values. + +- `fs.F_OK` - File is visible to the calling process. This is useful for +determining if a file exists, but says nothing about `rwx` permissions. +Default if no `mode` is specified. +- `fs.R_OK` - File can be read by the calling process. +- `fs.W_OK` - File can be written by the calling process. +- `fs.X_OK` - File can be executed by the calling process. This has no effect +on Windows (will behave like `fs.F_OK`). + +The final argument, `callback`, is a callback function that is invoked with +a possible error argument. If any of the accessibility checks fail, the error +argument will be populated. The following example checks if the file +`/etc/passwd` can be read and written by the current process. + +```js +fs.access('/etc/passwd', fs.R_OK | fs.W_OK, (err) => { + console.log(err ? 'no access!' : 'can read/write'); +}); +``` + +## fs.accessSync(path[, mode]) + + +* `path` {String | Buffer} +* `mode` {Integer} + +Synchronous version of [`fs.access()`][]. This throws if any accessibility checks +fail, and does nothing otherwise. + +## fs.appendFile(file, data[, options], callback) + + +* `file` {String | Buffer | Number} filename or file descriptor +* `data` {String | Buffer} +* `options` {Object | String} + * `encoding` {String | Null} default = `'utf8'` + * `mode` {Integer} default = `0o666` + * `flag` {String} default = `'a'` +* `callback` {Function} + +Asynchronously append data to a file, creating the file if it does not yet exist. +`data` can be a string or a buffer. + +Example: + +```js +fs.appendFile('message.txt', 'data to append', (err) => { + if (err) throw err; + console.log('The "data to append" was appended to file!'); +}); +``` + +If `options` is a string, then it specifies the encoding. Example: + +```js +fs.appendFile('message.txt', 'data to append', 'utf8', callback); +``` + +Any specified file descriptor has to have been opened for appending. + +_Note: Specified file descriptors will not be closed automatically._ + +## fs.appendFileSync(file, data[, options]) + + +* `file` {String | Buffer | Number} filename or file descriptor +* `data` {String | Buffer} +* `options` {Object | String} + * `encoding` {String | Null} default = `'utf8'` + * `mode` {Integer} default = `0o666` + * `flag` {String} default = `'a'` + +The synchronous version of [`fs.appendFile()`][]. Returns `undefined`. + +## fs.chmod(path, mode, callback) + + +* `path` {String | Buffer} +* `mode` {Integer} +* `callback` {Function} + +Asynchronous chmod(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.chmodSync(path, mode) + + +* `path` {String | Buffer} +* `mode` {Integer} + +Synchronous chmod(2). Returns `undefined`. + +## fs.chown(path, uid, gid, callback) + + +* `path` {String | Buffer} +* `uid` {Integer} +* `gid` {Integer} +* `callback` {Function} + +Asynchronous chown(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.chownSync(path, uid, gid) + + +* `path` {String | Buffer} +* `uid` {Integer} +* `gid` {Integer} + +Synchronous chown(2). Returns `undefined`. + +## fs.close(fd, callback) + + +* `fd` {Integer} +* `callback` {Function} + +Asynchronous close(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.closeSync(fd) + + +* `fd` {Integer} + +Synchronous close(2). Returns `undefined`. + +## fs.createReadStream(path[, options]) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `flags` {String} + * `encoding` {String} + * `fd` {Integer} + * `mode` {Integer} + * `autoClose` {Boolean} + * `start` {Integer} + * `end` {Integer} + +Returns a new [`ReadStream`][] object. (See [Readable Stream][]). + +Be aware that, unlike the default value set for `highWaterMark` on a +readable stream (16 kb), the stream returned by this method has a +default value of 64 kb for the same parameter. + +`options` is an object or string with the following defaults: + +```js +{ + flags: 'r', + encoding: null, + fd: null, + mode: 0o666, + autoClose: true +} +``` + +`options` can include `start` and `end` values to read a range of bytes from +the file instead of the entire file. Both `start` and `end` are inclusive and +start at 0. The `encoding` can be any one of those accepted by [`Buffer`][]. + +If `fd` is specified, `ReadStream` will ignore the `path` argument and will use +the specified file descriptor. This means that no `'open'` event will be emitted. +Note that `fd` should be blocking; non-blocking `fd`s should be passed to +[`net.Socket`][]. + +If `autoClose` is false, then the file descriptor won't be closed, even if +there's an error. It is your responsibility to close it and make sure +there's no file descriptor leak. If `autoClose` is set to true (default +behavior), on `error` or `end` the file descriptor will be closed +automatically. + +`mode` sets the file mode (permission and sticky bits), but only if the +file was created. + +An example to read the last 10 bytes of a file which is 100 bytes long: + +```js +fs.createReadStream('sample.txt', {start: 90, end: 99}); +``` + +If `options` is a string, then it specifies the encoding. + +## fs.createWriteStream(path[, options]) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `flags` {String} + * `defaultEncoding` {String} + * `fd` {Integer} + * `mode` {Integer} + * `autoClose` {Boolean} + * `start` {Integer} + +Returns a new [`WriteStream`][] object. (See [Writable Stream][]). + +`options` is an object or string with the following defaults: + +```js +{ + flags: 'w', + defaultEncoding: 'utf8', + fd: null, + mode: 0o666, + autoClose: true +} +``` + +`options` may also include a `start` option to allow writing data at +some position past the beginning of the file. Modifying a file rather +than replacing it may require a `flags` mode of `r+` rather than the +default mode `w`. The `defaultEncoding` can be any one of those accepted by [`Buffer`][]. + +If `autoClose` is set to true (default behavior) on `error` or `end` +the file descriptor will be closed automatically. If `autoClose` is false, +then the file descriptor won't be closed, even if there's an error. +It is your responsibility to close it and make sure +there's no file descriptor leak. + +Like [`ReadStream`][], if `fd` is specified, `WriteStream` will ignore the +`path` argument and will use the specified file descriptor. This means that no +`'open'` event will be emitted. Note that `fd` should be blocking; non-blocking +`fd`s should be passed to [`net.Socket`][]. + +If `options` is a string, then it specifies the encoding. + +## fs.exists(path, callback) + + + Stability: 0 - Deprecated: Use [`fs.stat()`][] or [`fs.access()`][] instead. + +* `path` {String | Buffer} +* `callback` {Function} + +Test whether or not the given path exists by checking with the file system. +Then call the `callback` argument with either true or false. Example: + +```js +fs.exists('/etc/passwd', (exists) => { + console.log(exists ? 'it\'s there' : 'no passwd!'); +}); +``` + +`fs.exists()` should not be used to check if a file exists before calling +`fs.open()`. Doing so introduces a race condition since other processes may +change the file's state between the two calls. Instead, user code should +call `fs.open()` directly and handle the error raised if the file is +non-existent. + +## fs.existsSync(path) + + + Stability: 0 - Deprecated: Use [`fs.statSync()`][] or [`fs.accessSync()`][] instead. + +* `path` {String | Buffer} + +Synchronous version of [`fs.exists()`][]. +Returns `true` if the file exists, `false` otherwise. + +## fs.fchmod(fd, mode, callback) + + +* `fd` {Integer} +* `mode` {Integer} +* `callback` {Function} + +Asynchronous fchmod(2). No arguments other than a possible exception +are given to the completion callback. + +## fs.fchmodSync(fd, mode) + + +* `fd` {Integer} +* `mode` {Integer} + +Synchronous fchmod(2). Returns `undefined`. + +## fs.fchown(fd, uid, gid, callback) + + +* `fd` {Integer} +* `uid` {Integer} +* `gid` {Integer} +* `callback` {Function} + +Asynchronous fchown(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.fchownSync(fd, uid, gid) + + +* `fd` {Integer} +* `uid` {Integer} +* `gid` {Integer} + +Synchronous fchown(2). Returns `undefined`. + +## fs.fdatasync(fd, callback) + + +* `fd` {Integer} +* `callback` {Function} + +Asynchronous fdatasync(2). No arguments other than a possible exception are +given to the completion callback. + +## fs.fdatasyncSync(fd) + + +* `fd` {Integer} + +Synchronous fdatasync(2). Returns `undefined`. + +## fs.fstat(fd, callback) + + +* `fd` {Integer} +* `callback` {Function} + +Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where +`stats` is a [`fs.Stats`][] object. `fstat()` is identical to [`stat()`][], +except that the file to be stat-ed is specified by the file descriptor `fd`. + +## fs.fstatSync(fd) + + +* `fd` {Integer} + +Synchronous fstat(2). Returns an instance of `fs.Stats`. + +## fs.fsync(fd, callback) + + +* `fd` {Integer} +* `callback` {Function} + +Asynchronous fsync(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.fsyncSync(fd) + + +* `fd` {Integer} + +Synchronous fsync(2). Returns `undefined`. + +## fs.ftruncate(fd, len, callback) + + +* `fd` {Integer} +* `len` {Integer} +* `callback` {Function} + +Asynchronous ftruncate(2). No arguments other than a possible exception are +given to the completion callback. + +## fs.ftruncateSync(fd, len) + + +* `fd` {Integer} +* `len` {Integer} + +Synchronous ftruncate(2). Returns `undefined`. + +## fs.futimes(fd, atime, mtime, callback) + + +* `fd` {Integer} +* `atime` {Integer} +* `mtime` {Integer} +* `callback` {Function} + +Change the file timestamps of a file referenced by the supplied file +descriptor. + +## fs.futimesSync(fd, atime, mtime) + + +* `fd` {Integer} +* `atime` {Integer} +* `mtime` {Integer} + +Synchronous version of [`fs.futimes()`][]. Returns `undefined`. + +## fs.lchmod(path, mode, callback) + + +* `path` {String | Buffer} +* `mode` {Integer} +* `callback` {Function} + +Asynchronous lchmod(2). No arguments other than a possible exception +are given to the completion callback. + +Only available on Mac OS X. + +## fs.lchmodSync(path, mode) + + +* `path` {String | Buffer} +* `mode` {Integer} + +Synchronous lchmod(2). Returns `undefined`. + +## fs.lchown(path, uid, gid, callback) + + +* `path` {String | Buffer} +* `uid` {Integer} +* `gid` {Integer} +* `callback` {Function} + +Asynchronous lchown(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.lchownSync(path, uid, gid) + + +* `path` {String | Buffer} +* `uid` {Integer} +* `gid` {Integer} + +Synchronous lchown(2). Returns `undefined`. + +## fs.link(srcpath, dstpath, callback) + + +* `srcpath` {String | Buffer} +* `dstpath` {String | Buffer} +* `callback` {Function} + +Asynchronous link(2). No arguments other than a possible exception are given to +the completion callback. + +## fs.linkSync(srcpath, dstpath) + + +* `srcpath` {String | Buffer} +* `dstpath` {String | Buffer} + +Synchronous link(2). Returns `undefined`. + +## fs.lstat(path, callback) + + +* `path` {String | Buffer} +* `callback` {Function} + +Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where +`stats` is a [`fs.Stats`][] object. `lstat()` is identical to `stat()`, +except that if `path` is a symbolic link, then the link itself is stat-ed, +not the file that it refers to. + +## fs.lstatSync(path) + + +* `path` {String | Buffer} + +Synchronous lstat(2). Returns an instance of `fs.Stats`. + +## fs.mkdir(path[, mode], callback) + + +* `path` {String | Buffer} +* `mode` {Integer} +* `callback` {Function} + +Asynchronous mkdir(2). No arguments other than a possible exception are given +to the completion callback. `mode` defaults to `0o777`. + +## fs.mkdirSync(path[, mode]) + + +* `path` {String | Buffer} +* `mode` {Integer} + +Synchronous mkdir(2). Returns `undefined`. + +## fs.mkdtemp(prefix, callback) + + +Creates a unique temporary directory. + +Generates six random characters to be appended behind a required +`prefix` to create a unique temporary directory. + +The created folder path is passed as a string to the callback's second +parameter. + +Example: + +```js +fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 +}); +``` + +*Note*: The `fs.mkdtemp()` method will append the six randomly selected +characters directly to the `prefix` string. For instance, given a directory +`/tmp`, if the intention is to create a temporary directory *within* `/tmp`, +the `prefix` *must* end with a trailing platform-specific path separator +(`require('path').sep`). + +```js +// The parent directory for the new temporary directory +const tmpDir = '/tmp'; + +// This method is *INCORRECT*: +fs.mkdtemp(tmpDir, (err, folder) => { + if (err) throw err; + console.log(folder); + // Will print something similar to `/tmpabc123`. + // Note that a new temporary directory is created + // at the file system root rather than *within* + // the /tmp directory. +}); + +// This method is *CORRECT*: +const path = require('path'); +fs.mkdtemp(tmpDir + path.sep, (err, folder) => { + if (err) throw err; + console.log(folder); + // Will print something similar to `/tmp/abc123`. + // A new temporary directory is created within + // the /tmp directory. +}); +``` + +## fs.mkdtempSync(prefix) + + +The synchronous version of [`fs.mkdtemp()`][]. Returns the created +folder path. + +## fs.open(path, flags[, mode], callback) + + +* `path` {String | Buffer} +* `flags` {String | Number} +* `mode` {Integer} +* `callback` {Function} + +Asynchronous file open. See open(2). `flags` can be: + +* `'r'` - Open file for reading. +An exception occurs if the file does not exist. + +* `'r+'` - Open file for reading and writing. +An exception occurs if the file does not exist. + +* `'rs+'` - Open file for reading and writing in synchronous mode. Instructs + the operating system to bypass the local file system cache. + + This is primarily useful for opening files on NFS mounts as it allows you to + skip the potentially stale local cache. It has a very real impact on I/O + performance so don't use this flag unless you need it. + + Note that this doesn't turn `fs.open()` into a synchronous blocking call. + If that's what you want then you should be using `fs.openSync()` + +* `'w'` - Open file for writing. +The file is created (if it does not exist) or truncated (if it exists). + +* `'wx'` - Like `'w'` but fails if `path` exists. + +* `'w+'` - Open file for reading and writing. +The file is created (if it does not exist) or truncated (if it exists). + +* `'wx+'` - Like `'w+'` but fails if `path` exists. + +* `'a'` - Open file for appending. +The file is created if it does not exist. + +* `'ax'` - Like `'a'` but fails if `path` exists. + +* `'a+'` - Open file for reading and appending. +The file is created if it does not exist. + +* `'ax+'` - Like `'a+'` but fails if `path` exists. + +`mode` sets the file mode (permission and sticky bits), but only if the file was +created. It defaults to `0666`, readable and writable. + +The callback gets two arguments `(err, fd)`. + +The exclusive flag `'x'` (`O_EXCL` flag in open(2)) ensures that `path` is newly +created. On POSIX systems, `path` is considered to exist even if it is a symlink +to a non-existent file. The exclusive flag may or may not work with network file +systems. + +`flags` can also be a number as documented by open(2); commonly used constants +are available from `require('constants')`. On Windows, flags are translated to +their equivalent ones where applicable, e.g. `O_WRONLY` to `FILE_GENERIC_WRITE`, +or `O_EXCL|O_CREAT` to `CREATE_NEW`, as accepted by CreateFileW. + +On Linux, positional writes don't work when the file is opened in append mode. +The kernel ignores the position argument and always appends the data to +the end of the file. + +_Note: The behavior of `fs.open()` is platform specific for some flags. As such, +opening a directory on OS X and Linux with the `'a+'` flag - see example below - +will return an error. In contrast, on Windows and FreeBSD, a file descriptor +will be returned._ + +```js +// OS X and Linux +fs.open('', 'a+', (err, fd) => { + // => [Error: EISDIR: illegal operation on a directory, open ] +}) + +// Windows and FreeBSD +fs.open('', 'a+', (err, fd) => { + // => null, +}) +``` + +## fs.openSync(path, flags[, mode]) + + +* `path` {String | Buffer} +* `flags` {String | Number} +* `mode` {Integer} + +Synchronous version of [`fs.open()`][]. Returns an integer representing the file +descriptor. + +## fs.read(fd, buffer, offset, length, position, callback) + + +* `fd` {Integer} +* `buffer` {String | Buffer} +* `offset` {Integer} +* `length` {Integer} +* `position` {Integer} +* `callback` {Function} + +Read data from the file specified by `fd`. + +`buffer` is the buffer that the data will be written to. + +`offset` is the offset in the buffer to start writing at. + +`length` is an integer specifying the number of bytes to read. + +`position` is an integer specifying where to begin reading from in the file. +If `position` is `null`, data will be read from the current file position. + +The callback is given the three arguments, `(err, bytesRead, buffer)`. + +## fs.readdir(path[, options], callback) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` +* `callback` {Function} + +Asynchronous readdir(3). Reads the contents of a directory. +The callback gets two arguments `(err, files)` where `files` is an array of +the names of the files in the directory excluding `'.'` and `'..'`. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the filenames passed to the callback. If the `encoding` is set to `'buffer'`, +the filenames returned will be passed as `Buffer` objects. + +## fs.readdirSync(path[, options]) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` + +Synchronous readdir(3). Returns an array of filenames excluding `'.'` and +`'..'`. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the filenames passed to the callback. If the `encoding` is set to `'buffer'`, +the filenames returned will be passed as `Buffer` objects. + +## fs.readFile(file[, options], callback) + + +* `file` {String | Buffer | Integer} filename or file descriptor +* `options` {Object | String} + * `encoding` {String | Null} default = `null` + * `flag` {String} default = `'r'` +* `callback` {Function} + +Asynchronously reads the entire contents of a file. Example: + +```js +fs.readFile('/etc/passwd', (err, data) => { + if (err) throw err; + console.log(data); +}); +``` + +The callback is passed two arguments `(err, data)`, where `data` is the +contents of the file. + +If no encoding is specified, then the raw buffer is returned. + +If `options` is a string, then it specifies the encoding. Example: + +```js +fs.readFile('/etc/passwd', 'utf8', callback); +``` + +Any specified file descriptor has to support reading. + +_Note: Specified file descriptors will not be closed automatically._ + +## fs.readFileSync(file[, options]) + + +* `file` {String | Buffer | Integer} filename or file descriptor +* `options` {Object | String} + * `encoding` {String | Null} default = `null` + * `flag` {String} default = `'r'` + +Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`. + +If the `encoding` option is specified then this function returns a +string. Otherwise it returns a buffer. + +## fs.readlink(path[, options], callback) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` +* `callback` {Function} + +Asynchronous readlink(2). The callback gets two arguments `(err, +linkString)`. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the link path passed to the callback. If the `encoding` is set to `'buffer'`, +the link path returned will be passed as a `Buffer` object. + +## fs.readlinkSync(path[, options]) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` + +Synchronous readlink(2). Returns the symbolic link's string value. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the link path passed to the callback. If the `encoding` is set to `'buffer'`, +the link path returned will be passed as a `Buffer` object. + +## fs.readSync(fd, buffer, offset, length, position) + + +* `fd` {Integer} +* `buffer` {String | Buffer} +* `offset` {Integer} +* `length` {Integer} +* `position` {Integer} + +Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. + +## fs.realpath(path[, options], callback) + + +* `path` {String | Buffer} +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` +* `callback` {Function} + +Asynchronous realpath(3). The `callback` gets two arguments `(err, +resolvedPath)`. May use `process.cwd` to resolve relative paths. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the path passed to the callback. If the `encoding` is set to `'buffer'`, +the path returned will be passed as a `Buffer` object. + +## fs.realpathSync(path[, options]) + + +* `path` {String | Buffer}; +* `options` {String | Object} + * `encoding` {String} default = `'utf8'` + +Synchronous realpath(3). Returns the resolved path. + +The optional `options` argument can be a string specifying an encoding, or an +object with an `encoding` property specifying the character encoding to use for +the path passed to the callback. If the `encoding` is set to `'buffer'`, +the path returned will be passed as a `Buffer` object. + +## fs.rename(oldPath, newPath, callback) + + +* `oldPath` {String | Buffer} +* `newPath` {String | Buffer} +* `callback` {Function} + +Asynchronous rename(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.renameSync(oldPath, newPath) + + +* `oldPath` {String | Buffer} +* `newPath` {String | Buffer} + +Synchronous rename(2). Returns `undefined`. + +## fs.rmdir(path, callback) + + +* `path` {String | Buffer} +* `callback` {Function} + +Asynchronous rmdir(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.rmdirSync(path) + + +* `path` {String | Buffer} + +Synchronous rmdir(2). Returns `undefined`. + +## fs.stat(path, callback) + + +* `path` {String | Buffer} +* `callback` {Function} + +Asynchronous stat(2). The callback gets two arguments `(err, stats)` where +`stats` is a [`fs.Stats`][] object. See the [`fs.Stats`][] section for more +information. + +## fs.statSync(path) + + +* `path` {String | Buffer} + +Synchronous stat(2). Returns an instance of [`fs.Stats`][]. + +## fs.symlink(target, path[, type], callback) + + +* `target` {String | Buffer} +* `path` {String | Buffer} +* `type` {String} +* `callback` {Function} + +Asynchronous symlink(2). No arguments other than a possible exception are given +to the completion callback. +The `type` argument can be set to `'dir'`, `'file'`, or `'junction'` (default +is `'file'`) and is only available on Windows (ignored on other platforms). +Note that Windows junction points require the destination path to be absolute. When using +`'junction'`, the `target` argument will automatically be normalized to absolute path. + +Here is an example below: + +```js +fs.symlink('./foo', './new-port'); +``` + +It creates a symbolic link named "new-port" that points to "foo". + +## fs.symlinkSync(target, path[, type]) + + +* `target` {String | Buffer} +* `path` {String | Buffer} +* `type` {String} + +Synchronous symlink(2). Returns `undefined`. + +## fs.truncate(path, len, callback) + + +* `path` {String | Buffer} +* `len` {Integer} +* `callback` {Function} + +Asynchronous truncate(2). No arguments other than a possible exception are +given to the completion callback. A file descriptor can also be passed as the +first argument. In this case, `fs.ftruncate()` is called. + +## fs.truncateSync(path, len) + + +* `path` {String | Buffer} +* `len` {Integer} + +Synchronous truncate(2). Returns `undefined`. + +## fs.unlink(path, callback) + + +* `path` {String | Buffer} +* `callback` {Function} + +Asynchronous unlink(2). No arguments other than a possible exception are given +to the completion callback. + +## fs.unlinkSync(path) + + +* `path` {String | Buffer} + +Synchronous unlink(2). Returns `undefined`. + +## fs.unwatchFile(filename[, listener]) + + +* `filename` {String | Buffer} +* `listener` {Function} + +Stop watching for changes on `filename`. If `listener` is specified, only that +particular listener is removed. Otherwise, *all* listeners are removed and you +have effectively stopped watching `filename`. + +Calling `fs.unwatchFile()` with a filename that is not being watched is a +no-op, not an error. + +_Note: [`fs.watch()`][] is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. +`fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` +when possible._ + +## fs.utimes(path, atime, mtime, callback) + + +* `path` {String | Buffer} +* `atime` {Integer} +* `mtime` {Integer} +* `callback` {Function} + +Change file timestamps of the file referenced by the supplied path. + +Note: the arguments `atime` and `mtime` of the following related functions does +follow the below rules: + +- If the value is a numberable string like `'123456789'`, the value would get + converted to corresponding number. +- If the value is `NaN` or `Infinity`, the value would get converted to + `Date.now()`. + +## fs.utimesSync(path, atime, mtime) + + +* `path` {String | Buffer} +* `atime` {Integer} +* `mtime` {Integer} + +Synchronous version of [`fs.utimes()`][]. Returns `undefined`. + +## fs.watch(filename[, options][, listener]) + + +* `filename` {String | Buffer} +* `options` {String | Object} + * `persistent` {Boolean} Indicates whether the process should continue to run + as long as files are being watched. default = `true` + * `recursive` {Boolean} Indicates whether all subdirectories should be + watched, or only the current directory. The applies when a directory is + specified, and only on supported platforms (See [Caveats][]). default = + `false` + * `encoding` {String} Specifies the character encoding to be used for the + filename passed to the listener. default = `'utf8'` +* `listener` {Function} + +Watch for changes on `filename`, where `filename` is either a file or a +directory. The returned object is a [`fs.FSWatcher`][]. + +The second argument is optional. If `options` is provided as a string, it +specifies the `encoding`. Otherwise `options` should be passed as an object. + +The listener callback gets two arguments `(event, filename)`. `event` is either +`'rename'` or `'change'`, and `filename` is the name of the file which triggered +the event. + +### Caveats + + + +The `fs.watch` API is not 100% consistent across platforms, and is +unavailable in some situations. + +The recursive option is only supported on OS X and Windows. + +#### Availability + + + +This feature depends on the underlying operating system providing a way +to be notified of filesystem changes. + +* On Linux systems, this uses `inotify`. +* On BSD systems, this uses `kqueue`. +* On OS X, this uses `kqueue` for files and 'FSEvents' for directories. +* On SunOS systems (including Solaris and SmartOS), this uses `event ports`. +* On Windows systems, this feature depends on `ReadDirectoryChangesW`. +* On Aix systems, this feature depends on `AHAFS`, which must be enabled. + +If the underlying functionality is not available for some reason, then +`fs.watch` will not be able to function. For example, watching files or +directories can be unreliable, and in some cases impossible, on network file +systems (NFS, SMB, etc), or host file systems when using virtualization software +such as Vagrant, Docker, etc. + +You can still use `fs.watchFile`, which uses stat polling, but it is slower and +less reliable. + +#### Inodes + + + +On Linux and OS X systems, `fs.watch()` resolves the path to an [inode][] and +watches the inode. If the watched path is deleted and recreated, it is assigned +a new inode. The watch will emit an event for the delete but will continue +watching the *original* inode. Events for the new inode will not be emitted. +This is expected behavior. + +#### Filename Argument + + + +Providing `filename` argument in the callback is only supported on Linux and +Windows. Even on supported platforms, `filename` is not always guaranteed to +be provided. Therefore, don't assume that `filename` argument is always +provided in the callback, and have some fallback logic if it is null. + +```js +fs.watch('somedir', (event, filename) => { + console.log(`event is: ${event}`); + if (filename) { + console.log(`filename provided: ${filename}`); + } else { + console.log('filename not provided'); + } +}); +``` + +## fs.watchFile(filename[, options], listener) + + +* `filename` {String | Buffer} +* `options` {Object} + * `persistent` {Boolean} + * `interval` {Integer} +* `listener` {Function} + +Watch for changes on `filename`. The callback `listener` will be called each +time the file is accessed. + +The `options` argument may be omitted. If provided, it should be an object. The +`options` object may contain a boolean named `persistent` that indicates +whether the process should continue to run as long as files are being watched. +The `options` object may specify an `interval` property indicating how often the +target should be polled in milliseconds. The default is +`{ persistent: true, interval: 5007 }`. + +The `listener` gets two arguments the current stat object and the previous +stat object: + +```js +fs.watchFile('message.text', (curr, prev) => { + console.log(`the current mtime is: ${curr.mtime}`); + console.log(`the previous mtime was: ${prev.mtime}`); +}); +``` + +These stat objects are instances of `fs.Stat`. + +If you want to be notified when the file was modified, not just accessed, +you need to compare `curr.mtime` and `prev.mtime`. + +_Note: when an `fs.watchFile` operation results in an `ENOENT` error, it will + invoke the listener once, with all the fields zeroed (or, for dates, the Unix + Epoch). In Windows, `blksize` and `blocks` fields will be `undefined`, instead + of zero. If the file is created later on, the listener will be called again, + with the latest stat objects. This is a change in functionality since v0.10._ + +_Note: [`fs.watch()`][] is more efficient than `fs.watchFile` and `fs.unwatchFile`. +`fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` +when possible._ + +## fs.write(fd, buffer, offset, length[, position], callback) + + +* `fd` {Integer} +* `buffer` {String | Buffer} +* `offset` {Integer} +* `length` {Integer} +* `position` {Integer} +* `callback` {Function} + +Write `buffer` to the file specified by `fd`. + +`offset` and `length` determine the part of the buffer to be written. + +`position` refers to the offset from the beginning of the file where this data +should be written. If `typeof position !== 'number'`, the data will be written +at the current position. See pwrite(2). + +The callback will be given three arguments `(err, written, buffer)` where +`written` specifies how many _bytes_ were written from `buffer`. + +Note that it is unsafe to use `fs.write` multiple times on the same file +without waiting for the callback. For this scenario, +`fs.createWriteStream` is strongly recommended. + +On Linux, positional writes don't work when the file is opened in append mode. +The kernel ignores the position argument and always appends the data to +the end of the file. + +## fs.write(fd, data[, position[, encoding]], callback) + + +* `fd` {Integer} +* `data` {String | Buffer} +* `position` {Integer} +* `encoding` {String} +* `callback` {Function} + +Write `data` to the file specified by `fd`. If `data` is not a Buffer instance +then the value will be coerced to a string. + +`position` refers to the offset from the beginning of the file where this data +should be written. If `typeof position !== 'number'` the data will be written at +the current position. See pwrite(2). + +`encoding` is the expected string encoding. + +The callback will receive the arguments `(err, written, string)` where `written` +specifies how many _bytes_ the passed string required to be written. Note that +bytes written is not the same as string characters. See [`Buffer.byteLength`][]. + +Unlike when writing `buffer`, the entire string must be written. No substring +may be specified. This is because the byte offset of the resulting data may not +be the same as the string offset. + +Note that it is unsafe to use `fs.write` multiple times on the same file +without waiting for the callback. For this scenario, +`fs.createWriteStream` is strongly recommended. + +On Linux, positional writes don't work when the file is opened in append mode. +The kernel ignores the position argument and always appends the data to +the end of the file. + +## fs.writeFile(file, data[, options], callback) + + +* `file` {String | Buffer | Integer} filename or file descriptor +* `data` {String | Buffer} +* `options` {Object | String} + * `encoding` {String | Null} default = `'utf8'` + * `mode` {Integer} default = `0o666` + * `flag` {String} default = `'w'` +* `callback` {Function} + +Asynchronously writes data to a file, replacing the file if it already exists. +`data` can be a string or a buffer. + +The `encoding` option is ignored if `data` is a buffer. It defaults +to `'utf8'`. + +Example: + +```js +fs.writeFile('message.txt', 'Hello Node.js', (err) => { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +If `options` is a string, then it specifies the encoding. Example: + +```js +fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback); +``` + +Any specified file descriptor has to support writing. + +Note that it is unsafe to use `fs.writeFile` multiple times on the same file +without waiting for the callback. For this scenario, +`fs.createWriteStream` is strongly recommended. + +_Note: Specified file descriptors will not be closed automatically._ + +## fs.writeFileSync(file, data[, options]) + + +* `file` {String | Buffer | Integer} filename or file descriptor +* `data` {String | Buffer} +* `options` {Object | String} + * `encoding` {String | Null} default = `'utf8'` + * `mode` {Integer} default = `0o666` + * `flag` {String} default = `'w'` + +The synchronous version of [`fs.writeFile()`][]. Returns `undefined`. + +## fs.writeSync(fd, buffer, offset, length[, position]) + + +* `fd` {Integer} +* `buffer` {String | Buffer} +* `offset` {Integer} +* `length` {Integer} +* `position` {Integer} + +## fs.writeSync(fd, data[, position[, encoding]]) + + +* `fd` {Integer} +* `data` {String | Buffer} +* `position` {Integer} +* `encoding` {String} + +Synchronous versions of [`fs.write()`][]. Returns the number of bytes written. + +[`Buffer.byteLength`]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding +[`Buffer`]: buffer.html#buffer_buffer +[Caveats]: #fs_caveats +[`fs.access()`]: #fs_fs_access_path_mode_callback +[`fs.accessSync()`]: #fs_fs_accesssync_path_mode +[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback +[`fs.exists()`]: fs.html#fs_fs_exists_path_callback +[`fs.fstat()`]: #fs_fs_fstat_fd_callback +[`fs.FSWatcher`]: #fs_class_fs_fswatcher +[`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback +[`fs.lstat()`]: #fs_fs_lstat_path_callback +[`fs.mkdtemp()`]: #fs_fs_mkdtemp_prefix_callback +[`fs.open()`]: #fs_fs_open_path_flags_mode_callback +[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback +[`fs.readFile`]: #fs_fs_readfile_file_options_callback +[`fs.stat()`]: #fs_fs_stat_path_callback +[`fs.Stats`]: #fs_class_fs_stats +[`fs.statSync()`]: #fs_fs_statsync_path +[`fs.utimes()`]: #fs_fs_futimes_fd_atime_mtime_callback +[`fs.watch()`]: #fs_fs_watch_filename_options_listener +[`fs.write()`]: #fs_fs_write_fd_buffer_offset_length_position_callback +[`fs.writeFile()`]: #fs_fs_writefile_file_data_options_callback +[`net.Socket`]: net.html#net_class_net_socket +[`ReadStream`]: #fs_class_fs_readstream +[`stat()`]: fs.html#fs_fs_stat_path_callback +[`util.inspect(stats)`]: util.html#util_util_inspect_object_options +[`WriteStream`]: #fs_class_fs_writestream +[MDN-Date-getTime]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime +[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date +[Readable Stream]: stream.html#stream_class_stream_readable +[Writable Stream]: stream.html#stream_class_stream_writable +[inode]: http://www.linux.org/threads/intro-to-inodes.4130 diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown deleted file mode 100644 index 1e2e0562bd8985..00000000000000 --- a/doc/api/globals.markdown +++ /dev/null @@ -1,208 +0,0 @@ -# Global Objects - - - -These objects are available in all modules. Some of these objects aren't -actually in the global scope but in the module scope - this will be noted. - -## Class: Buffer - - - -* {Function} - -Used to handle binary data. See the [buffer section][]. - -## \_\_dirname - - - -* {String} - -The name of the directory that the currently executing script resides in. - -Example: running `node example.js` from `/Users/mjr` - -```js -console.log(__dirname); -// /Users/mjr -``` - -`__dirname` isn't actually a global but rather local to each module. - -For instance, given two modules: `a` and `b`, where `b` is a dependency of -`a` and there is a directory structure of: - -* `/Users/mjr/app/a.js` -* `/Users/mjr/app/node_modules/b/b.js` - -References to `__dirname` within `b.js` will return -`/Users/mjr/app/node_modules/b` while references to `__dirname` within `a.js` -will return `/Users/mj/app`. - -## \_\_filename - - - -* {String} - -The filename of the code being executed. This is the resolved absolute path -of this code file. For a main program this is not necessarily the same -filename used in the command line. The value inside a module is the path -to that module file. - -Example: running `node example.js` from `/Users/mjr` - -```js -console.log(__filename); -// /Users/mjr/example.js -``` - -`__filename` isn't actually a global but rather local to each module. - -## clearImmediate(immediateObject) - - - -[`clearImmediate`] is described in the [timers][] section. - -## clearInterval(intervalObject) - - - -[`clearInterval`] is described in the [timers][] section. - -## clearTimeout(timeoutObject) - - - -[`clearTimeout`] is described in the [timers][] section. - -## console - - - -* {Object} - -Used to print to stdout and stderr. See the [`console`][] section. - -## exports - - - -A reference to the `module.exports` that is shorter to type. -See [module system documentation][] for details on when to use `exports` and -when to use `module.exports`. - -`exports` isn't actually a global but rather local to each module. - -See the [module system documentation][] for more information. - -## global - - - -* {Object} The global namespace object. - -In browsers, the top-level scope is the global scope. That means that in -browsers if you're in the global scope `var something` will define a global -variable. In Node.js this is different. The top-level scope is not the global -scope; `var something` inside an Node.js module will be local to that module. - -## module - - - -* {Object} - -A reference to the current module. In particular -`module.exports` is used for defining what a module exports and makes -available through `require()`. - -`module` isn't actually a global but rather local to each module. - -See the [module system documentation][] for more information. - -## process - - - -* {Object} - -The process object. See the [`process` object][] section. - -## require() - - - -* {Function} - -To require modules. See the [Modules][] section. `require` isn't actually a -global but rather local to each module. - -### require.cache - -* {Object} - -Modules are cached in this object when they are required. By deleting a key -value from this object, the next `require` will reload the module. - -### require.extensions - - Stability: 0 - Deprecated - -* {Object} - -Instruct `require` on how to handle certain file extensions. - -Process files with the extension `.sjs` as `.js`: - -```js -require.extensions['.sjs'] = require.extensions['.js']; -``` - -**Deprecated** In the past, this list has been used to load -non-JavaScript modules into Node.js by compiling them on-demand. -However, in practice, there are much better ways to do this, such as -loading modules via some other Node.js program, or compiling them to -JavaScript ahead of time. - -Since the Module system is locked, this feature will probably never go -away. However, it may have subtle bugs and complexities that are best -left untouched. - -### require.resolve() - -Use the internal `require()` machinery to look up the location of a module, -but rather than loading the module, just return the resolved filename. - -## setImmediate(callback[, arg][, ...]) - - - -[`setImmediate`] is described in the [timers][] section. - -## setInterval(callback, delay[, arg][, ...]) - - - -[`setInterval`] is described in the [timers][] section. - -## setTimeout(callback, delay[, arg][, ...]) - - - -[`setTimeout`] is described in the [timers][] section. - -[`console`]: console.html -[`process` object]: process.html#process_process -[buffer section]: buffer.html -[module system documentation]: modules.html -[Modules]: modules.html#modules_modules -[timers]: timers.html -[`clearImmediate`]: timers.html#timers_clearimmediate_immediateobject -[`clearInterval`]: timers.html#timers_clearinterval_intervalobject -[`clearTimeout`]: timers.html#timers_cleartimeout_timeoutobject -[`setImmediate`]: timers.html#timers_setimmediate_callback_arg -[`setInterval`]: timers.html#timers_setinterval_callback_delay_arg -[`setTimeout`]: timers.html#timers_settimeout_callback_delay_arg diff --git a/doc/api/globals.md b/doc/api/globals.md new file mode 100644 index 00000000000000..f70c52aae4904e --- /dev/null +++ b/doc/api/globals.md @@ -0,0 +1,216 @@ +# Global Objects + + + +These objects are available in all modules. Some of these objects aren't +actually in the global scope but in the module scope - this will be noted. + +The objects listed here are specific to Node.js. There are a number of +[built-in objects][] that are part of the JavaScript language itself, which are +also globally accessible. + +## Class: Buffer + + + +* {Function} + +Used to handle binary data. See the [buffer section][]. + +## \_\_dirname + + + +* {String} + +The name of the directory that the currently executing script resides in. + +Example: running `node example.js` from `/Users/mjr` + +```js +console.log(__dirname); +// /Users/mjr +``` + +`__dirname` isn't actually a global but rather local to each module. + +For instance, given two modules: `a` and `b`, where `b` is a dependency of +`a` and there is a directory structure of: + +* `/Users/mjr/app/a.js` +* `/Users/mjr/app/node_modules/b/b.js` + +References to `__dirname` within `b.js` will return +`/Users/mjr/app/node_modules/b` while references to `__dirname` within `a.js` +will return `/Users/mjr/app`. + +## \_\_filename + + + +* {String} + +The filename of the code being executed. This is the resolved absolute path +of this code file. For a main program this is not necessarily the same +filename used in the command line. The value inside a module is the path +to that module file. + +Example: running `node example.js` from `/Users/mjr` + +```js +console.log(__filename); +// /Users/mjr/example.js +``` + +`__filename` isn't actually a global but rather local to each module. + +## clearImmediate(immediateObject) + + + +[`clearImmediate`] is described in the [timers][] section. + +## clearInterval(intervalObject) + + + +[`clearInterval`] is described in the [timers][] section. + +## clearTimeout(timeoutObject) + + + +[`clearTimeout`] is described in the [timers][] section. + +## console + + + +* {Object} + +Used to print to stdout and stderr. See the [`console`][] section. + +## exports + + + +A reference to the `module.exports` that is shorter to type. +See [module system documentation][] for details on when to use `exports` and +when to use `module.exports`. + +`exports` isn't actually a global but rather local to each module. + +See the [module system documentation][] for more information. + +## global + + + +* {Object} The global namespace object. + +In browsers, the top-level scope is the global scope. That means that in +browsers if you're in the global scope `var something` will define a global +variable. In Node.js this is different. The top-level scope is not the global +scope; `var something` inside an Node.js module will be local to that module. + +## module + + + +* {Object} + +A reference to the current module. In particular +`module.exports` is used for defining what a module exports and makes +available through `require()`. + +`module` isn't actually a global but rather local to each module. + +See the [module system documentation][] for more information. + +## process + + + +* {Object} + +The process object. See the [`process` object][] section. + +## require() + + + +* {Function} + +To require modules. See the [Modules][] section. `require` isn't actually a +global but rather local to each module. + +### require.cache + +* {Object} + +Modules are cached in this object when they are required. By deleting a key +value from this object, the next `require` will reload the module. Note that +this does not apply to [native addons][], for which reloading will result in an +Error. + +### require.extensions + + Stability: 0 - Deprecated + +* {Object} + +Instruct `require` on how to handle certain file extensions. + +Process files with the extension `.sjs` as `.js`: + +```js +require.extensions['.sjs'] = require.extensions['.js']; +``` + +**Deprecated** In the past, this list has been used to load +non-JavaScript modules into Node.js by compiling them on-demand. +However, in practice, there are much better ways to do this, such as +loading modules via some other Node.js program, or compiling them to +JavaScript ahead of time. + +Since the Module system is locked, this feature will probably never go +away. However, it may have subtle bugs and complexities that are best +left untouched. + +### require.resolve() + +Use the internal `require()` machinery to look up the location of a module, +but rather than loading the module, just return the resolved filename. + +## setImmediate(callback[, arg][, ...]) + + + +[`setImmediate`] is described in the [timers][] section. + +## setInterval(callback, delay[, arg][, ...]) + + + +[`setInterval`] is described in the [timers][] section. + +## setTimeout(callback, delay[, arg][, ...]) + + + +[`setTimeout`] is described in the [timers][] section. + +[`console`]: console.html +[`process` object]: process.html#process_process +[buffer section]: buffer.html +[module system documentation]: modules.html +[Modules]: modules.html#modules_modules +[native addons]: addons.html +[timers]: timers.html +[`clearImmediate`]: timers.html#timers_clearimmediate_immediateobject +[`clearInterval`]: timers.html#timers_clearinterval_intervalobject +[`clearTimeout`]: timers.html#timers_cleartimeout_timeoutobject +[`setImmediate`]: timers.html#timers_setimmediate_callback_arg +[`setInterval`]: timers.html#timers_setinterval_callback_delay_arg +[`setTimeout`]: timers.html#timers_settimeout_callback_delay_arg +[built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects diff --git a/doc/api/http.markdown b/doc/api/http.markdown deleted file mode 100644 index b2fc5dbba00127..00000000000000 --- a/doc/api/http.markdown +++ /dev/null @@ -1,1262 +0,0 @@ -# HTTP - - Stability: 2 - Stable - -To use the HTTP server and client one must `require('http')`. - -The HTTP interfaces in Node.js are designed to support many features -of the protocol which have been traditionally difficult to use. -In particular, large, possibly chunk-encoded, messages. The interface is -careful to never buffer entire requests or responses--the -user is able to stream data. - -HTTP message headers are represented by an object like this: - -``` -{ 'content-length': '123', - 'content-type': 'text/plain', - 'connection': 'keep-alive', - 'host': 'mysite.com', - 'accept': '*/*' } -``` - -Keys are lowercased. Values are not modified. - -In order to support the full spectrum of possible HTTP applications, Node.js's -HTTP API is very low-level. It deals with stream handling and message -parsing only. It parses a message into headers and body but it does not -parse the actual headers or the body. - -See [`message.headers`][] for details on how duplicate headers are handled. - -The raw headers as they were received are retained in the `rawHeaders` -property, which is an array of `[key, value, key2, value2, ...]`. For -example, the previous message header object might have a `rawHeaders` -list like the following: - -``` -[ 'ConTent-Length', '123456', - 'content-LENGTH', '123', - 'content-type', 'text/plain', - 'CONNECTION', 'keep-alive', - 'Host', 'mysite.com', - 'accepT', '*/*' ] -``` - -## Class: http.Agent - -The HTTP Agent is used for pooling sockets used in HTTP client -requests. - -The HTTP Agent also defaults client requests to using -Connection:keep-alive. If no pending HTTP requests are waiting on a -socket to become free the socket is closed. This means that Node.js's -pool has the benefit of keep-alive when under load but still does not -require developers to manually close the HTTP clients using -KeepAlive. - -If you opt into using HTTP KeepAlive, you can create an Agent object -with that flag set to `true`. (See the [constructor options][].) -Then, the Agent will keep unused sockets in a pool for later use. They -will be explicitly marked so as to not keep the Node.js process running. -However, it is still a good idea to explicitly [`destroy()`][] KeepAlive -agents when they are no longer in use, so that the Sockets will be shut -down. - -Sockets are removed from the agent's pool when the socket emits either -a `'close'` event or a special `'agentRemove'` event. This means that if -you intend to keep one HTTP request open for a long time and don't -want it to stay in the pool you can do something along the lines of: - -```js -http.get(options, (res) => { - // Do stuff -}).on('socket', (socket) => { - socket.emit('agentRemove'); -}); -``` - -Alternatively, you could just opt out of pooling entirely using -`agent:false`: - -```js -http.get({ - hostname: 'localhost', - port: 80, - path: '/', - agent: false // create a new agent just for this one request -}, (res) => { - // Do stuff with response -}) -``` - -### new Agent([options]) - -* `options` {Object} Set of configurable options to set on the agent. - Can have the following fields: - * `keepAlive` {Boolean} Keep sockets around in a pool to be used by - other requests in the future. Default = `false` - * `keepAliveMsecs` {Integer} When using HTTP KeepAlive, how often - to send TCP KeepAlive packets over sockets being kept alive. - Default = `1000`. Only relevant if `keepAlive` is set to `true`. - * `maxSockets` {Number} Maximum number of sockets to allow per - host. Default = `Infinity`. - * `maxFreeSockets` {Number} Maximum number of sockets to leave open - in a free state. Only relevant if `keepAlive` is set to `true`. - Default = `256`. - -The default [`http.globalAgent`][] that is used by [`http.request()`][] has all -of these values set to their respective defaults. - -To configure any of them, you must create your own [`http.Agent`][] object. - -```js -const http = require('http'); -var keepAliveAgent = new http.Agent({ keepAlive: true }); -options.agent = keepAliveAgent; -http.request(options, onResponseCallback); -``` - -### agent.createConnection(options[, callback]) - -Produces a socket/stream to be used for HTTP requests. - -By default, this function is the same as [`net.createConnection()`][]. However, -custom Agents may override this method in case greater flexibility is desired. - -A socket/stream can be supplied in one of two ways: by returning the -socket/stream from this function, or by passing the socket/stream to `callback`. - -`callback` has a signature of `(err, stream)`. - -### agent.destroy() - -Destroy any sockets that are currently in use by the agent. - -It is usually not necessary to do this. However, if you are using an -agent with KeepAlive enabled, then it is best to explicitly shut down -the agent when you know that it will no longer be used. Otherwise, -sockets may hang open for quite a long time before the server -terminates them. - -### agent.freeSockets - -An object which contains arrays of sockets currently awaiting use by -the Agent when HTTP KeepAlive is used. Do not modify. - -### agent.getName(options) - -Get a unique name for a set of request options, to determine whether a -connection can be reused. In the http agent, this returns -`host:port:localAddress`. In the https agent, the name includes the -CA, cert, ciphers, and other HTTPS/TLS-specific options that determine -socket reusability. - -### agent.maxFreeSockets - -By default set to 256. For Agents supporting HTTP KeepAlive, this -sets the maximum number of sockets that will be left open in the free -state. - -### agent.maxSockets - -By default set to Infinity. Determines how many concurrent sockets the agent -can have open per origin. Origin is either a 'host:port' or -'host:port:localAddress' combination. - -### agent.requests - -An object which contains queues of requests that have not yet been assigned to -sockets. Do not modify. - -### agent.sockets - -An object which contains arrays of sockets currently in use by the -Agent. Do not modify. - -## Class: http.ClientRequest - -This object is created internally and returned from [`http.request()`][]. It -represents an _in-progress_ request whose header has already been queued. The -header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, -`removeHeader(name)` API. The actual header will be sent along with the first -data chunk or when closing the connection. - -To get the response, add a listener for `'response'` to the request object. -`'response'` will be emitted from the request object when the response -headers have been received. The `'response'` event is executed with one -argument which is an instance of [`http.IncomingMessage`][]. - -During the `'response'` event, one can add listeners to the -response object; particularly to listen for the `'data'` event. - -If no `'response'` handler is added, then the response will be -entirely discarded. However, if you add a `'response'` event handler, -then you **must** consume the data from the response object, either by -calling `response.read()` whenever there is a `'readable'` event, or -by adding a `'data'` handler, or by calling the `.resume()` method. -Until the data is consumed, the `'end'` event will not fire. Also, until -the data is read it will consume memory that can eventually lead to a -'process out of memory' error. - -Note: Node.js does not check whether Content-Length and the length of the body -which has been transmitted are equal or not. - -The request implements the [Writable Stream][] interface. This is an -[`EventEmitter`][] with the following events: - -### Event: 'abort' - -`function () { }` - -Emitted when the request has been aborted by the client. This event is only -emitted on the first call to `abort()`. - -### Event: 'checkExpectation' - -`function (request, response) { }` - -Emitted each time a request with an http Expect header is received, where the -value is not 100-continue. If this event isn't listened for, the server will -automatically respond with a 417 Expectation Failed as appropriate. - -Note that when this event is emitted and handled, the `request` event will -not be emitted. - -### Event: 'connect' - -`function (response, socket, head) { }` - -Emitted each time a server responds to a request with a `CONNECT` method. If this -event isn't being listened for, clients receiving a `CONNECT` method will have -their connections closed. - -A client server pair that show you how to listen for the `'connect'` event. - -```js -const http = require('http'); -const net = require('net'); -const url = require('url'); - -// Create an HTTP tunneling proxy -var proxy = http.createServer( (req, res) => { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('okay'); -}); -proxy.on('connect', (req, cltSocket, head) => { - // connect to an origin server - var srvUrl = url.parse(`http://${req.url}`); - var srvSocket = net.connect(srvUrl.port, srvUrl.hostname, () => { - cltSocket.write('HTTP/1.1 200 Connection Established\r\n' + - 'Proxy-agent: Node.js-Proxy\r\n' + - '\r\n'); - srvSocket.write(head); - srvSocket.pipe(cltSocket); - cltSocket.pipe(srvSocket); - }); -}); - -// now that proxy is running -proxy.listen(1337, '127.0.0.1', () => { - - // make a request to a tunneling proxy - var options = { - port: 1337, - hostname: '127.0.0.1', - method: 'CONNECT', - path: 'www.google.com:80' - }; - - var req = http.request(options); - req.end(); - - req.on('connect', (res, socket, head) => { - console.log('got connected!'); - - // make a request over an HTTP tunnel - socket.write('GET / HTTP/1.1\r\n' + - 'Host: www.google.com:80\r\n' + - 'Connection: close\r\n' + - '\r\n'); - socket.on('data', (chunk) => { - console.log(chunk.toString()); - }); - socket.on('end', () => { - proxy.close(); - }); - }); -}); -``` - -### Event: 'continue' - -`function () { }` - -Emitted when the server sends a '100 Continue' HTTP response, usually because -the request contained 'Expect: 100-continue'. This is an instruction that -the client should send the request body. - -### Event: 'response' - -`function (response) { }` - -Emitted when a response is received to this request. This event is emitted only -once. The `response` argument will be an instance of [`http.IncomingMessage`][]. - -Options: - -- `host`: A domain name or IP address of the server to issue the request to. -- `port`: Port of remote server. -- `socketPath`: Unix Domain Socket (use one of host:port or socketPath) - -### Event: 'socket' - -`function (socket) { }` - -Emitted after a socket is assigned to this request. - -### Event: 'upgrade' - -`function (response, socket, head) { }` - -Emitted each time a server responds to a request with an upgrade. If this -event isn't being listened for, clients receiving an upgrade header will have -their connections closed. - -A client server pair that show you how to listen for the `'upgrade'` event. - -```js -const http = require('http'); - -// Create an HTTP server -var srv = http.createServer( (req, res) => { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('okay'); -}); -srv.on('upgrade', (req, socket, head) => { - socket.write('HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + - 'Upgrade: WebSocket\r\n' + - 'Connection: Upgrade\r\n' + - '\r\n'); - - socket.pipe(socket); // echo back -}); - -// now that server is running -srv.listen(1337, '127.0.0.1', () => { - - // make a request - var options = { - port: 1337, - hostname: '127.0.0.1', - headers: { - 'Connection': 'Upgrade', - 'Upgrade': 'websocket' - } - }; - - var req = http.request(options); - req.end(); - - req.on('upgrade', (res, socket, upgradeHead) => { - console.log('got upgraded!'); - socket.end(); - process.exit(0); - }); -}); -``` - -### request.abort() - -Marks the request as aborting. Calling this will cause remaining data -in the response to be dropped and the socket to be destroyed. - -### request.end([data][, encoding][, callback]) - -Finishes sending the request. If any parts of the body are -unsent, it will flush them to the stream. If the request is -chunked, this will send the terminating `'0\r\n\r\n'`. - -If `data` is specified, it is equivalent to calling -[`response.write(data, encoding)`][] followed by `request.end(callback)`. - -If `callback` is specified, it will be called when the request stream -is finished. - -### request.flushHeaders() - -Flush the request headers. - -For efficiency reasons, Node.js normally buffers the request headers until you -call `request.end()` or write the first chunk of request data. It then tries -hard to pack the request headers and data into a single TCP packet. - -That's usually what you want (it saves a TCP round-trip) but not when the first -data isn't sent until possibly much later. `request.flushHeaders()` lets you bypass -the optimization and kickstart the request. - -### request.setNoDelay([noDelay]) - -Once a socket is assigned to this request and is connected -[`socket.setNoDelay()`][] will be called. - -### request.setSocketKeepAlive([enable][, initialDelay]) - -Once a socket is assigned to this request and is connected -[`socket.setKeepAlive()`][] will be called. - -### request.setTimeout(timeout[, callback]) - -Once a socket is assigned to this request and is connected -[`socket.setTimeout()`][] will be called. - -* `timeout` {Number} Milliseconds before a request is considered to be timed out. -* `callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - -### request.write(chunk[, encoding][, callback]) - -Sends a chunk of the body. By calling this method -many times, the user can stream a request body to a -server--in that case it is suggested to use the -`['Transfer-Encoding', 'chunked']` header line when -creating the request. - -The `chunk` argument should be a [`Buffer`][] or a string. - -The `encoding` argument is optional and only applies when `chunk` is a string. -Defaults to `'utf8'`. - -The `callback` argument is optional and will be called when this chunk of data -is flushed. - -Returns `request`. - -## Class: http.Server - -This class inherits from [`net.Server`][] and has the following additional events: - -### Event: 'checkContinue' - -`function (request, response) { }` - -Emitted each time a request with an http Expect: 100-continue is received. -If this event isn't listened for, the server will automatically respond -with a 100 Continue as appropriate. - -Handling this event involves calling [`response.writeContinue()`][] if the client -should continue to send the request body, or generating an appropriate HTTP -response (e.g., 400 Bad Request) if the client should not continue to send the -request body. - -Note that when this event is emitted and handled, the `'request'` event will -not be emitted. - -### Event: 'clientError' - -`function (exception, socket) { }` - -If a client connection emits an `'error'` event, it will be forwarded here. -Listener of this event is responsible for closing/destroying the underlying -socket. For example, one may wish to more gracefully close the socket with an -HTTP '400 Bad Request' response instead of abruptly severing the connection. - -Default behavior is to destroy the socket immediately on malformed request. - -`socket` is the [`net.Socket`][] object that the error originated from. - -```js -const http = require('http'); - -const server = http.createServer((req, res) => { - res.end(); -}); -server.on('clientError', (err, socket) => { - socket.end('HTTP/1.1 400 Bad Request\r\n\r\n'); -}); -server.listen(8000); -``` - -When the `'clientError'` event occurs, there is no `request` or `response` -object, so any HTTP response sent, including response headers and payload, -*must* be written directly to the `socket` object. Care must be taken to -ensure the response is a properly formatted HTTP response message. - -### Event: 'close' - -`function () { }` - -Emitted when the server closes. - -### Event: 'connect' - -`function (request, socket, head) { }` - -Emitted each time a client requests a http `CONNECT` method. If this event isn't -listened for, then clients requesting a `CONNECT` method will have their -connections closed. - -* `request` is the arguments for the http request, as it is in the request - event. -* `socket` is the network socket between the server and client. -* `head` is an instance of Buffer, the first packet of the tunneling stream, - this may be empty. - -After this event is emitted, the request's socket will not have a `'data'` -event listener, meaning you will need to bind to it in order to handle data -sent to the server on that socket. - -### Event: 'connection' - -`function (socket) { }` - -When a new TCP stream is established. `socket` is an object of type -[`net.Socket`][]. Usually users will not want to access this event. In -particular, the socket will not emit `'readable'` events because of how -the protocol parser attaches to the socket. The `socket` can also be -accessed at `request.connection`. - -### Event: 'request' - -`function (request, response) { }` - -Emitted each time there is a request. Note that there may be multiple requests -per connection (in the case of keep-alive connections). - `request` is an instance of [`http.IncomingMessage`][] and `response` is -an instance of [`http.ServerResponse`][]. - -### Event: 'upgrade' - -`function (request, socket, head) { }` - -Emitted each time a client requests a http upgrade. If this event isn't -listened for, then clients requesting an upgrade will have their connections -closed. - -* `request` is the arguments for the http request, as it is in the request - event. -* `socket` is the network socket between the server and client. -* `head` is an instance of Buffer, the first packet of the upgraded stream, - this may be empty. - -After this event is emitted, the request's socket will not have a `'data'` -event listener, meaning you will need to bind to it in order to handle data -sent to the server on that socket. - -### server.close([callback]) - -Stops the server from accepting new connections. See [`net.Server.close()`][]. - -### server.listen(handle[, callback]) - -* `handle` {Object} -* `callback` {Function} - -The `handle` object can be set to either a server or socket (anything -with an underlying `_handle` member), or a `{fd: }` object. - -This will cause the server to accept connections on the specified -handle, but it is presumed that the file descriptor or handle has -already been bound to a port or domain socket. - -Listening on a file descriptor is not supported on Windows. - -This function is asynchronous. The last parameter `callback` will be added as -a listener for the `'listening'` event. See also [`net.Server.listen()`][]. - -Returns `server`. - -### server.listen(path[, callback]) - -Start a UNIX socket server listening for connections on the given `path`. - -This function is asynchronous. The last parameter `callback` will be added as -a listener for the `'listening'` event. See also [`net.Server.listen(path)`][]. - -### server.listen(port[, hostname][, backlog][, callback]) - -Begin accepting connections on the specified `port` and `hostname`. If the -`hostname` is omitted, the server will accept connections on any IPv6 address -(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A -port value of zero will assign a random port. - -To listen to a unix socket, supply a filename instead of port and hostname. - -Backlog is the maximum length of the queue of pending connections. -The actual length will be determined by your OS through sysctl settings such as -`tcp_max_syn_backlog` and `somaxconn` on linux. The default value of this -parameter is 511 (not 512). - -This function is asynchronous. The last parameter `callback` will be added as -a listener for the `'listening'` event. See also [`net.Server.listen(port)`][]. - -### server.listening - -A Boolean indicating whether or not the server is listening for -connections. - -### server.maxHeadersCount - -Limits maximum incoming headers count, equal to 1000 by default. If set to 0 - -no limit will be applied. - -### server.setTimeout(msecs, callback) - -* `msecs` {Number} -* `callback` {Function} - -Sets the timeout value for sockets, and emits a `'timeout'` event on -the Server object, passing the socket as an argument, if a timeout -occurs. - -If there is a `'timeout'` event listener on the Server object, then it -will be called with the timed-out socket as an argument. - -By default, the Server's timeout value is 2 minutes, and sockets are -destroyed automatically if they time out. However, if you assign a -callback to the Server's `'timeout'` event, then you are responsible -for handling socket timeouts. - -Returns `server`. - -### server.timeout - -* {Number} Default = 120000 (2 minutes) - -The number of milliseconds of inactivity before a socket is presumed -to have timed out. - -Note that the socket timeout logic is set up on connection, so -changing this value only affects *new* connections to the server, not -any existing connections. - -Set to 0 to disable any kind of automatic timeout behavior on incoming -connections. - -## Class: http.ServerResponse - -This object is created internally by a HTTP server--not by the user. It is -passed as the second parameter to the `'request'` event. - -The response implements the [Writable Stream][] interface. This is an -[`EventEmitter`][] with the following events: - -### Event: 'close' - -`function () { }` - -Indicates that the underlying connection was terminated before -[`response.end()`][] was called or able to flush. - -### Event: 'finish' - -`function () { }` - -Emitted when the response has been sent. More specifically, this event is -emitted when the last segment of the response headers and body have been -handed off to the operating system for transmission over the network. It -does not imply that the client has received anything yet. - -After this event, no more events will be emitted on the response object. - -### response.addTrailers(headers) - -This method adds HTTP trailing headers (a header but at the end of the -message) to the response. - -Trailers will **only** be emitted if chunked encoding is used for the -response; if it is not (e.g., if the request was HTTP/1.0), they will -be silently discarded. - -Note that HTTP requires the `Trailer` header to be sent if you intend to -emit trailers, with a list of the header fields in its value. E.g., - -```js -response.writeHead(200, { 'Content-Type': 'text/plain', - 'Trailer': 'Content-MD5' }); -response.write(fileData); -response.addTrailers({'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667'}); -response.end(); -``` - -Attempting to set a header field name or value that contains invalid characters -will result in a [`TypeError`][] being thrown. - -### response.end([data][, encoding][, callback]) - -This method signals to the server that all of the response headers and body -have been sent; that server should consider this message complete. -The method, `response.end()`, MUST be called on each response. - -If `data` is specified, it is equivalent to calling -[`response.write(data, encoding)`][] followed by `response.end(callback)`. - -If `callback` is specified, it will be called when the response stream -is finished. - -### response.finished - -Boolean value that indicates whether the response has completed. Starts -as `false`. After [`response.end()`][] executes, the value will be `true`. - -### response.getHeader(name) - -Reads out a header that's already been queued but not sent to the client. Note -that the name is case insensitive. This can only be called before headers get -implicitly flushed. - -Example: - -```js -var contentType = response.getHeader('content-type'); -``` - -### response.headersSent - -Boolean (read-only). True if headers were sent, false otherwise. - -### response.removeHeader(name) - -Removes a header that's queued for implicit sending. - -Example: - -```js -response.removeHeader('Content-Encoding'); -``` - -### response.sendDate - -When true, the Date header will be automatically generated and sent in -the response if it is not already present in the headers. Defaults to true. - -This should only be disabled for testing; HTTP requires the Date header -in responses. - -### response.setHeader(name, value) - -Sets a single header value for implicit headers. If this header already exists -in the to-be-sent headers, its value will be replaced. Use an array of strings -here if you need to send multiple headers with the same name. - -Example: - -```js -response.setHeader('Content-Type', 'text/html'); -``` - -or - -```js -response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); -``` - -Attempting to set a header field name or value that contains invalid characters -will result in a [`TypeError`][] being thrown. - -When headers have been set with [`response.setHeader()`][], they will be merged with -any headers passed to [`response.writeHead()`][], with the headers passed to -[`response.writeHead()`][] given precedence. - -```js -// returns content-type = text/plain -const server = http.createServer((req,res) => { - res.setHeader('Content-Type', 'text/html'); - res.setHeader('X-Foo', 'bar'); - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('ok'); -}); -``` - -### response.setTimeout(msecs, callback) - -* `msecs` {Number} -* `callback` {Function} - -Sets the Socket's timeout value to `msecs`. If a callback is -provided, then it is added as a listener on the `'timeout'` event on -the response object. - -If no `'timeout'` listener is added to the request, the response, or -the server, then sockets are destroyed when they time out. If you -assign a handler on the request, the response, or the server's -`'timeout'` events, then it is your responsibility to handle timed out -sockets. - -Returns `response`. - -### response.statusCode - -When using implicit headers (not calling [`response.writeHead()`][] explicitly), -this property controls the status code that will be sent to the client when -the headers get flushed. - -Example: - -```js -response.statusCode = 404; -``` - -After response header was sent to the client, this property indicates the -status code which was sent out. - -### response.statusMessage - -When using implicit headers (not calling [`response.writeHead()`][] explicitly), this property -controls the status message that will be sent to the client when the headers get -flushed. If this is left as `undefined` then the standard message for the status -code will be used. - -Example: - -```js -response.statusMessage = 'Not found'; -``` - -After response header was sent to the client, this property indicates the -status message which was sent out. - -### response.write(chunk[, encoding][, callback]) - -If this method is called and [`response.writeHead()`][] has not been called, -it will switch to implicit header mode and flush the implicit headers. - -This sends a chunk of the response body. This method may -be called multiple times to provide successive parts of the body. - -`chunk` can be a string or a buffer. If `chunk` is a string, -the second parameter specifies how to encode it into a byte stream. -By default the `encoding` is `'utf8'`. The last parameter `callback` -will be called when this chunk of data is flushed. - -**Note**: This is the raw HTTP body and has nothing to do with -higher-level multi-part body encodings that may be used. - -The first time [`response.write()`][] is called, it will send the buffered -header information and the first body to the client. The second time -[`response.write()`][] is called, Node.js assumes you're going to be streaming -data, and sends that separately. That is, the response is buffered up to the -first chunk of body. - -Returns `true` if the entire data was flushed successfully to the kernel -buffer. Returns `false` if all or part of the data was queued in user memory. -`'drain'` will be emitted when the buffer is free again. - -### response.writeContinue() - -Sends a HTTP/1.1 100 Continue message to the client, indicating that -the request body should be sent. See the [`'checkContinue'`][] event on `Server`. - -### response.writeHead(statusCode[, statusMessage][, headers]) - -Sends a response header to the request. The status code is a 3-digit HTTP -status code, like `404`. The last argument, `headers`, are the response headers. -Optionally one can give a human-readable `statusMessage` as the second -argument. - -Example: - -```js -var body = 'hello world'; -response.writeHead(200, { - 'Content-Length': body.length, - 'Content-Type': 'text/plain' }); -``` - -This method must only be called once on a message and it must -be called before [`response.end()`][] is called. - -If you call [`response.write()`][] or [`response.end()`][] before calling this, -the implicit/mutable headers will be calculated and call this function for you. - -When headers have been set with [`response.setHeader()`][], they will be merged with -any headers passed to [`response.writeHead()`][], with the headers passed to -[`response.writeHead()`][] given precedence. - -```js -// returns content-type = text/plain -const server = http.createServer((req,res) => { - res.setHeader('Content-Type', 'text/html'); - res.setHeader('X-Foo', 'bar'); - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('ok'); -}); -``` - -Note that Content-Length is given in bytes not characters. The above example -works because the string `'hello world'` contains only single byte characters. -If the body contains higher coded characters then `Buffer.byteLength()` -should be used to determine the number of bytes in a given encoding. -And Node.js does not check whether Content-Length and the length of the body -which has been transmitted are equal or not. - -Attempting to set a header field name or value that contains invalid characters -will result in a [`TypeError`][] being thrown. - -## Class: http.IncomingMessage - -An `IncomingMessage` object is created by [`http.Server`][] or -[`http.ClientRequest`][] and passed as the first argument to the `'request'` -and `'response'` event respectively. It may be used to access response status, -headers and data. - -It implements the [Readable Stream][] interface, as well as the -following additional events, methods, and properties. - -### Event: 'close' - -`function () { }` - -Indicates that the underlying connection was closed. -Just like `'end'`, this event occurs only once per response. - -### message.headers - -The request/response headers object. - -Key-value pairs of header names and values. Header names are lower-cased. -Example: - -```js -// Prints something like: -// -// { 'user-agent': 'curl/7.22.0', -// host: '127.0.0.1:8000', -// accept: '*/*' } -console.log(request.headers); -``` - -Duplicates in raw headers are handled in the following ways, depending on the -header name: - -* Duplicates of `age`, `authorization`, `content-length`, `content-type`, -`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, -`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`, -`retry-after`, or `user-agent` are discarded. -* `set-cookie` is always an array. Duplicates are added to the array. -* For all other headers, the values are joined together with ', '. - -### message.httpVersion - -In case of server request, the HTTP version sent by the client. In the case of -client response, the HTTP version of the connected-to server. -Probably either `'1.1'` or `'1.0'`. - -Also `message.httpVersionMajor` is the first integer and -`message.httpVersionMinor` is the second. - -### message.method - -**Only valid for request obtained from [`http.Server`][].** - -The request method as a string. Read only. Example: -`'GET'`, `'DELETE'`. - -### message.rawHeaders - -The raw request/response headers list exactly as they were received. - -Note that the keys and values are in the same list. It is *not* a -list of tuples. So, the even-numbered offsets are key values, and the -odd-numbered offsets are the associated values. - -Header names are not lowercased, and duplicates are not merged. - -```js -// Prints something like: -// -// [ 'user-agent', -// 'this is invalid because there can be only one', -// 'User-Agent', -// 'curl/7.22.0', -// 'Host', -// '127.0.0.1:8000', -// 'ACCEPT', -// '*/*' ] -console.log(request.rawHeaders); -``` - -### message.rawTrailers - -The raw request/response trailer keys and values exactly as they were -received. Only populated at the `'end'` event. - -### message.setTimeout(msecs, callback) - -* `msecs` {Number} -* `callback` {Function} - -Calls `message.connection.setTimeout(msecs, callback)`. - -Returns `message`. - -### message.statusCode - -**Only valid for response obtained from [`http.ClientRequest`][].** - -The 3-digit HTTP response status code. E.G. `404`. - -### message.statusMessage - -**Only valid for response obtained from [`http.ClientRequest`][].** - -The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - -### message.socket - -The [`net.Socket`][] object associated with the connection. - -With HTTPS support, use [`request.socket.getPeerCertificate()`][] to obtain the -client's authentication details. - -### message.trailers - -The request/response trailers object. Only populated at the `'end'` event. - -### message.url - -**Only valid for request obtained from [`http.Server`][].** - -Request URL string. This contains only the URL that is -present in the actual HTTP request. If the request is: - -``` -GET /status?name=ryan HTTP/1.1\r\n -Accept: text/plain\r\n -\r\n -``` - -Then `request.url` will be: - -``` -'/status?name=ryan' -``` - -If you would like to parse the URL into its parts, you can use -`require('url').parse(request.url)`. Example: - -``` -$ node -> require('url').parse('/status?name=ryan') -{ - href: '/status?name=ryan', - search: '?name=ryan', - query: 'name=ryan', - pathname: '/status' -} -``` - -If you would like to extract the params from the query string, -you can use the `require('querystring').parse` function, or pass -`true` as the second argument to `require('url').parse`. Example: - -``` -$ node -> require('url').parse('/status?name=ryan', true) -{ - href: '/status?name=ryan', - search: '?name=ryan', - query: {name: 'ryan'}, - pathname: '/status' -} -``` - -## http.METHODS - -* {Array} - -A list of the HTTP methods that are supported by the parser. - -## http.STATUS_CODES - -* {Object} - -A collection of all the standard HTTP response status codes, and the -short description of each. For example, `http.STATUS_CODES[404] === 'Not -Found'`. - -## http.createClient([port][, host]) - - Stability: 0 - Deprecated: Use [`http.request()`][] instead. - -Constructs a new HTTP client. `port` and `host` refer to the server to be -connected to. - -## http.createServer([requestListener]) - -Returns a new instance of [`http.Server`][]. - -The `requestListener` is a function which is automatically -added to the `'request'` event. - -## http.get(options[, callback]) - -Since most requests are GET requests without bodies, Node.js provides this -convenience method. The only difference between this method and [`http.request()`][] -is that it sets the method to GET and calls `req.end()` automatically. - -Example: - -```js -http.get('http://www.google.com/index.html', (res) => { - console.log(`Got response: ${res.statusCode}`); - // consume response body - res.resume(); -}).on('error', (e) => { - console.log(`Got error: ${e.message}`); -}); -``` - -## http.globalAgent - -Global instance of Agent which is used as the default for all http client -requests. - -## http.request(options[, callback]) - -Node.js maintains several connections per server to make HTTP requests. -This function allows one to transparently issue requests. - -`options` can be an object or a string. If `options` is a string, it is -automatically parsed with [`url.parse()`][]. - -Options: - -- `protocol`: Protocol to use. Defaults to `'http:'`. -- `host`: A domain name or IP address of the server to issue the request to. - Defaults to `'localhost'`. -- `hostname`: Alias for `host`. To support [`url.parse()`][] `hostname` is - preferred over `host`. -- `family`: IP address family to use when resolving `host` and `hostname`. - Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be - used. -- `port`: Port of remote server. Defaults to 80. -- `localAddress`: Local interface to bind for network connections. -- `socketPath`: Unix Domain Socket (use one of host:port or socketPath). -- `method`: A string specifying the HTTP request method. Defaults to `'GET'`. -- `path`: Request path. Defaults to `'/'`. Should include query string if any. - E.G. `'/index.html?page=12'`. An exception is thrown when the request path - contains illegal characters. Currently, only spaces are rejected but that - may change in the future. -- `headers`: An object containing request headers. -- `auth`: Basic authentication i.e. `'user:password'` to compute an - Authorization header. -- `agent`: Controls [`Agent`][] behavior. When an Agent is used request will - default to `Connection: keep-alive`. Possible values: - - `undefined` (default): use [`http.globalAgent`][] for this host and port. - - `Agent` object: explicitly use the passed in `Agent`. - - `false`: opts out of connection pooling with an Agent, defaults request to - `Connection: close`. -- `createConnection`: A function that produces a socket/stream to use for the - request when the `agent` option is not used. This can be used to avoid - creating a custom Agent class just to override the default `createConnection` - function. See [`agent.createConnection()`][] for more details. - -The optional `callback` parameter will be added as a one time listener for -the `'response'` event. - -`http.request()` returns an instance of the [`http.ClientRequest`][] -class. The `ClientRequest` instance is a writable stream. If one needs to -upload a file with a POST request, then write to the `ClientRequest` object. - -Example: - -```js -var postData = querystring.stringify({ - 'msg' : 'Hello World!' -}); - -var options = { - hostname: 'www.google.com', - port: 80, - path: '/upload', - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': postData.length - } -}; - -var req = http.request(options, (res) => { - console.log(`STATUS: ${res.statusCode}`); - console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - res.setEncoding('utf8'); - res.on('data', (chunk) => { - console.log(`BODY: ${chunk}`); - }); - res.on('end', () => { - console.log('No more data in response.') - }) -}); - -req.on('error', (e) => { - console.log(`problem with request: ${e.message}`); -}); - -// write data to request body -req.write(postData); -req.end(); -``` - -Note that in the example `req.end()` was called. With `http.request()` one -must always call `req.end()` to signify that you're done with the request - -even if there is no data being written to the request body. - -If any error is encountered during the request (be that with DNS resolution, -TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted -on the returned request object. As with all `'error'` events, if no listeners -are registered the error will be thrown. - -There are a few special headers that should be noted. - -* Sending a 'Connection: keep-alive' will notify Node.js that the connection to - the server should be persisted until the next request. - -* Sending a 'Content-length' header will disable the default chunked encoding. - -* Sending an 'Expect' header will immediately send the request headers. - Usually, when sending 'Expect: 100-continue', you should both set a timeout - and listen for the `'continue'` event. See RFC2616 Section 8.2.3 for more - information. - -* Sending an Authorization header will override using the `auth` option - to compute basic authentication. - -[`'checkContinue'`]: #http_event_checkcontinue -[`'listening'`]: net.html#net_event_listening -[`'response'`]: #http_event_response -[`Agent`]: #http_class_http_agent -[`agent.createConnection()`]: #http_agent_createconnection -[`Buffer`]: buffer.html#buffer_buffer -[`destroy()`]: #http_agent_destroy -[`EventEmitter`]: events.html#events_class_events_eventemitter -[`http.Agent`]: #http_class_http_agent -[`http.ClientRequest`]: #http_class_http_clientrequest -[`http.globalAgent`]: #http_http_globalagent -[`http.IncomingMessage`]: #http_class_http_incomingmessage -[`http.request()`]: #http_http_request_options_callback -[`http.Server`]: #http_class_http_server -[`http.ServerResponse`]: #http_class_http_serverresponse -[`message.headers`]: #http_message_headers -[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener -[`net.Server`]: net.html#net_class_net_server -[`net.Server.close()`]: net.html#net_server_close_callback -[`net.Server.listen()`]: net.html#net_server_listen_handle_callback -[`net.Server.listen(path)`]: net.html#net_server_listen_path_callback -[`net.Server.listen(port)`]: net.html#net_server_listen_port_hostname_backlog_callback -[`net.Socket`]: net.html#net_class_net_socket -[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed -[`response.end()`]: #http_response_end_data_encoding_callback -[`response.setHeader()`]: #http_response_setheader_name_value -[`response.write()`]: #http_response_write_chunk_encoding_callback -[`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback -[`response.writeContinue()`]: #http_response_writecontinue -[`response.writeHead()`]: #http_response_writehead_statuscode_statusmessage_headers -[`socket.setKeepAlive()`]: net.html#net_socket_setkeepalive_enable_initialdelay -[`socket.setNoDelay()`]: net.html#net_socket_setnodelay_nodelay -[`socket.setTimeout()`]: net.html#net_socket_settimeout_timeout_callback -[`stream.setEncoding()`]: stream.html#stream_stream_setencoding_encoding -[`TypeError`]: errors.html#errors_class_typeerror -[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost -[constructor options]: #http_new_agent_options -[Readable Stream]: stream.html#stream_class_stream_readable -[Writable Stream]: stream.html#stream_class_stream_writable diff --git a/doc/api/http.md b/doc/api/http.md new file mode 100644 index 00000000000000..fad0e87e9ca1a4 --- /dev/null +++ b/doc/api/http.md @@ -0,0 +1,1263 @@ +# HTTP + + Stability: 2 - Stable + +To use the HTTP server and client one must `require('http')`. + +The HTTP interfaces in Node.js are designed to support many features +of the protocol which have been traditionally difficult to use. +In particular, large, possibly chunk-encoded, messages. The interface is +careful to never buffer entire requests or responses--the +user is able to stream data. + +HTTP message headers are represented by an object like this: + +``` +{ 'content-length': '123', + 'content-type': 'text/plain', + 'connection': 'keep-alive', + 'host': 'mysite.com', + 'accept': '*/*' } +``` + +Keys are lowercased. Values are not modified. + +In order to support the full spectrum of possible HTTP applications, Node.js's +HTTP API is very low-level. It deals with stream handling and message +parsing only. It parses a message into headers and body but it does not +parse the actual headers or the body. + +See [`message.headers`][] for details on how duplicate headers are handled. + +The raw headers as they were received are retained in the `rawHeaders` +property, which is an array of `[key, value, key2, value2, ...]`. For +example, the previous message header object might have a `rawHeaders` +list like the following: + +``` +[ 'ConTent-Length', '123456', + 'content-LENGTH', '123', + 'content-type', 'text/plain', + 'CONNECTION', 'keep-alive', + 'Host', 'mysite.com', + 'accepT', '*/*' ] +``` + +## Class: http.Agent + +The HTTP Agent is used for pooling sockets used in HTTP client +requests. + +The HTTP Agent also defaults client requests to using +Connection:keep-alive. If no pending HTTP requests are waiting on a +socket to become free the socket is closed. This means that Node.js's +pool has the benefit of keep-alive when under load but still does not +require developers to manually close the HTTP clients using +KeepAlive. + +If you opt into using HTTP KeepAlive, you can create an Agent object +with that flag set to `true`. (See the [constructor options][].) +Then, the Agent will keep unused sockets in a pool for later use. They +will be explicitly marked so as to not keep the Node.js process running. +However, it is still a good idea to explicitly [`destroy()`][] KeepAlive +agents when they are no longer in use, so that the Sockets will be shut +down. + +Sockets are removed from the agent's pool when the socket emits either +a `'close'` event or a special `'agentRemove'` event. This means that if +you intend to keep one HTTP request open for a long time and don't +want it to stay in the pool you can do something along the lines of: + +```js +http.get(options, (res) => { + // Do stuff +}).on('socket', (socket) => { + socket.emit('agentRemove'); +}); +``` + +Alternatively, you could just opt out of pooling entirely using +`agent:false`: + +```js +http.get({ + hostname: 'localhost', + port: 80, + path: '/', + agent: false // create a new agent just for this one request +}, (res) => { + // Do stuff with response +}) +``` + +### new Agent([options]) + +* `options` {Object} Set of configurable options to set on the agent. + Can have the following fields: + * `keepAlive` {Boolean} Keep sockets around in a pool to be used by + other requests in the future. Default = `false` + * `keepAliveMsecs` {Integer} When using HTTP KeepAlive, how often + to send TCP KeepAlive packets over sockets being kept alive. + Default = `1000`. Only relevant if `keepAlive` is set to `true`. + * `maxSockets` {Number} Maximum number of sockets to allow per + host. Default = `Infinity`. + * `maxFreeSockets` {Number} Maximum number of sockets to leave open + in a free state. Only relevant if `keepAlive` is set to `true`. + Default = `256`. + +The default [`http.globalAgent`][] that is used by [`http.request()`][] has all +of these values set to their respective defaults. + +To configure any of them, you must create your own [`http.Agent`][] object. + +```js +const http = require('http'); +var keepAliveAgent = new http.Agent({ keepAlive: true }); +options.agent = keepAliveAgent; +http.request(options, onResponseCallback); +``` + +### agent.createConnection(options[, callback]) + +Produces a socket/stream to be used for HTTP requests. + +By default, this function is the same as [`net.createConnection()`][]. However, +custom Agents may override this method in case greater flexibility is desired. + +A socket/stream can be supplied in one of two ways: by returning the +socket/stream from this function, or by passing the socket/stream to `callback`. + +`callback` has a signature of `(err, stream)`. + +### agent.destroy() + +Destroy any sockets that are currently in use by the agent. + +It is usually not necessary to do this. However, if you are using an +agent with KeepAlive enabled, then it is best to explicitly shut down +the agent when you know that it will no longer be used. Otherwise, +sockets may hang open for quite a long time before the server +terminates them. + +### agent.freeSockets + +An object which contains arrays of sockets currently awaiting use by +the Agent when HTTP KeepAlive is used. Do not modify. + +### agent.getName(options) + +Get a unique name for a set of request options, to determine whether a +connection can be reused. In the http agent, this returns +`host:port:localAddress`. In the https agent, the name includes the +CA, cert, ciphers, and other HTTPS/TLS-specific options that determine +socket reusability. + +Options: + +- `host`: A domain name or IP address of the server to issue the request to. +- `port`: Port of remote server. +- `localAddress`: Local interface to bind for network connections when issuing + the request. + +### agent.maxFreeSockets + +By default set to 256. For Agents supporting HTTP KeepAlive, this +sets the maximum number of sockets that will be left open in the free +state. + +### agent.maxSockets + +By default set to Infinity. Determines how many concurrent sockets the agent +can have open per origin. Origin is either a 'host:port' or +'host:port:localAddress' combination. + +### agent.requests + +An object which contains queues of requests that have not yet been assigned to +sockets. Do not modify. + +### agent.sockets + +An object which contains arrays of sockets currently in use by the +Agent. Do not modify. + +## Class: http.ClientRequest + +This object is created internally and returned from [`http.request()`][]. It +represents an _in-progress_ request whose header has already been queued. The +header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, +`removeHeader(name)` API. The actual header will be sent along with the first +data chunk or when closing the connection. + +To get the response, add a listener for `'response'` to the request object. +`'response'` will be emitted from the request object when the response +headers have been received. The `'response'` event is executed with one +argument which is an instance of [`http.IncomingMessage`][]. + +During the `'response'` event, one can add listeners to the +response object; particularly to listen for the `'data'` event. + +If no `'response'` handler is added, then the response will be +entirely discarded. However, if you add a `'response'` event handler, +then you **must** consume the data from the response object, either by +calling `response.read()` whenever there is a `'readable'` event, or +by adding a `'data'` handler, or by calling the `.resume()` method. +Until the data is consumed, the `'end'` event will not fire. Also, until +the data is read it will consume memory that can eventually lead to a +'process out of memory' error. + +Note: Node.js does not check whether Content-Length and the length of the body +which has been transmitted are equal or not. + +The request implements the [Writable Stream][] interface. This is an +[`EventEmitter`][] with the following events: + +### Event: 'abort' + +`function () { }` + +Emitted when the request has been aborted by the client. This event is only +emitted on the first call to `abort()`. + +### Event: 'checkExpectation' + +`function (request, response) { }` + +Emitted each time a request with an http Expect header is received, where the +value is not 100-continue. If this event isn't listened for, the server will +automatically respond with a 417 Expectation Failed as appropriate. + +Note that when this event is emitted and handled, the `request` event will +not be emitted. + +### Event: 'connect' + +`function (response, socket, head) { }` + +Emitted each time a server responds to a request with a `CONNECT` method. If this +event isn't being listened for, clients receiving a `CONNECT` method will have +their connections closed. + +A client server pair that show you how to listen for the `'connect'` event. + +```js +const http = require('http'); +const net = require('net'); +const url = require('url'); + +// Create an HTTP tunneling proxy +var proxy = http.createServer( (req, res) => { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('okay'); +}); +proxy.on('connect', (req, cltSocket, head) => { + // connect to an origin server + var srvUrl = url.parse(`http://${req.url}`); + var srvSocket = net.connect(srvUrl.port, srvUrl.hostname, () => { + cltSocket.write('HTTP/1.1 200 Connection Established\r\n' + + 'Proxy-agent: Node.js-Proxy\r\n' + + '\r\n'); + srvSocket.write(head); + srvSocket.pipe(cltSocket); + cltSocket.pipe(srvSocket); + }); +}); + +// now that proxy is running +proxy.listen(1337, '127.0.0.1', () => { + + // make a request to a tunneling proxy + var options = { + port: 1337, + hostname: '127.0.0.1', + method: 'CONNECT', + path: 'www.google.com:80' + }; + + var req = http.request(options); + req.end(); + + req.on('connect', (res, socket, head) => { + console.log('got connected!'); + + // make a request over an HTTP tunnel + socket.write('GET / HTTP/1.1\r\n' + + 'Host: www.google.com:80\r\n' + + 'Connection: close\r\n' + + '\r\n'); + socket.on('data', (chunk) => { + console.log(chunk.toString()); + }); + socket.on('end', () => { + proxy.close(); + }); + }); +}); +``` + +### Event: 'continue' + +`function () { }` + +Emitted when the server sends a '100 Continue' HTTP response, usually because +the request contained 'Expect: 100-continue'. This is an instruction that +the client should send the request body. + +### Event: 'response' + +`function (response) { }` + +Emitted when a response is received to this request. This event is emitted only +once. The `response` argument will be an instance of [`http.IncomingMessage`][]. + +### Event: 'socket' + +`function (socket) { }` + +Emitted after a socket is assigned to this request. + +### Event: 'upgrade' + +`function (response, socket, head) { }` + +Emitted each time a server responds to a request with an upgrade. If this +event isn't being listened for, clients receiving an upgrade header will have +their connections closed. + +A client server pair that show you how to listen for the `'upgrade'` event. + +```js +const http = require('http'); + +// Create an HTTP server +var srv = http.createServer( (req, res) => { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('okay'); +}); +srv.on('upgrade', (req, socket, head) => { + socket.write('HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + + 'Upgrade: WebSocket\r\n' + + 'Connection: Upgrade\r\n' + + '\r\n'); + + socket.pipe(socket); // echo back +}); + +// now that server is running +srv.listen(1337, '127.0.0.1', () => { + + // make a request + var options = { + port: 1337, + hostname: '127.0.0.1', + headers: { + 'Connection': 'Upgrade', + 'Upgrade': 'websocket' + } + }; + + var req = http.request(options); + req.end(); + + req.on('upgrade', (res, socket, upgradeHead) => { + console.log('got upgraded!'); + socket.end(); + process.exit(0); + }); +}); +``` + +### request.abort() + +Marks the request as aborting. Calling this will cause remaining data +in the response to be dropped and the socket to be destroyed. + +### request.end([data][, encoding][, callback]) + +Finishes sending the request. If any parts of the body are +unsent, it will flush them to the stream. If the request is +chunked, this will send the terminating `'0\r\n\r\n'`. + +If `data` is specified, it is equivalent to calling +[`response.write(data, encoding)`][] followed by `request.end(callback)`. + +If `callback` is specified, it will be called when the request stream +is finished. + +### request.flushHeaders() + +Flush the request headers. + +For efficiency reasons, Node.js normally buffers the request headers until you +call `request.end()` or write the first chunk of request data. It then tries +hard to pack the request headers and data into a single TCP packet. + +That's usually what you want (it saves a TCP round-trip) but not when the first +data isn't sent until possibly much later. `request.flushHeaders()` lets you bypass +the optimization and kickstart the request. + +### request.setNoDelay([noDelay]) + +Once a socket is assigned to this request and is connected +[`socket.setNoDelay()`][] will be called. + +### request.setSocketKeepAlive([enable][, initialDelay]) + +Once a socket is assigned to this request and is connected +[`socket.setKeepAlive()`][] will be called. + +### request.setTimeout(timeout[, callback]) + +Once a socket is assigned to this request and is connected +[`socket.setTimeout()`][] will be called. + +* `timeout` {Number} Milliseconds before a request is considered to be timed out. +* `callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + +### request.write(chunk[, encoding][, callback]) + +Sends a chunk of the body. By calling this method +many times, the user can stream a request body to a +server--in that case it is suggested to use the +`['Transfer-Encoding', 'chunked']` header line when +creating the request. + +The `chunk` argument should be a [`Buffer`][] or a string. + +The `encoding` argument is optional and only applies when `chunk` is a string. +Defaults to `'utf8'`. + +The `callback` argument is optional and will be called when this chunk of data +is flushed. + +Returns `request`. + +## Class: http.Server + +This class inherits from [`net.Server`][] and has the following additional events: + +### Event: 'checkContinue' + +`function (request, response) { }` + +Emitted each time a request with an http Expect: 100-continue is received. +If this event isn't listened for, the server will automatically respond +with a 100 Continue as appropriate. + +Handling this event involves calling [`response.writeContinue()`][] if the client +should continue to send the request body, or generating an appropriate HTTP +response (e.g., 400 Bad Request) if the client should not continue to send the +request body. + +Note that when this event is emitted and handled, the `'request'` event will +not be emitted. + +### Event: 'clientError' + +`function (exception, socket) { }` + +If a client connection emits an `'error'` event, it will be forwarded here. +Listener of this event is responsible for closing/destroying the underlying +socket. For example, one may wish to more gracefully close the socket with an +HTTP '400 Bad Request' response instead of abruptly severing the connection. + +Default behavior is to destroy the socket immediately on malformed request. + +`socket` is the [`net.Socket`][] object that the error originated from. + +```js +const http = require('http'); + +const server = http.createServer((req, res) => { + res.end(); +}); +server.on('clientError', (err, socket) => { + socket.end('HTTP/1.1 400 Bad Request\r\n\r\n'); +}); +server.listen(8000); +``` + +When the `'clientError'` event occurs, there is no `request` or `response` +object, so any HTTP response sent, including response headers and payload, +*must* be written directly to the `socket` object. Care must be taken to +ensure the response is a properly formatted HTTP response message. + +### Event: 'close' + +`function () { }` + +Emitted when the server closes. + +### Event: 'connect' + +`function (request, socket, head) { }` + +Emitted each time a client requests a http `CONNECT` method. If this event isn't +listened for, then clients requesting a `CONNECT` method will have their +connections closed. + +* `request` is the arguments for the http request, as it is in the request + event. +* `socket` is the network socket between the server and client. +* `head` is an instance of Buffer, the first packet of the tunneling stream, + this may be empty. + +After this event is emitted, the request's socket will not have a `'data'` +event listener, meaning you will need to bind to it in order to handle data +sent to the server on that socket. + +### Event: 'connection' + +`function (socket) { }` + +When a new TCP stream is established. `socket` is an object of type +[`net.Socket`][]. Usually users will not want to access this event. In +particular, the socket will not emit `'readable'` events because of how +the protocol parser attaches to the socket. The `socket` can also be +accessed at `request.connection`. + +### Event: 'request' + +`function (request, response) { }` + +Emitted each time there is a request. Note that there may be multiple requests +per connection (in the case of keep-alive connections). + `request` is an instance of [`http.IncomingMessage`][] and `response` is +an instance of [`http.ServerResponse`][]. + +### Event: 'upgrade' + +`function (request, socket, head) { }` + +Emitted each time a client requests a http upgrade. If this event isn't +listened for, then clients requesting an upgrade will have their connections +closed. + +* `request` is the arguments for the http request, as it is in the request + event. +* `socket` is the network socket between the server and client. +* `head` is an instance of Buffer, the first packet of the upgraded stream, + this may be empty. + +After this event is emitted, the request's socket will not have a `'data'` +event listener, meaning you will need to bind to it in order to handle data +sent to the server on that socket. + +### server.close([callback]) + +Stops the server from accepting new connections. See [`net.Server.close()`][]. + +### server.listen(handle[, callback]) + +* `handle` {Object} +* `callback` {Function} + +The `handle` object can be set to either a server or socket (anything +with an underlying `_handle` member), or a `{fd: }` object. + +This will cause the server to accept connections on the specified +handle, but it is presumed that the file descriptor or handle has +already been bound to a port or domain socket. + +Listening on a file descriptor is not supported on Windows. + +This function is asynchronous. The last parameter `callback` will be added as +a listener for the `'listening'` event. See also [`net.Server.listen()`][]. + +Returns `server`. + +### server.listen(path[, callback]) + +Start a UNIX socket server listening for connections on the given `path`. + +This function is asynchronous. The last parameter `callback` will be added as +a listener for the `'listening'` event. See also [`net.Server.listen(path)`][]. + +### server.listen(port[, hostname][, backlog][, callback]) + +Begin accepting connections on the specified `port` and `hostname`. If the +`hostname` is omitted, the server will accept connections on any IPv6 address +(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A +port value of zero will assign a random port. + +To listen to a unix socket, supply a filename instead of port and hostname. + +Backlog is the maximum length of the queue of pending connections. +The actual length will be determined by your OS through sysctl settings such as +`tcp_max_syn_backlog` and `somaxconn` on linux. The default value of this +parameter is 511 (not 512). + +This function is asynchronous. The last parameter `callback` will be added as +a listener for the `'listening'` event. See also [`net.Server.listen(port)`][]. + +### server.listening + +A Boolean indicating whether or not the server is listening for +connections. + +### server.maxHeadersCount + +Limits maximum incoming headers count, equal to 1000 by default. If set to 0 - +no limit will be applied. + +### server.setTimeout(msecs, callback) + +* `msecs` {Number} +* `callback` {Function} + +Sets the timeout value for sockets, and emits a `'timeout'` event on +the Server object, passing the socket as an argument, if a timeout +occurs. + +If there is a `'timeout'` event listener on the Server object, then it +will be called with the timed-out socket as an argument. + +By default, the Server's timeout value is 2 minutes, and sockets are +destroyed automatically if they time out. However, if you assign a +callback to the Server's `'timeout'` event, then you are responsible +for handling socket timeouts. + +Returns `server`. + +### server.timeout + +* {Number} Default = 120000 (2 minutes) + +The number of milliseconds of inactivity before a socket is presumed +to have timed out. + +Note that the socket timeout logic is set up on connection, so +changing this value only affects *new* connections to the server, not +any existing connections. + +Set to 0 to disable any kind of automatic timeout behavior on incoming +connections. + +## Class: http.ServerResponse + +This object is created internally by a HTTP server--not by the user. It is +passed as the second parameter to the `'request'` event. + +The response implements, but does not inherit from, the [Writable Stream][] +interface. This is an [`EventEmitter`][] with the following events: + +### Event: 'close' + +`function () { }` + +Indicates that the underlying connection was terminated before +[`response.end()`][] was called or able to flush. + +### Event: 'finish' + +`function () { }` + +Emitted when the response has been sent. More specifically, this event is +emitted when the last segment of the response headers and body have been +handed off to the operating system for transmission over the network. It +does not imply that the client has received anything yet. + +After this event, no more events will be emitted on the response object. + +### response.addTrailers(headers) + +This method adds HTTP trailing headers (a header but at the end of the +message) to the response. + +Trailers will **only** be emitted if chunked encoding is used for the +response; if it is not (e.g., if the request was HTTP/1.0), they will +be silently discarded. + +Note that HTTP requires the `Trailer` header to be sent if you intend to +emit trailers, with a list of the header fields in its value. E.g., + +```js +response.writeHead(200, { 'Content-Type': 'text/plain', + 'Trailer': 'Content-MD5' }); +response.write(fileData); +response.addTrailers({'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667'}); +response.end(); +``` + +Attempting to set a header field name or value that contains invalid characters +will result in a [`TypeError`][] being thrown. + +### response.end([data][, encoding][, callback]) + +This method signals to the server that all of the response headers and body +have been sent; that server should consider this message complete. +The method, `response.end()`, MUST be called on each response. + +If `data` is specified, it is equivalent to calling +[`response.write(data, encoding)`][] followed by `response.end(callback)`. + +If `callback` is specified, it will be called when the response stream +is finished. + +### response.finished + +Boolean value that indicates whether the response has completed. Starts +as `false`. After [`response.end()`][] executes, the value will be `true`. + +### response.getHeader(name) + +Reads out a header that's already been queued but not sent to the client. Note +that the name is case insensitive. This can only be called before headers get +implicitly flushed. + +Example: + +```js +var contentType = response.getHeader('content-type'); +``` + +### response.headersSent + +Boolean (read-only). True if headers were sent, false otherwise. + +### response.removeHeader(name) + +Removes a header that's queued for implicit sending. + +Example: + +```js +response.removeHeader('Content-Encoding'); +``` + +### response.sendDate + +When true, the Date header will be automatically generated and sent in +the response if it is not already present in the headers. Defaults to true. + +This should only be disabled for testing; HTTP requires the Date header +in responses. + +### response.setHeader(name, value) + +Sets a single header value for implicit headers. If this header already exists +in the to-be-sent headers, its value will be replaced. Use an array of strings +here if you need to send multiple headers with the same name. + +Example: + +```js +response.setHeader('Content-Type', 'text/html'); +``` + +or + +```js +response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); +``` + +Attempting to set a header field name or value that contains invalid characters +will result in a [`TypeError`][] being thrown. + +When headers have been set with [`response.setHeader()`][], they will be merged with +any headers passed to [`response.writeHead()`][], with the headers passed to +[`response.writeHead()`][] given precedence. + +```js +// returns content-type = text/plain +const server = http.createServer((req,res) => { + res.setHeader('Content-Type', 'text/html'); + res.setHeader('X-Foo', 'bar'); + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('ok'); +}); +``` + +### response.setTimeout(msecs, callback) + +* `msecs` {Number} +* `callback` {Function} + +Sets the Socket's timeout value to `msecs`. If a callback is +provided, then it is added as a listener on the `'timeout'` event on +the response object. + +If no `'timeout'` listener is added to the request, the response, or +the server, then sockets are destroyed when they time out. If you +assign a handler on the request, the response, or the server's +`'timeout'` events, then it is your responsibility to handle timed out +sockets. + +Returns `response`. + +### response.statusCode + +When using implicit headers (not calling [`response.writeHead()`][] explicitly), +this property controls the status code that will be sent to the client when +the headers get flushed. + +Example: + +```js +response.statusCode = 404; +``` + +After response header was sent to the client, this property indicates the +status code which was sent out. + +### response.statusMessage + +When using implicit headers (not calling [`response.writeHead()`][] explicitly), this property +controls the status message that will be sent to the client when the headers get +flushed. If this is left as `undefined` then the standard message for the status +code will be used. + +Example: + +```js +response.statusMessage = 'Not found'; +``` + +After response header was sent to the client, this property indicates the +status message which was sent out. + +### response.write(chunk[, encoding][, callback]) + +If this method is called and [`response.writeHead()`][] has not been called, +it will switch to implicit header mode and flush the implicit headers. + +This sends a chunk of the response body. This method may +be called multiple times to provide successive parts of the body. + +`chunk` can be a string or a buffer. If `chunk` is a string, +the second parameter specifies how to encode it into a byte stream. +By default the `encoding` is `'utf8'`. The last parameter `callback` +will be called when this chunk of data is flushed. + +**Note**: This is the raw HTTP body and has nothing to do with +higher-level multi-part body encodings that may be used. + +The first time [`response.write()`][] is called, it will send the buffered +header information and the first body to the client. The second time +[`response.write()`][] is called, Node.js assumes you're going to be streaming +data, and sends that separately. That is, the response is buffered up to the +first chunk of body. + +Returns `true` if the entire data was flushed successfully to the kernel +buffer. Returns `false` if all or part of the data was queued in user memory. +`'drain'` will be emitted when the buffer is free again. + +### response.writeContinue() + +Sends a HTTP/1.1 100 Continue message to the client, indicating that +the request body should be sent. See the [`'checkContinue'`][] event on `Server`. + +### response.writeHead(statusCode[, statusMessage][, headers]) + +Sends a response header to the request. The status code is a 3-digit HTTP +status code, like `404`. The last argument, `headers`, are the response headers. +Optionally one can give a human-readable `statusMessage` as the second +argument. + +Example: + +```js +var body = 'hello world'; +response.writeHead(200, { + 'Content-Length': body.length, + 'Content-Type': 'text/plain' }); +``` + +This method must only be called once on a message and it must +be called before [`response.end()`][] is called. + +If you call [`response.write()`][] or [`response.end()`][] before calling this, +the implicit/mutable headers will be calculated and call this function for you. + +When headers have been set with [`response.setHeader()`][], they will be merged with +any headers passed to [`response.writeHead()`][], with the headers passed to +[`response.writeHead()`][] given precedence. + +```js +// returns content-type = text/plain +const server = http.createServer((req,res) => { + res.setHeader('Content-Type', 'text/html'); + res.setHeader('X-Foo', 'bar'); + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('ok'); +}); +``` + +Note that Content-Length is given in bytes not characters. The above example +works because the string `'hello world'` contains only single byte characters. +If the body contains higher coded characters then `Buffer.byteLength()` +should be used to determine the number of bytes in a given encoding. +And Node.js does not check whether Content-Length and the length of the body +which has been transmitted are equal or not. + +Attempting to set a header field name or value that contains invalid characters +will result in a [`TypeError`][] being thrown. + +## Class: http.IncomingMessage + +An `IncomingMessage` object is created by [`http.Server`][] or +[`http.ClientRequest`][] and passed as the first argument to the `'request'` +and `'response'` event respectively. It may be used to access response status, +headers and data. + +It implements the [Readable Stream][] interface, as well as the +following additional events, methods, and properties. + +### Event: 'close' + +`function () { }` + +Indicates that the underlying connection was closed. +Just like `'end'`, this event occurs only once per response. + +### message.headers + +The request/response headers object. + +Key-value pairs of header names and values. Header names are lower-cased. +Example: + +```js +// Prints something like: +// +// { 'user-agent': 'curl/7.22.0', +// host: '127.0.0.1:8000', +// accept: '*/*' } +console.log(request.headers); +``` + +Duplicates in raw headers are handled in the following ways, depending on the +header name: + +* Duplicates of `age`, `authorization`, `content-length`, `content-type`, +`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, +`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`, +`retry-after`, or `user-agent` are discarded. +* `set-cookie` is always an array. Duplicates are added to the array. +* For all other headers, the values are joined together with ', '. + +### message.httpVersion + +In case of server request, the HTTP version sent by the client. In the case of +client response, the HTTP version of the connected-to server. +Probably either `'1.1'` or `'1.0'`. + +Also `message.httpVersionMajor` is the first integer and +`message.httpVersionMinor` is the second. + +### message.method + +**Only valid for request obtained from [`http.Server`][].** + +The request method as a string. Read only. Example: +`'GET'`, `'DELETE'`. + +### message.rawHeaders + +The raw request/response headers list exactly as they were received. + +Note that the keys and values are in the same list. It is *not* a +list of tuples. So, the even-numbered offsets are key values, and the +odd-numbered offsets are the associated values. + +Header names are not lowercased, and duplicates are not merged. + +```js +// Prints something like: +// +// [ 'user-agent', +// 'this is invalid because there can be only one', +// 'User-Agent', +// 'curl/7.22.0', +// 'Host', +// '127.0.0.1:8000', +// 'ACCEPT', +// '*/*' ] +console.log(request.rawHeaders); +``` + +### message.rawTrailers + +The raw request/response trailer keys and values exactly as they were +received. Only populated at the `'end'` event. + +### message.setTimeout(msecs, callback) + +* `msecs` {Number} +* `callback` {Function} + +Calls `message.connection.setTimeout(msecs, callback)`. + +Returns `message`. + +### message.statusCode + +**Only valid for response obtained from [`http.ClientRequest`][].** + +The 3-digit HTTP response status code. E.G. `404`. + +### message.statusMessage + +**Only valid for response obtained from [`http.ClientRequest`][].** + +The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + +### message.socket + +The [`net.Socket`][] object associated with the connection. + +With HTTPS support, use [`request.socket.getPeerCertificate()`][] to obtain the +client's authentication details. + +### message.trailers + +The request/response trailers object. Only populated at the `'end'` event. + +### message.url + +**Only valid for request obtained from [`http.Server`][].** + +Request URL string. This contains only the URL that is +present in the actual HTTP request. If the request is: + +``` +GET /status?name=ryan HTTP/1.1\r\n +Accept: text/plain\r\n +\r\n +``` + +Then `request.url` will be: + +``` +'/status?name=ryan' +``` + +If you would like to parse the URL into its parts, you can use +`require('url').parse(request.url)`. Example: + +``` +$ node +> require('url').parse('/status?name=ryan') +{ + href: '/status?name=ryan', + search: '?name=ryan', + query: 'name=ryan', + pathname: '/status' +} +``` + +If you would like to extract the params from the query string, +you can use the `require('querystring').parse` function, or pass +`true` as the second argument to `require('url').parse`. Example: + +``` +$ node +> require('url').parse('/status?name=ryan', true) +{ + href: '/status?name=ryan', + search: '?name=ryan', + query: {name: 'ryan'}, + pathname: '/status' +} +``` + +## http.METHODS + +* {Array} + +A list of the HTTP methods that are supported by the parser. + +## http.STATUS_CODES + +* {Object} + +A collection of all the standard HTTP response status codes, and the +short description of each. For example, `http.STATUS_CODES[404] === 'Not +Found'`. + +## http.createClient([port][, host]) + + Stability: 0 - Deprecated: Use [`http.request()`][] instead. + +Constructs a new HTTP client. `port` and `host` refer to the server to be +connected to. + +## http.createServer([requestListener]) + +Returns a new instance of [`http.Server`][]. + +The `requestListener` is a function which is automatically +added to the `'request'` event. + +## http.get(options[, callback]) + +Since most requests are GET requests without bodies, Node.js provides this +convenience method. The only difference between this method and [`http.request()`][] +is that it sets the method to GET and calls `req.end()` automatically. + +Example: + +```js +http.get('http://www.google.com/index.html', (res) => { + console.log(`Got response: ${res.statusCode}`); + // consume response body + res.resume(); +}).on('error', (e) => { + console.log(`Got error: ${e.message}`); +}); +``` + +## http.globalAgent + +Global instance of Agent which is used as the default for all http client +requests. + +## http.request(options[, callback]) + +Node.js maintains several connections per server to make HTTP requests. +This function allows one to transparently issue requests. + +`options` can be an object or a string. If `options` is a string, it is +automatically parsed with [`url.parse()`][]. + +Options: + +- `protocol`: Protocol to use. Defaults to `'http:'`. +- `host`: A domain name or IP address of the server to issue the request to. + Defaults to `'localhost'`. +- `hostname`: Alias for `host`. To support [`url.parse()`][] `hostname` is + preferred over `host`. +- `family`: IP address family to use when resolving `host` and `hostname`. + Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be + used. +- `port`: Port of remote server. Defaults to 80. +- `localAddress`: Local interface to bind for network connections. +- `socketPath`: Unix Domain Socket (use one of host:port or socketPath). +- `method`: A string specifying the HTTP request method. Defaults to `'GET'`. +- `path`: Request path. Defaults to `'/'`. Should include query string if any. + E.G. `'/index.html?page=12'`. An exception is thrown when the request path + contains illegal characters. Currently, only spaces are rejected but that + may change in the future. +- `headers`: An object containing request headers. +- `auth`: Basic authentication i.e. `'user:password'` to compute an + Authorization header. +- `agent`: Controls [`Agent`][] behavior. When an Agent is used request will + default to `Connection: keep-alive`. Possible values: + - `undefined` (default): use [`http.globalAgent`][] for this host and port. + - `Agent` object: explicitly use the passed in `Agent`. + - `false`: opts out of connection pooling with an Agent, defaults request to + `Connection: close`. +- `createConnection`: A function that produces a socket/stream to use for the + request when the `agent` option is not used. This can be used to avoid + creating a custom Agent class just to override the default `createConnection` + function. See [`agent.createConnection()`][] for more details. + +The optional `callback` parameter will be added as a one time listener for +the `'response'` event. + +`http.request()` returns an instance of the [`http.ClientRequest`][] +class. The `ClientRequest` instance is a writable stream. If one needs to +upload a file with a POST request, then write to the `ClientRequest` object. + +Example: + +```js +var postData = querystring.stringify({ + 'msg' : 'Hello World!' +}); + +var options = { + hostname: 'www.google.com', + port: 80, + path: '/upload', + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': postData.length + } +}; + +var req = http.request(options, (res) => { + console.log(`STATUS: ${res.statusCode}`); + console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + res.setEncoding('utf8'); + res.on('data', (chunk) => { + console.log(`BODY: ${chunk}`); + }); + res.on('end', () => { + console.log('No more data in response.') + }) +}); + +req.on('error', (e) => { + console.log(`problem with request: ${e.message}`); +}); + +// write data to request body +req.write(postData); +req.end(); +``` + +Note that in the example `req.end()` was called. With `http.request()` one +must always call `req.end()` to signify that you're done with the request - +even if there is no data being written to the request body. + +If any error is encountered during the request (be that with DNS resolution, +TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted +on the returned request object. As with all `'error'` events, if no listeners +are registered the error will be thrown. + +There are a few special headers that should be noted. + +* Sending a 'Connection: keep-alive' will notify Node.js that the connection to + the server should be persisted until the next request. + +* Sending a 'Content-length' header will disable the default chunked encoding. + +* Sending an 'Expect' header will immediately send the request headers. + Usually, when sending 'Expect: 100-continue', you should both set a timeout + and listen for the `'continue'` event. See RFC2616 Section 8.2.3 for more + information. + +* Sending an Authorization header will override using the `auth` option + to compute basic authentication. + +[`'checkContinue'`]: #http_event_checkcontinue +[`'listening'`]: net.html#net_event_listening +[`'response'`]: #http_event_response +[`Agent`]: #http_class_http_agent +[`agent.createConnection()`]: #http_agent_createconnection_options_callback +[`Buffer`]: buffer.html#buffer_buffer +[`destroy()`]: #http_agent_destroy +[`EventEmitter`]: events.html#events_class_eventemitter +[`http.Agent`]: #http_class_http_agent +[`http.ClientRequest`]: #http_class_http_clientrequest +[`http.globalAgent`]: #http_http_globalagent +[`http.IncomingMessage`]: #http_class_http_incomingmessage +[`http.request()`]: #http_http_request_options_callback +[`http.Server`]: #http_class_http_server +[`http.ServerResponse`]: #http_class_http_serverresponse +[`message.headers`]: #http_message_headers +[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener +[`net.Server`]: net.html#net_class_net_server +[`net.Server.close()`]: net.html#net_server_close_callback +[`net.Server.listen()`]: net.html#net_server_listen_handle_backlog_callback +[`net.Server.listen(path)`]: net.html#net_server_listen_path_backlog_callback +[`net.Server.listen(port)`]: net.html#net_server_listen_port_hostname_backlog_callback +[`net.Socket`]: net.html#net_class_net_socket +[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed +[`response.end()`]: #http_response_end_data_encoding_callback +[`response.setHeader()`]: #http_response_setheader_name_value +[`response.write()`]: #http_response_write_chunk_encoding_callback +[`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback +[`response.writeContinue()`]: #http_response_writecontinue +[`response.writeHead()`]: #http_response_writehead_statuscode_statusmessage_headers +[`socket.setKeepAlive()`]: net.html#net_socket_setkeepalive_enable_initialdelay +[`socket.setNoDelay()`]: net.html#net_socket_setnodelay_nodelay +[`socket.setTimeout()`]: net.html#net_socket_settimeout_timeout_callback +[`stream.setEncoding()`]: stream.html#stream_stream_setencoding_encoding +[`TypeError`]: errors.html#errors_class_typeerror +[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost +[constructor options]: #http_new_agent_options +[Readable Stream]: stream.html#stream_class_stream_readable +[Writable Stream]: stream.html#stream_class_stream_writable diff --git a/doc/api/https.markdown b/doc/api/https.markdown deleted file mode 100644 index 69b5f418466859..00000000000000 --- a/doc/api/https.markdown +++ /dev/null @@ -1,246 +0,0 @@ -# HTTPS - - Stability: 2 - Stable - -HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a -separate module. - -## Class: https.Agent - -An Agent object for HTTPS similar to [`http.Agent`][]. See [`https.request()`][] -for more information. - -## Class: https.Server - -This class is a subclass of `tls.Server` and emits events same as -[`http.Server`][]. See [`http.Server`][] for more information. - -### server.setTimeout(msecs, callback) - -See [`http.Server#setTimeout()`][]. - -### server.timeout - -See [`http.Server#timeout`][]. - -## https.createServer(options[, requestListener]) - -Returns a new HTTPS web server object. The `options` is similar to -[`tls.createServer()`][]. The `requestListener` is a function which is -automatically added to the `'request'` event. - -Example: - -```js -// curl -k https://localhost:8000/ -const https = require('https'); -const fs = require('fs'); - -const options = { - key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') -}; - -https.createServer(options, (req, res) => { - res.writeHead(200); - res.end('hello world\n'); -}).listen(8000); -``` - -Or - -```js -const https = require('https'); -const fs = require('fs'); - -const options = { - pfx: fs.readFileSync('server.pfx') -}; - -https.createServer(options, (req, res) => { - res.writeHead(200); - res.end('hello world\n'); -}).listen(8000); -``` - -### server.close([callback]) - -See [`http.close()`][] for details. - -### server.listen(handle[, callback]) -### server.listen(path[, callback]) -### server.listen(port[, host][, backlog][, callback]) - -See [`http.listen()`][] for details. - -## https.get(options, callback) - -Like [`http.get()`][] but for HTTPS. - -`options` can be an object or a string. If `options` is a string, it is -automatically parsed with [`url.parse()`][]. - -Example: - -```js -const https = require('https'); - -https.get('https://encrypted.google.com/', (res) => { - console.log('statusCode: ', res.statusCode); - console.log('headers: ', res.headers); - - res.on('data', (d) => { - process.stdout.write(d); - }); - -}).on('error', (e) => { - console.error(e); -}); -``` - -## https.globalAgent - -Global instance of [`https.Agent`][] for all HTTPS client requests. - -## https.request(options, callback) - -Makes a request to a secure web server. - -`options` can be an object or a string. If `options` is a string, it is -automatically parsed with [`url.parse()`][]. - -All options from [`http.request()`][] are valid. - -Example: - -```js -const https = require('https'); - -var options = { - hostname: 'encrypted.google.com', - port: 443, - path: '/', - method: 'GET' -}; - -var req = https.request(options, (res) => { - console.log('statusCode: ', res.statusCode); - console.log('headers: ', res.headers); - - res.on('data', (d) => { - process.stdout.write(d); - }); -}); -req.end(); - -req.on('error', (e) => { - console.error(e); -}); -``` - -The options argument has the following options - -- `host`: A domain name or IP address of the server to issue the request to. - Defaults to `'localhost'`. -- `hostname`: Alias for `host`. To support `url.parse()` `hostname` is - preferred over `host`. -- `family`: IP address family to use when resolving `host` and `hostname`. - Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be - used. -- `port`: Port of remote server. Defaults to 443. -- `localAddress`: Local interface to bind for network connections. -- `socketPath`: Unix Domain Socket (use one of host:port or socketPath). -- `method`: A string specifying the HTTP request method. Defaults to `'GET'`. -- `path`: Request path. Defaults to `'/'`. Should include query string if any. - E.G. `'/index.html?page=12'`. An exception is thrown when the request path - contains illegal characters. Currently, only spaces are rejected but that - may change in the future. -- `headers`: An object containing request headers. -- `auth`: Basic authentication i.e. `'user:password'` to compute an - Authorization header. -- `agent`: Controls [`Agent`][] behavior. When an Agent is used request will - default to `Connection: keep-alive`. Possible values: - - `undefined` (default): use [`globalAgent`][] for this host and port. - - `Agent` object: explicitly use the passed in `Agent`. - - `false`: opts out of connection pooling with an Agent, defaults request to - `Connection: close`. - -The following options from [`tls.connect()`][] can also be specified. However, a -[`globalAgent`][] silently ignores these. - -- `pfx`: Certificate, Private key and CA certificates to use for SSL. Default `null`. -- `key`: Private key to use for SSL. Default `null`. -- `passphrase`: A string of passphrase for the private key or pfx. Default `null`. -- `cert`: Public x509 certificate to use. Default `null`. -- `ca`: A string, [`Buffer`][] or array of strings or [`Buffer`][]s of trusted - certificates in PEM format. If this is omitted several well known "root" - CAs will be used, like VeriSign. These are used to authorize connections. -- `ciphers`: A string describing the ciphers to use or exclude. Consult - for - details on the format. -- `rejectUnauthorized`: If `true`, the server certificate is verified against - the list of supplied CAs. An `'error'` event is emitted if verification - fails. Verification happens at the connection level, *before* the HTTP - request is sent. Default `true`. -- `secureProtocol`: The SSL method to use, e.g. `SSLv3_method` to force - SSL version 3. The possible values depend on your installation of - OpenSSL and are defined in the constant [`SSL_METHODS`][]. -- `servername`: Servername for SNI (Server Name Indication) TLS extension. - -In order to specify these options, use a custom [`Agent`][]. - -Example: - -```js -var options = { - hostname: 'encrypted.google.com', - port: 443, - path: '/', - method: 'GET', - key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') -}; -options.agent = new https.Agent(options); - -var req = https.request(options, (res) => { - ... -} -``` - -Alternatively, opt out of connection pooling by not using an `Agent`. - -Example: - -```js -var options = { - hostname: 'encrypted.google.com', - port: 443, - path: '/', - method: 'GET', - key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - agent: false -}; - -var req = https.request(options, (res) => { - ... -} -``` - -[`Agent`]: #https_class_https_agent -[`Buffer`]: buffer.html#buffer_buffer -[`globalAgent`]: #https_https_globalagent -[`http.Agent`]: http.html#http_class_http_agent -[`http.close()`]: http.html#http_server_close_callback -[`http.get()`]: http.html#http_http_get_options_callback -[`http.listen()`]: http.html#http_server_listen_port_hostname_backlog_callback -[`http.request()`]: http.html#http_http_request_options_callback -[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback -[`http.Server#timeout`]: http.html#http_server_timeout -[`http.Server`]: http.html#http_class_http_server -[`https.Agent`]: #https_class_https_agent -[`https.request()`]: #https_https_request_options_callback -[`SSL_METHODS`]: https://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS -[`tls.connect()`]: tls.html#tls_tls_connect_options_callback -[`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener -[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost diff --git a/doc/api/https.md b/doc/api/https.md new file mode 100644 index 00000000000000..09c4b5d2b9775f --- /dev/null +++ b/doc/api/https.md @@ -0,0 +1,246 @@ +# HTTPS + + Stability: 2 - Stable + +HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a +separate module. + +## Class: https.Agent + +An Agent object for HTTPS similar to [`http.Agent`][]. See [`https.request()`][] +for more information. + +## Class: https.Server + +This class is a subclass of `tls.Server` and emits events same as +[`http.Server`][]. See [`http.Server`][] for more information. + +### server.setTimeout(msecs, callback) + +See [`http.Server#setTimeout()`][]. + +### server.timeout + +See [`http.Server#timeout`][]. + +## https.createServer(options[, requestListener]) + +Returns a new HTTPS web server object. The `options` is similar to +[`tls.createServer()`][]. The `requestListener` is a function which is +automatically added to the `'request'` event. + +Example: + +```js +// curl -k https://localhost:8000/ +const https = require('https'); +const fs = require('fs'); + +const options = { + key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') +}; + +https.createServer(options, (req, res) => { + res.writeHead(200); + res.end('hello world\n'); +}).listen(8000); +``` + +Or + +```js +const https = require('https'); +const fs = require('fs'); + +const options = { + pfx: fs.readFileSync('server.pfx') +}; + +https.createServer(options, (req, res) => { + res.writeHead(200); + res.end('hello world\n'); +}).listen(8000); +``` + +### server.close([callback]) + +See [`http.close()`][] for details. + +### server.listen(handle[, callback]) +### server.listen(path[, callback]) +### server.listen(port[, host][, backlog][, callback]) + +See [`http.listen()`][] for details. + +## https.get(options, callback) + +Like [`http.get()`][] but for HTTPS. + +`options` can be an object or a string. If `options` is a string, it is +automatically parsed with [`url.parse()`][]. + +Example: + +```js +const https = require('https'); + +https.get('https://encrypted.google.com/', (res) => { + console.log('statusCode: ', res.statusCode); + console.log('headers: ', res.headers); + + res.on('data', (d) => { + process.stdout.write(d); + }); + +}).on('error', (e) => { + console.error(e); +}); +``` + +## https.globalAgent + +Global instance of [`https.Agent`][] for all HTTPS client requests. + +## https.request(options, callback) + +Makes a request to a secure web server. + +`options` can be an object or a string. If `options` is a string, it is +automatically parsed with [`url.parse()`][]. + +All options from [`http.request()`][] are valid. + +Example: + +```js +const https = require('https'); + +var options = { + hostname: 'encrypted.google.com', + port: 443, + path: '/', + method: 'GET' +}; + +var req = https.request(options, (res) => { + console.log('statusCode: ', res.statusCode); + console.log('headers: ', res.headers); + + res.on('data', (d) => { + process.stdout.write(d); + }); +}); +req.end(); + +req.on('error', (e) => { + console.error(e); +}); +``` + +The options argument has the following options + +- `host`: A domain name or IP address of the server to issue the request to. + Defaults to `'localhost'`. +- `hostname`: Alias for `host`. To support `url.parse()` `hostname` is + preferred over `host`. +- `family`: IP address family to use when resolving `host` and `hostname`. + Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be + used. +- `port`: Port of remote server. Defaults to 443. +- `localAddress`: Local interface to bind for network connections. +- `socketPath`: Unix Domain Socket (use one of host:port or socketPath). +- `method`: A string specifying the HTTP request method. Defaults to `'GET'`. +- `path`: Request path. Defaults to `'/'`. Should include query string if any. + E.G. `'/index.html?page=12'`. An exception is thrown when the request path + contains illegal characters. Currently, only spaces are rejected but that + may change in the future. +- `headers`: An object containing request headers. +- `auth`: Basic authentication i.e. `'user:password'` to compute an + Authorization header. +- `agent`: Controls [`Agent`][] behavior. When an Agent is used request will + default to `Connection: keep-alive`. Possible values: + - `undefined` (default): use [`globalAgent`][] for this host and port. + - `Agent` object: explicitly use the passed in `Agent`. + - `false`: opts out of connection pooling with an Agent, defaults request to + `Connection: close`. + +The following options from [`tls.connect()`][] can also be specified. However, a +[`globalAgent`][] silently ignores these. + +- `pfx`: Certificate, Private key and CA certificates to use for SSL. Default `null`. +- `key`: Private key to use for SSL. Default `null`. +- `passphrase`: A string of passphrase for the private key or pfx. Default `null`. +- `cert`: Public x509 certificate to use. Default `null`. +- `ca`: A string, [`Buffer`][] or array of strings or [`Buffer`][]s of trusted + certificates in PEM format. If this is omitted several well known "root" + CAs will be used, like VeriSign. These are used to authorize connections. +- `ciphers`: A string describing the ciphers to use or exclude. Consult + for + details on the format. +- `rejectUnauthorized`: If `true`, the server certificate is verified against + the list of supplied CAs. An `'error'` event is emitted if verification + fails. Verification happens at the connection level, *before* the HTTP + request is sent. Default `true`. +- `secureProtocol`: The SSL method to use, e.g. `SSLv3_method` to force + SSL version 3. The possible values depend on your installation of + OpenSSL and are defined in the constant [`SSL_METHODS`][]. +- `servername`: Servername for SNI (Server Name Indication) TLS extension. + +In order to specify these options, use a custom [`Agent`][]. + +Example: + +```js +var options = { + hostname: 'encrypted.google.com', + port: 443, + path: '/', + method: 'GET', + key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') +}; +options.agent = new https.Agent(options); + +var req = https.request(options, (res) => { + ... +} +``` + +Alternatively, opt out of connection pooling by not using an `Agent`. + +Example: + +```js +var options = { + hostname: 'encrypted.google.com', + port: 443, + path: '/', + method: 'GET', + key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + agent: false +}; + +var req = https.request(options, (res) => { + ... +} +``` + +[`Agent`]: #https_class_https_agent +[`Buffer`]: buffer.html#buffer_buffer +[`globalAgent`]: #https_https_globalagent +[`http.Agent`]: http.html#http_class_http_agent +[`http.close()`]: http.html#http_server_close_callback +[`http.get()`]: http.html#http_http_get_options_callback +[`http.listen()`]: http.html#http_server_listen_port_hostname_backlog_callback +[`http.request()`]: http.html#http_http_request_options_callback +[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback +[`http.Server#timeout`]: http.html#http_server_timeout +[`http.Server`]: http.html#http_class_http_server +[`https.Agent`]: #https_class_https_agent +[`https.request()`]: #https_https_request_options_callback +[`SSL_METHODS`]: https://www.openssl.org/docs/ssl/ssl.html#DEALING-WITH-PROTOCOL-METHODS +[`tls.connect()`]: tls.html#tls_tls_connect_options_callback +[`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener +[`url.parse()`]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost diff --git a/doc/api/index.markdown b/doc/api/index.markdown deleted file mode 100644 index 1a774507aef098..00000000000000 --- a/doc/api/index.markdown +++ /dev/null @@ -1 +0,0 @@ -@include _toc.markdown diff --git a/doc/api/index.md b/doc/api/index.md new file mode 100644 index 00000000000000..400faf6e5ed34a --- /dev/null +++ b/doc/api/index.md @@ -0,0 +1 @@ +@include _toc.md diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown deleted file mode 100644 index 20c8b175cd9340..00000000000000 --- a/doc/api/modules.markdown +++ /dev/null @@ -1,563 +0,0 @@ -# Modules - - Stability: 3 - Locked - - - -Node.js has a simple module loading system. In Node.js, files and modules are -in one-to-one correspondence. As an example, `foo.js` loads the module -`circle.js` in the same directory. - -The contents of `foo.js`: - -```js -const circle = require('./circle.js'); -console.log( `The area of a circle of radius 4 is ${circle.area(4)}`); -``` - -The contents of `circle.js`: - -```js -const PI = Math.PI; - -exports.area = (r) => PI * r * r; - -exports.circumference = (r) => 2 * PI * r; - -``` - -The module `circle.js` has exported the functions `area()` and -`circumference()`. To add functions and objects to the root of your module, -you can add them to the special `exports` object. - -Variables local to the module will be private, as though the module was wrapped -in a function. In this example the variable `PI` is private to `circle.js`. - -If you want the root of your module's export to be a function (such as a -constructor) or if you want to export a complete object in one assignment -instead of building it one property at a time, assign it to `module.exports` -instead of `exports`. - -Below, `bar.js` makes use of the `square` module, which exports a constructor: - -```js -const square = require('./square.js'); -var mySquare = square(2); -console.log(`The area of my square is ${mySquare.area()}`); -``` - -The `square` module is defined in `square.js`: - -```js -// assigning to exports will not modify module, must use module.exports -module.exports = (width) => { - return { - area: () => width * width - }; -} -``` - -The module system is implemented in the `require("module")` module. - -## Accessing the main module - - - -When a file is run directly from Node.js, `require.main` is set to its -`module`. That means that you can determine whether a file has been run -directly by testing - -```js -require.main === module -``` - -For a file `foo.js`, this will be `true` if run via `node foo.js`, but -`false` if run by `require('./foo')`. - -Because `module` provides a `filename` property (normally equivalent to -`__filename`), the entry point of the current application can be obtained -by checking `require.main.filename`. - -## Addenda: Package Manager Tips - - - -The semantics of Node.js's `require()` function were designed to be general -enough to support a number of reasonable directory structures. Package manager -programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to -build native packages from Node.js modules without modification. - -Below we give a suggested directory structure that could work: - -Let's say that we wanted to have the folder at -`/usr/lib/node//` hold the contents of a -specific version of a package. - -Packages can depend on one another. In order to install package `foo`, you -may have to install a specific version of package `bar`. The `bar` package -may itself have dependencies, and in some cases, these dependencies may even -collide or form cycles. - -Since Node.js looks up the `realpath` of any modules it loads (that is, -resolves symlinks), and then looks for their dependencies in the `node_modules` -folders as described [here](#modules_loading_from_node_modules_folders), this -situation is very simple to resolve with the following architecture: - -* `/usr/lib/node/foo/1.2.3/` - Contents of the `foo` package, version 1.2.3. -* `/usr/lib/node/bar/4.3.2/` - Contents of the `bar` package that `foo` - depends on. -* `/usr/lib/node/foo/1.2.3/node_modules/bar` - Symbolic link to - `/usr/lib/node/bar/4.3.2/`. -* `/usr/lib/node/bar/4.3.2/node_modules/*` - Symbolic links to the packages - that `bar` depends on. - -Thus, even if a cycle is encountered, or if there are dependency -conflicts, every module will be able to get a version of its dependency -that it can use. - -When the code in the `foo` package does `require('bar')`, it will get the -version that is symlinked into `/usr/lib/node/foo/1.2.3/node_modules/bar`. -Then, when the code in the `bar` package calls `require('quux')`, it'll get -the version that is symlinked into -`/usr/lib/node/bar/4.3.2/node_modules/quux`. - -Furthermore, to make the module lookup process even more optimal, rather -than putting packages directly in `/usr/lib/node`, we could put them in -`/usr/lib/node_modules//`. Then Node.js will not bother -looking for missing dependencies in `/usr/node_modules` or `/node_modules`. - -In order to make modules available to the Node.js REPL, it might be useful to -also add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment -variable. Since the module lookups using `node_modules` folders are all -relative, and based on the real path of the files making the calls to -`require()`, the packages themselves can be anywhere. - -## All Together... - - - -To get the exact filename that will be loaded when `require()` is called, use -the `require.resolve()` function. - -Putting together all of the above, here is the high-level algorithm -in pseudocode of what require.resolve does: - -``` -require(X) from module at path Y -1. If X is a core module, - a. return the core module - b. STOP -2. If X begins with './' or '/' or '../' - a. LOAD_AS_FILE(Y + X) - b. LOAD_AS_DIRECTORY(Y + X) -3. LOAD_NODE_MODULES(X, dirname(Y)) -4. THROW "not found" - -LOAD_AS_FILE(X) -1. If X is a file, load X as JavaScript text. STOP -2. If X.js is a file, load X.js as JavaScript text. STOP -3. If X.json is a file, parse X.json to a JavaScript Object. STOP -4. If X.node is a file, load X.node as binary addon. STOP - -LOAD_AS_DIRECTORY(X) -1. If X/package.json is a file, - a. Parse X/package.json, and look for "main" field. - b. let M = X + (json main field) - c. LOAD_AS_FILE(M) -2. If X/index.js is a file, load X/index.js as JavaScript text. STOP -3. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP -4. If X/index.node is a file, load X/index.node as binary addon. STOP - -LOAD_NODE_MODULES(X, START) -1. let DIRS=NODE_MODULES_PATHS(START) -2. for each DIR in DIRS: - a. LOAD_AS_FILE(DIR/X) - b. LOAD_AS_DIRECTORY(DIR/X) - -NODE_MODULES_PATHS(START) -1. let PARTS = path split(START) -2. let I = count of PARTS - 1 -3. let DIRS = [] -4. while I >= 0, - a. if PARTS[I] = "node_modules" CONTINUE - c. DIR = path join(PARTS[0 .. I] + "node_modules") - b. DIRS = DIRS + DIR - c. let I = I - 1 -5. return DIRS -``` - -## Caching - - - -Modules are cached after the first time they are loaded. This means -(among other things) that every call to `require('foo')` will get -exactly the same object returned, if it would resolve to the same file. - -Multiple calls to `require('foo')` may not cause the module code to be -executed multiple times. This is an important feature. With it, -"partially done" objects can be returned, thus allowing transitive -dependencies to be loaded even when they would cause cycles. - -If you want to have a module execute code multiple times, then export a -function, and call that function. - -### Module Caching Caveats - - - -Modules are cached based on their resolved filename. Since modules may -resolve to a different filename based on the location of the calling -module (loading from `node_modules` folders), it is not a *guarantee* -that `require('foo')` will always return the exact same object, if it -would resolve to different files. - -Additionally, on case-insensitive file systems or operating systems, different -resolved filenames can point to the same file, but the cache will still treat -them as different modules and will reload the file multiple times. For example, -`require('./foo')` and `require('./FOO')` return two different objects, -irrespective of whether or not `./foo` and `./FOO` are the same file. - -## Core Modules - - - -Node.js has several modules compiled into the binary. These modules are -described in greater detail elsewhere in this documentation. - -The core modules are defined within Node.js's source and are located in the -`lib/` folder. - -Core modules are always preferentially loaded if their identifier is -passed to `require()`. For instance, `require('http')` will always -return the built in HTTP module, even if there is a file by that name. - -## Cycles - - - -When there are circular `require()` calls, a module might not have finished -executing when it is returned. - -Consider this situation: - -`a.js`: - -``` -console.log('a starting'); -exports.done = false; -const b = require('./b.js'); -console.log('in a, b.done = %j', b.done); -exports.done = true; -console.log('a done'); -``` - -`b.js`: - -``` -console.log('b starting'); -exports.done = false; -const a = require('./a.js'); -console.log('in b, a.done = %j', a.done); -exports.done = true; -console.log('b done'); -``` - -`main.js`: - -``` -console.log('main starting'); -const a = require('./a.js'); -const b = require('./b.js'); -console.log('in main, a.done=%j, b.done=%j', a.done, b.done); -``` - -When `main.js` loads `a.js`, then `a.js` in turn loads `b.js`. At that -point, `b.js` tries to load `a.js`. In order to prevent an infinite -loop, an **unfinished copy** of the `a.js` exports object is returned to the -`b.js` module. `b.js` then finishes loading, and its `exports` object is -provided to the `a.js` module. - -By the time `main.js` has loaded both modules, they're both finished. -The output of this program would thus be: - -``` -$ node main.js -main starting -a starting -b starting -in b, a.done = false -b done -in a, b.done = true -a done -in main, a.done=true, b.done=true -``` - -If you have cyclic module dependencies in your program, make sure to -plan accordingly. - -## File Modules - - - -If the exact filename is not found, then Node.js will attempt to load the -required filename with the added extensions: `.js`, `.json`, and finally -`.node`. - -`.js` files are interpreted as JavaScript text files, and `.json` files are -parsed as JSON text files. `.node` files are interpreted as compiled addon -modules loaded with `dlopen`. - -A required module prefixed with `'/'` is an absolute path to the file. For -example, `require('/home/marco/foo.js')` will load the file at -`/home/marco/foo.js`. - -A required module prefixed with `'./'` is relative to the file calling -`require()`. That is, `circle.js` must be in the same directory as `foo.js` for -`require('./circle')` to find it. - -Without a leading '/', './', or '../' to indicate a file, the module must -either be a core module or is loaded from a `node_modules` folder. - -If the given path does not exist, `require()` will throw an [`Error`][] with its -`code` property set to `'MODULE_NOT_FOUND'`. - -## Folders as Modules - - - -It is convenient to organize programs and libraries into self-contained -directories, and then provide a single entry point to that library. -There are three ways in which a folder may be passed to `require()` as -an argument. - -The first is to create a `package.json` file in the root of the folder, -which specifies a `main` module. An example package.json file might -look like this: - -``` -{ "name" : "some-library", - "main" : "./lib/some-library.js" } -``` - -If this was in a folder at `./some-library`, then -`require('./some-library')` would attempt to load -`./some-library/lib/some-library.js`. - -This is the extent of Node.js's awareness of package.json files. - -Note: If the file specified by the `"main"` entry of `package.json` is missing -and can not be resolved, Node.js will report the entire module as missing with -the default error: - -``` -Error: Cannot find module 'some-library' -``` - -If there is no package.json file present in the directory, then Node.js -will attempt to load an `index.js` or `index.node` file out of that -directory. For example, if there was no package.json file in the above -example, then `require('./some-library')` would attempt to load: - -* `./some-library/index.js` -* `./some-library/index.node` - -## Loading from `node_modules` Folders - - - -If the module identifier passed to `require()` is not a native module, -and does not begin with `'/'`, `'../'`, or `'./'`, then Node.js starts at the -parent directory of the current module, and adds `/node_modules`, and -attempts to load the module from that location. Node will not append -`node_modules` to a path already ending in `node_modules`. - -If it is not found there, then it moves to the parent directory, and so -on, until the root of the file system is reached. - -For example, if the file at `'/home/ry/projects/foo.js'` called -`require('bar.js')`, then Node.js would look in the following locations, in -this order: - -* `/home/ry/projects/node_modules/bar.js` -* `/home/ry/node_modules/bar.js` -* `/home/node_modules/bar.js` -* `/node_modules/bar.js` - -This allows programs to localize their dependencies, so that they do not -clash. - -You can require specific files or sub modules distributed with a module by -including a path suffix after the module name. For instance -`require('example-module/path/to/file')` would resolve `path/to/file` -relative to where `example-module` is located. The suffixed path follows the -same module resolution semantics. - -## Loading from the global folders - - - -If the `NODE_PATH` environment variable is set to a colon-delimited list -of absolute paths, then Node.js will search those paths for modules if they -are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by -semicolons instead of colons.) - -`NODE_PATH` was originally created to support loading modules from -varying paths before the current [module resolution][] algorithm was frozen. - -`NODE_PATH` is still supported, but is less necessary now that the Node.js -ecosystem has settled on a convention for locating dependent modules. -Sometimes deployments that rely on `NODE_PATH` show surprising behavior -when people are unaware that `NODE_PATH` must be set. Sometimes a -module's dependencies change, causing a different version (or even a -different module) to be loaded as the `NODE_PATH` is searched. - -Additionally, Node.js will search in the following locations: - -* 1: `$HOME/.node_modules` -* 2: `$HOME/.node_libraries` -* 3: `$PREFIX/lib/node` - -Where `$HOME` is the user's home directory, and `$PREFIX` is Node.js's -configured `node_prefix`. - -These are mostly for historic reasons. **You are highly encouraged -to place your dependencies locally in `node_modules` folders.** They -will be loaded faster, and more reliably. - -## The `module` Object - - - - -* {Object} - -In each module, the `module` free variable is a reference to the object -representing the current module. For convenience, `module.exports` is -also accessible via the `exports` module-global. `module` isn't actually -a global but rather local to each module. - -### module.children - -* {Array} - -The module objects required by this one. - -### module.exports - -* {Object} - -The `module.exports` object is created by the Module system. Sometimes this is -not acceptable; many want their module to be an instance of some class. To do -this, assign the desired export object to `module.exports`. Note that assigning -the desired object to `exports` will simply rebind the local `exports` variable, -which is probably not what you want to do. - -For example suppose we were making a module called `a.js` - -```js -const EventEmitter = require('events'); - -module.exports = new EventEmitter(); - -// Do some work, and after some time emit -// the 'ready' event from the module itself. -setTimeout(() => { - module.exports.emit('ready'); -}, 1000); -``` - -Then in another file we could do - -```js -const a = require('./a'); -a.on('ready', () => { - console.log('module a is ready'); -}); -``` - - -Note that assignment to `module.exports` must be done immediately. It cannot be -done in any callbacks. This does not work: - -x.js: - -```js -setTimeout(() => { - module.exports = { a: 'hello' }; -}, 0); -``` - -y.js: - -```js -const x = require('./x'); -console.log(x.a); -``` - -#### exports alias - -The `exports` variable that is available within a module starts as a reference -to `module.exports`. As with any variable, if you assign a new value to it, it -is no longer bound to the previous value. - -To illustrate the behavior, imagine this hypothetical implementation of -`require()`: - -```js -function require(...) { - // ... - ((module, exports) => { - // Your module code here - exports = some_func; // re-assigns exports, exports is no longer - // a shortcut, and nothing is exported. - module.exports = some_func; // makes your module export 0 - })(module, module.exports); - return module; -} -``` - -As a guideline, if the relationship between `exports` and `module.exports` -seems like magic to you, ignore `exports` and only use `module.exports`. - -### module.filename - -* {String} - -The fully resolved filename to the module. - -### module.id - -* {String} - -The identifier for the module. Typically this is the fully resolved -filename. - -### module.loaded - -* {Boolean} - -Whether or not the module is done loading, or is in the process of -loading. - -### module.parent - -* {Object} Module object - -The module that first required this one. - -### module.require(id) - -* `id` {String} -* Return: {Object} `module.exports` from the resolved module - -The `module.require` method provides a way to load a module as if -`require()` was called from the original module. - -Note that in order to do this, you must get a reference to the `module` -object. Since `require()` returns the `module.exports`, and the `module` is -typically *only* available within a specific module's code, it must be -explicitly exported in order to be used. - -[`Error`]: errors.html#errors_class_error -[module resolution]: #modules_all_together diff --git a/doc/api/modules.md b/doc/api/modules.md new file mode 100644 index 00000000000000..836285b26f491d --- /dev/null +++ b/doc/api/modules.md @@ -0,0 +1,588 @@ +# Modules + + Stability: 3 - Locked + + + +Node.js has a simple module loading system. In Node.js, files and modules are +in one-to-one correspondence. As an example, `foo.js` loads the module +`circle.js` in the same directory. + +The contents of `foo.js`: + +```js +const circle = require('./circle.js'); +console.log( `The area of a circle of radius 4 is ${circle.area(4)}`); +``` + +The contents of `circle.js`: + +```js +const PI = Math.PI; + +exports.area = (r) => PI * r * r; + +exports.circumference = (r) => 2 * PI * r; + +``` + +The module `circle.js` has exported the functions `area()` and +`circumference()`. To add functions and objects to the root of your module, +you can add them to the special `exports` object. + +Variables local to the module will be private, because the module is wrapped +in a function by Node.js (see [module wrapper](#modules_the_module_wrapper)). +In this example, the variable `PI` is private to `circle.js`. + +If you want the root of your module's export to be a function (such as a +constructor) or if you want to export a complete object in one assignment +instead of building it one property at a time, assign it to `module.exports` +instead of `exports`. + +Below, `bar.js` makes use of the `square` module, which exports a constructor: + +```js +const square = require('./square.js'); +var mySquare = square(2); +console.log(`The area of my square is ${mySquare.area()}`); +``` + +The `square` module is defined in `square.js`: + +```js +// assigning to exports will not modify module, must use module.exports +module.exports = (width) => { + return { + area: () => width * width + }; +} +``` + +The module system is implemented in the `require("module")` module. + +## Accessing the main module + + + +When a file is run directly from Node.js, `require.main` is set to its +`module`. That means that you can determine whether a file has been run +directly by testing + +```js +require.main === module +``` + +For a file `foo.js`, this will be `true` if run via `node foo.js`, but +`false` if run by `require('./foo')`. + +Because `module` provides a `filename` property (normally equivalent to +`__filename`), the entry point of the current application can be obtained +by checking `require.main.filename`. + +## Addenda: Package Manager Tips + + + +The semantics of Node.js's `require()` function were designed to be general +enough to support a number of reasonable directory structures. Package manager +programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to +build native packages from Node.js modules without modification. + +Below we give a suggested directory structure that could work: + +Let's say that we wanted to have the folder at +`/usr/lib/node//` hold the contents of a +specific version of a package. + +Packages can depend on one another. In order to install package `foo`, you +may have to install a specific version of package `bar`. The `bar` package +may itself have dependencies, and in some cases, these dependencies may even +collide or form cycles. + +Since Node.js looks up the `realpath` of any modules it loads (that is, +resolves symlinks), and then looks for their dependencies in the `node_modules` +folders as described [here](#modules_loading_from_node_modules_folders), this +situation is very simple to resolve with the following architecture: + +* `/usr/lib/node/foo/1.2.3/` - Contents of the `foo` package, version 1.2.3. +* `/usr/lib/node/bar/4.3.2/` - Contents of the `bar` package that `foo` + depends on. +* `/usr/lib/node/foo/1.2.3/node_modules/bar` - Symbolic link to + `/usr/lib/node/bar/4.3.2/`. +* `/usr/lib/node/bar/4.3.2/node_modules/*` - Symbolic links to the packages + that `bar` depends on. + +Thus, even if a cycle is encountered, or if there are dependency +conflicts, every module will be able to get a version of its dependency +that it can use. + +When the code in the `foo` package does `require('bar')`, it will get the +version that is symlinked into `/usr/lib/node/foo/1.2.3/node_modules/bar`. +Then, when the code in the `bar` package calls `require('quux')`, it'll get +the version that is symlinked into +`/usr/lib/node/bar/4.3.2/node_modules/quux`. + +Furthermore, to make the module lookup process even more optimal, rather +than putting packages directly in `/usr/lib/node`, we could put them in +`/usr/lib/node_modules//`. Then Node.js will not bother +looking for missing dependencies in `/usr/node_modules` or `/node_modules`. + +In order to make modules available to the Node.js REPL, it might be useful to +also add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment +variable. Since the module lookups using `node_modules` folders are all +relative, and based on the real path of the files making the calls to +`require()`, the packages themselves can be anywhere. + +## All Together... + + + +To get the exact filename that will be loaded when `require()` is called, use +the `require.resolve()` function. + +Putting together all of the above, here is the high-level algorithm +in pseudocode of what require.resolve does: + +``` +require(X) from module at path Y +1. If X is a core module, + a. return the core module + b. STOP +2. If X begins with './' or '/' or '../' + a. LOAD_AS_FILE(Y + X) + b. LOAD_AS_DIRECTORY(Y + X) +3. LOAD_NODE_MODULES(X, dirname(Y)) +4. THROW "not found" + +LOAD_AS_FILE(X) +1. If X is a file, load X as JavaScript text. STOP +2. If X.js is a file, load X.js as JavaScript text. STOP +3. If X.json is a file, parse X.json to a JavaScript Object. STOP +4. If X.node is a file, load X.node as binary addon. STOP + +LOAD_AS_DIRECTORY(X) +1. If X/package.json is a file, + a. Parse X/package.json, and look for "main" field. + b. let M = X + (json main field) + c. LOAD_AS_FILE(M) +2. If X/index.js is a file, load X/index.js as JavaScript text. STOP +3. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP +4. If X/index.node is a file, load X/index.node as binary addon. STOP + +LOAD_NODE_MODULES(X, START) +1. let DIRS=NODE_MODULES_PATHS(START) +2. for each DIR in DIRS: + a. LOAD_AS_FILE(DIR/X) + b. LOAD_AS_DIRECTORY(DIR/X) + +NODE_MODULES_PATHS(START) +1. let PARTS = path split(START) +2. let I = count of PARTS - 1 +3. let DIRS = [] +4. while I >= 0, + a. if PARTS[I] = "node_modules" CONTINUE + c. DIR = path join(PARTS[0 .. I] + "node_modules") + b. DIRS = DIRS + DIR + c. let I = I - 1 +5. return DIRS +``` + +## Caching + + + +Modules are cached after the first time they are loaded. This means +(among other things) that every call to `require('foo')` will get +exactly the same object returned, if it would resolve to the same file. + +Multiple calls to `require('foo')` may not cause the module code to be +executed multiple times. This is an important feature. With it, +"partially done" objects can be returned, thus allowing transitive +dependencies to be loaded even when they would cause cycles. + +If you want to have a module execute code multiple times, then export a +function, and call that function. + +### Module Caching Caveats + + + +Modules are cached based on their resolved filename. Since modules may +resolve to a different filename based on the location of the calling +module (loading from `node_modules` folders), it is not a *guarantee* +that `require('foo')` will always return the exact same object, if it +would resolve to different files. + +Additionally, on case-insensitive file systems or operating systems, different +resolved filenames can point to the same file, but the cache will still treat +them as different modules and will reload the file multiple times. For example, +`require('./foo')` and `require('./FOO')` return two different objects, +irrespective of whether or not `./foo` and `./FOO` are the same file. + +## Core Modules + + + +Node.js has several modules compiled into the binary. These modules are +described in greater detail elsewhere in this documentation. + +The core modules are defined within Node.js's source and are located in the +`lib/` folder. + +Core modules are always preferentially loaded if their identifier is +passed to `require()`. For instance, `require('http')` will always +return the built in HTTP module, even if there is a file by that name. + +## Cycles + + + +When there are circular `require()` calls, a module might not have finished +executing when it is returned. + +Consider this situation: + +`a.js`: + +``` +console.log('a starting'); +exports.done = false; +const b = require('./b.js'); +console.log('in a, b.done = %j', b.done); +exports.done = true; +console.log('a done'); +``` + +`b.js`: + +``` +console.log('b starting'); +exports.done = false; +const a = require('./a.js'); +console.log('in b, a.done = %j', a.done); +exports.done = true; +console.log('b done'); +``` + +`main.js`: + +``` +console.log('main starting'); +const a = require('./a.js'); +const b = require('./b.js'); +console.log('in main, a.done=%j, b.done=%j', a.done, b.done); +``` + +When `main.js` loads `a.js`, then `a.js` in turn loads `b.js`. At that +point, `b.js` tries to load `a.js`. In order to prevent an infinite +loop, an **unfinished copy** of the `a.js` exports object is returned to the +`b.js` module. `b.js` then finishes loading, and its `exports` object is +provided to the `a.js` module. + +By the time `main.js` has loaded both modules, they're both finished. +The output of this program would thus be: + +``` +$ node main.js +main starting +a starting +b starting +in b, a.done = false +b done +in a, b.done = true +a done +in main, a.done=true, b.done=true +``` + +If you have cyclic module dependencies in your program, make sure to +plan accordingly. + +## File Modules + + + +If the exact filename is not found, then Node.js will attempt to load the +required filename with the added extensions: `.js`, `.json`, and finally +`.node`. + +`.js` files are interpreted as JavaScript text files, and `.json` files are +parsed as JSON text files. `.node` files are interpreted as compiled addon +modules loaded with `dlopen`. + +A required module prefixed with `'/'` is an absolute path to the file. For +example, `require('/home/marco/foo.js')` will load the file at +`/home/marco/foo.js`. + +A required module prefixed with `'./'` is relative to the file calling +`require()`. That is, `circle.js` must be in the same directory as `foo.js` for +`require('./circle')` to find it. + +Without a leading '/', './', or '../' to indicate a file, the module must +either be a core module or is loaded from a `node_modules` folder. + +If the given path does not exist, `require()` will throw an [`Error`][] with its +`code` property set to `'MODULE_NOT_FOUND'`. + +## Folders as Modules + + + +It is convenient to organize programs and libraries into self-contained +directories, and then provide a single entry point to that library. +There are three ways in which a folder may be passed to `require()` as +an argument. + +The first is to create a `package.json` file in the root of the folder, +which specifies a `main` module. An example package.json file might +look like this: + +``` +{ "name" : "some-library", + "main" : "./lib/some-library.js" } +``` + +If this was in a folder at `./some-library`, then +`require('./some-library')` would attempt to load +`./some-library/lib/some-library.js`. + +This is the extent of Node.js's awareness of package.json files. + +Note: If the file specified by the `"main"` entry of `package.json` is missing +and can not be resolved, Node.js will report the entire module as missing with +the default error: + +``` +Error: Cannot find module 'some-library' +``` + +If there is no package.json file present in the directory, then Node.js +will attempt to load an `index.js` or `index.node` file out of that +directory. For example, if there was no package.json file in the above +example, then `require('./some-library')` would attempt to load: + +* `./some-library/index.js` +* `./some-library/index.node` + +## Loading from `node_modules` Folders + + + +If the module identifier passed to `require()` is not a native module, +and does not begin with `'/'`, `'../'`, or `'./'`, then Node.js starts at the +parent directory of the current module, and adds `/node_modules`, and +attempts to load the module from that location. Node will not append +`node_modules` to a path already ending in `node_modules`. + +If it is not found there, then it moves to the parent directory, and so +on, until the root of the file system is reached. + +For example, if the file at `'/home/ry/projects/foo.js'` called +`require('bar.js')`, then Node.js would look in the following locations, in +this order: + +* `/home/ry/projects/node_modules/bar.js` +* `/home/ry/node_modules/bar.js` +* `/home/node_modules/bar.js` +* `/node_modules/bar.js` + +This allows programs to localize their dependencies, so that they do not +clash. + +You can require specific files or sub modules distributed with a module by +including a path suffix after the module name. For instance +`require('example-module/path/to/file')` would resolve `path/to/file` +relative to where `example-module` is located. The suffixed path follows the +same module resolution semantics. + +## Loading from the global folders + + + +If the `NODE_PATH` environment variable is set to a colon-delimited list +of absolute paths, then Node.js will search those paths for modules if they +are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by +semicolons instead of colons.) + +`NODE_PATH` was originally created to support loading modules from +varying paths before the current [module resolution][] algorithm was frozen. + +`NODE_PATH` is still supported, but is less necessary now that the Node.js +ecosystem has settled on a convention for locating dependent modules. +Sometimes deployments that rely on `NODE_PATH` show surprising behavior +when people are unaware that `NODE_PATH` must be set. Sometimes a +module's dependencies change, causing a different version (or even a +different module) to be loaded as the `NODE_PATH` is searched. + +Additionally, Node.js will search in the following locations: + +* 1: `$HOME/.node_modules` +* 2: `$HOME/.node_libraries` +* 3: `$PREFIX/lib/node` + +Where `$HOME` is the user's home directory, and `$PREFIX` is Node.js's +configured `node_prefix`. + +These are mostly for historic reasons. **You are highly encouraged +to place your dependencies locally in `node_modules` folders.** They +will be loaded faster, and more reliably. + +## The module wrapper + + + +Before a module's code is executed, Node.js will wrap it with a function +wrapper that looks like the following: + +```js +(function (exports, require, module, __filename, __dirname) { +// Your module code actually lives in here +}); +``` + +By doing this, Node.js achieves a few things: + +- It keeps top-level variables (defined with `var`, `const` or `let`) scoped to +the module rather than the global object. +- It helps to provide some global-looking variables that are actually specific +to the module, such as: + - The `module` and `exports` objects that the implementor can use to export + values from the module. + - The convenience variables `__filename` and `__dirname`, containing the + module's absolute filename and directory path. + +## The `module` Object + + + + +* {Object} + +In each module, the `module` free variable is a reference to the object +representing the current module. For convenience, `module.exports` is +also accessible via the `exports` module-global. `module` isn't actually +a global but rather local to each module. + +### module.children + +* {Array} + +The module objects required by this one. + +### module.exports + +* {Object} + +The `module.exports` object is created by the Module system. Sometimes this is +not acceptable; many want their module to be an instance of some class. To do +this, assign the desired export object to `module.exports`. Note that assigning +the desired object to `exports` will simply rebind the local `exports` variable, +which is probably not what you want to do. + +For example suppose we were making a module called `a.js` + +```js +const EventEmitter = require('events'); + +module.exports = new EventEmitter(); + +// Do some work, and after some time emit +// the 'ready' event from the module itself. +setTimeout(() => { + module.exports.emit('ready'); +}, 1000); +``` + +Then in another file we could do + +```js +const a = require('./a'); +a.on('ready', () => { + console.log('module a is ready'); +}); +``` + + +Note that assignment to `module.exports` must be done immediately. It cannot be +done in any callbacks. This does not work: + +x.js: + +```js +setTimeout(() => { + module.exports = { a: 'hello' }; +}, 0); +``` + +y.js: + +```js +const x = require('./x'); +console.log(x.a); +``` + +#### exports alias + +The `exports` variable that is available within a module starts as a reference +to `module.exports`. As with any variable, if you assign a new value to it, it +is no longer bound to the previous value. + +To illustrate the behavior, imagine this hypothetical implementation of +`require()`: + +```js +function require(...) { + // ... + ((module, exports) => { + // Your module code here + exports = some_func; // re-assigns exports, exports is no longer + // a shortcut, and nothing is exported. + module.exports = some_func; // makes your module export 0 + })(module, module.exports); + return module; +} +``` + +As a guideline, if the relationship between `exports` and `module.exports` +seems like magic to you, ignore `exports` and only use `module.exports`. + +### module.filename + +* {String} + +The fully resolved filename to the module. + +### module.id + +* {String} + +The identifier for the module. Typically this is the fully resolved +filename. + +### module.loaded + +* {Boolean} + +Whether or not the module is done loading, or is in the process of +loading. + +### module.parent + +* {Object} Module object + +The module that first required this one. + +### module.require(id) + +* `id` {String} +* Return: {Object} `module.exports` from the resolved module + +The `module.require` method provides a way to load a module as if +`require()` was called from the original module. + +Note that in order to do this, you must get a reference to the `module` +object. Since `require()` returns the `module.exports`, and the `module` is +typically *only* available within a specific module's code, it must be +explicitly exported in order to be used. + +[`Error`]: errors.html#errors_class_error +[module resolution]: #modules_all_together diff --git a/doc/api/net.markdown b/doc/api/net.markdown deleted file mode 100644 index 10129c13b8944f..00000000000000 --- a/doc/api/net.markdown +++ /dev/null @@ -1,737 +0,0 @@ -# net - - Stability: 2 - Stable - -The `net` module provides you with an asynchronous network wrapper. It contains -functions for creating both servers and clients (called streams). You can include -this module with `require('net');`. - -## Class: net.Server - -This class is used to create a TCP or local server. - -`net.Server` is an [`EventEmitter`][] with the following events: - -### Event: 'close' - -Emitted when the server closes. Note that if connections exist, this -event is not emitted until all connections are ended. - -### Event: 'connection' - -* {net.Socket} The connection object - -Emitted when a new connection is made. `socket` is an instance of -`net.Socket`. - -### Event: 'error' - -* {Error} - -Emitted when an error occurs. The [`'close'`][] event will be called directly -following this event. See example in discussion of `server.listen`. - -### Event: 'listening' - -Emitted when the server has been bound after calling `server.listen`. - -### server.address() - -Returns the bound address, the address family name and port of the server -as reported by the operating system. -Useful to find which port was assigned when giving getting an OS-assigned address. -Returns an object with three properties, e.g. -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - -Example: - -```js -var server = net.createServer((socket) => { - socket.end('goodbye\n'); -}).on('error', (err) => { - // handle errors here - throw err; -}); - -// grab a random port. -server.listen(() => { - address = server.address(); - console.log('opened server on %j', address); -}); -``` - -Don't call `server.address()` until the `'listening'` event has been emitted. - -### server.close([callback]) - -Stops the server from accepting new connections and keeps existing -connections. This function is asynchronous, the server is finally -closed when all connections are ended and the server emits a [`'close'`][] event. -The optional `callback` will be called once the `'close'` event occurs. Unlike -that event, it will be called with an Error as its only argument if the server -was not open when it was closed. - -### server.connections - - Stability: 0 - Deprecated: Use [`server.getConnections()`][] instead. - -The number of concurrent connections on the server. - -This becomes `null` when sending a socket to a child with -[`child_process.fork()`][]. To poll forks and get current number of active -connections use asynchronous `server.getConnections` instead. - -### server.getConnections(callback) - -Asynchronously get the number of concurrent connections on the server. Works -when sockets were sent to forks. - -Callback should take two arguments `err` and `count`. - -### server.listen(handle[, backlog][, callback]) - -* `handle` {Object} -* `backlog` {Number} -* `callback` {Function} - -The `handle` object can be set to either a server or socket (anything -with an underlying `_handle` member), or a `{fd: }` object. - -This will cause the server to accept connections on the specified -handle, but it is presumed that the file descriptor or handle has -already been bound to a port or domain socket. - -Listening on a file descriptor is not supported on Windows. - -This function is asynchronous. When the server has been bound, -[`'listening'`][] event will be emitted. -The last parameter `callback` will be added as a listener for the -[`'listening'`][] event. - -The parameter `backlog` behaves the same as in -[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. - -### server.listen(options[, callback]) - -* `options` {Object} - Required. Supports the following properties: - * `port` {Number} - Optional. - * `host` {String} - Optional. - * `backlog` {Number} - Optional. - * `path` {String} - Optional. - * `exclusive` {Boolean} - Optional. -* `callback` {Function} - Optional. - -The `port`, `host`, and `backlog` properties of `options`, as well as the -optional callback function, behave as they do on a call to -[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. -Alternatively, the `path` option can be used to specify a UNIX socket. - -If `exclusive` is `false` (default), then cluster workers will use the same -underlying handle, allowing connection handling duties to be shared. When -`exclusive` is `true`, the handle is not shared, and attempted port sharing -results in an error. An example which listens on an exclusive port is -shown below. - -```js -server.listen({ - host: 'localhost', - port: 80, - exclusive: true -}); -``` - -### server.listen(path[, backlog][, callback]) - -* `path` {String} -* `backlog` {Number} -* `callback` {Function} - -Start a local socket server listening for connections on the given `path`. - -This function is asynchronous. When the server has been bound, -[`'listening'`][] event will be emitted. The last parameter `callback` -will be added as a listener for the [`'listening'`][] event. - -On UNIX, the local domain is usually known as the UNIX domain. The path is a -filesystem path name. It is subject to the same naming conventions and -permissions checks as would be done on file creation, will be visible in the -filesystem, and will *persist until unlinked*. - -On Windows, the local domain is implemented using a named pipe. The path *must* -refer to an entry in `\\?\pipe\` or `\\.\pipe\`. Any characters are permitted, -but the latter may do some processing of pipe names, such as resolving `..` -sequences. Despite appearances, the pipe name space is flat. Pipes will *not -persist*, they are removed when the last reference to them is closed. Do not -forget JavaScript string escaping requires paths to be specified with -double-backslashes, such as: - - net.createServer().listen( - path.join('\\\\?\\pipe', process.cwd(), 'myctl')) - -The parameter `backlog` behaves the same as in -[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. - -### server.listen(port[, hostname][, backlog][, callback]) - -Begin accepting connections on the specified `port` and `hostname`. If the -`hostname` is omitted, the server will accept connections on any IPv6 address -(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A -port value of zero will assign a random port. - -Backlog is the maximum length of the queue of pending connections. -The actual length will be determined by your OS through sysctl settings such as -`tcp_max_syn_backlog` and `somaxconn` on linux. The default value of this -parameter is 511 (not 512). - -This function is asynchronous. When the server has been bound, -[`'listening'`][] event will be emitted. The last parameter `callback` -will be added as a listener for the [`'listening'`][] event. - -One issue some users run into is getting `EADDRINUSE` errors. This means that -another server is already running on the requested port. One way of handling this -would be to wait a second and then try again. This can be done with - -```js -server.on('error', (e) => { - if (e.code == 'EADDRINUSE') { - console.log('Address in use, retrying...'); - setTimeout(() => { - server.close(); - server.listen(PORT, HOST); - }, 1000); - } -}); -``` - -(Note: All sockets in Node.js set `SO_REUSEADDR` already) - -### server.listening - -A Boolean indicating whether or not the server is listening for -connections. - -### server.maxConnections - -Set this property to reject connections when the server's connection count gets -high. - -It is not recommended to use this option once a socket has been sent to a child -with [`child_process.fork()`][]. - -### server.ref() - -Opposite of `unref`, calling `ref` on a previously `unref`d server will *not* -let the program exit if it's the only server left (the default behavior). If -the server is `ref`d calling `ref` again will have no effect. - -Returns `server`. - -### server.unref() - -Calling `unref` on a server will allow the program to exit if this is the only -active server in the event system. If the server is already `unref`d calling -`unref` again will have no effect. - -Returns `server`. - -## Class: net.Socket - -This object is an abstraction of a TCP or local socket. `net.Socket` -instances implement a duplex Stream interface. They can be created by the -user and used as a client (with [`connect()`][]) or they can be created by Node.js -and passed to the user through the `'connection'` event of a server. - -### new net.Socket([options]) - -Construct a new socket object. - -`options` is an object with the following defaults: - -```js -{ - fd: null, - allowHalfOpen: false, - readable: false, - writable: false -} -``` - -`fd` allows you to specify the existing file descriptor of socket. -Set `readable` and/or `writable` to `true` to allow reads and/or writes on this -socket (NOTE: Works only when `fd` is passed). -About `allowHalfOpen`, refer to `createServer()` and `'end'` event. - -`net.Socket` instances are [`EventEmitter`][] with the following events: - -### Event: 'close' - -* `had_error` {Boolean} `true` if the socket had a transmission error. - -Emitted once the socket is fully closed. The argument `had_error` is a boolean -which says if the socket was closed due to a transmission error. - -### Event: 'connect' - -Emitted when a socket connection is successfully established. -See [`connect()`][]. - -### Event: 'data' - -* {Buffer} - -Emitted when data is received. The argument `data` will be a `Buffer` or -`String`. Encoding of data is set by `socket.setEncoding()`. -(See the [Readable Stream][] section for more information.) - -Note that the __data will be lost__ if there is no listener when a `Socket` -emits a `'data'` event. - -### Event: 'drain' - -Emitted when the write buffer becomes empty. Can be used to throttle uploads. - -See also: the return values of `socket.write()` - -### Event: 'end' - -Emitted when the other end of the socket sends a FIN packet. - -By default (`allowHalfOpen == false`) the socket will destroy its file -descriptor once it has written out its pending write queue. However, by -setting `allowHalfOpen == true` the socket will not automatically `end()` -its side allowing the user to write arbitrary amounts of data, with the -caveat that the user is required to `end()` their side now. - -### Event: 'error' - -* {Error} - -Emitted when an error occurs. The `'close'` event will be called directly -following this event. - -### Event: 'lookup' - -Emitted after resolving the hostname but before connecting. -Not applicable to UNIX sockets. - -* `err` {Error|Null} The error object. See [`dns.lookup()`][]. -* `address` {String} The IP address. -* `family` {String|Null} The address type. See [`dns.lookup()`][]. -* `host` {String} The hostname. - -### Event: 'timeout' - -Emitted if the socket times out from inactivity. This is only to notify that -the socket has been idle. The user must manually close the connection. - -See also: [`socket.setTimeout()`][] - -### socket.address() - -Returns the bound address, the address family name and port of the -socket as reported by the operating system. Returns an object with -three properties, e.g. -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - -### socket.bufferSize - -`net.Socket` has the property that `socket.write()` always works. This is to -help users get up and running quickly. The computer cannot always keep up -with the amount of data that is written to a socket - the network connection -simply might be too slow. Node.js will internally queue up the data written to a -socket and send it out over the wire when it is possible. (Internally it is -polling on the socket's file descriptor for being writable). - -The consequence of this internal buffering is that memory may grow. This -property shows the number of characters currently buffered to be written. -(Number of characters is approximately equal to the number of bytes to be -written, but the buffer may contain strings, and the strings are lazily -encoded, so the exact number of bytes is not known.) - -Users who experience large or growing `bufferSize` should attempt to -"throttle" the data flows in their program with [`pause()`][] and [`resume()`][]. - -### socket.bytesRead - -The amount of received bytes. - -### socket.bytesWritten - -The amount of bytes sent. - -### socket.connect(options[, connectListener]) - -Opens the connection for a given socket. - -For TCP sockets, `options` argument should be an object which specifies: - - - `port`: Port the client should connect to (Required). - - - `host`: Host the client should connect to. Defaults to `'localhost'`. - - - `localAddress`: Local interface to bind to for network connections. - - - `localPort`: Local port to bind to for network connections. - - - `family` : Version of IP stack. Defaults to `4`. - - - `hints`: [`dns.lookup()` hints][]. Defaults to `0`. - - - `lookup` : Custom lookup function. Defaults to `dns.lookup`. - -For local domain sockets, `options` argument should be an object which -specifies: - - - `path`: Path the client should connect to (Required). - -Normally this method is not needed, as `net.createConnection` opens the -socket. Use this only if you are implementing a custom Socket. - -This function is asynchronous. When the [`'connect'`][] event is emitted the -socket is established. If there is a problem connecting, the `'connect'` event -will not be emitted, the [`'error'`][] event will be emitted with the exception. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event. - -### socket.connect(path[, connectListener]) -### socket.connect(port[, host][, connectListener]) - -As [`socket.connect(options\[, connectListener\])`][`socket.connect(options, connectListener)`], -with options either as either `{port: port, host: host}` or `{path: path}`. - -### socket.destroy() - -Ensures that no more I/O activity happens on this socket. Only necessary in -case of errors (parse error or so). - -### socket.end([data][, encoding]) - -Half-closes the socket. i.e., it sends a FIN packet. It is possible the -server will still send some data. - -If `data` is specified, it is equivalent to calling -`socket.write(data, encoding)` followed by `socket.end()`. - -### socket.localAddress - -The string representation of the local IP address the remote client is -connecting on. For example, if you are listening on `'0.0.0.0'` and the -client connects on `'192.168.1.1'`, the value would be `'192.168.1.1'`. - -### socket.localPort - -The numeric representation of the local port. For example, -`80` or `21`. - -### socket.pause() - -Pauses the reading of data. That is, [`'data'`][] events will not be emitted. -Useful to throttle back an upload. - -### socket.ref() - -Opposite of `unref`, calling `ref` on a previously `unref`d socket will *not* -let the program exit if it's the only socket left (the default behavior). If -the socket is `ref`d calling `ref` again will have no effect. - -Returns `socket`. - -### socket.remoteAddress - -The string representation of the remote IP address. For example, -`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if -the socket is destroyed (for example, if the client disconnected). - -### socket.remoteFamily - -The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - -### socket.remotePort - -The numeric representation of the remote port. For example, -`80` or `21`. - -### socket.resume() - -Resumes reading after a call to [`pause()`][]. - -### socket.setEncoding([encoding]) - -Set the encoding for the socket as a [Readable Stream][]. See -[`stream.setEncoding()`][] for more information. - -### socket.setKeepAlive([enable][, initialDelay]) - -Enable/disable keep-alive functionality, and optionally set the initial -delay before the first keepalive probe is sent on an idle socket. -`enable` defaults to `false`. - -Set `initialDelay` (in milliseconds) to set the delay between the last -data packet received and the first keepalive probe. Setting 0 for -initialDelay will leave the value unchanged from the default -(or previous) setting. Defaults to `0`. - -Returns `socket`. - -### socket.setNoDelay([noDelay]) - -Disables the Nagle algorithm. By default TCP connections use the Nagle -algorithm, they buffer data before sending it off. Setting `true` for -`noDelay` will immediately fire off data each time `socket.write()` is called. -`noDelay` defaults to `true`. - -Returns `socket`. - -### socket.setTimeout(timeout[, callback]) - -Sets the socket to timeout after `timeout` milliseconds of inactivity on -the socket. By default `net.Socket` do not have a timeout. - -When an idle timeout is triggered the socket will receive a [`'timeout'`][] -event but the connection will not be severed. The user must manually [`end()`][] -or [`destroy()`][] the socket. - -If `timeout` is 0, then the existing idle timeout is disabled. - -The optional `callback` parameter will be added as a one time listener for the -[`'timeout'`][] event. - -Returns `socket`. - -### socket.unref() - -Calling `unref` on a socket will allow the program to exit if this is the only -active socket in the event system. If the socket is already `unref`d calling -`unref` again will have no effect. - -Returns `socket`. - -### socket.write(data[, encoding][, callback]) - -Sends data on the socket. The second parameter specifies the encoding in the -case of a string--it defaults to UTF8 encoding. - -Returns `true` if the entire data was flushed successfully to the kernel -buffer. Returns `false` if all or part of the data was queued in user memory. -[`'drain'`][] will be emitted when the buffer is again free. - -The optional `callback` parameter will be executed when the data is finally -written out - this may not be immediately. - -## net.connect(options[, connectListener]) - -A factory function, which returns a new [`net.Socket`][] and automatically -connects with the supplied `options`. - -The options are passed to both the [`net.Socket`][] constructor and the -[`socket.connect`][] method. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -Here is an example of a client of the previously described echo server: - -```js -const net = require('net'); -const client = net.connect({port: 8124}, () => { - // 'connect' listener - console.log('connected to server!'); - client.write('world!\r\n'); -}); -client.on('data', (data) => { - console.log(data.toString()); - client.end(); -}); -client.on('end', () => { - console.log('disconnected from server'); -}); -``` - -To connect on the socket `/tmp/echo.sock` the second line would just be -changed to - -```js -const client = net.connect({path: '/tmp/echo.sock'}); -``` - -## net.connect(path[, connectListener]) - -A factory function, which returns a new unix [`net.Socket`][] and automatically -connects to the supplied `path`. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -## net.connect(port[, host][, connectListener]) - -A factory function, which returns a new [`net.Socket`][] and automatically -connects to the supplied `port` and `host`. - -If `host` is omitted, `'localhost'` will be assumed. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -## net.createConnection(options[, connectListener]) - -A factory function, which returns a new [`net.Socket`][] and automatically -connects with the supplied `options`. - -The options are passed to both the [`net.Socket`][] constructor and the -[`socket.connect`][] method. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -Here is an example of a client of the previously described echo server: - -```js -const net = require('net'); -const client = net.createConnection({port: 8124}, () => { - //'connect' listener - console.log('connected to server!'); - client.write('world!\r\n'); -}); -client.on('data', (data) => { - console.log(data.toString()); - client.end(); -}); -client.on('end', () => { - console.log('disconnected from server'); -}); -``` - -To connect on the socket `/tmp/echo.sock` the second line would just be -changed to - -```js -const client = net.connect({path: '/tmp/echo.sock'}); -``` - -## net.createConnection(path[, connectListener]) - -A factory function, which returns a new unix [`net.Socket`][] and automatically -connects to the supplied `path`. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -## net.createConnection(port[, host][, connectListener]) - -A factory function, which returns a new [`net.Socket`][] and automatically -connects to the supplied `port` and `host`. - -If `host` is omitted, `'localhost'` will be assumed. - -The `connectListener` parameter will be added as a listener for the -[`'connect'`][] event once. - -## net.createServer([options][, connectionListener]) - -Creates a new server. The `connectionListener` argument is -automatically set as a listener for the [`'connection'`][] event. - -`options` is an object with the following defaults: - -```js -{ - allowHalfOpen: false, - pauseOnConnect: false -} -``` - -If `allowHalfOpen` is `true`, then the socket won't automatically send a FIN -packet when the other end of the socket sends a FIN packet. The socket becomes -non-readable, but still writable. You should call the [`end()`][] method explicitly. -See [`'end'`][] event for more information. - -If `pauseOnConnect` is `true`, then the socket associated with each incoming -connection will be paused, and no data will be read from its handle. This allows -connections to be passed between processes without any data being read by the -original process. To begin reading data from a paused socket, call [`resume()`][]. - -Here is an example of an echo server which listens for connections -on port 8124: - -```js -const net = require('net'); -const server = net.createServer((c) => { - // 'connection' listener - console.log('client connected'); - c.on('end', () => { - console.log('client disconnected'); - }); - c.write('hello\r\n'); - c.pipe(c); -}); -server.on('error', (err) => { - throw err; -}); -server.listen(8124, () => { - console.log('server bound'); -}); -``` - -Test this by using `telnet`: - -``` -telnet localhost 8124 -``` - -To listen on the socket `/tmp/echo.sock` the third line from the last would -just be changed to - -```js -server.listen('/tmp/echo.sock', () => { - console.log('server bound'); -}); -``` - -Use `nc` to connect to a UNIX domain socket server: - -```js -nc -U /tmp/echo.sock -``` - -## net.isIP(input) - -Tests if input is an IP address. Returns 0 for invalid strings, -returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses. - - -## net.isIPv4(input) - -Returns true if input is a version 4 IP address, otherwise returns false. - - -## net.isIPv6(input) - -Returns true if input is a version 6 IP address, otherwise returns false. - -[`'close'`]: #net_event_close -[`'connect'`]: #net_event_connect -[`'connection'`]: #net_event_connection -[`'data'`]: #net_event_data -[`'drain'`]: #net_event_drain -[`'end'`]: #net_event_end -[`'error'`]: #net_event_error_1 -[`'listening'`]: #net_event_listening -[`'timeout'`]: #net_event_timeout -[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options -[`connect()`]: #net_socket_connect_options_connectlistener -[`destroy()`]: #net_socket_destroy -[`dns.lookup()`]: dns.html#dns_dns_lookup_hostname_options_callback -[`dns.lookup()` hints]: #dns_supported_getaddrinfo_flags -[`end()`]: #net_socket_end_data_encoding -[`EventEmitter`]: events.html#events_class_events_eventemitter -[`net.Socket`]: #net_class_net_socket -[`pause()`]: #net_socket_pause -[`resume()`]: #net_socket_resume -[`server.getConnections()`]: #net_server_getconnections_callback -[`server.listen(port, host, backlog, callback)`]: #net_server_listen_port_hostname_backlog_callback -[`socket.connect(options, connectListener)`]: #net_socket_connect_options_connectlistener -[`socket.connect`]: #net_socket_connect_options_connectlistener -[`socket.setTimeout()`]: #net_socket_settimeout_timeout_callback -[`stream.setEncoding()`]: stream.html#stream_readable_setencoding_encoding -[Readable Stream]: stream.html#stream_class_stream_readable diff --git a/doc/api/net.md b/doc/api/net.md new file mode 100644 index 00000000000000..505337871a8904 --- /dev/null +++ b/doc/api/net.md @@ -0,0 +1,746 @@ +# net + + Stability: 2 - Stable + +The `net` module provides you with an asynchronous network wrapper. It contains +functions for creating both servers and clients (called streams). You can include +this module with `require('net');`. + +## Class: net.Server + +This class is used to create a TCP or local server. + +`net.Server` is an [`EventEmitter`][] with the following events: + +### Event: 'close' + +Emitted when the server closes. Note that if connections exist, this +event is not emitted until all connections are ended. + +### Event: 'connection' + +* {net.Socket} The connection object + +Emitted when a new connection is made. `socket` is an instance of +`net.Socket`. + +### Event: 'error' + +* {Error} + +Emitted when an error occurs. The [`'close'`][] event will be called directly +following this event. See example in discussion of `server.listen`. + +### Event: 'listening' + +Emitted when the server has been bound after calling `server.listen`. + +### server.address() + +Returns the bound address, the address family name, and port of the server +as reported by the operating system. +Useful to find which port was assigned when getting an OS-assigned address. +Returns an object with `port`, `family`, and `address` properties: +`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + +Example: + +```js +var server = net.createServer((socket) => { + socket.end('goodbye\n'); +}).on('error', (err) => { + // handle errors here + throw err; +}); + +// grab a random port. +server.listen(() => { + address = server.address(); + console.log('opened server on %j', address); +}); +``` + +Don't call `server.address()` until the `'listening'` event has been emitted. + +### server.close([callback]) + +Stops the server from accepting new connections and keeps existing +connections. This function is asynchronous, the server is finally +closed when all connections are ended and the server emits a [`'close'`][] event. +The optional `callback` will be called once the `'close'` event occurs. Unlike +that event, it will be called with an Error as its only argument if the server +was not open when it was closed. + +### server.connections + + Stability: 0 - Deprecated: Use [`server.getConnections()`][] instead. + +The number of concurrent connections on the server. + +This becomes `null` when sending a socket to a child with +[`child_process.fork()`][]. To poll forks and get current number of active +connections use asynchronous `server.getConnections` instead. + +### server.getConnections(callback) + +Asynchronously get the number of concurrent connections on the server. Works +when sockets were sent to forks. + +Callback should take two arguments `err` and `count`. + +### server.listen(handle[, backlog][, callback]) + +* `handle` {Object} +* `backlog` {Number} +* `callback` {Function} + +The `handle` object can be set to either a server or socket (anything +with an underlying `_handle` member), or a `{fd: }` object. + +This will cause the server to accept connections on the specified +handle, but it is presumed that the file descriptor or handle has +already been bound to a port or domain socket. + +Listening on a file descriptor is not supported on Windows. + +This function is asynchronous. When the server has been bound, +[`'listening'`][] event will be emitted. +The last parameter `callback` will be added as a listener for the +[`'listening'`][] event. + +The parameter `backlog` behaves the same as in +[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. + +### server.listen(options[, callback]) + +* `options` {Object} - Required. Supports the following properties: + * `port` {Number} - Optional. + * `host` {String} - Optional. + * `backlog` {Number} - Optional. + * `path` {String} - Optional. + * `exclusive` {Boolean} - Optional. +* `callback` {Function} - Optional. + +The `port`, `host`, and `backlog` properties of `options`, as well as the +optional callback function, behave as they do on a call to +[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. +Alternatively, the `path` option can be used to specify a UNIX socket. + +If `exclusive` is `false` (default), then cluster workers will use the same +underlying handle, allowing connection handling duties to be shared. When +`exclusive` is `true`, the handle is not shared, and attempted port sharing +results in an error. An example which listens on an exclusive port is +shown below. + +```js +server.listen({ + host: 'localhost', + port: 80, + exclusive: true +}); +``` + +### server.listen(path[, backlog][, callback]) + +* `path` {String} +* `backlog` {Number} +* `callback` {Function} + +Start a local socket server listening for connections on the given `path`. + +This function is asynchronous. When the server has been bound, +[`'listening'`][] event will be emitted. The last parameter `callback` +will be added as a listener for the [`'listening'`][] event. + +On UNIX, the local domain is usually known as the UNIX domain. The path is a +filesystem path name. It gets truncated to `sizeof(sockaddr_un.sun_path)` +bytes, decreased by 1. It varies on different operating system between 91 and +107 bytes. The typical values are 107 on Linux and 103 on OS X. The path is +subject to the same naming conventions and permissions checks as would be done +on file creation, will be visible in the filesystem, and will *persist until +unlinked*. + +On Windows, the local domain is implemented using a named pipe. The path *must* +refer to an entry in `\\?\pipe\` or `\\.\pipe\`. Any characters are permitted, +but the latter may do some processing of pipe names, such as resolving `..` +sequences. Despite appearances, the pipe name space is flat. Pipes will *not +persist*, they are removed when the last reference to them is closed. Do not +forget JavaScript string escaping requires paths to be specified with +double-backslashes, such as: + + net.createServer().listen( + path.join('\\\\?\\pipe', process.cwd(), 'myctl')) + +The parameter `backlog` behaves the same as in +[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. + +### server.listen(port[, hostname][, backlog][, callback]) + +Begin accepting connections on the specified `port` and `hostname`. If the +`hostname` is omitted, the server will accept connections on any IPv6 address +(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A +port value of zero will assign a random port. + +Backlog is the maximum length of the queue of pending connections. +The actual length will be determined by the OS through sysctl settings such as +`tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this +parameter is 511 (not 512). + +This function is asynchronous. When the server has been bound, +[`'listening'`][] event will be emitted. The last parameter `callback` +will be added as a listener for the [`'listening'`][] event. + +One issue some users run into is getting `EADDRINUSE` errors. This means that +another server is already running on the requested port. One way of handling this +would be to wait a second and then try again: + +```js +server.on('error', (e) => { + if (e.code == 'EADDRINUSE') { + console.log('Address in use, retrying...'); + setTimeout(() => { + server.close(); + server.listen(PORT, HOST); + }, 1000); + } +}); +``` + +(Note: All sockets in Node.js are set `SO_REUSEADDR`.) + +### server.listening + +A Boolean indicating whether or not the server is listening for +connections. + +### server.maxConnections + +Set this property to reject connections when the server's connection count gets +high. + +It is not recommended to use this option once a socket has been sent to a child +with [`child_process.fork()`][]. + +### server.ref() + +Opposite of `unref`, calling `ref` on a previously `unref`d server will *not* +let the program exit if it's the only server left (the default behavior). If +the server is `ref`d calling `ref` again will have no effect. + +Returns `server`. + +### server.unref() + +Calling `unref` on a server will allow the program to exit if this is the only +active server in the event system. If the server is already `unref`d calling +`unref` again will have no effect. + +Returns `server`. + +## Class: net.Socket + +This object is an abstraction of a TCP or local socket. `net.Socket` +instances implement a duplex Stream interface. They can be created by the +user and used as a client (with [`connect()`][]) or they can be created by Node.js +and passed to the user through the `'connection'` event of a server. + +### new net.Socket([options]) + +Construct a new socket object. + +`options` is an object with the following defaults: + +```js +{ + fd: null, + allowHalfOpen: false, + readable: false, + writable: false +} +``` + +`fd` allows you to specify the existing file descriptor of socket. +Set `readable` and/or `writable` to `true` to allow reads and/or writes on this +socket (NOTE: Works only when `fd` is passed). +About `allowHalfOpen`, refer to `createServer()` and `'end'` event. + +`net.Socket` instances are [`EventEmitter`][] with the following events: + +### Event: 'close' + +* `had_error` {Boolean} `true` if the socket had a transmission error. + +Emitted once the socket is fully closed. The argument `had_error` is a boolean +which says if the socket was closed due to a transmission error. + +### Event: 'connect' + +Emitted when a socket connection is successfully established. +See [`connect()`][]. + +### Event: 'data' + +* {Buffer} + +Emitted when data is received. The argument `data` will be a `Buffer` or +`String`. Encoding of data is set by `socket.setEncoding()`. +(See the [Readable Stream][] section for more information.) + +Note that the __data will be lost__ if there is no listener when a `Socket` +emits a `'data'` event. + +### Event: 'drain' + +Emitted when the write buffer becomes empty. Can be used to throttle uploads. + +See also: the return values of `socket.write()` + +### Event: 'end' + +Emitted when the other end of the socket sends a FIN packet. + +By default (`allowHalfOpen == false`) the socket will destroy its file +descriptor once it has written out its pending write queue. However, by +setting `allowHalfOpen == true` the socket will not automatically `end()` +its side allowing the user to write arbitrary amounts of data, with the +caveat that the user is required to `end()` their side now. + +### Event: 'error' + +* {Error} + +Emitted when an error occurs. The `'close'` event will be called directly +following this event. + +### Event: 'lookup' + +Emitted after resolving the hostname but before connecting. +Not applicable to UNIX sockets. + +* `err` {Error|Null} The error object. See [`dns.lookup()`][]. +* `address` {String} The IP address. +* `family` {String|Null} The address type. See [`dns.lookup()`][]. +* `host` {String} The hostname. + +### Event: 'timeout' + +Emitted if the socket times out from inactivity. This is only to notify that +the socket has been idle. The user must manually close the connection. + +See also: [`socket.setTimeout()`][] + +### socket.address() + +Returns the bound address, the address family name and port of the +socket as reported by the operating system. Returns an object with +three properties, e.g. +`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + +### socket.bufferSize + +`net.Socket` has the property that `socket.write()` always works. This is to +help users get up and running quickly. The computer cannot always keep up +with the amount of data that is written to a socket - the network connection +simply might be too slow. Node.js will internally queue up the data written to a +socket and send it out over the wire when it is possible. (Internally it is +polling on the socket's file descriptor for being writable). + +The consequence of this internal buffering is that memory may grow. This +property shows the number of characters currently buffered to be written. +(Number of characters is approximately equal to the number of bytes to be +written, but the buffer may contain strings, and the strings are lazily +encoded, so the exact number of bytes is not known.) + +Users who experience large or growing `bufferSize` should attempt to +"throttle" the data flows in their program with [`pause()`][] and [`resume()`][]. + +### socket.bytesRead + +The amount of received bytes. + +### socket.bytesWritten + +The amount of bytes sent. + +### socket.connect(options[, connectListener]) + +Opens the connection for a given socket. + +For TCP sockets, `options` argument should be an object which specifies: + + - `port`: Port the client should connect to (Required). + + - `host`: Host the client should connect to. Defaults to `'localhost'`. + + - `localAddress`: Local interface to bind to for network connections. + + - `localPort`: Local port to bind to for network connections. + + - `family` : Version of IP stack. Defaults to `4`. + + - `hints`: [`dns.lookup()` hints][]. Defaults to `0`. + + - `lookup` : Custom lookup function. Defaults to `dns.lookup`. + +For local domain sockets, `options` argument should be an object which +specifies: + + - `path`: Path the client should connect to (Required). + +Normally this method is not needed, as `net.createConnection` opens the +socket. Use this only if you are implementing a custom Socket. + +This function is asynchronous. When the [`'connect'`][] event is emitted the +socket is established. If there is a problem connecting, the `'connect'` event +will not be emitted, the [`'error'`][] event will be emitted with the exception. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event. + +### socket.connect(path[, connectListener]) +### socket.connect(port[, host][, connectListener]) + +As [`socket.connect(options[, connectListener])`][`socket.connect(options, connectListener)`], +with options either as either `{port: port, host: host}` or `{path: path}`. + +### socket.connecting + +If `true` - [`socket.connect(options[, connectListener])`][`socket.connect(options, connectListener)`] was called and +haven't yet finished. Will be set to `false` before emitting `connect` event +and/or calling [`socket.connect(options[, connectListener])`][`socket.connect(options, connectListener)`]'s callback. + +### socket.destroy() + +Ensures that no more I/O activity happens on this socket. Only necessary in +case of errors (parse error or so). + +### socket.end([data][, encoding]) + +Half-closes the socket. i.e., it sends a FIN packet. It is possible the +server will still send some data. + +If `data` is specified, it is equivalent to calling +`socket.write(data, encoding)` followed by `socket.end()`. + +### socket.localAddress + +The string representation of the local IP address the remote client is +connecting on. For example, if you are listening on `'0.0.0.0'` and the +client connects on `'192.168.1.1'`, the value would be `'192.168.1.1'`. + +### socket.localPort + +The numeric representation of the local port. For example, +`80` or `21`. + +### socket.pause() + +Pauses the reading of data. That is, [`'data'`][] events will not be emitted. +Useful to throttle back an upload. + +### socket.ref() + +Opposite of `unref`, calling `ref` on a previously `unref`d socket will *not* +let the program exit if it's the only socket left (the default behavior). If +the socket is `ref`d calling `ref` again will have no effect. + +Returns `socket`. + +### socket.remoteAddress + +The string representation of the remote IP address. For example, +`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if +the socket is destroyed (for example, if the client disconnected). + +### socket.remoteFamily + +The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + +### socket.remotePort + +The numeric representation of the remote port. For example, +`80` or `21`. + +### socket.resume() + +Resumes reading after a call to [`pause()`][]. + +### socket.setEncoding([encoding]) + +Set the encoding for the socket as a [Readable Stream][]. See +[`stream.setEncoding()`][] for more information. + +### socket.setKeepAlive([enable][, initialDelay]) + +Enable/disable keep-alive functionality, and optionally set the initial +delay before the first keepalive probe is sent on an idle socket. +`enable` defaults to `false`. + +Set `initialDelay` (in milliseconds) to set the delay between the last +data packet received and the first keepalive probe. Setting 0 for +initialDelay will leave the value unchanged from the default +(or previous) setting. Defaults to `0`. + +Returns `socket`. + +### socket.setNoDelay([noDelay]) + +Disables the Nagle algorithm. By default TCP connections use the Nagle +algorithm, they buffer data before sending it off. Setting `true` for +`noDelay` will immediately fire off data each time `socket.write()` is called. +`noDelay` defaults to `true`. + +Returns `socket`. + +### socket.setTimeout(timeout[, callback]) + +Sets the socket to timeout after `timeout` milliseconds of inactivity on +the socket. By default `net.Socket` do not have a timeout. + +When an idle timeout is triggered the socket will receive a [`'timeout'`][] +event but the connection will not be severed. The user must manually [`end()`][] +or [`destroy()`][] the socket. + +If `timeout` is 0, then the existing idle timeout is disabled. + +The optional `callback` parameter will be added as a one time listener for the +[`'timeout'`][] event. + +Returns `socket`. + +### socket.unref() + +Calling `unref` on a socket will allow the program to exit if this is the only +active socket in the event system. If the socket is already `unref`d calling +`unref` again will have no effect. + +Returns `socket`. + +### socket.write(data[, encoding][, callback]) + +Sends data on the socket. The second parameter specifies the encoding in the +case of a string--it defaults to UTF8 encoding. + +Returns `true` if the entire data was flushed successfully to the kernel +buffer. Returns `false` if all or part of the data was queued in user memory. +[`'drain'`][] will be emitted when the buffer is again free. + +The optional `callback` parameter will be executed when the data is finally +written out - this may not be immediately. + +## net.connect(options[, connectListener]) + +A factory function, which returns a new [`net.Socket`][] and automatically +connects with the supplied `options`. + +The options are passed to both the [`net.Socket`][] constructor and the +[`socket.connect`][] method. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +Here is an example of a client of the previously described echo server: + +```js +const net = require('net'); +const client = net.connect({port: 8124}, () => { + // 'connect' listener + console.log('connected to server!'); + client.write('world!\r\n'); +}); +client.on('data', (data) => { + console.log(data.toString()); + client.end(); +}); +client.on('end', () => { + console.log('disconnected from server'); +}); +``` + +To connect on the socket `/tmp/echo.sock` the second line would just be +changed to + +```js +const client = net.connect({path: '/tmp/echo.sock'}); +``` + +## net.connect(path[, connectListener]) + +A factory function, which returns a new unix [`net.Socket`][] and automatically +connects to the supplied `path`. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +## net.connect(port[, host][, connectListener]) + +A factory function, which returns a new [`net.Socket`][] and automatically +connects to the supplied `port` and `host`. + +If `host` is omitted, `'localhost'` will be assumed. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +## net.createConnection(options[, connectListener]) + +A factory function, which returns a new [`net.Socket`][] and automatically +connects with the supplied `options`. + +The options are passed to both the [`net.Socket`][] constructor and the +[`socket.connect`][] method. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +Here is an example of a client of the previously described echo server: + +```js +const net = require('net'); +const client = net.createConnection({port: 8124}, () => { + //'connect' listener + console.log('connected to server!'); + client.write('world!\r\n'); +}); +client.on('data', (data) => { + console.log(data.toString()); + client.end(); +}); +client.on('end', () => { + console.log('disconnected from server'); +}); +``` + +To connect on the socket `/tmp/echo.sock` the second line would just be +changed to + +```js +const client = net.connect({path: '/tmp/echo.sock'}); +``` + +## net.createConnection(path[, connectListener]) + +A factory function, which returns a new unix [`net.Socket`][] and automatically +connects to the supplied `path`. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +## net.createConnection(port[, host][, connectListener]) + +A factory function, which returns a new [`net.Socket`][] and automatically +connects to the supplied `port` and `host`. + +If `host` is omitted, `'localhost'` will be assumed. + +The `connectListener` parameter will be added as a listener for the +[`'connect'`][] event once. + +## net.createServer([options][, connectionListener]) + +Creates a new server. The `connectionListener` argument is +automatically set as a listener for the [`'connection'`][] event. + +`options` is an object with the following defaults: + +```js +{ + allowHalfOpen: false, + pauseOnConnect: false +} +``` + +If `allowHalfOpen` is `true`, then the socket won't automatically send a FIN +packet when the other end of the socket sends a FIN packet. The socket becomes +non-readable, but still writable. You should call the [`end()`][] method explicitly. +See [`'end'`][] event for more information. + +If `pauseOnConnect` is `true`, then the socket associated with each incoming +connection will be paused, and no data will be read from its handle. This allows +connections to be passed between processes without any data being read by the +original process. To begin reading data from a paused socket, call [`resume()`][]. + +Here is an example of an echo server which listens for connections +on port 8124: + +```js +const net = require('net'); +const server = net.createServer((c) => { + // 'connection' listener + console.log('client connected'); + c.on('end', () => { + console.log('client disconnected'); + }); + c.write('hello\r\n'); + c.pipe(c); +}); +server.on('error', (err) => { + throw err; +}); +server.listen(8124, () => { + console.log('server bound'); +}); +``` + +Test this by using `telnet`: + +``` +telnet localhost 8124 +``` + +To listen on the socket `/tmp/echo.sock` the third line from the last would +just be changed to + +```js +server.listen('/tmp/echo.sock', () => { + console.log('server bound'); +}); +``` + +Use `nc` to connect to a UNIX domain socket server: + +```js +nc -U /tmp/echo.sock +``` + +## net.isIP(input) + +Tests if input is an IP address. Returns 0 for invalid strings, +returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses. + + +## net.isIPv4(input) + +Returns true if input is a version 4 IP address, otherwise returns false. + + +## net.isIPv6(input) + +Returns true if input is a version 6 IP address, otherwise returns false. + +[`'close'`]: #net_event_close +[`'connect'`]: #net_event_connect +[`'connection'`]: #net_event_connection +[`'data'`]: #net_event_data +[`'drain'`]: #net_event_drain +[`'end'`]: #net_event_end +[`'error'`]: #net_event_error_1 +[`'listening'`]: #net_event_listening +[`'timeout'`]: #net_event_timeout +[`child_process.fork()`]: child_process.html#child_process_child_process_fork_modulepath_args_options +[`connect()`]: #net_socket_connect_options_connectlistener +[`destroy()`]: #net_socket_destroy +[`dns.lookup()`]: dns.html#dns_dns_lookup_hostname_options_callback +[`dns.lookup()` hints]: dns.html#dns_supported_getaddrinfo_flags +[`end()`]: #net_socket_end_data_encoding +[`EventEmitter`]: events.html#events_class_eventemitter +[`net.Socket`]: #net_class_net_socket +[`pause()`]: #net_socket_pause +[`resume()`]: #net_socket_resume +[`server.getConnections()`]: #net_server_getconnections_callback +[`server.listen(port, host, backlog, callback)`]: #net_server_listen_port_hostname_backlog_callback +[`socket.connect(options, connectListener)`]: #net_socket_connect_options_connectlistener +[`socket.connect`]: #net_socket_connect_options_connectlistener +[`socket.setTimeout()`]: #net_socket_settimeout_timeout_callback +[`stream.setEncoding()`]: stream.html#stream_readable_setencoding_encoding +[Readable Stream]: stream.html#stream_class_stream_readable diff --git a/doc/api/os.markdown b/doc/api/os.markdown deleted file mode 100644 index ea4f40ba79e958..00000000000000 --- a/doc/api/os.markdown +++ /dev/null @@ -1,186 +0,0 @@ -# OS - - Stability: 2 - Stable - -Provides a few basic operating-system related utility functions. - -Use `require('os')` to access this module. - -## os.EOL - -A constant defining the appropriate End-of-line marker for the operating -system. - -## os.arch() - -Returns the operating system CPU architecture. Possible values are `'x64'`, -`'arm'` and `'ia32'`. Returns the value of [`process.arch`][]. - -## os.cpus() - -Returns an array of objects containing information about each CPU/core -installed: model, speed (in MHz), and times (an object containing the number of -milliseconds the CPU/core spent in: user, nice, sys, idle, and irq). - -Example inspection of os.cpus: - -```js -[ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 252020, - nice: 0, - sys: 30340, - idle: 1070356870, - irq: 0 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 306960, - nice: 0, - sys: 26980, - idle: 1071569080, - irq: 0 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 248450, - nice: 0, - sys: 21750, - idle: 1070919370, - irq: 0 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 256880, - nice: 0, - sys: 19430, - idle: 1070905480, - irq: 20 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 511580, - nice: 20, - sys: 40900, - idle: 1070842510, - irq: 0 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 291660, - nice: 0, - sys: 34360, - idle: 1070888000, - irq: 10 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 308260, - nice: 0, - sys: 55410, - idle: 1071129970, - irq: 880 } }, - { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - speed: 2926, - times: - { user: 266450, - nice: 1480, - sys: 34920, - idle: 1072572010, - irq: 30 } } ] -``` - -Note that since `nice` values are UNIX centric in Windows the `nice` values of -all processors are always 0. - -## os.endianness() - -Returns the endianness of the CPU. Possible values are `'BE'` for big endian -or `'LE'` for little endian. - -## os.freemem() - -Returns the amount of free system memory in bytes. - -## os.homedir() - -Returns the home directory of the current user. - -## os.hostname() - -Returns the hostname of the operating system. - -## os.loadavg() - -Returns an array containing the 1, 5, and 15 minute load averages. - -The load average is a measure of system activity, calculated by the operating -system and expressed as a fractional number. As a rule of thumb, the load -average should ideally be less than the number of logical CPUs in the system. - -The load average is a very UNIX-y concept; there is no real equivalent on -Windows platforms. That is why this function always returns `[0, 0, 0]` on -Windows. - -## os.networkInterfaces() - -Get a list of network interfaces: - -```js -{ lo: - [ { address: '127.0.0.1', - netmask: '255.0.0.0', - family: 'IPv4', - mac: '00:00:00:00:00:00', - internal: true }, - { address: '::1', - netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - family: 'IPv6', - mac: '00:00:00:00:00:00', - internal: true } ], - eth0: - [ { address: '192.168.1.108', - netmask: '255.255.255.0', - family: 'IPv4', - mac: '01:02:03:0a:0b:0c', - internal: false }, - { address: 'fe80::a00:27ff:fe4e:66a1', - netmask: 'ffff:ffff:ffff:ffff::', - family: 'IPv6', - mac: '01:02:03:0a:0b:0c', - internal: false } ] } -``` - -Note that due to the underlying implementation this will only return network -interfaces that have been assigned an address. - -## os.platform() - -Returns the operating system platform. Possible values are `'darwin'`, -`'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of -[`process.platform`][]. - -## os.release() - -Returns the operating system release. - -## os.tmpdir() - -Returns the operating system's default directory for temporary files. - -## os.totalmem() - -Returns the total amount of system memory in bytes. - -## os.type() - -Returns the operating system name. For example `'Linux'` on Linux, `'Darwin'` -on OS X and `'Windows_NT'` on Windows. - -## os.uptime() - -Returns the system uptime in seconds. - -[`process.arch`]: process.html#process_process_arch -[`process.platform`]: process.html#process_process_platform diff --git a/doc/api/os.md b/doc/api/os.md new file mode 100644 index 00000000000000..7e92f2bf434e37 --- /dev/null +++ b/doc/api/os.md @@ -0,0 +1,250 @@ +# OS + + Stability: 2 - Stable + +Provides a few basic operating-system related utility functions. + +Use `require('os')` to access this module. + +## os.EOL + + +A constant defining the appropriate End-of-line marker for the operating +system. + +## os.arch() + + +Returns the operating system CPU architecture. Possible values are `'x64'`, +`'arm'` and `'ia32'`. Returns the value of [`process.arch`][]. + +## os.cpus() + + +Returns an array of objects containing information about each CPU/core +installed: model, speed (in MHz), and times (an object containing the number of +milliseconds the CPU/core spent in: user, nice, sys, idle, and irq). + +Example inspection of os.cpus: + +```js +[ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 252020, + nice: 0, + sys: 30340, + idle: 1070356870, + irq: 0 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 306960, + nice: 0, + sys: 26980, + idle: 1071569080, + irq: 0 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 248450, + nice: 0, + sys: 21750, + idle: 1070919370, + irq: 0 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 256880, + nice: 0, + sys: 19430, + idle: 1070905480, + irq: 20 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 511580, + nice: 20, + sys: 40900, + idle: 1070842510, + irq: 0 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 291660, + nice: 0, + sys: 34360, + idle: 1070888000, + irq: 10 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 308260, + nice: 0, + sys: 55410, + idle: 1071129970, + irq: 880 } }, + { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + speed: 2926, + times: + { user: 266450, + nice: 1480, + sys: 34920, + idle: 1072572010, + irq: 30 } } ] +``` + +Note that since `nice` values are UNIX centric in Windows the `nice` values of +all processors are always 0. + +## os.endianness() + + +Returns the endianness of the CPU. Possible values are `'BE'` for big endian +or `'LE'` for little endian. + +## os.freemem() + + +Returns the amount of free system memory in bytes. + +## os.homedir() + + +Returns the home directory of the current user. + +## os.hostname() + + +Returns the hostname of the operating system. + +## os.loadavg() + + +Returns an array containing the 1, 5, and 15 minute load averages. + +The load average is a measure of system activity, calculated by the operating +system and expressed as a fractional number. As a rule of thumb, the load +average should ideally be less than the number of logical CPUs in the system. + +The load average is a very UNIX-y concept; there is no real equivalent on +Windows platforms. That is why this function always returns `[0, 0, 0]` on +Windows. + +## os.networkInterfaces() + + +Get a list of network interfaces: + +```js +{ lo: + [ { address: '127.0.0.1', + netmask: '255.0.0.0', + family: 'IPv4', + mac: '00:00:00:00:00:00', + internal: true }, + { address: '::1', + netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + family: 'IPv6', + mac: '00:00:00:00:00:00', + internal: true } ], + eth0: + [ { address: '192.168.1.108', + netmask: '255.255.255.0', + family: 'IPv4', + mac: '01:02:03:0a:0b:0c', + internal: false }, + { address: 'fe80::a00:27ff:fe4e:66a1', + netmask: 'ffff:ffff:ffff:ffff::', + family: 'IPv6', + mac: '01:02:03:0a:0b:0c', + internal: false } ] } +``` + +Note that due to the underlying implementation this will only return network +interfaces that have been assigned an address. + +## os.platform() + + +Returns the operating system platform. Possible values are `'darwin'`, +`'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of +[`process.platform`][]. + +## os.release() + + +Returns the operating system release. + +## os.tmpdir() + + +Returns the operating system's default directory for temporary files. + +## os.totalmem() + + +Returns the total amount of system memory in bytes. + +## os.type() + + +Returns the operating system name. For example `'Linux'` on Linux, `'Darwin'` +on OS X and `'Windows_NT'` on Windows. + +## os.uptime() + + +Returns the system uptime in seconds. + +## os.userInfo([options]) + + +* `options` {Object} + * `encoding` {String} Character encoding used to interpret resulting strings. + If `encoding` is set to `'buffer'`, the `username`, `shell`, and `homedir` + values will be `Buffer` instances. (Default: 'utf8') + +Returns a subset of the password file entry for the current effective user. The +returned object includes the `username`, `uid`, `gid`, `shell`, and `homedir`. +On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. + +The value of `homedir` returned by `userInfo()` comes directly from the +operating system. This differs from the result of `os.homedir()`, which queries +several environment variables for the home directory before falling back to the +operating system response. + +[`process.arch`]: process.html#process_process_arch +[`process.platform`]: process.html#process_process_platform diff --git a/doc/api/path.markdown b/doc/api/path.markdown deleted file mode 100644 index 3711dd42a1279c..00000000000000 --- a/doc/api/path.markdown +++ /dev/null @@ -1,345 +0,0 @@ -# Path - - Stability: 2 - Stable - -This module contains utilities for handling and transforming file -paths. The file system is not consulted to check whether paths are valid. - -Use `require('path')` to use this module. The following methods are provided: - -## path.basename(path[, ext]) - -Return the last portion of a path, similar to the Unix `basename` command. -`path` must be a string. `ext`, if given, must also be a string. - -Examples: - -```js -path.basename('/foo/bar/baz/asdf/quux.html') -// returns 'quux.html' - -path.basename('/foo/bar/baz/asdf/quux.html', '.html') -// returns 'quux' -``` - -## path.delimiter - -The platform-specific path delimiter, `;` or `':'`. - -An example on \*nix: - -```js -console.log(process.env.PATH) -// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' - -process.env.PATH.split(path.delimiter) -// returns ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] -``` - -An example on Windows: - -```js -console.log(process.env.PATH) -// 'C:\Windows\system32;C:\Windows;C:\Program Files\node\' - -process.env.PATH.split(path.delimiter) -// returns ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\'] -``` - -## path.dirname(path) - -Return the directory name of a path, similar to the Unix `dirname` command. -`path` must be a string. - -Example: - -```js -path.dirname('/foo/bar/baz/asdf/quux') -// returns '/foo/bar/baz/asdf' -``` - -## path.extname(path) - -Return the extension of the path, from the last '.' to end of string -in the last portion of the path. If there is no '.' in the last portion -of the path or the first character of it is '.', then it returns -an empty string. `path` must be a string. - -Examples: - -```js -path.extname('index.html') -// returns '.html' - -path.extname('index.coffee.md') -// returns '.md' - -path.extname('index.') -// returns '.' - -path.extname('index') -// returns '' - -path.extname('.index') -// returns '' -``` - -## path.format(pathObject) - -Returns a path string from an object. This is the opposite of [`path.parse`][]. - -If `pathObject` has `dir` and `base` properties, the returned string will -be a concatenation of the `dir` property, the platform-dependent path separator, -and the `base` property. - -If the `dir` property is not supplied, the `root` property will be used as the -`dir` property. However, it will be assumed that the `root` property already -ends with the platform-dependent path separator. In this case, the returned -string will be the concatenation fo the `root` property and the `base` property. - -If both the `dir` and the `root` properties are not supplied, then the returned -string will be the contents of the `base` property. - -If the `base` property is not supplied, a concatenation of the `name` property -and the `ext` property will be used as the `base` property. - -Examples: - -An example on Posix systems: - -```js -path.format({ - root : "/", - dir : "/home/user/dir", - base : "file.txt", - ext : ".txt", - name : "file" -}); -// returns '/home/user/dir/file.txt' - -// `root` will be used if `dir` is not specified and `name` + `ext` will be used -// if `base` is not specified -path.format({ - root : "/", - ext : ".txt", - name : "file" -}) -// returns '/file.txt' -``` - -An example on Windows: - -```js -path.format({ - root : "C:\\", - dir : "C:\\path\\dir", - base : "file.txt", - ext : ".txt", - name : "file" -}) -// returns 'C:\\path\\dir\\file.txt' -``` - -## path.isAbsolute(path) - -Determines whether `path` is an absolute path. An absolute path will always -resolve to the same location, regardless of the working directory. `path` must -be a string. - -Examples on \*nix: - -```js -path.isAbsolute('/foo/bar') // true -path.isAbsolute('/baz/..') // true -path.isAbsolute('qux/') // false -path.isAbsolute('.') // false -``` - -Examples on Windows: - -```js -path.isAbsolute('//server') // true -path.isAbsolute('C:/foo/..') // true -path.isAbsolute('bar\\baz') // false -path.isAbsolute('.') // false -``` - -*Note:* If the path string passed as parameter is a zero-length string, unlike - other path module functions, it will be used as-is and `false` will be - returned. - -## path.join([path1][, path2][, ...]) - -Join all arguments together and normalize the resulting path. - -All arguments must be strings. In v0.8, non-string arguments were -silently ignored. In v0.10 and up, an exception is thrown. - -Examples: - -```js -path.join('/foo', 'bar', 'baz/asdf', 'quux', '..') -// returns '/foo/bar/baz/asdf' - -path.join('foo', {}, 'bar') -// throws exception -TypeError: Arguments to path.join must be strings -``` - -*Note:* If the arguments to `join` have zero-length strings, unlike other path - module functions, they will be ignored. If the joined path string is a - zero-length string then `'.'` will be returned, which represents the - current working directory. - -## path.normalize(path) - -Normalize a path, taking care of `'..'` and `'.'` parts. `path` must be a -string. - -When multiple slashes are found, they're replaced by a single one; -when the path contains a trailing slash, it is preserved. -On Windows backslashes are used. - -Example: - -```js -path.normalize('/foo/bar//baz/asdf/quux/..') -// returns '/foo/bar/baz/asdf' -``` - -*Note:* If the path string passed as argument is a zero-length string then `'.'` - will be returned, which represents the current working directory. - -## path.parse(path) - -Returns an object from a path. `path` must be a string. - -An example on \*nix: - -```js -path.parse('/home/user/dir/file.txt') -// returns -// { -// root : "/", -// dir : "/home/user/dir", -// base : "file.txt", -// ext : ".txt", -// name : "file" -// } -``` - -An example on Windows: - -```js -path.parse('C:\\path\\dir\\index.html') -// returns -// { -// root : "C:\\", -// dir : "C:\\path\\dir", -// base : "index.html", -// ext : ".html", -// name : "index" -// } -``` - -## path.posix - -Provide access to aforementioned `path` methods but always interact in a posix -compatible way. - -## path.relative(from, to) - -Solve the relative path from `from` to `to`. `from` and `to` must be strings. - -At times we have two absolute paths, and we need to derive the relative -path from one to the other. This is actually the reverse transform of -`path.resolve`, which means we see that: - -```js -path.resolve(from, path.relative(from, to)) == path.resolve(to) -``` - -Examples: - -```js -path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') -// returns '..\\..\\impl\\bbb' - -path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') -// returns '../../impl/bbb' -``` - -*Note:* If the arguments to `relative` have zero-length strings then the current - working directory will be used instead of the zero-length strings. If - both the paths are the same then a zero-length string will be returned. - -## path.resolve([from ...], to) - -Resolves `to` to an absolute path. All arguments must be strings. - -If `to` isn't already absolute `from` arguments are prepended in right to left -order, until an absolute path is found. If after using all `from` paths still -no absolute path is found, the current working directory is used as well. The -resulting path is normalized, and trailing slashes are removed unless the path -gets resolved to the root directory. - -Another way to think of it is as a sequence of `cd` commands in a shell. - -```js -path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile') -``` - -Is similar to: - -``` -cd foo/bar -cd /tmp/file/ -cd .. -cd a/../subfile -pwd -``` - -The difference is that the different paths don't need to exist and may also be -files. - -Examples: - -```js -path.resolve('/foo/bar', './baz') -// returns '/foo/bar/baz' - -path.resolve('/foo/bar', '/tmp/file/') -// returns '/tmp/file' - -path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') -// if currently in /home/myself/node, it returns -// '/home/myself/node/wwwroot/static_files/gif/image.gif' -``` - -*Note:* If the arguments to `resolve` have zero-length strings then the current - working directory will be used instead of them. - -## path.sep - -The platform-specific file separator. `'\\'` or `'/'`. - -An example on \*nix: - -```js -'foo/bar/baz'.split(path.sep) -// returns ['foo', 'bar', 'baz'] -``` - -An example on Windows: - -```js -'foo\\bar\\baz'.split(path.sep) -// returns ['foo', 'bar', 'baz'] -``` - -## path.win32 - -Provide access to aforementioned `path` methods but always interact in a win32 -compatible way. - -[`path.parse`]: #path_path_parse_path diff --git a/doc/api/path.md b/doc/api/path.md new file mode 100644 index 00000000000000..49cff7a8beb503 --- /dev/null +++ b/doc/api/path.md @@ -0,0 +1,356 @@ +# Path + + Stability: 2 - Stable + +This module contains utilities for handling and transforming file +paths. The file system is not consulted to check whether paths are valid. + +Use `require('path')` to use this module. The following methods are provided: + +## path.basename(path[, ext]) + +Return the last portion of a path, similar to the Unix `basename` command. +`path` must be a string. `ext`, if given, must also be a string. + +Examples: + +```js +path.basename('/foo/bar/baz/asdf/quux.html') +// returns 'quux.html' + +path.basename('/foo/bar/baz/asdf/quux.html', '.html') +// returns 'quux' +``` + +## path.delimiter + +The platform-specific path delimiter, `;` or `':'`. + +An example on \*nix: + +```js +console.log(process.env.PATH) +// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' + +process.env.PATH.split(path.delimiter) +// returns ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] +``` + +An example on Windows: + +```js +console.log(process.env.PATH) +// 'C:\Windows\system32;C:\Windows;C:\Program Files\node\' + +process.env.PATH.split(path.delimiter) +// returns ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\'] +``` + +## path.dirname(path) + +Return the directory name of a path, similar to the Unix `dirname` command. +`path` must be a string. + +Example: + +```js +path.dirname('/foo/bar/baz/asdf/quux') +// returns '/foo/bar/baz/asdf' +``` + +## path.extname(path) + +Return the extension of the path, from the last '.' to end of string +in the last portion of the path. If there is no '.' in the last portion +of the path or the first character of it is '.', then it returns +an empty string. `path` must be a string. + +Examples: + +```js +path.extname('index.html') +// returns '.html' + +path.extname('index.coffee.md') +// returns '.md' + +path.extname('index.') +// returns '.' + +path.extname('index') +// returns '' + +path.extname('.index') +// returns '' +``` + +## path.format(pathObject) + +Returns a path string from an object. This is the opposite of [`path.parse`][]. + +If `pathObject` has `dir` and `base` properties, the returned string will +be a concatenation of the `dir` property, the platform-dependent path separator, +and the `base` property. + +If the `dir` property is not supplied, the `root` property will be used as the +`dir` property. However, it will be assumed that the `root` property already +ends with the platform-dependent path separator. In this case, the returned +string will be the concatenation of the `root` property and the `base` property. + +If both the `dir` and the `root` properties are not supplied, then the returned +string will be the contents of the `base` property. + +If the `base` property is not supplied, a concatenation of the `name` property +and the `ext` property will be used as the `base` property. + +Examples: + +Some Posix system examples: + +```js +// If `dir` and `base` are provided, `dir` + platform separator + `base` +// will be returned. +path.format({ + dir: '/home/user/dir', + base: 'file.txt' +}); +// returns '/home/user/dir/file.txt' + +// `root` will be used if `dir` is not specified. +// `name` + `ext` will be used if `base` is not specified. +// If only `root` is provided or `dir` is equal to `root` then the +// platform separator will not be included. +path.format({ + root: '/', + base: 'file.txt' +}); +// returns '/file.txt' + +path.format({ + dir: '/', + root: '/', + name: 'file', + ext: '.txt' +}); +// returns '/file.txt' + +// `base` will be returned if `dir` or `root` are not provided. +path.format({ + base: 'file.txt' +}); +// returns 'file.txt' +``` +An example on Windows: + +```js +path.format({ + root : "C:\\", + dir : "C:\\path\\dir", + base : "file.txt", + ext : ".txt", + name : "file" +}) +// returns 'C:\\path\\dir\\file.txt' +``` + +## path.isAbsolute(path) + +Determines whether `path` is an absolute path. An absolute path will always +resolve to the same location, regardless of the working directory. `path` must +be a string. + +Examples on \*nix: + +```js +path.isAbsolute('/foo/bar') // true +path.isAbsolute('/baz/..') // true +path.isAbsolute('qux/') // false +path.isAbsolute('.') // false +``` + +Examples on Windows: + +```js +path.isAbsolute('//server') // true +path.isAbsolute('C:/foo/..') // true +path.isAbsolute('bar\\baz') // false +path.isAbsolute('.') // false +``` + +*Note:* If the path string passed as parameter is a zero-length string, unlike + other path module functions, it will be used as-is and `false` will be + returned. + +## path.join([path1][, path2][, ...]) + +Join all arguments together and normalize the resulting path. + +All arguments must be strings. In v0.8, non-string arguments were +silently ignored. In v0.10 and up, an exception is thrown. + +Examples: + +```js +path.join('/foo', 'bar', 'baz/asdf', 'quux', '..') +// returns '/foo/bar/baz/asdf' + +path.join('foo', {}, 'bar') +// throws exception +TypeError: Arguments to path.join must be strings +``` + +*Note:* If the arguments to `join` have zero-length strings, unlike other path + module functions, they will be ignored. If the joined path string is a + zero-length string then `'.'` will be returned, which represents the + current working directory. + +## path.normalize(path) + +Normalize a path, taking care of `'..'` and `'.'` parts. `path` must be a +string. + +When multiple slashes are found, they're replaced by a single one; +when the path contains a trailing slash, it is preserved. +On Windows backslashes are used. + +Example: + +```js +path.normalize('/foo/bar//baz/asdf/quux/..') +// returns '/foo/bar/baz/asdf' +``` + +*Note:* If the path string passed as argument is a zero-length string then `'.'` + will be returned, which represents the current working directory. + +## path.parse(path) + +Returns an object from a path. `path` must be a string. + +An example on \*nix: + +```js +path.parse('/home/user/dir/file.txt') +// returns +// { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +An example on Windows: + +```js +path.parse('C:\\path\\dir\\index.html') +// returns +// { +// root : "C:\\", +// dir : "C:\\path\\dir", +// base : "index.html", +// ext : ".html", +// name : "index" +// } +``` + +## path.posix + +Provide access to aforementioned `path` methods but always interact in a posix +compatible way. + +## path.relative(from, to) + +Solve the relative path from `from` to `to`. `from` and `to` must be strings. + +At times we have two absolute paths, and we need to derive the relative +path from one to the other. This is actually the reverse transform of +`path.resolve`, which means we see that: + +```js +path.resolve(from, path.relative(from, to)) == path.resolve(to) +``` + +Examples: + +```js +path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') +// returns '..\\..\\impl\\bbb' + +path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') +// returns '../../impl/bbb' +``` + +*Note:* If the arguments to `relative` have zero-length strings then the current + working directory will be used instead of the zero-length strings. If + both the paths are the same then a zero-length string will be returned. + +## path.resolve([from ...], to) + +Resolves `to` to an absolute path. All arguments must be strings. + +If `to` isn't already absolute `from` arguments are prepended in right to left +order, until an absolute path is found. If after using all `from` paths still +no absolute path is found, the current working directory is used as well. The +resulting path is normalized, and trailing slashes are removed unless the path +gets resolved to the root directory. Empty string `from` arguments are +ignored. + +Another way to think of it is as a sequence of `cd` commands in a shell. + +```js +path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile') +``` + +Is similar to: + +``` +cd foo/bar +cd /tmp/file/ +cd .. +cd a/../subfile +pwd +``` + +The difference is that the different paths don't need to exist and may also be +files. + +Examples: + +```js +path.resolve('/foo/bar', './baz') +// returns '/foo/bar/baz' + +path.resolve('/foo/bar', '/tmp/file/') +// returns '/tmp/file' + +path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') +// if currently in /home/myself/node, it returns +// '/home/myself/node/wwwroot/static_files/gif/image.gif' +``` + +## path.sep + +The platform-specific file separator. `'\\'` or `'/'`. + +An example on \*nix: + +```js +'foo/bar/baz'.split(path.sep) +// returns ['foo', 'bar', 'baz'] +``` + +An example on Windows: + +```js +'foo\\bar\\baz'.split(path.sep) +// returns ['foo', 'bar', 'baz'] +``` + +## path.win32 + +Provide access to aforementioned `path` methods but always interact in a win32 +compatible way. + +[`path.parse`]: #path_path_parse_path diff --git a/doc/api/process.markdown b/doc/api/process.markdown deleted file mode 100644 index 2e65e6a4b1efca..00000000000000 --- a/doc/api/process.markdown +++ /dev/null @@ -1,1303 +0,0 @@ -# process - - - -The `process` object is a global object and can be accessed from anywhere. -It is an instance of [`EventEmitter`][]. - -## Event: 'beforeExit' - -This event is emitted when Node.js empties its event loop and has nothing else -to schedule. Normally, Node.js exits when there is no work scheduled, but a -listener for `'beforeExit'` can make asynchronous calls, and cause Node.js to -continue. - -`'beforeExit'` is not emitted for conditions causing explicit termination, such -as [`process.exit()`][] or uncaught exceptions, and should not be used as an -alternative to the `'exit'` event unless the intention is to schedule more work. - -## Event: 'exit' - -Emitted when the process is about to exit. There is no way to prevent the -exiting of the event loop at this point, and once all `'exit'` listeners have -finished running the process will exit. Therefore you **must** only perform -**synchronous** operations in this handler. This is a good hook to perform -checks on the module's state (like for unit tests). The callback takes one -argument, the code the process is exiting with. - -This event is only emitted when Node.js exits explicitly by process.exit() or -implicitly by the event loop draining. - -Example of listening for `'exit'`: - -```js -process.on('exit', (code) => { - // do *NOT* do this - setTimeout(() => { - console.log('This will not run'); - }, 0); - console.log('About to exit with code:', code); -}); -``` - -## Event: 'message' - -* `message` {Object} a parsed JSON object or primitive value -* `sendHandle` {Handle object} a [`net.Socket`][] or [`net.Server`][] object, or - undefined. - -Messages sent by [`ChildProcess.send()`][] are obtained using the `'message'` -event on the child's process object. - -## Event: 'rejectionHandled' - -Emitted whenever a Promise was rejected and an error handler was attached to it -(for example with `.catch()`) later than after an event loop turn. This event -is emitted with the following arguments: - - - `p` the promise that was previously emitted in an `'unhandledRejection'` - event, but which has now gained a rejection handler. - -There is no notion of a top level for a promise chain at which rejections can -always be handled. Being inherently asynchronous in nature, a promise rejection -can be handled at a future point in time — possibly much later than the -event loop turn it takes for the `'unhandledRejection'` event to be emitted. - -Another way of stating this is that, unlike in synchronous code where there is -an ever-growing list of unhandled exceptions, with promises there is a -growing-and-shrinking list of unhandled rejections. In synchronous code, the -`'uncaughtException'` event tells you when the list of unhandled exceptions -grows. And in asynchronous code, the `'unhandledRejection'` event tells you -when the list of unhandled rejections grows, while the `'rejectionHandled'` -event tells you when the list of unhandled rejections shrinks. - -For example using the rejection detection hooks in order to keep a map of all -the rejected promise reasons at a given time: - -```js -const unhandledRejections = new Map(); -process.on('unhandledRejection', (reason, p) => { - unhandledRejections.set(p, reason); -}); -process.on('rejectionHandled', (p) => { - unhandledRejections.delete(p); -}); -``` - -This map will grow and shrink over time, reflecting rejections that start -unhandled and then become handled. You could record the errors in some error -log, either periodically (probably best for long-running programs, allowing -you to clear the map, which in the case of a very buggy program could grow -indefinitely) or upon process exit (more convenient for scripts). - -## Event: 'uncaughtException' - -The `'uncaughtException'` event is emitted when an exception bubbles all the -way back to the event loop. By default, Node.js handles such exceptions by -printing the stack trace to stderr and exiting. Adding a handler for the -`'uncaughtException'` event overrides this default behavior. - -For example: - -```js -process.on('uncaughtException', (err) => { - console.log(`Caught exception: ${err}`); -}); - -setTimeout(() => { - console.log('This will still run.'); -}, 500); - -// Intentionally cause an exception, but don't catch it. -nonexistentFunc(); -console.log('This will not run.'); -``` - -### Warning: Using `'uncaughtException'` correctly - -Note that `'uncaughtException'` is a crude mechanism for exception handling -intended to be used only as a last resort. The event *should not* be used as -an equivalent to `On Error Resume Next`. Unhandled exceptions inherently mean -that an application is in an undefined state. Attempting to resume application -code without properly recovering from the exception can cause additional -unforeseen and unpredictable issues. - -Exceptions thrown from within the event handler will not be caught. Instead the -process will exit with a non zero exit code and the stack trace will be printed. -This is to avoid infinite recursion. - -Attempting to resume normally after an uncaught exception can be similar to -pulling out of the power cord when upgrading a computer -- nine out of ten -times nothing happens - but the 10th time, the system becomes corrupted. - -The correct use of `'uncaughtException'` is to perform synchronous cleanup -of allocated resources (e.g. file descriptors, handles, etc) before shutting -down the process. It is not safe to resume normal operation after -`'uncaughtException'`. - -## Event: 'unhandledRejection' - -Emitted whenever a `Promise` is rejected and no error handler is attached to -the promise within a turn of the event loop. When programming with promises -exceptions are encapsulated as rejected promises. Such promises can be caught -and handled using [`promise.catch(...)`][] and rejections are propagated through -a promise chain. This event is useful for detecting and keeping track of -promises that were rejected whose rejections were not handled yet. This event -is emitted with the following arguments: - - - `reason` the object with which the promise was rejected (usually an - [`Error`][] instance). - - `p` the promise that was rejected. - -Here is an example that logs every unhandled rejection to the console - -```js -process.on('unhandledRejection', (reason, p) => { - console.log("Unhandled Rejection at: Promise ", p, " reason: ", reason); - // application specific logging, throwing an error, or other logic here -}); -``` - -For example, here is a rejection that will trigger the `'unhandledRejection'` -event: - -```js -somePromise.then((res) => { - return reportToUser(JSON.pasre(res)); // note the typo (`pasre`) -}); // no `.catch` or `.then` -``` - -Here is an example of a coding pattern that will also trigger -`'unhandledRejection'`: - -```js -function SomeResource() { - // Initially set the loaded status to a rejected promise - this.loaded = Promise.reject(new Error('Resource not yet loaded!')); -} - -var resource = new SomeResource(); -// no .catch or .then on resource.loaded for at least a turn -``` - -In cases like this, you may not want to track the rejection as a developer -error like you would for other `'unhandledRejection'` events. To address -this, you can either attach a dummy `.catch(() => { })` handler to -`resource.loaded`, preventing the `'unhandledRejection'` event from being -emitted, or you can use the [`'rejectionHandled'`][] event. - -## Event: 'warning' - -Emitted whenever Node.js emits a process warning. - -A process warning is similar to an error in that it describes exceptional -conditions that are being brought to the user's attention. However, warnings -are not part of the normal Node.js and JavaScript error handling flow. -Node.js can emit warnings whenever it detects bad coding practices that could -lead to sub-optimal application performance, bugs or security vulnerabilities. - -The event handler for `'warning'` events is called with a single `warning` -argument whose value is an `Error` object. There are three key properties that -describe the warning: - -* `name` - The name of the warning (currently `Warning` by default). -* `message` - A system-provided description of the warning. -* `stack` - A stack trace to the location in the code where the warning was - issued. - -```js -process.on('warning', (warning) => { - console.warn(warning.name); // Print the warning name - console.warn(warning.message); // Print the warning message - console.warn(warning.stack); // Print the stack trace -}); -``` - -By default, Node.js will print process warnings to `stderr`. The `--no-warnings` -command-line option can be used to suppress the default console output but the -`'warning'` event will still be emitted by the `process` object. - -The following example illustrates the warning that is printed to `stderr` when -too many listeners have been added to an event - -``` -$ node -> event.defaultMaxListeners = 1; -> process.on('foo', () => {}); -> process.on('foo', () => {}); -> (node:38638) Warning: Possible EventEmitter memory leak detected. 2 foo -... listeners added. Use emitter.setMaxListeners() to increase limit -``` - -In contrast, the following example turns off the default warning output and -adds a custom handler to the `'warning'` event: - -``` -$ node --no-warnings -> var p = process.on('warning', (warning) => console.warn('Do not do that!')); -> event.defaultMaxListeners = 1; -> process.on('foo', () => {}); -> process.on('foo', () => {}); -> Do not do that! -``` - -The `--trace-warnings` command-line option can be used to have the default -console output for warnings include the full stack trace of the warning. - -### Emitting custom warnings - -The [`process.emitWarning()`][process_emit_warning] method can be used to issue -custom or application specific warnings. - -```js -// Emit a warning using a string... -process.emitWarning('Something happened!'); - // Prints: (node 12345) Warning: Something happened! - -// Emit a warning using an object... -process.emitWarning('Something Happened!', 'CustomWarning'); - // Prints: (node 12345) CustomWarning: Something happened! - -// Emit a warning using a custom Error object... -class CustomWarning extends Error { - constructor(message) { - super(message); - this.name = 'CustomWarning'; - Error.captureStackTrace(this, CustomWarning); - } -} -const myWarning = new CustomWarning('Something happened!'); -process.emitWarning(myWarning); - // Prints: (node 12345) CustomWarning: Something happened! -``` - -### Emitting custom deprecation warnings - -Custom deprecation warnings can be emitted by setting the `name` of a custom -warning to `DeprecationWarning`. For instance: - -```js -process.emitWarning('This API is deprecated', 'DeprecationWarning'); -``` - -Or, - -```js -const err = new Error('This API is deprecated'); -err.name = 'DeprecationWarning'; -process.emitWarning(err); -``` - -Launching Node.js using the `--throw-deprecation` command line flag will -cause custom deprecation warnings to be thrown as exceptions. - -Using the `--trace-deprecation` command line flag will cause the custom -deprecation to be printed to `stderr` along with the stack trace. - -Using the `--no-deprecation` command line flag will suppress all reporting -of the custom deprecation. - -The `*-deprecation` command line flags only affect warnings that use the name -`DeprecationWarning`. - -## Exit Codes - -Node.js will normally exit with a `0` status code when no more async -operations are pending. The following status codes are used in other -cases: - -* `1` **Uncaught Fatal Exception** - There was an uncaught exception, - and it was not handled by a domain or an `'uncaughtException'` event - handler. -* `2` - Unused (reserved by Bash for builtin misuse) -* `3` **Internal JavaScript Parse Error** - The JavaScript source code - internal in Node.js's bootstrapping process caused a parse error. This - is extremely rare, and generally can only happen during development - of Node.js itself. -* `4` **Internal JavaScript Evaluation Failure** - The JavaScript - source code internal in Node.js's bootstrapping process failed to - return a function value when evaluated. This is extremely rare, and - generally can only happen during development of Node.js itself. -* `5` **Fatal Error** - There was a fatal unrecoverable error in V8. - Typically a message will be printed to stderr with the prefix `FATAL - ERROR`. -* `6` **Non-function Internal Exception Handler** - There was an - uncaught exception, but the internal fatal exception handler - function was somehow set to a non-function, and could not be called. -* `7` **Internal Exception Handler Run-Time Failure** - There was an - uncaught exception, and the internal fatal exception handler - function itself threw an error while attempting to handle it. This - can happen, for example, if a `process.on('uncaughtException')` or - `domain.on('error')` handler throws an error. -* `8` - Unused. In previous versions of Node.js, exit code 8 sometimes - indicated an uncaught exception. -* `9` - **Invalid Argument** - Either an unknown option was specified, - or an option requiring a value was provided without a value. -* `10` **Internal JavaScript Run-Time Failure** - The JavaScript - source code internal in Node.js's bootstrapping process threw an error - when the bootstrapping function was called. This is extremely rare, - and generally can only happen during development of Node.js itself. -* `12` **Invalid Debug Argument** - The `--debug` and/or `--debug-brk` - options were set, but an invalid port number was chosen. -* `>128` **Signal Exits** - If Node.js receives a fatal signal such as - `SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the - value of the signal code. This is a standard Unix practice, since - exit codes are defined to be 7-bit integers, and signal exits set - the high-order bit, and then contain the value of the signal code. - -## Signal Events - - - - -Emitted when the processes receives a signal. See sigaction(2) for a list of -standard POSIX signal names such as `SIGINT`, `SIGHUP`, etc. - -Example of listening for `SIGINT`: - -```js -// Start reading from stdin so we don't exit. -process.stdin.resume(); - -process.on('SIGINT', () => { - console.log('Got SIGINT. Press Control-D to exit.'); -}); -``` - -An easy way to send the `SIGINT` signal is with `Control-C` in most terminal -programs. - -Note: - -- `SIGUSR1` is reserved by Node.js to start the debugger. It's possible to - install a listener but that won't stop the debugger from starting. -- `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that - resets the terminal mode before exiting with code `128 + signal number`. If - one of these signals has a listener installed, its default behavior will be - removed (Node.js will no longer exit). -- `SIGPIPE` is ignored by default. It can have a listener installed. -- `SIGHUP` is generated on Windows when the console window is closed, and on other - platforms under various similar conditions, see signal(7). It can have a - listener installed, however Node.js will be unconditionally terminated by - Windows about 10 seconds later. On non-Windows platforms, the default - behavior of `SIGHUP` is to terminate Node.js, but once a listener has been - installed its default behavior will be removed. -- `SIGTERM` is not supported on Windows, it can be listened on. -- `SIGINT` from the terminal is supported on all platforms, and can usually be - generated with `CTRL+C` (though this may be configurable). It is not generated - when terminal raw mode is enabled. -- `SIGBREAK` is delivered on Windows when `CTRL+BREAK` is pressed, on - non-Windows - platforms it can be listened on, but there is no way to send or generate it. -- `SIGWINCH` is delivered when the console has been resized. On Windows, this - will only happen on write to the console when the cursor is being moved, or - when a readable tty is used in raw mode. -- `SIGKILL` cannot have a listener installed, it will unconditionally terminate - Node.js on all platforms. -- `SIGSTOP` cannot have a listener installed. - -Note that Windows does not support sending Signals, but Node.js offers some -emulation with `process.kill()`, and `child_process.kill()`. Sending signal `0` -can be used to test for the existence of a process. Sending `SIGINT`, -`SIGTERM`, and `SIGKILL` cause the unconditional termination of the target -process. - -## process.abort() - -This causes Node.js to emit an abort. This will cause Node.js to exit and -generate a core file. - -## process.arch - -What processor architecture you're running on: `'arm'`, `'ia32'`, or `'x64'`. - -```js -console.log('This processor architecture is ' + process.arch); -``` - -## process.argv - -An array containing the command line arguments. The first element will be -'node', the second element will be the name of the JavaScript file. The -next elements will be any additional command line arguments. - -```js -// print process.argv -process.argv.forEach((val, index, array) => { - console.log(`${index}: ${val}`); -}); -``` - -This will generate: - -``` -$ node process-2.js one two=three four -0: node -1: /Users/mjr/work/node/process-2.js -2: one -3: two=three -4: four -``` - -## process.chdir(directory) - -Changes the current working directory of the process or throws an exception if that fails. - -```js -console.log(`Starting directory: ${process.cwd()}`); -try { - process.chdir('/tmp'); - console.log(`New directory: ${process.cwd()}`); -} -catch (err) { - console.log(`chdir: ${err}`); -} -``` - -## process.config - -An Object containing the JavaScript representation of the configure options -that were used to compile the current Node.js executable. This is the same as -the `config.gypi` file that was produced when running the `./configure` script. - -An example of the possible output looks like: - -``` -{ - target_defaults: - { cflags: [], - default_configuration: 'Release', - defines: [], - include_dirs: [], - libraries: [] }, - variables: - { - host_arch: 'x64', - node_install_npm: 'true', - node_prefix: '', - node_shared_cares: 'false', - node_shared_http_parser: 'false', - node_shared_libuv: 'false', - node_shared_zlib: 'false', - node_use_dtrace: 'false', - node_use_openssl: 'true', - node_shared_openssl: 'false', - strict_aliasing: 'true', - target_arch: 'x64', - v8_use_snapshot: 'true' - } -} -``` - -## process.connected - -* {Boolean} Set to false after `process.disconnect()` is called - -If `process.connected` is false, it is no longer possible to send messages. - -## process.cwd() - -Returns the current working directory of the process. - -```js -console.log(`Current directory: ${process.cwd()}`); -``` - -## process.disconnect() - -Close the IPC channel to the parent process, allowing this child to exit -gracefully once there are no other connections keeping it alive. - -Identical to the parent process's [`ChildProcess.disconnect()`][]. - -If Node.js was not spawned with an IPC channel, `process.disconnect()` will be -undefined. - -## process.env - -An object containing the user environment. See environ(7). - -An example of this object looks like: - -```js -{ TERM: 'xterm-256color', - SHELL: '/usr/local/bin/bash', - USER: 'maciej', - PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - PWD: '/Users/maciej', - EDITOR: 'vim', - SHLVL: '1', - HOME: '/Users/maciej', - LOGNAME: 'maciej', - _: '/usr/local/bin/node' } -``` - -You can write to this object, but changes won't be reflected outside of your -process. That means that the following won't work: - -``` -$ node -e 'process.env.foo = "bar"' && echo $foo -``` - -But this will: - -```js -process.env.foo = 'bar'; -console.log(process.env.foo); -``` - -Assigning a property on `process.env` will implicitly convert the value -to a string. - -Example: - -```js -process.env.test = null; -console.log(process.env.test); -// => 'null' -process.env.test = undefined; -console.log(process.env.test); -// => 'undefined' -``` - -Use `delete` to delete a property from `process.env`. - -Example: - -```js -process.env.TEST = 1; -delete process.env.TEST; -console.log(process.env.TEST); -// => undefined -``` - -## process.emitWarning(warning[, name][, ctor]) - -* `warning` {String | Error} The warning to emit. -* `name` {String} When `warning` is a String, `name` is the name to use - for the warning. Default: `Warning`. -* `ctor` {Function} When `warning` is a String, `ctor` is an optional - function used to limit the generated stack trace. Default - `process.emitWarning` - -The `process.emitWarning()` method can be used to emit custom or application -specific process warnings. These can be listened for by adding a handler to the -[`process.on('warning')`][process_warning] event. - -```js -// Emit a warning using a string... -process.emitWarning('Something happened!'); - // Emits: (node: 56338) Warning: Something happened! -``` - -``` -// Emit a warning using a string and a name... -process.emitWarning('Something Happened!', 'CustomWarning'); - // Emits: (node:56338) CustomWarning: Something Happened! -``` - -In each of the previous examples, an `Error` object is generated internally by -`process.emitWarning()` and passed through to the -[`process.on('warning')`][process_warning] event. - -``` -process.on('warning', (warning) => { - console.warn(warning.name); - console.warn(warning.message); - console.warn(warning.stack); -}); -``` - -If `warning` is passed as an `Error` object, it will be passed through to the -`process.on('warning')` event handler unmodified (and the optional `name` -and `ctor` arguments will be ignored): - -``` -// Emit a warning using an Error object... -const myWarning = new Error('Warning! Something happened!'); -myWarning.name = 'CustomWarning'; - -process.emitWarning(myWarning); - // Emits: (node:56338) CustomWarning: Warning! Something Happened! -``` - -A `TypeError` is thrown if `warning` is anything other than a string or `Error` -object. - -Note that while process warnings use `Error` objects, the process warning -mechanism is **not** a replacement for normal error handling mechanisms. - -The following additional handling is implemented if the warning `name` is -`DeprecationWarning`: - -* If the `--throw-deprecation` command-line flag is used, the deprecation - warning is thrown as an exception rather than being emitted as an event. -* If the `--no-deprecation` command-line flag is used, the deprecation - warning is suppressed. -* If the `--trace-deprecation` command-line flag is used, the deprecation - warning is printed to `stderr` along with the full stack trace. - -### Avoiding duplicate warnings - -As a best practice, warnings should be emitted only once per process. To do -so, it is recommended to place the `emitWarning()` behind a simple boolean -flag as illustrated in the example below: - -``` -var warned = false; -function emitMyWarning() { - if (!warned) { - process.emitWarning('Only warn once!'); - warned = true; - } -} -emitMyWarning(); - // Emits: (node: 56339) Warning: Only warn once! -emitMyWarning(); - // Emits nothing -``` - -## process.execArgv - -This is the set of Node.js-specific command line options from the -executable that started the process. These options do not show up in -`process.argv`, and do not include the Node.js executable, the name of -the script, or any options following the script name. These options -are useful in order to spawn child processes with the same execution -environment as the parent. - -Example: - -``` -$ node --harmony script.js --version -``` - -results in process.execArgv: - -```js -['--harmony'] -``` - -and process.argv: - -```js -['/usr/local/bin/node', 'script.js', '--version'] -``` - -## process.execPath - -This is the absolute pathname of the executable that started the process. - -Example: - -``` -/usr/local/bin/node -``` - - -## process.exit([code]) - -Ends the process with the specified `code`. If omitted, exit uses the -'success' code `0`. - -To exit with a 'failure' code: - -```js -process.exit(1); -``` - -The shell that executed Node.js should see the exit code as 1. - - -## process.exitCode - -A number which will be the process exit code, when the process either -exits gracefully, or is exited via [`process.exit()`][] without specifying -a code. - -Specifying a code to `process.exit(code)` will override any previous -setting of `process.exitCode`. - - -## process.getegid() - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Gets the effective group identity of the process. (See getegid(2).) -This is the numerical group id, not the group name. - -```js -if (process.getegid) { - console.log(`Current gid: ${process.getegid()}`); -} -``` - - -## process.geteuid() - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Gets the effective user identity of the process. (See geteuid(2).) -This is the numerical userid, not the username. - -```js -if (process.geteuid) { - console.log(`Current uid: ${process.geteuid()}`); -} -``` - -## process.getgid() - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Gets the group identity of the process. (See getgid(2).) -This is the numerical group id, not the group name. - -```js -if (process.getgid) { - console.log(`Current gid: ${process.getgid()}`); -} -``` - -## process.getgroups() - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Returns an array with the supplementary group IDs. POSIX leaves it unspecified -if the effective group ID is included but Node.js ensures it always is. - -## process.getuid() - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Gets the user identity of the process. (See getuid(2).) -This is the numerical userid, not the username. - -```js -if (process.getuid) { - console.log(`Current uid: ${process.getuid()}`); -} -``` - -## process.hrtime() - -Returns the current high-resolution real time in a `[seconds, nanoseconds]` -tuple Array. It is relative to an arbitrary time in the past. It is not -related to the time of day and therefore not subject to clock drift. The -primary use is for measuring performance between intervals. - -You may pass in the result of a previous call to `process.hrtime()` to get -a diff reading, useful for benchmarks and measuring intervals: - -```js -var time = process.hrtime(); -// [ 1800216, 25 ] - -setTimeout(() => { - var diff = process.hrtime(time); - // [ 1, 552 ] - - console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]); - // benchmark took 1000000527 nanoseconds -}, 1000); -``` - - -## process.initgroups(user, extra_group) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Reads /etc/group and initializes the group access list, using all groups of -which the user is a member. This is a privileged operation, meaning you need -to be root or have the `CAP_SETGID` capability. - -`user` is a user name or user ID. `extra_group` is a group name or group ID. - -Some care needs to be taken when dropping privileges. Example: - -```js -console.log(process.getgroups()); // [ 0 ] -process.initgroups('bnoordhuis', 1000); // switch user -console.log(process.getgroups()); // [ 27, 30, 46, 1000, 0 ] -process.setgid(1000); // drop root gid -console.log(process.getgroups()); // [ 27, 30, 46, 1000 ] -``` - -## process.kill(pid[, signal]) - -Send a signal to a process. `pid` is the process id and `signal` is the -string describing the signal to send. Signal names are strings like -`SIGINT` or `SIGHUP`. If omitted, the signal will be `SIGTERM`. -See [Signal Events][] and kill(2) for more information. - -Will throw an error if target does not exist, and as a special case, a signal -of `0` can be used to test for the existence of a process. Windows platforms -will throw an error if the `pid` is used to kill a process group. - -Note that even though the name of this function is `process.kill`, it is really -just a signal sender, like the `kill` system call. The signal sent may do -something other than kill the target process. - -Example of sending a signal to yourself: - -```js -process.on('SIGHUP', () => { - console.log('Got SIGHUP signal.'); -}); - -setTimeout(() => { - console.log('Exiting.'); - process.exit(0); -}, 100); - -process.kill(process.pid, 'SIGHUP'); -``` - -Note: When SIGUSR1 is received by Node.js it starts the debugger, see -[Signal Events][]. - -## process.mainModule - -Alternate way to retrieve [`require.main`][]. The difference is that if the main -module changes at runtime, `require.main` might still refer to the original main -module in modules that were required before the change occurred. Generally it's -safe to assume that the two refer to the same module. - -As with `require.main`, it will be `undefined` if there was no entry script. - -## process.memoryUsage() - -Returns an object describing the memory usage of the Node.js process -measured in bytes. - -```js -const util = require('util'); - -console.log(util.inspect(process.memoryUsage())); -``` - -This will generate: - -```js -{ rss: 4935680, - heapTotal: 1826816, - heapUsed: 650472 } -``` - -`heapTotal` and `heapUsed` refer to V8's memory usage. - - -## process.nextTick(callback[, arg][, ...]) - -* `callback` {Function} - -Once the current event loop turn runs to completion, call the callback -function. - -This is *not* a simple alias to [`setTimeout(fn, 0)`][], it's much more -efficient. It runs before any additional I/O events (including -timers) fire in subsequent ticks of the event loop. - -```js -console.log('start'); -process.nextTick(() => { - console.log('nextTick callback'); -}); -console.log('scheduled'); -// Output: -// start -// scheduled -// nextTick callback -``` - -This is important in developing APIs where you want to give the user the -chance to assign event handlers after an object has been constructed, -but before any I/O has occurred. - -```js -function MyThing(options) { - this.setupOptions(options); - - process.nextTick(() => { - this.startDoingStuff(); - }); -} - -var thing = new MyThing(); -thing.getReadyForStuff(); - -// thing.startDoingStuff() gets called now, not before. -``` - -It is very important for APIs to be either 100% synchronous or 100% -asynchronous. Consider this example: - -```js -// WARNING! DO NOT USE! BAD UNSAFE HAZARD! -function maybeSync(arg, cb) { - if (arg) { - cb(); - return; - } - - fs.stat('file', cb); -} -``` - -This API is hazardous. If you do this: - -```js -maybeSync(true, () => { - foo(); -}); -bar(); -``` - -then it's not clear whether `foo()` or `bar()` will be called first. - -This approach is much better: - -```js -function definitelyAsync(arg, cb) { - if (arg) { - process.nextTick(cb); - return; - } - - fs.stat('file', cb); -} -``` - -Note: the nextTick queue is completely drained on each pass of the -event loop **before** additional I/O is processed. As a result, -recursively setting nextTick callbacks will block any I/O from -happening, just like a `while(true);` loop. - -## process.pid - -The PID of the process. - -```js -console.log(`This process is pid ${process.pid}`); -``` - -## process.platform - -What platform you're running on: -`'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'` - -```js -console.log(`This platform is ${process.platform}`); -``` - -## process.release - -An Object containing metadata related to the current release, including URLs -for the source tarball and headers-only tarball. - -`process.release` contains the following properties: - -* `name`: a string with a value that will always be `'node'` for Node.js. For - legacy io.js releases, this will be `'io.js'`. -* `sourceUrl`: a complete URL pointing to a _.tar.gz_ file containing the - source of the current release. -* `headersUrl`: a complete URL pointing to a _.tar.gz_ file containing only - the header files for the current release. This file is significantly smaller - than the full source file and can be used for compiling add-ons against - Node.js. -* `libUrl`: a complete URL pointing to an _node.lib_ file matching the - architecture and version of the current release. This file is used for - compiling add-ons against Node.js. _This property is only present on Windows - builds of Node.js and will be missing on all other platforms._ - -e.g. - -```js -{ name: 'node', - sourceUrl: 'https://nodejs.org/download/release/v4.0.0/node-v4.0.0.tar.gz', - headersUrl: 'https://nodejs.org/download/release/v4.0.0/node-v4.0.0-headers.tar.gz', - libUrl: 'https://nodejs.org/download/release/v4.0.0/win-x64/node.lib' } -``` - -In custom builds from non-release versions of the source tree, only the -`name` property may be present. The additional properties should not be -relied upon to exist. - -## process.send(message[, sendHandle[, options]][, callback]) - -* `message` {Object} -* `sendHandle` {Handle object} -* `options` {Object} -* `callback` {Function} -* Return: {Boolean} - -When Node.js is spawned with an IPC channel attached, it can send messages to its -parent process using `process.send()`. Each will be received as a -[`'message'`][] event on the parent's `ChildProcess` object. - -*Note: this function uses [`JSON.stringify()`][] internally to serialize the `message`.* - -If Node.js was not spawned with an IPC channel, `process.send()` will be undefined. - -## process.setegid(id) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Sets the effective group identity of the process. (See setegid(2).) -This accepts either a numerical ID or a groupname string. If a groupname -is specified, this method blocks while resolving it to a numerical ID. - -```js -if (process.getegid && process.setegid) { - console.log(`Current gid: ${process.getegid()}`); - try { - process.setegid(501); - console.log(`New gid: ${process.getegid()}`); - } - catch (err) { - console.log(`Failed to set gid: ${err}`); - } -} -``` - -## process.seteuid(id) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Sets the effective user identity of the process. (See seteuid(2).) -This accepts either a numerical ID or a username string. If a username -is specified, this method blocks while resolving it to a numerical ID. - -```js -if (process.geteuid && process.seteuid) { - console.log(`Current uid: ${process.geteuid()}`); - try { - process.seteuid(501); - console.log(`New uid: ${process.geteuid()}`); - } - catch (err) { - console.log(`Failed to set uid: ${err}`); - } -} -``` - -## process.setgid(id) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Sets the group identity of the process. (See setgid(2).) This accepts either -a numerical ID or a groupname string. If a groupname is specified, this method -blocks while resolving it to a numerical ID. - -```js -if (process.getgid && process.setgid) { - console.log(`Current gid: ${process.getgid()}`); - try { - process.setgid(501); - console.log(`New gid: ${process.getgid()}`); - } - catch (err) { - console.log(`Failed to set gid: ${err}`); - } -} -``` - -## process.setgroups(groups) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Sets the supplementary group IDs. This is a privileged operation, meaning you -need to be root or have the `CAP_SETGID` capability. - -The list can contain group IDs, group names or both. - -## process.setuid(id) - -Note: this function is only available on POSIX platforms (i.e. not Windows, -Android) - -Sets the user identity of the process. (See setuid(2).) This accepts either -a numerical ID or a username string. If a username is specified, this method -blocks while resolving it to a numerical ID. - -```js -if (process.getuid && process.setuid) { - console.log(`Current uid: ${process.getuid()}`); - try { - process.setuid(501); - console.log(`New uid: ${process.getuid()}`); - } - catch (err) { - console.log(`Failed to set uid: ${err}`); - } -} -``` - -## process.stderr - -A writable stream to stderr (on fd `2`). - -`process.stderr` and `process.stdout` are unlike other streams in Node.js in -that they cannot be closed (`end()` will throw), they never emit the `finish` -event and that writes can block when output is redirected to a file (although -disks are fast and operating systems normally employ write-back caching so it -should be a very rare occurrence indeed.) - -## process.stdin - -A `Readable Stream` for stdin (on fd `0`). - -Example of opening standard input and listening for both events: - -```js -process.stdin.setEncoding('utf8'); - -process.stdin.on('readable', () => { - var chunk = process.stdin.read(); - if (chunk !== null) { - process.stdout.write(`data: ${chunk}`); - } -}); - -process.stdin.on('end', () => { - process.stdout.write('end'); -}); -``` - -As a Stream, `process.stdin` can also be used in "old" mode that is compatible -with scripts written for node.js prior to v0.10. -For more information see [Stream compatibility][]. - -In "old" Streams mode the stdin stream is paused by default, so one -must call `process.stdin.resume()` to read from it. Note also that calling -`process.stdin.resume()` itself would switch stream to "old" mode. - -If you are starting a new project you should prefer a more recent "new" Streams -mode over "old" one. - -## process.stdout - -A `Writable Stream` to `stdout` (on fd `1`). - -For example, a `console.log` equivalent could look like this: - -```js -console.log = (msg) => { - process.stdout.write(`${msg}\n`); -}; -``` - -`process.stderr` and `process.stdout` are unlike other streams in Node.js in -that they cannot be closed (`end()` will throw), they never emit the `'finish'` -event and that writes can block when output is redirected to a file (although -disks are fast and operating systems normally employ write-back caching so it -should be a very rare occurrence indeed.) - -To check if Node.js is being run in a TTY context, read the `isTTY` property -on `process.stderr`, `process.stdout`, or `process.stdin`: - -``` -$ node -p "Boolean(process.stdin.isTTY)" -true -$ echo "foo" | node -p "Boolean(process.stdin.isTTY)" -false - -$ node -p "Boolean(process.stdout.isTTY)" -true -$ node -p "Boolean(process.stdout.isTTY)" | cat -false -``` - -See [the tty docs][] for more information. - -## process.title - -Getter/setter to set what is displayed in `ps`. - -When used as a setter, the maximum length is platform-specific and probably -short. - -On Linux and OS X, it's limited to the size of the binary name plus the -length of the command line arguments because it overwrites the argv memory. - -v0.8 allowed for longer process title strings by also overwriting the environ -memory but that was potentially insecure/confusing in some (rather obscure) -cases. - -## process.umask([mask]) - -Sets or reads the process's file mode creation mask. Child processes inherit -the mask from the parent process. Returns the old mask if `mask` argument is -given, otherwise returns the current mask. - -```js -const newmask = 0o022; -const oldmask = process.umask(newmask); -console.log( - `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}` -); -``` - - -## process.uptime() - -Number of seconds Node.js has been running. - -## process.version - -A compiled-in property that exposes `NODE_VERSION`. - -```js -console.log(`Version: ${process.version}`); -``` - -## process.versions - -A property exposing version strings of Node.js and its dependencies. - -```js -console.log(process.versions); -``` - -Will print something like: - -```js -{ http_parser: '2.3.0', - node: '1.1.1', - v8: '4.1.0.14', - uv: '1.3.0', - zlib: '1.2.8', - ares: '1.10.0-DEV', - modules: '43', - icu: '55.1', - openssl: '1.0.1k' } -``` - -[`'message'`]: child_process.html#child_process_event_message -[`ChildProcess.disconnect()`]: child_process.html#child_process_child_disconnect -[`ChildProcess.send()`]: child_process.html#child_process_child_send_message_sendhandle_callback -[`Error`]: errors.html#errors_class_error -[`EventEmitter`]: events.html#events_class_events_eventemitter -[`net.Server`]: net.html#net_class_net_server -[`net.Socket`]: net.html#net_class_net_socket -[`process.exit()`]: #process_process_exit_code -[`promise.catch(...)`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch -[`'rejectionHandled'`]: #process_event_rejectionhandled -[`require.main`]: modules.html#modules_accessing_the_main_module -[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg -[Signal Events]: #process_signal_events -[Stream compatibility]: stream.html#stream_compatibility_with_older_node_js_versions -[the tty docs]: tty.html#tty_tty -[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify -[process_warning]: #process_event_warning -[process_emit_warning]: #process_emitwarning_warning_name_ctor diff --git a/doc/api/process.md b/doc/api/process.md new file mode 100644 index 00000000000000..b0e85746cf3548 --- /dev/null +++ b/doc/api/process.md @@ -0,0 +1,1549 @@ +# process + + + +The `process` object is a global object and can be accessed from anywhere. +It is an instance of [`EventEmitter`][]. + +## Event: 'beforeExit' + + +This event is emitted when Node.js empties its event loop and has nothing else +to schedule. Normally, Node.js exits when there is no work scheduled, but a +listener for `'beforeExit'` can make asynchronous calls, and cause Node.js to +continue. + +`'beforeExit'` is not emitted for conditions causing explicit termination, such +as [`process.exit()`][] or uncaught exceptions, and should not be used as an +alternative to the `'exit'` event unless the intention is to schedule more work. + +## Event: 'disconnect' + + +If process is spawned with an IPC channel, `'disconnect'` will be emitted when +IPC channel is closed. Read more in [child_process `'disconnect'` event][] doc. + +## Event: 'exit' + + +Emitted when the process is about to exit. There is no way to prevent the +exiting of the event loop at this point, and once all `'exit'` listeners have +finished running the process will exit. Therefore you **must** only perform +**synchronous** operations in this handler. This is a good hook to perform +checks on the module's state (like for unit tests). The callback takes one +argument, the code the process is exiting with. + +This event is only emitted when Node.js exits explicitly by process.exit() or +implicitly by the event loop draining. + +Example of listening for `'exit'`: + +```js +process.on('exit', (code) => { + // do *NOT* do this + setTimeout(() => { + console.log('This will not run'); + }, 0); + console.log('About to exit with code:', code); +}); +``` + +## Event: 'message' + + +* `message` {Object} a parsed JSON object or primitive value +* `sendHandle` {Handle object} a [`net.Socket`][] or [`net.Server`][] object, or + undefined. + +Messages sent by [`ChildProcess.send()`][] are obtained using the `'message'` +event on the child's process object. + +## Event: 'rejectionHandled' + + +Emitted whenever a Promise was rejected and an error handler was attached to it +(for example with [`promise.catch()`][]) later than after an event loop turn. This event +is emitted with the following arguments: + + - `p` the promise that was previously emitted in an `'unhandledRejection'` + event, but which has now gained a rejection handler. + +There is no notion of a top level for a promise chain at which rejections can +always be handled. Being inherently asynchronous in nature, a promise rejection +can be handled at a future point in time — possibly much later than the +event loop turn it takes for the `'unhandledRejection'` event to be emitted. + +Another way of stating this is that, unlike in synchronous code where there is +an ever-growing list of unhandled exceptions, with promises there is a +growing-and-shrinking list of unhandled rejections. In synchronous code, the +`'uncaughtException'` event tells you when the list of unhandled exceptions +grows. And in asynchronous code, the `'unhandledRejection'` event tells you +when the list of unhandled rejections grows, while the `'rejectionHandled'` +event tells you when the list of unhandled rejections shrinks. + +For example using the rejection detection hooks in order to keep a map of all +the rejected promise reasons at a given time: + +```js +const unhandledRejections = new Map(); +process.on('unhandledRejection', (reason, p) => { + unhandledRejections.set(p, reason); +}); +process.on('rejectionHandled', (p) => { + unhandledRejections.delete(p); +}); +``` + +This map will grow and shrink over time, reflecting rejections that start +unhandled and then become handled. You could record the errors in some error +log, either periodically (probably best for long-running programs, allowing +you to clear the map, which in the case of a very buggy program could grow +indefinitely) or upon process exit (more convenient for scripts). + +## Event: 'uncaughtException' + + +The `'uncaughtException'` event is emitted when an exception bubbles all the +way back to the event loop. By default, Node.js handles such exceptions by +printing the stack trace to stderr and exiting. Adding a handler for the +`'uncaughtException'` event overrides this default behavior. + +For example: + +```js +process.on('uncaughtException', (err) => { + console.log(`Caught exception: ${err}`); +}); + +setTimeout(() => { + console.log('This will still run.'); +}, 500); + +// Intentionally cause an exception, but don't catch it. +nonexistentFunc(); +console.log('This will not run.'); +``` + +### Warning: Using `'uncaughtException'` correctly + +Note that `'uncaughtException'` is a crude mechanism for exception handling +intended to be used only as a last resort. The event *should not* be used as +an equivalent to `On Error Resume Next`. Unhandled exceptions inherently mean +that an application is in an undefined state. Attempting to resume application +code without properly recovering from the exception can cause additional +unforeseen and unpredictable issues. + +Exceptions thrown from within the event handler will not be caught. Instead the +process will exit with a non zero exit code and the stack trace will be printed. +This is to avoid infinite recursion. + +Attempting to resume normally after an uncaught exception can be similar to +pulling out of the power cord when upgrading a computer -- nine out of ten +times nothing happens - but the 10th time, the system becomes corrupted. + +The correct use of `'uncaughtException'` is to perform synchronous cleanup +of allocated resources (e.g. file descriptors, handles, etc) before shutting +down the process. It is not safe to resume normal operation after +`'uncaughtException'`. + +## Event: 'unhandledRejection' + + +Emitted whenever a `Promise` is rejected and no error handler is attached to +the promise within a turn of the event loop. When programming with promises +exceptions are encapsulated as rejected promises. Such promises can be caught +and handled using [`promise.catch()`][] and rejections are propagated through +a promise chain. This event is useful for detecting and keeping track of +promises that were rejected whose rejections were not handled yet. This event +is emitted with the following arguments: + + - `reason` the object with which the promise was rejected (usually an + [`Error`][] instance). + - `p` the promise that was rejected. + +Here is an example that logs every unhandled rejection to the console + +```js +process.on('unhandledRejection', (reason, p) => { + console.log("Unhandled Rejection at: Promise ", p, " reason: ", reason); + // application specific logging, throwing an error, or other logic here +}); +``` + +For example, here is a rejection that will trigger the `'unhandledRejection'` +event: + +```js +somePromise.then((res) => { + return reportToUser(JSON.pasre(res)); // note the typo (`pasre`) +}); // no `.catch` or `.then` +``` + +Here is an example of a coding pattern that will also trigger +`'unhandledRejection'`: + +```js +function SomeResource() { + // Initially set the loaded status to a rejected promise + this.loaded = Promise.reject(new Error('Resource not yet loaded!')); +} + +var resource = new SomeResource(); +// no .catch or .then on resource.loaded for at least a turn +``` + +In cases like this, you may not want to track the rejection as a developer +error like you would for other `'unhandledRejection'` events. To address +this, you can either attach a dummy [`.catch(() => { })`][`promise.catch()`] handler to +`resource.loaded`, preventing the `'unhandledRejection'` event from being +emitted, or you can use the [`'rejectionHandled'`][] event. + +## Event: 'warning' + + +Emitted whenever Node.js emits a process warning. + +A process warning is similar to an error in that it describes exceptional +conditions that are being brought to the user's attention. However, warnings +are not part of the normal Node.js and JavaScript error handling flow. +Node.js can emit warnings whenever it detects bad coding practices that could +lead to sub-optimal application performance, bugs or security vulnerabilities. + +The event handler for `'warning'` events is called with a single `warning` +argument whose value is an `Error` object. There are three key properties that +describe the warning: + +* `name` - The name of the warning (currently `Warning` by default). +* `message` - A system-provided description of the warning. +* `stack` - A stack trace to the location in the code where the warning was + issued. + +```js +process.on('warning', (warning) => { + console.warn(warning.name); // Print the warning name + console.warn(warning.message); // Print the warning message + console.warn(warning.stack); // Print the stack trace +}); +``` + +By default, Node.js will print process warnings to `stderr`. The `--no-warnings` +command-line option can be used to suppress the default console output but the +`'warning'` event will still be emitted by the `process` object. + +The following example illustrates the warning that is printed to `stderr` when +too many listeners have been added to an event + +``` +$ node +> event.defaultMaxListeners = 1; +> process.on('foo', () => {}); +> process.on('foo', () => {}); +> (node:38638) Warning: Possible EventEmitter memory leak detected. 2 foo +... listeners added. Use emitter.setMaxListeners() to increase limit +``` + +In contrast, the following example turns off the default warning output and +adds a custom handler to the `'warning'` event: + +``` +$ node --no-warnings +> var p = process.on('warning', (warning) => console.warn('Do not do that!')); +> event.defaultMaxListeners = 1; +> process.on('foo', () => {}); +> process.on('foo', () => {}); +> Do not do that! +``` + +The `--trace-warnings` command-line option can be used to have the default +console output for warnings include the full stack trace of the warning. + +### Emitting custom warnings + +The [`process.emitWarning()`][process_emit_warning] method can be used to issue +custom or application specific warnings. + +```js +// Emit a warning using a string... +process.emitWarning('Something happened!'); + // Prints: (node 12345) Warning: Something happened! + +// Emit a warning using an object... +process.emitWarning('Something Happened!', 'CustomWarning'); + // Prints: (node 12345) CustomWarning: Something happened! + +// Emit a warning using a custom Error object... +class CustomWarning extends Error { + constructor(message) { + super(message); + this.name = 'CustomWarning'; + Error.captureStackTrace(this, CustomWarning); + } +} +const myWarning = new CustomWarning('Something happened!'); +process.emitWarning(myWarning); + // Prints: (node 12345) CustomWarning: Something happened! +``` + +### Emitting custom deprecation warnings + +Custom deprecation warnings can be emitted by setting the `name` of a custom +warning to `DeprecationWarning`. For instance: + +```js +process.emitWarning('This API is deprecated', 'DeprecationWarning'); +``` + +Or, + +```js +const err = new Error('This API is deprecated'); +err.name = 'DeprecationWarning'; +process.emitWarning(err); +``` + +Launching Node.js using the `--throw-deprecation` command line flag will +cause custom deprecation warnings to be thrown as exceptions. + +Using the `--trace-deprecation` command line flag will cause the custom +deprecation to be printed to `stderr` along with the stack trace. + +Using the `--no-deprecation` command line flag will suppress all reporting +of the custom deprecation. + +The `*-deprecation` command line flags only affect warnings that use the name +`DeprecationWarning`. + +## Exit Codes + +Node.js will normally exit with a `0` status code when no more async +operations are pending. The following status codes are used in other +cases: + +* `1` **Uncaught Fatal Exception** - There was an uncaught exception, + and it was not handled by a domain or an [`'uncaughtException'`][] event + handler. +* `2` - Unused (reserved by Bash for builtin misuse) +* `3` **Internal JavaScript Parse Error** - The JavaScript source code + internal in Node.js's bootstrapping process caused a parse error. This + is extremely rare, and generally can only happen during development + of Node.js itself. +* `4` **Internal JavaScript Evaluation Failure** - The JavaScript + source code internal in Node.js's bootstrapping process failed to + return a function value when evaluated. This is extremely rare, and + generally can only happen during development of Node.js itself. +* `5` **Fatal Error** - There was a fatal unrecoverable error in V8. + Typically a message will be printed to stderr with the prefix `FATAL + ERROR`. +* `6` **Non-function Internal Exception Handler** - There was an + uncaught exception, but the internal fatal exception handler + function was somehow set to a non-function, and could not be called. +* `7` **Internal Exception Handler Run-Time Failure** - There was an + uncaught exception, and the internal fatal exception handler + function itself threw an error while attempting to handle it. This + can happen, for example, if a [`'uncaughtException'`][] or + `domain.on('error')` handler throws an error. +* `8` - Unused. In previous versions of Node.js, exit code 8 sometimes + indicated an uncaught exception. +* `9` - **Invalid Argument** - Either an unknown option was specified, + or an option requiring a value was provided without a value. +* `10` **Internal JavaScript Run-Time Failure** - The JavaScript + source code internal in Node.js's bootstrapping process threw an error + when the bootstrapping function was called. This is extremely rare, + and generally can only happen during development of Node.js itself. +* `12` **Invalid Debug Argument** - The `--debug` and/or `--debug-brk` + options were set, but an invalid port number was chosen. +* `>128` **Signal Exits** - If Node.js receives a fatal signal such as + `SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the + value of the signal code. This is a standard Unix practice, since + exit codes are defined to be 7-bit integers, and signal exits set + the high-order bit, and then contain the value of the signal code. + +## Signal Events + + + + +Emitted when the processes receives a signal. See sigaction(2) for a list of +standard POSIX signal names such as `SIGINT`, `SIGHUP`, etc. + +Example of listening for `SIGINT`: + +```js +// Start reading from stdin so we don't exit. +process.stdin.resume(); + +process.on('SIGINT', () => { + console.log('Got SIGINT. Press Control-D to exit.'); +}); +``` + +An easy way to send the `SIGINT` signal is with `Control-C` in most terminal +programs. + +Note: + +- `SIGUSR1` is reserved by Node.js to start the debugger. It's possible to + install a listener but that won't stop the debugger from starting. +- `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that + resets the terminal mode before exiting with code `128 + signal number`. If + one of these signals has a listener installed, its default behavior will be + removed (Node.js will no longer exit). +- `SIGPIPE` is ignored by default. It can have a listener installed. +- `SIGHUP` is generated on Windows when the console window is closed, and on other + platforms under various similar conditions, see signal(7). It can have a + listener installed, however Node.js will be unconditionally terminated by + Windows about 10 seconds later. On non-Windows platforms, the default + behavior of `SIGHUP` is to terminate Node.js, but once a listener has been + installed its default behavior will be removed. +- `SIGTERM` is not supported on Windows, it can be listened on. +- `SIGINT` from the terminal is supported on all platforms, and can usually be + generated with `CTRL+C` (though this may be configurable). It is not generated + when terminal raw mode is enabled. +- `SIGBREAK` is delivered on Windows when `CTRL+BREAK` is pressed, on + non-Windows + platforms it can be listened on, but there is no way to send or generate it. +- `SIGWINCH` is delivered when the console has been resized. On Windows, this + will only happen on write to the console when the cursor is being moved, or + when a readable tty is used in raw mode. +- `SIGKILL` cannot have a listener installed, it will unconditionally terminate + Node.js on all platforms. +- `SIGSTOP` cannot have a listener installed. + +Note that Windows does not support sending Signals, but Node.js offers some +emulation with [`process.kill()`][], and [`ChildProcess.kill()`][]. Sending signal `0` +can be used to test for the existence of a process. Sending `SIGINT`, +`SIGTERM`, and `SIGKILL` cause the unconditional termination of the target +process. + +## process.abort() + + +This causes Node.js to emit an abort. This will cause Node.js to exit and +generate a core file. + +## process.arch + + +What processor architecture you're running on: `'arm'`, `'ia32'`, or `'x64'`. + +```js +console.log('This processor architecture is ' + process.arch); +``` + +## process.argv + + +An array containing the command line arguments. The first element will be +'node', the second element will be the name of the JavaScript file. The +next elements will be any additional command line arguments. + +```js +// print process.argv +process.argv.forEach((val, index, array) => { + console.log(`${index}: ${val}`); +}); +``` + +This will generate: + +``` +$ node process-2.js one two=three four +0: node +1: /Users/mjr/work/node/process-2.js +2: one +3: two=three +4: four +``` + +## process.chdir(directory) + + +Changes the current working directory of the process or throws an exception if that fails. + +```js +console.log(`Starting directory: ${process.cwd()}`); +try { + process.chdir('/tmp'); + console.log(`New directory: ${process.cwd()}`); +} +catch (err) { + console.log(`chdir: ${err}`); +} +``` + +## process.config + + +An Object containing the JavaScript representation of the configure options +that were used to compile the current Node.js executable. This is the same as +the `config.gypi` file that was produced when running the `./configure` script. + +An example of the possible output looks like: + +``` +{ + target_defaults: + { cflags: [], + default_configuration: 'Release', + defines: [], + include_dirs: [], + libraries: [] }, + variables: + { + host_arch: 'x64', + node_install_npm: 'true', + node_prefix: '', + node_shared_cares: 'false', + node_shared_http_parser: 'false', + node_shared_libuv: 'false', + node_shared_zlib: 'false', + node_use_dtrace: 'false', + node_use_openssl: 'true', + node_shared_openssl: 'false', + strict_aliasing: 'true', + target_arch: 'x64', + v8_use_snapshot: 'true' + } +} +``` + +*Note: the `process.config` property is **not** read-only and there are existing +modules in the ecosystem that are known to extend, modify, or entirely replace +the value of `process.config`.* + +## process.connected + + +* {Boolean} Set to `false` after `process.disconnect()` is called + +If `process.connected` is `false`, it is no longer possible to send messages. + +## process.cpuUsage([previousValue]) + + +Returns the user and system CPU time usage of the current process, in an object +with properties `user` and `system`, whose values are microsecond values +(millionth of a second). These values measure time spent in user and +system code respectively, and may end up being greater than actual elapsed time +if multiple CPU cores are performing work for this process. + +The result of a previous call to `process.cpuUsage()` can be passed as the +argument to the function, to get a diff reading. + +```js +const startUsage = process.cpuUsage(); +// { user: 38579, system: 6986 } + +// spin the CPU for 500 milliseconds +const now = Date.now(); +while (Date.now() - now < 500); + +console.log(process.cpuUsage(startUsage)); +// { user: 514883, system: 11226 } +``` + +## process.cwd() + + +Returns the current working directory of the process. + +```js +console.log(`Current directory: ${process.cwd()}`); +``` + +## process.disconnect() + + +Close the IPC channel to the parent process, allowing this child to exit +gracefully once there are no other connections keeping it alive. + +Identical to the parent process's [`ChildProcess.disconnect()`][]. + +If Node.js was not spawned with an IPC channel, `process.disconnect()` will be +undefined. + +## process.env + + +An object containing the user environment. See environ(7). + +An example of this object looks like: + +```js +{ TERM: 'xterm-256color', + SHELL: '/usr/local/bin/bash', + USER: 'maciej', + PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + PWD: '/Users/maciej', + EDITOR: 'vim', + SHLVL: '1', + HOME: '/Users/maciej', + LOGNAME: 'maciej', + _: '/usr/local/bin/node' } +``` + +You can write to this object, but changes won't be reflected outside of your +process. That means that the following won't work: + +``` +$ node -e 'process.env.foo = "bar"' && echo $foo +``` + +But this will: + +```js +process.env.foo = 'bar'; +console.log(process.env.foo); +``` + +Assigning a property on `process.env` will implicitly convert the value +to a string. + +Example: + +```js +process.env.test = null; +console.log(process.env.test); +// => 'null' +process.env.test = undefined; +console.log(process.env.test); +// => 'undefined' +``` + +Use `delete` to delete a property from `process.env`. + +Example: + +```js +process.env.TEST = 1; +delete process.env.TEST; +console.log(process.env.TEST); +// => undefined +``` + +## process.emitWarning(warning[, name][, ctor]) + + +* `warning` {String | Error} The warning to emit. +* `name` {String} When `warning` is a String, `name` is the name to use + for the warning. Default: `Warning`. +* `ctor` {Function} When `warning` is a String, `ctor` is an optional + function used to limit the generated stack trace. Default + `process.emitWarning` + +The `process.emitWarning()` method can be used to emit custom or application +specific process warnings. These can be listened for by adding a handler to the +[`process.on('warning')`][process_warning] event. + +```js +// Emit a warning using a string... +process.emitWarning('Something happened!'); + // Emits: (node: 56338) Warning: Something happened! +``` + +``` +// Emit a warning using a string and a name... +process.emitWarning('Something Happened!', 'CustomWarning'); + // Emits: (node:56338) CustomWarning: Something Happened! +``` + +In each of the previous examples, an `Error` object is generated internally by +`process.emitWarning()` and passed through to the +[`process.on('warning')`][process_warning] event. + +``` +process.on('warning', (warning) => { + console.warn(warning.name); + console.warn(warning.message); + console.warn(warning.stack); +}); +``` + +If `warning` is passed as an `Error` object, it will be passed through to the +`process.on('warning')` event handler unmodified (and the optional `name` +and `ctor` arguments will be ignored): + +``` +// Emit a warning using an Error object... +const myWarning = new Error('Warning! Something happened!'); +myWarning.name = 'CustomWarning'; + +process.emitWarning(myWarning); + // Emits: (node:56338) CustomWarning: Warning! Something Happened! +``` + +A `TypeError` is thrown if `warning` is anything other than a string or `Error` +object. + +Note that while process warnings use `Error` objects, the process warning +mechanism is **not** a replacement for normal error handling mechanisms. + +The following additional handling is implemented if the warning `name` is +`DeprecationWarning`: + +* If the `--throw-deprecation` command-line flag is used, the deprecation + warning is thrown as an exception rather than being emitted as an event. +* If the `--no-deprecation` command-line flag is used, the deprecation + warning is suppressed. +* If the `--trace-deprecation` command-line flag is used, the deprecation + warning is printed to `stderr` along with the full stack trace. + +### Avoiding duplicate warnings + +As a best practice, warnings should be emitted only once per process. To do +so, it is recommended to place the `emitWarning()` behind a simple boolean +flag as illustrated in the example below: + +``` +var warned = false; +function emitMyWarning() { + if (!warned) { + process.emitWarning('Only warn once!'); + warned = true; + } +} +emitMyWarning(); + // Emits: (node: 56339) Warning: Only warn once! +emitMyWarning(); + // Emits nothing +``` + +## process.execArgv + + +This is the set of Node.js-specific command line options from the +executable that started the process. These options do not show up in +[`process.argv`][], and do not include the Node.js executable, the name of +the script, or any options following the script name. These options +are useful in order to spawn child processes with the same execution +environment as the parent. + +Example: + +``` +$ node --harmony script.js --version +``` + +results in process.execArgv: + +```js +['--harmony'] +``` + +and process.argv: + +```js +['/usr/local/bin/node', 'script.js', '--version'] +``` + +## process.execPath + + +This is the absolute pathname of the executable that started the process. + +Example: + +``` +/usr/local/bin/node +``` + + +## process.exit([code]) + + +* `code` {Integer} The exit code. Defaults to `0`. + +The `process.exit()` method instructs Node.js to terminate the process as +quickly as possible with the specified exit `code`. If the `code` is omitted, +exit uses either the 'success' code `0` or the value of `process.exitCode` if +specified. + +To exit with a 'failure' code: + +```js +process.exit(1); +``` + +The shell that executed Node.js should see the exit code as `1`. + +It is important to note that calling `process.exit()` will force the process to +exit as quickly as possible *even if there are still asynchronous operations +pending* that have not yet completed fully, *including* I/O operations to +`process.stdout` and `process.stderr`. + +In most situations, it is not actually necessary to call `process.exit()` +explicitly. The Node.js process will exit on it's own *if there is no additional +work pending* in the event loop. The `process.exitCode` property can be set to +tell the process which exit code to use when the process exits gracefully. + +For instance, the following example illustrates a *misuse* of the +`process.exit()` method that could lead to data printed to stdout being +truncated and lost: + +```js +// This is an example of what *not* to do: +if (someConditionNotMet()) { + printUsageToStdout(); + process.exit(1); +} +``` + +The reason this is problematic is because writes to `process.stdout` in Node.js +are usually *non-blocking* and may occur over multiple ticks of the Node.js +event loop. +Calling `process.exit()`, however, forces the process to exit *before* those +additional writes to `stdout` can be performed. + +Rather than calling `process.exit()` directly, the code *should* set the +`process.exitCode` and allow the process to exit naturally by avoiding +scheduling any additional work for the event loop: + +```js +// How to properly set the exit code while letting +// the process exit gracefully. +if (someConditionNotMet()) { + printUsageToStdout(); + process.exitCode = 1; +} +``` + +If it is necessary to terminate the Node.js process due to an error condition, +throwing an *uncaught* error and allowing the process to terminate accordingly +is safer than calling `process.exit()`. + +## process.exitCode + + +A number which will be the process exit code, when the process either +exits gracefully, or is exited via [`process.exit()`][] without specifying +a code. + +Specifying a code to [`process.exit(code)`][`process.exit()`] will override any +previous setting of `process.exitCode`. + + +## process.getegid() + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Gets the effective group identity of the process. (See getegid(2).) +This is the numerical group id, not the group name. + +```js +if (process.getegid) { + console.log(`Current gid: ${process.getegid()}`); +} +``` + + +## process.geteuid() + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Gets the effective user identity of the process. (See geteuid(2).) +This is the numerical userid, not the username. + +```js +if (process.geteuid) { + console.log(`Current uid: ${process.geteuid()}`); +} +``` + +## process.getgid() + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Gets the group identity of the process. (See getgid(2).) +This is the numerical group id, not the group name. + +```js +if (process.getgid) { + console.log(`Current gid: ${process.getgid()}`); +} +``` + +## process.getgroups() + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Returns an array with the supplementary group IDs. POSIX leaves it unspecified +if the effective group ID is included but Node.js ensures it always is. + +## process.getuid() + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Gets the user identity of the process. (See getuid(2).) +This is the numerical userid, not the username. + +```js +if (process.getuid) { + console.log(`Current uid: ${process.getuid()}`); +} +``` + +## process.hrtime([time]) + + +Returns the current high-resolution real time in a `[seconds, nanoseconds]` +tuple Array. `time` is an optional parameter that must be the result of a +previous `process.hrtime()` call (and therefore, a real time in a +`[seconds, nanoseconds]` tuple Array containing a previous time) to diff with +the current time. These times are relative to an arbitrary time in the past, +and not related to the time of day and therefore not subject to clock drift. +The primary use is for measuring performance between intervals. + +You may pass in the result of a previous call to `process.hrtime()` to get +a diff reading, useful for benchmarks and measuring intervals: + +```js +var time = process.hrtime(); +// [ 1800216, 25 ] + +setTimeout(() => { + var diff = process.hrtime(time); + // [ 1, 552 ] + + console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]); + // benchmark took 1000000527 nanoseconds +}, 1000); +``` + +Constructing an array by some method other than calling `process.hrtime()` and +passing the result to process.hrtime() will result in undefined behavior. + + +## process.initgroups(user, extra_group) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Reads /etc/group and initializes the group access list, using all groups of +which the user is a member. This is a privileged operation, meaning you need +to be root or have the `CAP_SETGID` capability. + +`user` is a user name or user ID. `extra_group` is a group name or group ID. + +Some care needs to be taken when dropping privileges. Example: + +```js +console.log(process.getgroups()); // [ 0 ] +process.initgroups('bnoordhuis', 1000); // switch user +console.log(process.getgroups()); // [ 27, 30, 46, 1000, 0 ] +process.setgid(1000); // drop root gid +console.log(process.getgroups()); // [ 27, 30, 46, 1000 ] +``` + +## process.kill(pid[, signal]) + + +Send a signal to a process. `pid` is the process id and `signal` is the +string describing the signal to send. Signal names are strings like +`'SIGINT'` or `'SIGHUP'`. If omitted, the signal will be `'SIGTERM'`. +See [Signal Events][] and kill(2) for more information. + +Will throw an error if target does not exist, and as a special case, a signal +of `0` can be used to test for the existence of a process. Windows platforms +will throw an error if the `pid` is used to kill a process group. + +Note that even though the name of this function is `process.kill`, it is really +just a signal sender, like the `kill` system call. The signal sent may do +something other than kill the target process. + +Example of sending a signal to yourself: + +```js +process.on('SIGHUP', () => { + console.log('Got SIGHUP signal.'); +}); + +setTimeout(() => { + console.log('Exiting.'); + process.exit(0); +}, 100); + +process.kill(process.pid, 'SIGHUP'); +``` + +Note: When SIGUSR1 is received by Node.js it starts the debugger, see +[Signal Events][]. + +## process.mainModule + + +Alternate way to retrieve [`require.main`][]. The difference is that if the main +module changes at runtime, [`require.main`][] might still refer to the original main +module in modules that were required before the change occurred. Generally it's +safe to assume that the two refer to the same module. + +As with [`require.main`][], it will be `undefined` if there was no entry script. + +## process.memoryUsage() + + +Returns an object describing the memory usage of the Node.js process +measured in bytes. + +```js +const util = require('util'); + +console.log(util.inspect(process.memoryUsage())); +``` + +This will generate: + +```js +{ rss: 4935680, + heapTotal: 1826816, + heapUsed: 650472 } +``` + +`heapTotal` and `heapUsed` refer to V8's memory usage. + + +## process.nextTick(callback[, arg][, ...]) + + +* `callback` {Function} + +Once the current event loop turn runs to completion, call the callback +function. + +This is *not* a simple alias to [`setTimeout(fn, 0)`][], it's much more +efficient. It runs before any additional I/O events (including +timers) fire in subsequent ticks of the event loop. + +```js +console.log('start'); +process.nextTick(() => { + console.log('nextTick callback'); +}); +console.log('scheduled'); +// Output: +// start +// scheduled +// nextTick callback +``` + +This is important in developing APIs where you want to give the user the +chance to assign event handlers after an object has been constructed, +but before any I/O has occurred. + +```js +function MyThing(options) { + this.setupOptions(options); + + process.nextTick(() => { + this.startDoingStuff(); + }); +} + +var thing = new MyThing(); +thing.getReadyForStuff(); + +// thing.startDoingStuff() gets called now, not before. +``` + +It is very important for APIs to be either 100% synchronous or 100% +asynchronous. Consider this example: + +```js +// WARNING! DO NOT USE! BAD UNSAFE HAZARD! +function maybeSync(arg, cb) { + if (arg) { + cb(); + return; + } + + fs.stat('file', cb); +} +``` + +This API is hazardous. If you do this: + +```js +maybeSync(true, () => { + foo(); +}); +bar(); +``` + +then it's not clear whether `foo()` or `bar()` will be called first. + +This approach is much better: + +```js +function definitelyAsync(arg, cb) { + if (arg) { + process.nextTick(cb); + return; + } + + fs.stat('file', cb); +} +``` + +Note: the nextTick queue is completely drained on each pass of the +event loop **before** additional I/O is processed. As a result, +recursively setting nextTick callbacks will block any I/O from +happening, just like a `while(true);` loop. + +## process.pid + + +The PID of the process. + +```js +console.log(`This process is pid ${process.pid}`); +``` + +## process.platform + + +What platform you're running on: +`'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'` + +```js +console.log(`This platform is ${process.platform}`); +``` + +## process.release + + +An Object containing metadata related to the current release, including URLs +for the source tarball and headers-only tarball. + +`process.release` contains the following properties: + +* `name`: a string with a value that will always be `'node'` for Node.js. For + legacy io.js releases, this will be `'io.js'`. +* `sourceUrl`: a complete URL pointing to a _.tar.gz_ file containing the + source of the current release. +* `headersUrl`: a complete URL pointing to a _.tar.gz_ file containing only + the header files for the current release. This file is significantly smaller + than the full source file and can be used for compiling add-ons against + Node.js. +* `libUrl`: a complete URL pointing to an _node.lib_ file matching the + architecture and version of the current release. This file is used for + compiling add-ons against Node.js. _This property is only present on Windows + builds of Node.js and will be missing on all other platforms._ + +e.g. + +```js +{ name: 'node', + sourceUrl: 'https://nodejs.org/download/release/v4.0.0/node-v4.0.0.tar.gz', + headersUrl: 'https://nodejs.org/download/release/v4.0.0/node-v4.0.0-headers.tar.gz', + libUrl: 'https://nodejs.org/download/release/v4.0.0/win-x64/node.lib' } +``` + +In custom builds from non-release versions of the source tree, only the +`name` property may be present. The additional properties should not be +relied upon to exist. + +## process.send(message[, sendHandle[, options]][, callback]) + + +* `message` {Object} +* `sendHandle` {Handle object} +* `options` {Object} +* `callback` {Function} +* Return: {Boolean} + +When Node.js is spawned with an IPC channel attached, it can send messages to its +parent process using `process.send()`. Each will be received as a +[`'message'`][] event on the parent's [`ChildProcess`][] object. + +*Note: this function uses [`JSON.stringify()`][] internally to serialize the `message`.* + +If Node.js was not spawned with an IPC channel, `process.send()` will be undefined. + +## process.setegid(id) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Sets the effective group identity of the process. (See setegid(2).) +This accepts either a numerical ID or a group name string. If a group name +is specified, this method blocks while resolving it to a numerical ID. + +```js +if (process.getegid && process.setegid) { + console.log(`Current gid: ${process.getegid()}`); + try { + process.setegid(501); + console.log(`New gid: ${process.getegid()}`); + } + catch (err) { + console.log(`Failed to set gid: ${err}`); + } +} +``` + +## process.seteuid(id) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Sets the effective user identity of the process. (See seteuid(2).) +This accepts either a numerical ID or a username string. If a username +is specified, this method blocks while resolving it to a numerical ID. + +```js +if (process.geteuid && process.seteuid) { + console.log(`Current uid: ${process.geteuid()}`); + try { + process.seteuid(501); + console.log(`New uid: ${process.geteuid()}`); + } + catch (err) { + console.log(`Failed to set uid: ${err}`); + } +} +``` + +## process.setgid(id) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Sets the group identity of the process. (See setgid(2).) This accepts either +a numerical ID or a group name string. If a group name is specified, this method +blocks while resolving it to a numerical ID. + +```js +if (process.getgid && process.setgid) { + console.log(`Current gid: ${process.getgid()}`); + try { + process.setgid(501); + console.log(`New gid: ${process.getgid()}`); + } + catch (err) { + console.log(`Failed to set gid: ${err}`); + } +} +``` + +## process.setgroups(groups) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Sets the supplementary group IDs. This is a privileged operation, meaning you +need to be root or have the `CAP_SETGID` capability. + +The list can contain group IDs, group names or both. + +## process.setuid(id) + + +Note: this function is only available on POSIX platforms (i.e. not Windows, +Android) + +Sets the user identity of the process. (See setuid(2).) This accepts either +a numerical ID or a username string. If a username is specified, this method +blocks while resolving it to a numerical ID. + +```js +if (process.getuid && process.setuid) { + console.log(`Current uid: ${process.getuid()}`); + try { + process.setuid(501); + console.log(`New uid: ${process.getuid()}`); + } + catch (err) { + console.log(`Failed to set uid: ${err}`); + } +} +``` + +## process.stderr + +A writable stream to stderr (on fd `2`). + +`process.stderr` and `process.stdout` are unlike other streams in Node.js in +that they cannot be closed ([`end()`][] will throw), they never emit the [`'finish'`][] +event and that writes can block when output is redirected to a file (although +disks are fast and operating systems normally employ write-back caching so it +should be a very rare occurrence indeed.) + +Additionally, `process.stderr` and `process.stdout` are blocking when outputting +to TTYs (terminals) on OS X as a workaround for the OS's very small, 1kb +buffer size. This is to prevent interleaving between `stdout` and `stderr`. + +## process.stdin + +A `Readable Stream` for stdin (on fd `0`). + +Example of opening standard input and listening for both events: + +```js +process.stdin.setEncoding('utf8'); + +process.stdin.on('readable', () => { + var chunk = process.stdin.read(); + if (chunk !== null) { + process.stdout.write(`data: ${chunk}`); + } +}); + +process.stdin.on('end', () => { + process.stdout.write('end'); +}); +``` + +As a Stream, `process.stdin` can also be used in "old" mode that is compatible +with scripts written for node.js prior to v0.10. +For more information see [Stream compatibility][]. + +In "old" Streams mode the stdin stream is paused by default, so one +must call `process.stdin.resume()` to read from it. Note also that calling +`process.stdin.resume()` itself would switch stream to "old" mode. + +If you are starting a new project you should prefer a more recent "new" Streams +mode over "old" one. + +## process.stdout + +A `Writable Stream` to `stdout` (on fd `1`). + +For example, a `console.log` equivalent could look like this: + +```js +console.log = (msg) => { + process.stdout.write(`${msg}\n`); +}; +``` + +`process.stderr` and `process.stdout` are unlike other streams in Node.js in +that they cannot be closed ([`end()`][] will throw), they never emit the [`'finish'`][] +event and that writes can block when output is redirected to a file (although +disks are fast and operating systems normally employ write-back caching so it +should be a very rare occurrence indeed.) + +Additionally, `process.stderr` and `process.stdout` are blocking when outputting +to TTYs (terminals) on OS X as a workaround for the OS's very small, 1kb +buffer size. This is to prevent interleaving between `stdout` and `stderr`. + +To check if Node.js is being run in a TTY context, read the `isTTY` property +on `process.stderr`, `process.stdout`, or `process.stdin`: + +``` +$ node -p "Boolean(process.stdin.isTTY)" +true +$ echo "foo" | node -p "Boolean(process.stdin.isTTY)" +false + +$ node -p "Boolean(process.stdout.isTTY)" +true +$ node -p "Boolean(process.stdout.isTTY)" | cat +false +``` + +See [the tty docs][] for more information. + +## process.title + + +Getter/setter to set what is displayed in `ps`. + +When used as a setter, the maximum length is platform-specific and probably +short. + +On Linux and OS X, it's limited to the size of the binary name plus the +length of the command line arguments because it overwrites the argv memory. + +v0.8 allowed for longer process title strings by also overwriting the environ +memory but that was potentially insecure/confusing in some (rather obscure) +cases. + +## process.umask([mask]) + + +Sets or reads the process's file mode creation mask. Child processes inherit +the mask from the parent process. Returns the old mask if `mask` argument is +given, otherwise returns the current mask. + +```js +const newmask = 0o022; +const oldmask = process.umask(newmask); +console.log( + `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}` +); +``` + + +## process.uptime() + + +Number of seconds Node.js has been running. + +## process.version + + +A compiled-in property that exposes `NODE_VERSION`. + +```js +console.log(`Version: ${process.version}`); +``` + +## process.versions + + +A property exposing version strings of Node.js and its dependencies. + +```js +console.log(process.versions); +``` + +Will print something like: + +```js +{ http_parser: '2.3.0', + node: '1.1.1', + v8: '4.1.0.14', + uv: '1.3.0', + zlib: '1.2.8', + ares: '1.10.0-DEV', + modules: '43', + icu: '55.1', + openssl: '1.0.1k' } +``` + +[`'finish'`]: stream.html#stream_event_finish +[`'message'`]: child_process.html#child_process_event_message +[`'rejectionHandled'`]: #process_event_rejectionhandled +[`'uncaughtException'`]: #process_event_uncaughtexception +[`ChildProcess.disconnect()`]: child_process.html#child_process_child_disconnect +[`ChildProcess.kill()`]: child_process.html#child_process_child_kill_signal +[`ChildProcess.send()`]: child_process.html#child_process_child_send_message_sendhandle_options_callback +[`ChildProcess`]: child_process.html#child_process_class_childprocess +[`end()`]: stream.html#stream_writable_end_chunk_encoding_callback +[`Error`]: errors.html#errors_class_error +[`EventEmitter`]: events.html#events_class_eventemitter +[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[`net.Server`]: net.html#net_class_net_server +[`net.Socket`]: net.html#net_class_net_socket +[`process.argv`]: #process_process_argv +[`process.exit()`]: #process_process_exit_code +[`process.kill()`]: #process_process_kill_pid_signal +[`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch +[`require.main`]: modules.html#modules_accessing_the_main_module +[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg +[child_process `'disconnect'` event]: child_process.html#child_process_event_disconnect +[process_emit_warning]: #process_process_emitwarning_warning_name_ctor +[process_warning]: #process_event_warning +[Signal Events]: #process_signal_events +[Stream compatibility]: stream.html#stream_compatibility_with_older_node_js_versions +[the tty docs]: tty.html#tty_tty diff --git a/doc/api/punycode.markdown b/doc/api/punycode.markdown deleted file mode 100644 index 7f3617c12d8efd..00000000000000 --- a/doc/api/punycode.markdown +++ /dev/null @@ -1,82 +0,0 @@ -# punycode - - Stability: 2 - Stable - -[Punycode.js][] is bundled with Node.js v0.6.2+. Use `require('punycode')` to -access it. (To use it with other Node.js versions, use npm to install the -`punycode` module first.) - -## punycode.decode(string) - -Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -## punycode.encode(string) - -Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -## punycode.toASCII(domain) - -Converts a Unicode string representing a domain name to Punycode. Only the -non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if -you call it with a domain that's already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' -``` - -## punycode.toUnicode(domain) - -Converts a Punycode string representing a domain name to Unicode. Only the -Punycoded parts of the domain name will be converted, i.e. it doesn't matter if -you call it on a string that has already been converted to Unicode. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' -``` - -## punycode.ucs2 - -### punycode.ucs2.decode(string) - -Creates an array containing the numeric code point values of each Unicode -symbol in the string. While [JavaScript uses UCS-2 internally][], this function -will convert a pair of surrogate halves (each of which UCS-2 exposes as -separate characters) into a single code point, matching UTF-16. - -```js -punycode.ucs2.decode('abc'); // [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 tetragram for centre: -punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] -``` - -### punycode.ucs2.encode(codePoints) - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); // 'abc' -punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06' -``` - -## punycode.version - -A string representing the current Punycode.js version number. - -[Punycode.js]: https://mths.be/punycode -[JavaScript uses UCS-2 internally]: https://mathiasbynens.be/notes/javascript-encoding diff --git a/doc/api/punycode.md b/doc/api/punycode.md new file mode 100644 index 00000000000000..f94ecb16bfff46 --- /dev/null +++ b/doc/api/punycode.md @@ -0,0 +1,106 @@ +# punycode + + Stability: 2 - Stable + +[Punycode.js][] is bundled with Node.js v0.5.1+. Use `require('punycode')` to +access it. (To use it with other Node.js versions, use npm to install the +`punycode` module first.) + +## punycode.decode(string) + + +Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +## punycode.encode(string) + + +Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +## punycode.toASCII(domain) + + +Converts a Unicode string representing a domain name to Punycode. Only the +non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if +you call it with a domain that's already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' +``` + +## punycode.toUnicode(domain) + + +Converts a Punycode string representing a domain name to Unicode. Only the +Punycoded parts of the domain name will be converted, i.e. it doesn't matter if +you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' +``` + +## punycode.ucs2 + + +### punycode.ucs2.decode(string) + + +Creates an array containing the numeric code point values of each Unicode +symbol in the string. While [JavaScript uses UCS-2 internally][], this function +will convert a pair of surrogate halves (each of which UCS-2 exposes as +separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); // [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 tetragram for centre: +punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] +``` + +### punycode.ucs2.encode(codePoints) + + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); // 'abc' +punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06' +``` + +## punycode.version + + +A string representing the current Punycode.js version number. + +[Punycode.js]: https://mths.be/punycode +[JavaScript uses UCS-2 internally]: https://mathiasbynens.be/notes/javascript-encoding diff --git a/doc/api/querystring.markdown b/doc/api/querystring.markdown deleted file mode 100644 index 3a864e2d4fa1fe..00000000000000 --- a/doc/api/querystring.markdown +++ /dev/null @@ -1,72 +0,0 @@ -# Query String - - Stability: 2 - Stable - - - -This module provides utilities for dealing with query strings. -It provides the following methods: - -## querystring.escape - -The escape function used by `querystring.stringify`, -provided so that it could be overridden if necessary. - -## querystring.parse(str[, sep][, eq][, options]) - -Deserialize a query string to an object. -Optionally override the default separator (`'&'`) and assignment (`'='`) -characters. - -Options object may contain `maxKeys` property (equal to 1000 by default), it'll -be used to limit processed keys. Set it to 0 to remove key count limitation. - -Options object may contain `decodeURIComponent` property (`querystring.unescape` by default), -it can be used to decode a `non-utf8` encoding string if necessary. - -Example: - -```js -querystring.parse('foo=bar&baz=qux&baz=quux&corge') -// returns { foo: 'bar', baz: ['qux', 'quux'], corge: '' } - -// Suppose gbkDecodeURIComponent function already exists, -// it can decode `gbk` encoding string -querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - { decodeURIComponent: gbkDecodeURIComponent }) -// returns { w: '中文', foo: 'bar' } -``` - -## querystring.stringify(obj[, sep][, eq][, options]) - -Serialize an object to a query string. -Optionally override the default separator (`'&'`) and assignment (`'='`) -characters. - -Options object may contain `encodeURIComponent` property (`querystring.escape` by default), -it can be used to encode string with `non-utf8` encoding if necessary. - -Example: - -```js -querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }) -// returns 'foo=bar&baz=qux&baz=quux&corge=' - -querystring.stringify({foo: 'bar', baz: 'qux'}, ';', ':') -// returns 'foo:bar;baz:qux' - -// Suppose gbkEncodeURIComponent function already exists, -// it can encode string with `gbk` encoding -querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - { encodeURIComponent: gbkEncodeURIComponent }) -// returns 'w=%D6%D0%CE%C4&foo=bar' -``` - -## querystring.unescape - -The unescape function used by `querystring.parse`, -provided so that it could be overridden if necessary. - -It will try to use `decodeURIComponent` in the first place, -but if that fails it falls back to a safer equivalent that -doesn't throw on malformed URLs. diff --git a/doc/api/querystring.md b/doc/api/querystring.md new file mode 100644 index 00000000000000..263f44e1990b44 --- /dev/null +++ b/doc/api/querystring.md @@ -0,0 +1,84 @@ +# Query String + + Stability: 2 - Stable + + + +This module provides utilities for dealing with query strings. +It provides the following methods: + +## querystring.escape + + +The escape function used by `querystring.stringify`, +provided so that it could be overridden if necessary. + +## querystring.parse(str[, sep][, eq][, options]) + + +Deserialize a query string to an object. +Optionally override the default separator (`'&'`) and assignment (`'='`) +characters. + +Options object may contain `maxKeys` property (equal to 1000 by default), it'll +be used to limit processed keys. Set it to 0 to remove key count limitation. + +Options object may contain `decodeURIComponent` property (`querystring.unescape` by default), +it can be used to decode a `non-utf8` encoding string if necessary. + +Example: + +```js +querystring.parse('foo=bar&baz=qux&baz=quux&corge') +// returns { foo: 'bar', baz: ['qux', 'quux'], corge: '' } + +// Suppose gbkDecodeURIComponent function already exists, +// it can decode `gbk` encoding string +querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + { decodeURIComponent: gbkDecodeURIComponent }) +// returns { w: '中文', foo: 'bar' } +``` + +## querystring.stringify(obj[, sep][, eq][, options]) + + +Serialize an object to a query string. +Optionally override the default separator (`'&'`) and assignment (`'='`) +characters. + +Options object may contain `encodeURIComponent` property (`querystring.escape` by default), +it can be used to encode string with `non-utf8` encoding if necessary. + +Example: + +```js +querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }) +// returns 'foo=bar&baz=qux&baz=quux&corge=' + +querystring.stringify({foo: 'bar', baz: 'qux'}, ';', ':') +// returns 'foo:bar;baz:qux' + +// Suppose gbkEncodeURIComponent function already exists, +// it can encode string with `gbk` encoding +querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + { encodeURIComponent: gbkEncodeURIComponent }) +// returns 'w=%D6%D0%CE%C4&foo=bar' +``` + +## querystring.unescape + + +The unescape function used by `querystring.parse`, +provided so that it could be overridden if necessary. + +It will try to use `decodeURIComponent` in the first place, +but if that fails it falls back to a safer equivalent that +doesn't throw on malformed URLs. diff --git a/doc/api/readline.markdown b/doc/api/readline.markdown deleted file mode 100644 index db543d2306a591..00000000000000 --- a/doc/api/readline.markdown +++ /dev/null @@ -1,367 +0,0 @@ -# Readline - - Stability: 2 - Stable - -To use this module, do `require('readline')`. Readline allows reading of a -stream (such as [`process.stdin`][]) on a line-by-line basis. - -Note that once you've invoked this module, your Node.js program will not -terminate until you've closed the interface. Here's how to allow your -program to gracefully exit: - -```js -const readline = require('readline'); - -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - -rl.question('What do you think of Node.js? ', (answer) => { - // TODO: Log the answer in a database - console.log('Thank you for your valuable feedback:', answer); - - rl.close(); -}); -``` - -## Class: Interface - -The class that represents a readline interface with an input and output -stream. - -### rl.close() - -Closes the `Interface` instance, relinquishing control on the `input` and -`output` streams. The `'close'` event will also be emitted. - -### rl.pause() - -Pauses the readline `input` stream, allowing it to be resumed later if needed. - -Note that this doesn't immediately pause the stream of events. Several events may -be emitted after calling `pause`, including `line`. - -### rl.prompt([preserveCursor]) - -Readies readline for input from the user, putting the current `setPrompt` -options on a new line, giving the user a new spot to write. Set `preserveCursor` -to `true` to prevent the cursor placement being reset to `0`. - -This will also resume the `input` stream used with `createInterface` if it has -been paused. - -If `output` is set to `null` or `undefined` when calling `createInterface`, the -prompt is not written. - -### rl.question(query, callback) - -Prepends the prompt with `query` and invokes `callback` with the user's -response. Displays the query to the user, and then invokes `callback` -with the user's response after it has been typed. - -This will also resume the `input` stream used with `createInterface` if -it has been paused. - -If `output` is set to `null` or `undefined` when calling `createInterface`, -nothing is displayed. - -Example usage: - -```js -rl.question('What is your favorite food?', (answer) => { - console.log(`Oh, so your favorite food is ${answer}`); -}); -``` - -### rl.resume() - -Resumes the readline `input` stream. - -### rl.setPrompt(prompt) - -Sets the prompt, for example when you run `node` on the command line, you see -`> `, which is Node.js's prompt. - -### rl.write(data[, key]) - -Writes `data` to `output` stream, unless `output` is set to `null` or -`undefined` when calling `createInterface`. `key` is an object literal to -represent a key sequence; available if the terminal is a TTY. - -This will also resume the `input` stream if it has been paused. - -Example: - -```js -rl.write('Delete me!'); -// Simulate ctrl+u to delete the line written previously -rl.write(null, {ctrl: true, name: 'u'}); -``` - -## Events - -### Event: 'close' - -`function () {}` - -Emitted when `close()` is called. - -Also emitted when the `input` stream receives its `'end'` event. The `Interface` -instance should be considered "finished" once this is emitted. For example, when -the `input` stream receives `^D`, respectively known as `EOT`. - -This event is also called if there is no `SIGINT` event listener present when -the `input` stream receives a `^C`, respectively known as `SIGINT`. - -### Event: 'line' - -`function (line) {}` - -Emitted whenever the `input` stream receives an end of line (`\n`, `\r`, or -`\r\n`), usually received when the user hits enter, or return. This is a good -hook to listen for user input. - -Example of listening for `'line'`: - -```js -rl.on('line', (cmd) => { - console.log(`You just typed: ${cmd}`); -}); -``` - -### Event: 'pause' - -`function () {}` - -Emitted whenever the `input` stream is paused. - -Also emitted whenever the `input` stream is not paused and receives the -`SIGCONT` event. (See events `SIGTSTP` and `SIGCONT`) - -Example of listening for `'pause'`: - -```js -rl.on('pause', () => { - console.log('Readline paused.'); -}); -``` - -### Event: 'resume' - -`function () {}` - -Emitted whenever the `input` stream is resumed. - -Example of listening for `'resume'`: - -```js -rl.on('resume', () => { - console.log('Readline resumed.'); -}); -``` - -### Event: 'SIGCONT' - -`function () {}` - -**This does not work on Windows.** - -Emitted whenever the `input` stream is sent to the background with `^Z`, -respectively known as `SIGTSTP`, and then continued with `fg(1)`. This event -only emits if the stream was not paused before sending the program to the -background. - -Example of listening for `SIGCONT`: - -```js -rl.on('SIGCONT', () => { - // `prompt` will automatically resume the stream - rl.prompt(); -}); -``` - -### Event: 'SIGINT' - -`function () {}` - -Emitted whenever the `input` stream receives a `^C`, respectively known as -`SIGINT`. If there is no `SIGINT` event listener present when the `input` -stream receives a `SIGINT`, `pause` will be triggered. - -Example of listening for `SIGINT`: - -```js -rl.on('SIGINT', () => { - rl.question('Are you sure you want to exit?', (answer) => { - if (answer.match(/^y(es)?$/i)) rl.pause(); - }); -}); -``` - -### Event: 'SIGTSTP' - -`function () {}` - -**This does not work on Windows.** - -Emitted whenever the `input` stream receives a `^Z`, respectively known as -`SIGTSTP`. If there is no `SIGTSTP` event listener present when the `input` -stream receives a `SIGTSTP`, the program will be sent to the background. - -When the program is resumed with `fg`, the `'pause'` and `SIGCONT` events will be -emitted. You can use either to resume the stream. - -The `'pause'` and `SIGCONT` events will not be triggered if the stream was paused -before the program was sent to the background. - -Example of listening for `SIGTSTP`: - -```js -rl.on('SIGTSTP', () => { - // This will override SIGTSTP and prevent the program from going to the - // background. - console.log('Caught SIGTSTP.'); -}); -``` - -## Example: Tiny CLI - -Here's an example of how to use all these together to craft a tiny command -line interface: - -```js -const readline = require('readline'); -const rl = readline.createInterface(process.stdin, process.stdout); - -rl.setPrompt('OHAI> '); -rl.prompt(); - -rl.on('line', (line) => { - switch(line.trim()) { - case 'hello': - console.log('world!'); - break; - default: - console.log('Say what? I might have heard `' + line.trim() + '`'); - break; - } - rl.prompt(); -}).on('close', () => { - console.log('Have a great day!'); - process.exit(0); -}); -``` - -## Example: Read File Stream Line-by-Line - -A common case for `readline`'s `input` option is to pass a filesystem readable -stream to it. This is how one could craft line-by-line parsing of a file: - -```js -const readline = require('readline'); -const fs = require('fs'); - -const rl = readline.createInterface({ - input: fs.createReadStream('sample.txt') -}); - -rl.on('line', (line) => { - console.log('Line from file:', line); -}); -``` - -## readline.clearLine(stream, dir) - -Clears current line of given TTY stream in a specified direction. -`dir` should have one of following values: - -* `-1` - to the left from cursor -* `1` - to the right from cursor -* `0` - the entire line - -## readline.clearScreenDown(stream) - -Clears the screen from the current position of the cursor down. - -## readline.createInterface(options) - -Creates a readline `Interface` instance. Accepts an `options` Object that takes -the following values: - - - `input` - the readable stream to listen to (Required). - - - `output` - the writable stream to write readline data to (Optional). - - - `completer` - an optional function that is used for Tab autocompletion. See - below for an example of using this. - - - `terminal` - pass `true` if the `input` and `output` streams should be - treated like a TTY, and have ANSI/VT100 escape codes written to it. - Defaults to checking `isTTY` on the `output` stream upon instantiation. - - - `historySize` - maximum number of history lines retained. Defaults to `30`. - -The `completer` function is given the current line entered by the user, and -is supposed to return an Array with 2 entries: - - 1. An Array with matching entries for the completion. - - 2. The substring that was used for the matching. - -Which ends up looking something like: -`[[substr1, substr2, ...], originalsubstring]`. - -Example: - -```js -function completer(line) { - var completions = '.help .error .exit .quit .q'.split(' ') - var hits = completions.filter((c) => { return c.indexOf(line) == 0 }) - // show all completions if none found - return [hits.length ? hits : completions, line] -} -``` - -Also `completer` can be run in async mode if it accepts two arguments: - -```js -function completer(linePartial, callback) { - callback(null, [['123'], linePartial]); -} -``` - -`createInterface` is commonly used with [`process.stdin`][] and -[`process.stdout`][] in order to accept user input: - -```js -const readline = require('readline'); -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); -``` - -Once you have a readline instance, you most commonly listen for the -`'line'` event. - -If `terminal` is `true` for this instance then the `output` stream will get -the best compatibility if it defines an `output.columns` property, and fires -a `'resize'` event on the `output` if/when the columns ever change -([`process.stdout`][] does this automatically when it is a TTY). - -## readline.cursorTo(stream, x, y) - -Move cursor to the specified position in a given TTY stream. - -## readline.emitKeypressEvents(stream) - -Causes `stream` to begin emitting `'keypress'` events corresponding to its -input. - -## readline.moveCursor(stream, dx, dy) - -Move cursor relative to it's current position in a given TTY stream. - -[`process.stdin`]: process.html#process_process_stdin -[`process.stdout`]: process.html#process_process_stdout diff --git a/doc/api/readline.md b/doc/api/readline.md new file mode 100644 index 00000000000000..cc71b20bc9b951 --- /dev/null +++ b/doc/api/readline.md @@ -0,0 +1,381 @@ +# Readline + + Stability: 2 - Stable + +To use this module, do `require('readline')`. Readline allows reading of a +stream (such as [`process.stdin`][]) on a line-by-line basis. + +Note that once you've invoked this module, your Node.js program will not +terminate until you've closed the interface. Here's how to allow your +program to gracefully exit: + +```js +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +rl.question('What do you think of Node.js? ', (answer) => { + // TODO: Log the answer in a database + console.log('Thank you for your valuable feedback:', answer); + + rl.close(); +}); +``` + +## Class: Interface + +The class that represents a readline interface with an input and output +stream. + +### rl.close() + +Closes the `Interface` instance, relinquishing control on the `input` and +`output` streams. The `'close'` event will also be emitted. + +### rl.pause() + +Pauses the readline `input` stream, allowing it to be resumed later if needed. + +Note that this doesn't immediately pause the stream of events. Several events may +be emitted after calling `pause`, including `line`. + +### rl.prompt([preserveCursor]) + +Readies readline for input from the user, putting the current `setPrompt` +options on a new line, giving the user a new spot to write. Set `preserveCursor` +to `true` to prevent the cursor placement being reset to `0`. + +This will also resume the `input` stream used with `createInterface` if it has +been paused. + +If `output` is set to `null` or `undefined` when calling `createInterface`, the +prompt is not written. + +### rl.question(query, callback) + +Prepends the prompt with `query` and invokes `callback` with the user's +response. Displays the query to the user, and then invokes `callback` +with the user's response after it has been typed. + +This will also resume the `input` stream used with `createInterface` if +it has been paused. + +If `output` is set to `null` or `undefined` when calling `createInterface`, +nothing is displayed. + +Example usage: + +```js +rl.question('What is your favorite food?', (answer) => { + console.log(`Oh, so your favorite food is ${answer}`); +}); +``` + +### rl.resume() + +Resumes the readline `input` stream. + +### rl.setPrompt(prompt) + +Sets the prompt, for example when you run `node` on the command line, you see +`> `, which is Node.js's prompt. + +### rl.write(data[, key]) + +Writes `data` to `output` stream, unless `output` is set to `null` or +`undefined` when calling `createInterface`. `key` is an object literal to +represent a key sequence; available if the terminal is a TTY. + +This will also resume the `input` stream if it has been paused. + +Example: + +```js +rl.write('Delete me!'); +// Simulate ctrl+u to delete the line written previously +rl.write(null, {ctrl: true, name: 'u'}); +``` + +## Events + +### Event: 'close' + +`function () {}` + +Emitted when `close()` is called. + +Also emitted when the `input` stream receives its `'end'` event. The `Interface` +instance should be considered "finished" once this is emitted. For example, when +the `input` stream receives `^D`, respectively known as `EOT`. + +This event is also called if there is no `SIGINT` event listener present when +the `input` stream receives a `^C`, respectively known as `SIGINT`. + +### Event: 'line' + +`function (line) {}` + +Emitted whenever the `input` stream receives an end of line (`\n`, `\r`, or +`\r\n`), usually received when the user hits enter, or return. This is a good +hook to listen for user input. + +Example of listening for `'line'`: + +```js +rl.on('line', (cmd) => { + console.log(`You just typed: ${cmd}`); +}); +``` + +### Event: 'pause' + +`function () {}` + +Emitted whenever the `input` stream is paused. + +Also emitted whenever the `input` stream is not paused and receives the +`SIGCONT` event. (See events `SIGTSTP` and `SIGCONT`) + +Example of listening for `'pause'`: + +```js +rl.on('pause', () => { + console.log('Readline paused.'); +}); +``` + +### Event: 'resume' + +`function () {}` + +Emitted whenever the `input` stream is resumed. + +Example of listening for `'resume'`: + +```js +rl.on('resume', () => { + console.log('Readline resumed.'); +}); +``` + +### Event: 'SIGCONT' + +`function () {}` + +**This does not work on Windows.** + +Emitted whenever the `input` stream is sent to the background with `^Z`, +respectively known as `SIGTSTP`, and then continued with `fg(1)`. This event +only emits if the stream was not paused before sending the program to the +background. + +Example of listening for `SIGCONT`: + +```js +rl.on('SIGCONT', () => { + // `prompt` will automatically resume the stream + rl.prompt(); +}); +``` + +### Event: 'SIGINT' + +`function () {}` + +Emitted whenever the `input` stream receives a `^C`, respectively known as +`SIGINT`. If there is no `SIGINT` event listener present when the `input` +stream receives a `SIGINT`, `pause` will be triggered. + +Example of listening for `SIGINT`: + +```js +rl.on('SIGINT', () => { + rl.question('Are you sure you want to exit?', (answer) => { + if (answer.match(/^y(es)?$/i)) rl.pause(); + }); +}); +``` + +### Event: 'SIGTSTP' + +`function () {}` + +**This does not work on Windows.** + +Emitted whenever the `input` stream receives a `^Z`, respectively known as +`SIGTSTP`. If there is no `SIGTSTP` event listener present when the `input` +stream receives a `SIGTSTP`, the program will be sent to the background. + +When the program is resumed with `fg`, the `'pause'` and `SIGCONT` events will be +emitted. You can use either to resume the stream. + +The `'pause'` and `SIGCONT` events will not be triggered if the stream was paused +before the program was sent to the background. + +Example of listening for `SIGTSTP`: + +```js +rl.on('SIGTSTP', () => { + // This will override SIGTSTP and prevent the program from going to the + // background. + console.log('Caught SIGTSTP.'); +}); +``` + +## Example: Tiny CLI + +Here's an example of how to use all these together to craft a tiny command +line interface: + +```js +const readline = require('readline'); +const rl = readline.createInterface(process.stdin, process.stdout); + +rl.setPrompt('OHAI> '); +rl.prompt(); + +rl.on('line', (line) => { + switch(line.trim()) { + case 'hello': + console.log('world!'); + break; + default: + console.log('Say what? I might have heard `' + line.trim() + '`'); + break; + } + rl.prompt(); +}).on('close', () => { + console.log('Have a great day!'); + process.exit(0); +}); +``` + +## Example: Read File Stream Line-by-Line + +A common case for `readline`'s `input` option is to pass a filesystem readable +stream to it. This is how one could craft line-by-line parsing of a file: + +```js +const readline = require('readline'); +const fs = require('fs'); + +const rl = readline.createInterface({ + input: fs.createReadStream('sample.txt') +}); + +rl.on('line', (line) => { + console.log('Line from file:', line); +}); +``` + +## readline.clearLine(stream, dir) + +Clears current line of given TTY stream in a specified direction. +`dir` should have one of following values: + +* `-1` - to the left from cursor +* `1` - to the right from cursor +* `0` - the entire line + +## readline.clearScreenDown(stream) + +Clears the screen from the current position of the cursor down. + +## readline.createInterface(options) + +Creates a readline `Interface` instance. Accepts an `options` Object that takes +the following values: + + - `input` - the readable stream to listen to (Required). + + - `output` - the writable stream to write readline data to (Optional). + + - `completer` - an optional function that is used for Tab autocompletion. See + below for an example of using this. + + - `terminal` - pass `true` if the `input` and `output` streams should be + treated like a TTY, and have ANSI/VT100 escape codes written to it. + Defaults to checking `isTTY` on the `output` stream upon instantiation. + + - `historySize` - maximum number of history lines retained. To disable the + history set this value to `0`. Defaults to `30`. This option makes sense + only if `terminal` is set to `true` by the user or by an internal `output` + check, otherwise the history caching mechanism is not initialized at all. + +The `completer` function is given the current line entered by the user, and +is supposed to return an Array with 2 entries: + + 1. An Array with matching entries for the completion. + + 2. The substring that was used for the matching. + +Which ends up looking something like: +`[[substr1, substr2, ...], originalsubstring]`. + +Example: + +```js +function completer(line) { + var completions = '.help .error .exit .quit .q'.split(' ') + var hits = completions.filter((c) => { return c.indexOf(line) == 0 }) + // show all completions if none found + return [hits.length ? hits : completions, line] +} +``` + +Also `completer` can be run in async mode if it accepts two arguments: + +```js +function completer(linePartial, callback) { + callback(null, [['123'], linePartial]); +} +``` + +`createInterface` is commonly used with [`process.stdin`][] and +[`process.stdout`][] in order to accept user input: + +```js +const readline = require('readline'); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); +``` + +Once you have a readline instance, you most commonly listen for the +`'line'` event. + +If `terminal` is `true` for this instance then the `output` stream will get +the best compatibility if it defines an `output.columns` property, and fires +a `'resize'` event on the `output` if/when the columns ever change +([`process.stdout`][] does this automatically when it is a TTY). + +## readline.cursorTo(stream, x, y) + +Move cursor to the specified position in a given TTY stream. + +## readline.emitKeypressEvents(stream[, interface]) + +Causes `stream` to begin emitting `'keypress'` events corresponding to its +input. +Optionally, `interface` specifies a `readline.Interface` instance for which +autocompletion is disabled when copy-pasted input is detected. + +Note that the stream, if it is a TTY, needs to be in raw mode: +```js +readline.emitKeypressEvents(process.stdin); +if (process.stdin.isTTY) { + // might not be a TTY if spawned from another node process + process.stdin.setRawMode(true); +} +``` + +## readline.moveCursor(stream, dx, dy) + +Move cursor relative to it's current position in a given TTY stream. + +[`process.stdin`]: process.html#process_process_stdin +[`process.stdout`]: process.html#process_process_stdout diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown deleted file mode 100644 index f77833ea472932..00000000000000 --- a/doc/api/repl.markdown +++ /dev/null @@ -1,355 +0,0 @@ -# REPL - - Stability: 2 - Stable - -A Read-Eval-Print-Loop (REPL) is available both as a standalone program and -easily includable in other programs. The REPL provides a way to interactively -run JavaScript and see the results. It can be used for debugging, testing, or -just trying things out. - -By executing `node` without any arguments from the command-line you will be -dropped into the REPL. It has simplistic emacs line-editing. - -``` -$ node -Type '.help' for options. -> a = [ 1, 2, 3]; -[ 1, 2, 3 ] -> a.forEach((v) => { -... console.log(v); -... }); -1 -2 -3 -``` - -For advanced line-editors, start Node.js with the environmental variable -`NODE_NO_READLINE=1`. This will start the main and debugger REPL in canonical -terminal settings which will allow you to use with `rlwrap`. - -For example, you could add this to your bashrc file: - -``` -alias node="env NODE_NO_READLINE=1 rlwrap node" -``` - -## Environment Variable Options - -The built-in repl (invoked by running `node` or `node -i`) may be controlled -via the following environment variables: - - - `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history - will be saved to the specified file rather than `.node_repl_history` in the - user's home directory. Setting this value to `""` will disable persistent - REPL history. Whitespace will be trimmed from the value. - - `NODE_REPL_HISTORY_SIZE` - Defaults to `1000`. Controls how many lines of - history will be persisted if history is available. Must be a positive number. - - `NODE_REPL_MODE` - May be any of `sloppy`, `strict`, or `magic`. Defaults - to `magic`, which will automatically run "strict mode only" statements in - strict mode. - -## Persistent History - -By default, the REPL will persist history between `node` REPL sessions by saving -to a `.node_repl_history` file in the user's home directory. This can be -disabled by setting the environment variable `NODE_REPL_HISTORY=""`. - -### NODE_REPL_HISTORY_FILE - - Stability: 0 - Deprecated: Use `NODE_REPL_HISTORY` instead. - -Previously in Node.js/io.js v2.x, REPL history was controlled by using a -`NODE_REPL_HISTORY_FILE` environment variable, and the history was saved in JSON -format. This variable has now been deprecated, and your REPL history will -automatically be converted to using plain text. The new file will be saved to -either your home directory, or a directory defined by the `NODE_REPL_HISTORY` -variable, as documented [here](#repl_environment_variable_options). - -## REPL Features - - - -Inside the REPL, Control+D will exit. Multi-line expressions can be input. -Tab completion is supported for both global and local variables. - -Core modules will be loaded on-demand into the environment. For example, -accessing `fs` will `require()` the `fs` module as `global.fs`. - -The special variable `_` (underscore) contains the result of the last expression. - -``` -> [ 'a', 'b', 'c' ] -[ 'a', 'b', 'c' ] -> _.length -3 -> _ += 1 -4 -``` - -Explicitly setting `_` will disable this behavior until the context is reset. - -The REPL provides access to any variables in the global scope. You can expose -a variable to the REPL explicitly by assigning it to the `context` object -associated with each `REPLServer`. For example: - -```js -// repl_test.js -const repl = require('repl'); -var msg = 'message'; - -repl.start('> ').context.m = msg; -``` - -Things in the `context` object appear as local within the REPL: - -``` -$ node repl_test.js -> m -'message' -``` - -There are a few special REPL commands: - - - `.break` - While inputting a multi-line expression, sometimes you get lost - or just don't care about completing it. `.break` will start over. - - `.clear` - Resets the `context` object to an empty object and clears any - multi-line expression. - - `.exit` - Close the I/O stream, which will cause the REPL to exit. - - `.help` - Show this list of special commands. - - `.save` - Save the current REPL session to a file - >.save ./file/to/save.js - - `.load` - Load a file into the current REPL session. - >.load ./file/to/load.js - -The following key combinations in the REPL have these special effects: - - - `C` - Similar to the `.break` keyword. Terminates the current - command. Press twice on a blank line to forcibly exit. - - `D` - Similar to the `.exit` keyword. - - `` - Show both global and local(scope) variables - - -### Customizing Object displays in the REPL - -The REPL module internally uses -[`util.inspect()`][], when printing values. However, `util.inspect` delegates the - call to the object's `inspect()` function, if it has one. You can read more - about this delegation [here][]. - -For example, if you have defined an `inspect()` function on an object, like this: - -``` -> var obj = {foo: 'this will not show up in the inspect() output'}; -undefined -> obj.inspect = () => { -... return {bar: 'baz'}; -... }; -[Function] -``` - -and try to print `obj` in REPL, it will invoke the custom `inspect()` function: - -``` -> obj -{bar: 'baz'} -``` - -## Class: REPLServer - -This inherits from [Readline Interface][] with the following events: - -### Event: 'exit' - -`function () {}` - -Emitted when the user exits the REPL in any of the defined ways. Namely, typing -`.exit` at the repl, pressing Ctrl+C twice to signal `SIGINT`, or pressing Ctrl+D -to signal `'end'` on the `input` stream. - -Example of listening for `exit`: - -```js -replServer.on('exit', () => { - console.log('Got "exit" event from repl!'); - process.exit(); -}); -``` - - -### Event: 'reset' - -`function (context) {}` - -Emitted when the REPL's context is reset. This happens when you type `.clear`. -If you start the repl with `{ useGlobal: true }` then this event will never -be emitted. - -Example of listening for `reset`: - -```js -// Extend the initial repl context. -var replServer = repl.start({ options ... }); -someExtension.extend(r.context); - -// When a new context is created extend it as well. -replServer.on('reset', (context) => { - console.log('repl has a new context'); - someExtension.extend(context); -}); -``` - -### replServer.defineCommand(keyword, cmd) - -* `keyword` {String} -* `cmd` {Object|Function} - -Makes a command available in the REPL. The command is invoked by typing a `.` -followed by the keyword. The `cmd` is an object with the following values: - - - `help` - help text to be displayed when `.help` is entered (Optional). - - `action` - a function to execute, potentially taking in a string argument, - when the command is invoked, bound to the REPLServer instance (Required). - -If a function is provided instead of an object for `cmd`, it is treated as the -`action`. - -Example of defining a command: - -```js -// repl_test.js -const repl = require('repl'); - -var replServer = repl.start(); -replServer.defineCommand('sayhello', { - help: 'Say hello', - action: function(name) { - this.write(`Hello, ${name}!\n`); - this.displayPrompt(); - } -}); -``` - -Example of invoking that command from the REPL: - -``` -> .sayhello Node.js User -Hello, Node.js User! -``` - -### replServer.displayPrompt([preserveCursor]) - -* `preserveCursor` {Boolean} - -Like [`readline.prompt`][] except also adding indents with ellipses when inside -blocks. The `preserveCursor` argument is passed to [`readline.prompt`][]. This is -used primarily with `defineCommand`. It's also used internally to render each -prompt line. - -## repl.start([options]) - -Returns and starts a `REPLServer` instance, that inherits from -[Readline Interface][]. Accepts an "options" Object that takes -the following values: - - - `prompt` - the prompt and `stream` for all I/O. Defaults to `> `. - - - `input` - the readable stream to listen to. Defaults to `process.stdin`. - - - `output` - the writable stream to write readline data to. Defaults to - `process.stdout`. - - - `terminal` - pass `true` if the `stream` should be treated like a TTY, and - have ANSI/VT100 escape codes written to it. Defaults to checking `isTTY` - on the `output` stream upon instantiation. - - - `eval` - function that will be used to eval each given line. Defaults to - an async wrapper for `eval()`. See below for an example of a custom `eval`. - - - `useColors` - a boolean which specifies whether or not the `writer` function - should output colors. If a different `writer` function is set then this does - nothing. Defaults to the repl's `terminal` value. - - - `useGlobal` - if set to `true`, then the repl will use the `global` object, - instead of running scripts in a separate context. Defaults to `false`. - - - `ignoreUndefined` - if set to `true`, then the repl will not output the - return value of command if it's `undefined`. Defaults to `false`. - - - `writer` - the function to invoke for each command that gets evaluated which - returns the formatting (including coloring) to display. Defaults to - `util.inspect`. - - - `replMode` - controls whether the repl runs all commands in strict mode, - default mode, or a hybrid mode ("magic" mode.) Acceptable values are: - * `repl.REPL_MODE_SLOPPY` - run commands in sloppy mode. - * `repl.REPL_MODE_STRICT` - run commands in strict mode. This is equivalent to - prefacing every repl statement with `'use strict'`. - * `repl.REPL_MODE_MAGIC` - attempt to run commands in default mode. If they - fail to parse, re-try in strict mode. - -You can use your own `eval` function if it has following signature: - - function eval(cmd, context, filename, callback) { - callback(null, result); - } - -On tab completion, `eval` will be called with `.scope` as an input string. It -is expected to return an array of scope names to be used for the auto-completion. - -Multiple REPLs may be started against the same running instance of Node.js. Each -will share the same global object but will have unique I/O. - -Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket: - -```js -const net = require('net'); -const repl = require('repl'); -var connections = 0; - -repl.start({ - prompt: 'Node.js via stdin> ', - input: process.stdin, - output: process.stdout -}); - -net.createServer((socket) => { - connections += 1; - repl.start({ - prompt: 'Node.js via Unix socket> ', - input: socket, - output: socket - }).on('exit', () => { - socket.end(); - }) -}).listen('/tmp/node-repl-sock'); - -net.createServer((socket) => { - connections += 1; - repl.start({ - prompt: 'Node.js via TCP socket> ', - input: socket, - output: socket - }).on('exit', () => { - socket.end(); - }); -}).listen(5001); -``` - -Running this program from the command line will start a REPL on stdin. Other -REPL clients may connect through the Unix socket or TCP socket. `telnet` is useful -for connecting to TCP sockets, and `socat` can be used to connect to both Unix and -TCP sockets. - -By starting a REPL from a Unix socket-based server instead of stdin, you can -connect to a long-running Node.js process without restarting it. - -For an example of running a "full-featured" (`terminal`) REPL over -a `net.Server` and `net.Socket` instance, see: https://gist.github.com/2209310 - -For an example of running a REPL instance over `curl(1)`, -see: https://gist.github.com/2053342 - -[`readline.prompt`]: readline.html#readline_rl_prompt_preservecursor -[`util.inspect()`]: util.html#util_util_inspect_object_options -[here]: util.html#util_custom_inspect_function_on_objects -[Readline Interface]: readline.html#readline_class_interface diff --git a/doc/api/repl.md b/doc/api/repl.md new file mode 100644 index 00000000000000..26f2889f0b45f3 --- /dev/null +++ b/doc/api/repl.md @@ -0,0 +1,374 @@ +# REPL + + Stability: 2 - Stable + +A Read-Eval-Print-Loop (REPL) is available both as a standalone program and +easily includable in other programs. The REPL provides a way to interactively +run JavaScript and see the results. It can be used for debugging, testing, or +just trying things out. + +By executing `node` without any arguments from the command-line you will be +dropped into the REPL. It has simplistic emacs line-editing. + +``` +$ node +Type '.help' for options. +> a = [1, 2, 3]; +[ 1, 2, 3 ] +> a.forEach((v) => { +... console.log(v); +... }); +1 +2 +3 +``` + +For advanced line-editors, start Node.js with the environmental variable +`NODE_NO_READLINE=1`. This will start the main and debugger REPL in canonical +terminal settings which will allow you to use with `rlwrap`. + +For example, you could add this to your bashrc file: + +``` +alias node="env NODE_NO_READLINE=1 rlwrap node" +``` + +## Environment Variable Options + +The built-in repl (invoked by running `node` or `node -i`) may be controlled +via the following environment variables: + + - `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history + will be saved to the specified file rather than `.node_repl_history` in the + user's home directory. Setting this value to `""` will disable persistent + REPL history. Whitespace will be trimmed from the value. + - `NODE_REPL_HISTORY_SIZE` - Defaults to `1000`. Controls how many lines of + history will be persisted if history is available. Must be a positive number. + - `NODE_REPL_MODE` - May be any of `sloppy`, `strict`, or `magic`. Defaults + to `magic`, which will automatically run "strict mode only" statements in + strict mode. + +## Persistent History + +By default, the REPL will persist history between `node` REPL sessions by saving +to a `.node_repl_history` file in the user's home directory. This can be +disabled by setting the environment variable `NODE_REPL_HISTORY=""`. + +### NODE_REPL_HISTORY_FILE + + Stability: 0 - Deprecated: Use `NODE_REPL_HISTORY` instead. + +Previously in Node.js/io.js v2.x, REPL history was controlled by using a +`NODE_REPL_HISTORY_FILE` environment variable, and the history was saved in JSON +format. This variable has now been deprecated, and your REPL history will +automatically be converted to using plain text. The new file will be saved to +either your home directory, or a directory defined by the `NODE_REPL_HISTORY` +variable, as documented [here](#repl_environment_variable_options). + +## REPL Features + + + +Inside the REPL, Control+D will exit. Multi-line expressions can be input. +Tab completion is supported for both global and local variables. + +Core modules will be loaded on-demand into the environment. For example, +accessing `fs` will `require()` the `fs` module as `global.fs`. + +The special variable `_` (underscore) contains the result of the last expression. + +``` +> [ 'a', 'b', 'c' ] +[ 'a', 'b', 'c' ] +> _.length +3 +> _ += 1 +4 +``` + +Explicitly setting `_` will disable this behavior until the context is reset. + +The REPL provides access to any variables in the global scope. You can expose +a variable to the REPL explicitly by assigning it to the `context` object +associated with each `REPLServer`. For example: + +```js +// repl_test.js +const repl = require('repl'); +var msg = 'message'; + +repl.start('> ').context.m = msg; +``` + +Things in the `context` object appear as local within the REPL: + +``` +$ node repl_test.js +> m +'message' +``` + +There are a few special REPL commands: + + - `.break` - While inputting a multi-line expression, sometimes you get lost + or just don't care about completing it. `.break` will start over. + - `.clear` - Resets the `context` object to an empty object and clears any + multi-line expression. + - `.exit` - Close the I/O stream, which will cause the REPL to exit. + - `.help` - Show this list of special commands. + - `.save` - Save the current REPL session to a file + >.save ./file/to/save.js + - `.load` - Load a file into the current REPL session. + >.load ./file/to/load.js + +The following key combinations in the REPL have these special effects: + + - `C` - Similar to the `.break` keyword. Terminates the current + command. Press twice on a blank line to forcibly exit. + - `D` - Similar to the `.exit` keyword. + - `` - Show both global and local(scope) variables + + +### Customizing Object displays in the REPL + +The REPL module internally uses +[`util.inspect()`][], when printing values. However, `util.inspect` delegates the + call to the object's `inspect()` function, if it has one. You can read more + about this delegation [here][]. + +For example, if you have defined an `inspect()` function on an object, like this: + +``` +> var obj = {foo: 'this will not show up in the inspect() output'}; +undefined +> obj.inspect = () => { +... return {bar: 'baz'}; +... }; +[Function] +``` + +and try to print `obj` in REPL, it will invoke the custom `inspect()` function: + +``` +> obj +{bar: 'baz'} +``` + +## Class: REPLServer + +This inherits from [Readline Interface][] with the following events: + +### Event: 'exit' + +`function () {}` + +Emitted when the user exits the REPL in any of the defined ways. Namely, typing +`.exit` at the repl, pressing Ctrl+C twice to signal `SIGINT`, or pressing Ctrl+D +to signal `'end'` on the `input` stream. + +Example of listening for `exit`: + +```js +replServer.on('exit', () => { + console.log('Got "exit" event from repl!'); + process.exit(); +}); +``` + + +### Event: 'reset' + +`function (context) {}` + +Emitted when the REPL's context is reset. This happens when you type `.clear`. +If you start the repl with `{ useGlobal: true }` then this event will never +be emitted. + +Example of listening for `reset`: + +```js +// Extend the initial repl context. +var replServer = repl.start({ options ... }); +someExtension.extend(r.context); + +// When a new context is created extend it as well. +replServer.on('reset', (context) => { + console.log('repl has a new context'); + someExtension.extend(context); +}); +``` + +### replServer.defineCommand(keyword, cmd) + +* `keyword` {String} +* `cmd` {Object|Function} + +Makes a command available in the REPL. The command is invoked by typing a `.` +followed by the keyword. The `cmd` is an object with the following values: + + - `help` - help text to be displayed when `.help` is entered (Optional). + - `action` - a function to execute, potentially taking in a string argument, + when the command is invoked, bound to the REPLServer instance (Required). + +If a function is provided instead of an object for `cmd`, it is treated as the +`action`. + +Example of defining a command: + +```js +// repl_test.js +const repl = require('repl'); + +var replServer = repl.start(); +replServer.defineCommand('sayhello', { + help: 'Say hello', + action: function(name) { + this.write(`Hello, ${name}!\n`); + this.displayPrompt(); + } +}); +``` + +Example of invoking that command from the REPL: + +``` +> .sayhello Node.js User +Hello, Node.js User! +``` + +### replServer.displayPrompt([preserveCursor]) + +* `preserveCursor` {Boolean} + +Like [`readline.prompt`][] except also adding indents with ellipses when inside +blocks. The `preserveCursor` argument is passed to [`readline.prompt`][]. This is +used primarily with `defineCommand`. It's also used internally to render each +prompt line. + +## repl.start([options]) + +Returns and starts a `REPLServer` instance, that inherits from +[Readline Interface][]. Accepts an "options" Object that takes +the following values: + + - `prompt` - the prompt and `stream` for all I/O. Defaults to `> `. + + - `input` - the readable stream to listen to. Defaults to `process.stdin`. + + - `output` - the writable stream to write readline data to. Defaults to + `process.stdout`. + + - `terminal` - pass `true` if the `stream` should be treated like a TTY, and + have ANSI/VT100 escape codes written to it. Defaults to checking `isTTY` + on the `output` stream upon instantiation. + + - `eval` - a function that will be used to eval each given line. Defaults to + an async wrapper for `eval()`. An `eval` function can error with + `repl.Recoverable` to indicate the code was incomplete and prompt for more + lines. See below for an example of a custom `eval`. + + - `useColors` - a boolean which specifies whether or not the `writer` function + should output colors. If a different `writer` function is set then this does + nothing. Defaults to the repl's `terminal` value. + + - `useGlobal` - if set to `true`, then the repl will use the `global` object, + instead of running scripts in a separate context. Defaults to `false`. + + - `ignoreUndefined` - if set to `true`, then the repl will not output the + return value of command if it's `undefined`. Defaults to `false`. + + - `writer` - the function to invoke for each command that gets evaluated which + returns the formatting (including coloring) to display. Defaults to + `util.inspect`. + + - `replMode` - controls whether the repl runs all commands in strict mode, + default mode, or a hybrid mode ("magic" mode.) Acceptable values are: + * `repl.REPL_MODE_SLOPPY` - run commands in sloppy mode. + * `repl.REPL_MODE_STRICT` - run commands in strict mode. This is equivalent to + prefacing every repl statement with `'use strict'`. + * `repl.REPL_MODE_MAGIC` - attempt to run commands in default mode. If they + fail to parse, re-try in strict mode. + +It is possible to use a custom `eval` function as illustrated below: + +```js +function eval(cmd, context, filename, callback) { + var result; + try { + result = vm.runInThisContext(cmd); + } catch (e) { + if (isRecoverableError(e)) { + return callback(new repl.Recoverable(e)); + } + } + callback(null, result); +} + +function isRecoverableError(error) { + if (error.name === 'SyntaxError') { + return /^(Unexpected end of input|Unexpected token)/.test(error.message); + } + return false; +} +``` + +On tab completion, `eval` will be called with `.scope` as an input string. It +is expected to return an array of scope names to be used for the auto-completion. + +Multiple REPLs may be started against the same running instance of Node.js. Each +will share the same global object but will have unique I/O. + +Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket: + +```js +const net = require('net'); +const repl = require('repl'); +var connections = 0; + +repl.start({ + prompt: 'Node.js via stdin> ', + input: process.stdin, + output: process.stdout +}); + +net.createServer((socket) => { + connections += 1; + repl.start({ + prompt: 'Node.js via Unix socket> ', + input: socket, + output: socket + }).on('exit', () => { + socket.end(); + }) +}).listen('/tmp/node-repl-sock'); + +net.createServer((socket) => { + connections += 1; + repl.start({ + prompt: 'Node.js via TCP socket> ', + input: socket, + output: socket + }).on('exit', () => { + socket.end(); + }); +}).listen(5001); +``` + +Running this program from the command line will start a REPL on stdin. Other +REPL clients may connect through the Unix socket or TCP socket. `telnet` is useful +for connecting to TCP sockets, and `socat` can be used to connect to both Unix and +TCP sockets. + +By starting a REPL from a Unix socket-based server instead of stdin, you can +connect to a long-running Node.js process without restarting it. + +For an example of running a "full-featured" (`terminal`) REPL over +a `net.Server` and `net.Socket` instance, see: https://gist.github.com/2209310 + +For an example of running a REPL instance over `curl(1)`, +see: https://gist.github.com/2053342 + +[`readline.prompt`]: readline.html#readline_rl_prompt_preservecursor +[`util.inspect()`]: util.html#util_util_inspect_object_options +[here]: util.html#util_custom_inspect_function_on_objects +[Readline Interface]: readline.html#readline_class_interface diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown deleted file mode 100644 index d2d0c4487ed9bf..00000000000000 --- a/doc/api/stream.markdown +++ /dev/null @@ -1,1761 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -Node.js. For example a [request to an HTTP server][http-incoming-message] is a -stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All -streams are instances of [`EventEmitter`][]. - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections: - -1. The first section explains the parts of the API that you need to be - aware of to use streams in your programs. -2. The second section explains the parts of the API that you need to - use if you implement your own custom streams yourself. The API is designed to - make this easy for you to do. -3. The third section goes into more depth about how streams work, - including some of the internal mechanisms and functions that you - should probably not modify unless you definitely know what you are - doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. - -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: - -```js -const http = require('http'); - -var server = http.createServer( (req, res) => { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', (chunk) => { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', () => { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end(`error: ${er.message}`); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Duplex streams include: - -* [TCP sockets][] -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [HTTP responses, on the client][http-incoming-message] -* [HTTP requests, on the server][http-incoming-message] -* [fs read streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdout and stderr][] -* [`process.stdin`][] - -#### Event: 'close' - -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. - -Not all streams will emit the `'close'` event. - -#### Event: 'data' - -* `chunk` {Buffer|String} The chunk of data. - -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', () => { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error receiving data. - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: - -```js -const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); -rr.on('readable', () => { - console.log('readable:', rr.read()); -}); -rr.on('end', () => { - console.log('end'); -}); -``` - -The output of running this script is: - -``` -$ node test.js -readable: null -end -``` - -#### readable.isPaused() - -* Return: {Boolean} - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). - -```js -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(() => { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.pipe(destination[, options]) - -* `destination` {stream.Writable} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```js -reader.pipe(writer, { end: false }); -reader.on('end', () => { - writer.end('Goodbye\n'); -}); -``` - -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String|Buffer|Null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```js -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. - -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting [`'data'`][] -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. - -```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. - -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. - -```js -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', (chunk) => { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.unpipe([destination]) - -* `destination` {stream.Writable} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(() => { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) - -```js -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -const StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` -will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) - -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. - -For example: - -```js -const OldReader = require('./old-api-module.js').OldReader; -const Readable = require('stream').Readable; -const oreader = new OldReader; -const myReader = new Readable().wrap(oreader); - -myReader.on('readable', () => { - myReader.read(); // etc. -}); -``` - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Transform streams include: - -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] - -#### Event: 'drain' - -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. - -```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. If an error -occurs, the callback may or may not be called with the error as its -first argument. To detect write errors, listen for the `'error'` event. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Use-case

-
-

Class

-
-

Method(s) to implement

-
-

Reading only

-
-

[Readable](#stream_class_stream_readable_1)

-
-

[_read][stream-_read]

-
-

Writing only

-
-

[Writable](#stream_class_stream_writable_1)

-
-

[_write][stream-_write], [_writev][stream-_writev]

-
-

Reading and writing

-
-

[Duplex](#stream_class_stream_duplex_1)

-
-

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

-
-

Operate on written data, then read the result

-
-

[Transform](#stream_class_stream_transform_1)

-
-

[_transform][stream-_transform], [_flush][stream-_flush]

-
- -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. - -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. - -#### readable.push(chunk[, encoding]) - - -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** - -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. - -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. - -```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -const Readable = require('stream').Readable; -const util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - source.on('end', () => { - this.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - this.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### Events: 'finish' and 'end' - -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. - -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: - -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Example: `SimpleProtocol` parser v2 - -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. - -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. - -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Duplex - -```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -### Readable - -```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - } -}); -``` - -### Transform - -```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - - // generate output as many times as needed - // this.push(chunk); - - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood - - // generate output as many times as needed - // this.push(chunk); - - done(); - } -}); -``` - -### Writable - -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. - -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing -[`'data'`][] chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'`][] event handler is added. -* The [`stream.resume()`][stream-resume] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```js -// WARNING! BROKEN! -net.createServer((socket) => { - - // we add an 'end' method, but never consume the data - socket.on('end', () => { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: - -```js -// Workaround -net.createServer((socket) => { - - socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). - -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `stream.read(0)` will trigger -a low-level [`stream._read()`][stream-_read] call. - -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -[`'data'`]: #stream_event_data -[`'drain'`]: #stream_event_drain -[`'end'`]: #stream_event_end -[`'finish'`]: #stream_event_finish -[`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: events.html#events_class_eventemitter -[`process.stderr`]: process.html#process_process_stderr -[`process.stdin`]: process.html#process_process_stdin -[`process.stdout`]: process.html#process_process_stdout -[`stream.cork()`]: #stream_writable_cork -[`stream.pipe()`]: #stream_readable_pipe_destination_options -[`stream.uncork()`]: #stream_writable_uncork -[`stream.unpipe()`]: #stream_readable_unpipe_destination -[`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: tls.html#tls_class_cryptostream -[`util.inherits()`]: util.html#util_util_inherits_constructor_superconstructor -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: child_process.html#child_process_child_stdin -[child process stdout and stderr]: child_process.html#child_process_child_stdout -[Compatibility]: #stream_compatibility_with_older_node_js_versions -[crypto]: crypto.html -[Duplex]: #stream_class_stream_duplex -[fs read streams]: fs.html#fs_class_fs_readstream -[fs write streams]: fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: http.html#http_class_http_clientrequest -[HTTP responses, on the server]: http.html#http_class_http_serverresponse -[http-incoming-message]: http.html#http_class_http_incomingmessage -[Object mode]: #stream_object_mode -[Readable]: #stream_class_stream_readable -[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 -[stream-_flush]: #stream_transform_flush_callback -[stream-_read]: #stream_readable_read_size_1 -[stream-_transform]: #stream_transform_transform_chunk_encoding_callback -[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 -[stream-_writev]: #stream_writable_writev_chunks_callback -[stream-end]: #stream_writable_end_chunk_encoding_callback -[stream-pause]: #stream_readable_pause -[stream-push]: #stream_readable_push_chunk_encoding -[stream-read]: #stream_readable_read_size -[stream-resume]: #stream_readable_resume -[stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: net.html#net_class_net_socket -[Transform]: #stream_class_stream_transform -[Writable]: #stream_class_stream_writable -[zlib]: zlib.html diff --git a/doc/api/stream.md b/doc/api/stream.md new file mode 100644 index 00000000000000..be36b64b9ef478 --- /dev/null +++ b/doc/api/stream.md @@ -0,0 +1,1761 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event as the `'close'` event is +optional. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = Buffer.from(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: '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 as the `'close'` event is +optional. + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding +* Return: `this` + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. If an error +occurs, the callback may or may not be called with the error as its +first argument. To detect write errors, listen for the `'error'` event. + +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 via the `extends` + keyword. +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Use-case

+
+

Class

+
+

Method(s) to implement

+
+

Reading only

+
+

[Readable](#stream_class_stream_readable_1)

+
+

[_read][stream-_read]

+
+

Writing only

+
+

[Writable](#stream_class_stream_writable_1)

+
+

[_write][stream-_write], [_writev][stream-_writev]

+
+

Reading and writing

+
+

[Duplex](#stream_class_stream_duplex_1)

+
+

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

+
+

Operate on written data, then read the result

+
+

[Transform](#stream_class_stream_transform_1)

+
+

[_transform][stream-_transform], [_flush][stream-_flush]

+
+ +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + + +class SourceWrapper extends Readable { + constructor(options) { + super(options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; + } + // _read will be called when the stream wants to pull more data in + // the advisory size argument is ignored in this case. + _read(size) { + this._source.readStart(); + } +} +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; + +class Counter extends Readable { + constructor(opt) { + super(opt); + this._max = 1000000; + this._index = 1; + } + + _read() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = Buffer.from(str, 'ascii'); + this.push(buf); + } + } +} +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; + +class SimpleProtocol extends Readable { + constructor(source, options) { + super(options); + + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + source.on('end', () => { + this.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + this.read(0); + }); + + this._rawHeader = []; + this.header = null; + } + + _read(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } + } +} +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const Transform = require('stream').Transform; + +class SimpleProtocol extends Transform { + constructor(options) { + super(options); + + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; + } + + _transform(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); + } +} +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; + +// Gets \n-delimited JSON string data, and emits the parsed objects +class JSONParseStream extends Transform { + constructor() { + super({ readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); + } + + _transform(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(); + } + + _flush(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); + } +} +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: events.html#events_class_eventemitter +[`process.stderr`]: process.html#process_process_stderr +[`process.stdin`]: process.html#process_process_stdin +[`process.stdout`]: process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: tls.html#tls_class_cryptostream +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: child_process.html#child_process_child_stdin +[child process stdout and stderr]: child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: fs.html#fs_class_fs_readstream +[fs write streams]: fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: http.html#http_class_http_clientrequest +[HTTP responses, on the server]: http.html#http_class_http_serverresponse +[http-incoming-message]: http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/doc/api/string_decoder.markdown b/doc/api/string_decoder.markdown deleted file mode 100644 index d1de27dc4a395a..00000000000000 --- a/doc/api/string_decoder.markdown +++ /dev/null @@ -1,30 +0,0 @@ -# StringDecoder - - Stability: 2 - Stable - -To use this module, do `require('string_decoder')`. StringDecoder decodes a -buffer to a string. It is a simple interface to `buffer.toString()` but provides -additional support for utf8. - -```js -const StringDecoder = require('string_decoder').StringDecoder; -const decoder = new StringDecoder('utf8'); - -const cent = new Buffer([0xC2, 0xA2]); -console.log(decoder.write(cent)); - -const euro = new Buffer([0xE2, 0x82, 0xAC]); -console.log(decoder.write(euro)); -``` - -## Class: StringDecoder - -Accepts a single argument, `encoding` which defaults to `'utf8'`. - -### decoder.end() - -Returns any trailing bytes that were left in the buffer. - -### decoder.write(buffer) - -Returns a decoded string. diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md new file mode 100644 index 00000000000000..6bd5a57502b82c --- /dev/null +++ b/doc/api/string_decoder.md @@ -0,0 +1,77 @@ +# StringDecoder + + Stability: 2 - Stable + +The `string_decoder` module provides an API for decoding `Buffer` objects into +strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 +characters. It can be accessed using: + +```js +const StringDecoder = require('string_decoder').StringDecoder; +``` + +The following example shows the basic use of the `StringDecoder` class. + +```js +const StringDecoder = require('string_decoder').StringDecoder; +const decoder = new StringDecoder('utf8'); + +const cent = Buffer.from([0xC2, 0xA2]); +console.log(decoder.write(cent)); + +const euro = Buffer.from([0xE2, 0x82, 0xAC]); +console.log(decoder.write(euro)); +``` + +When a `Buffer` instance is written to the `StringDecoder` instance, an +internal buffer is used to ensure that the decoded string does not contain +any incomplete multibyte characters. These are held in the buffer until the +next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + +In the following example, the three UTF-8 encoded bytes of the European Euro +symbol (`€`) are written over three separate operations: + +```js +const StringDecoder = require('string_decoder').StringDecoder; +const decoder = new StringDecoder('utf8'); + +decoder.write(Buffer.from([0xE2])); +decoder.write(Buffer.from([0x82])); +console.log(decoder.end(Buffer.from([0xAC]))); +``` + +## Class: new StringDecoder([encoding]) + + +* `encoding` {string} The character encoding the `StringDecoder` will use. + Defaults to `'utf8'`. + +Creates a new `StringDecoder` instance. + +### stringDecoder.end([buffer]) + + +* `buffer` {Buffer} A `Buffer` containing the bytes to decode. + +Returns any remaining input stored in the internal buffer as a string. Bytes +representing incomplete UTF-8 and UTF-16 characters will be replaced with +substitution characters appropriate for the character encoding. + +If the `buffer` argument is provided, one final call to `stringDecoder.write()` +is performed before returning the remaining input. + +### stringDecoder.write(buffer) + + +* `buffer` {Buffer} A `Buffer` containing the bytes to decode. + +Returns a decoded string, ensuring that any incomplete multibyte characters at +the end of the `Buffer` are omitted from the returned string and stored in an +internal buffer for the next call to `stringDecoder.write()` or +`stringDecoder.end()`. diff --git a/doc/api/synopsis.markdown b/doc/api/synopsis.markdown deleted file mode 100644 index 7dd3b8fe99d7fd..00000000000000 --- a/doc/api/synopsis.markdown +++ /dev/null @@ -1,29 +0,0 @@ -# Synopsis - - - -An example of a [web server][] written with Node.js which responds with -`'Hello World'`: - -```js -const http = require('http'); - -http.createServer( (request, response) => { - response.writeHead(200, {'Content-Type': 'text/plain'}); - response.end('Hello World\n'); -}).listen(8124); - -console.log('Server running at http://127.0.0.1:8124/'); -``` - -To run the server, put the code into a file called `example.js` and execute -it with the node program - -``` -$ node example.js -Server running at http://127.0.0.1:8124/ -``` - -All of the examples in the documentation can be run similarly. - -[web server]: http.html diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md new file mode 100644 index 00000000000000..35e8593d3547c1 --- /dev/null +++ b/doc/api/synopsis.md @@ -0,0 +1,43 @@ +# Usage + + + +`node [options] [v8 options] [script.js | -e "script"] [arguments]` + +Please see the [Command Line Options][] document for information about +different options and ways to run scripts with Node.js. + +## Example + +An example of a [web server][] written with Node.js which responds with +`'Hello World'`: + +```js +const http = require('http'); + +const hostname = '127.0.0.1'; +const port = 3000; + +const server = http.createServer((req, res) => { + res.statusCode = 200; + res.setHeader('Content-Type', 'text/plain'); + res.end('Hello World\n'); +}); + +server.listen(port, hostname, () => { + console.log(`Server running at http://${hostname}:${port}/`); +}); +``` + +To run the server, put the code into a file called `example.js` and execute +it with Node.js: + +``` +$ node example.js +Server running at http://127.0.0.1:3000/ +``` + +All of the examples in the documentation can be run similarly. + +[Command Line Options]: cli.html#cli_command_line_options +[web server]: http.html diff --git a/doc/api/timers.markdown b/doc/api/timers.md similarity index 100% rename from doc/api/timers.markdown rename to doc/api/timers.md diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown deleted file mode 100644 index ef1c7fc32bdd9f..00000000000000 --- a/doc/api/tls.markdown +++ /dev/null @@ -1,1008 +0,0 @@ -# TLS (SSL) - - Stability: 2 - Stable - -Use `require('tls')` to access this module. - -The `tls` module uses OpenSSL to provide Transport Layer Security and/or -Secure Socket Layer: encrypted stream communication. - -TLS/SSL is a public/private key infrastructure. Each client and each -server must have a private key. A private key is created like this: - -``` -openssl genrsa -out ryans-key.pem 2048 -``` - -All servers and some clients need to have a certificate. Certificates are public -keys signed by a Certificate Authority or self-signed. The first step to -getting a certificate is to create a "Certificate Signing Request" (CSR) -file. This is done with: - -``` -openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem -``` - -To create a self-signed certificate with the CSR, do this: - -``` -openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem -``` - -Alternatively you can send the CSR to a Certificate Authority for signing. - -For Perfect Forward Secrecy, it is required to generate Diffie-Hellman -parameters: - -``` -openssl dhparam -outform PEM -out dhparam.pem 2048 -``` - -To create a .pfx or .p12, do this: - -``` -openssl pkcs12 -export -in agent5-cert.pem -inkey agent5-key.pem \ - -certfile ca-cert.pem -out agent5.pfx -``` - - - `in`: certificate - - `inkey`: private key - - `certfile`: all CA certs concatenated in one file like - `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem` - -## ALPN, NPN and SNI - - - -ALPN (Application-Layer Protocol Negotiation Extension), NPN (Next -Protocol Negotiation) and, SNI (Server Name Indication) are TLS -handshake extensions: - - * ALPN/NPN - Allows the use of one TLS server for multiple protocols (HTTP, - SPDY, HTTP/2) - * SNI - Allows the use of one TLS server for multiple hostnames with different - SSL certificates. - -## Client-initiated renegotiation attack mitigation - - - -The TLS protocol lets the client renegotiate certain aspects of the TLS session. -Unfortunately, session renegotiation requires a disproportionate amount of -server-side resources, which makes it a potential vector for denial-of-service -attacks. - -To mitigate this, renegotiation is limited to three times every 10 minutes. An -error is emitted on the [`tls.TLSSocket`][] instance when the threshold is -exceeded. These limits are configurable: - - - `tls.CLIENT_RENEG_LIMIT`: renegotiation limit, default is 3. - - - `tls.CLIENT_RENEG_WINDOW`: renegotiation window in seconds, default is - 10 minutes. - -Do not change the defaults without a full understanding of the implications. - -To test the server, connect to it with `openssl s_client -connect address:port` -and tap `R` (i.e., the letter `R` followed by a carriage return) a few -times. - -## Modifying the Default TLS Cipher suite - -Node.js is built with a default suite of enabled and disabled TLS ciphers. -Currently, the default cipher suite is: - -``` -ECDHE-RSA-AES128-GCM-SHA256: -ECDHE-ECDSA-AES128-GCM-SHA256: -ECDHE-RSA-AES256-GCM-SHA384: -ECDHE-ECDSA-AES256-GCM-SHA384: -DHE-RSA-AES128-GCM-SHA256: -ECDHE-RSA-AES128-SHA256: -DHE-RSA-AES128-SHA256: -ECDHE-RSA-AES256-SHA384: -DHE-RSA-AES256-SHA384: -ECDHE-RSA-AES256-SHA256: -DHE-RSA-AES256-SHA256: -HIGH: -!aNULL: -!eNULL: -!EXPORT: -!DES: -!RC4: -!MD5: -!PSK: -!SRP: -!CAMELLIA -``` - -This default can be overriden entirely using the `--tls-cipher-list` command -line switch. For instance, the following makes -`ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS cipher suite: - -``` -node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4" -``` - -Note that the default cipher suite included within Node.js has been carefully -selected to reflect current security best practices and risk mitigation. -Changing the default cipher suite can have a significant impact on the security -of an application. The `--tls-cipher-list` switch should by used only if -absolutely necessary. - -## Perfect Forward Secrecy - - - -The term "[Forward Secrecy]" or "Perfect Forward Secrecy" describes a feature of -key-agreement (i.e., key-exchange) methods. Practically it means that even if -the private key of a server is compromised, communication can only be -decrypted by eavesdroppers if they manage to obtain the key-pair specifically -generated for each session. - -This is achieved by randomly generating a key pair for key-agreement on every -handshake (in contrast to using the same key for all sessions). Methods -implementing this technique, thus offering Perfect Forward Secrecy, are -called "ephemeral". - -Currently two methods are commonly used to achieve Perfect Forward Secrecy (note -the character "E" appended to the traditional abbreviations): - - * [DHE] - An ephemeral version of the Diffie Hellman key-agreement protocol. - * [ECDHE] - An ephemeral version of the Elliptic Curve Diffie Hellman - key-agreement protocol. - -Ephemeral methods may have some performance drawbacks, because key generation -is expensive. - -## Class: CryptoStream - - Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. - -This is an encrypted stream. - -### cryptoStream.bytesWritten - -A proxy to the underlying socket's bytesWritten accessor, this will return -the total bytes written to the socket, *including the TLS overhead*. - -## Class: SecurePair - -Returned by tls.createSecurePair. - -### Event: 'secure' - -This event is emitted from the SecurePair once the pair has successfully -established a secure connection. - -As with checking for the server [`secureConnection`](#event-secureconnection) -event, `pair.cleartext.authorized` should be inspected to confirm whether the -certificate used is properly authorized. - -## Class: tls.Server - -This class is a subclass of `net.Server` and has the same methods on it. -Instead of accepting only raw TCP connections, this accepts encrypted -connections using TLS or SSL. - -### Event: 'tlsClientError' - -`function (exception, tlsSocket) { }` - -When a client connection emits an `'error'` event before a secure connection is -established it will be forwarded here. - -`tlsSocket` is the [`tls.TLSSocket`][] that the error originated from. - -### Event: 'newSession' - -`function (sessionId, sessionData, callback) { }` - -Emitted on creation of a TLS session. May be used to store sessions in external -storage. `callback` must be invoked eventually, otherwise no data will be -sent or received from the secure connection. - -NOTE: adding this event listener will only have an effect on connections -established after the addition of the event listener. - -### Event: 'OCSPRequest' - -`function (certificate, issuer, callback) { }` - -Emitted when the client sends a certificate status request. The server's -current certificate can be parsed to obtain the OCSP URL and certificate ID; -after obtaining an OCSP response `callback(null, resp)` is then invoked, where -`resp` is a `Buffer` instance. Both `certificate` and `issuer` are `Buffer` -DER-representations of the primary and issuer's certificates. They can be used -to obtain the OCSP certificate ID and OCSP endpoint URL. - -Alternatively, `callback(null, null)` may be called, meaning that there was no -OCSP response. - -Calling `callback(err)` will result in a `socket.destroy(err)` call. - -Typical flow: - -1. Client connects to the server and sends an `'OCSPRequest'` to it (via status - info extension in ClientHello). -2. Server receives the request and invokes the `'OCSPRequest'` event listener - if present. -3. Server extracts the OCSP URL from either the `certificate` or `issuer` and - performs an [OCSP request] to the CA. -4. Server receives `OCSPResponse` from the CA and sends it back to the client - via the `callback` argument -5. Client validates the response and either destroys the socket or performs a - handshake. - -NOTE: `issuer` could be `null` if the certificate is self-signed or if the -issuer is not in the root certificates list. (An issuer may be provided via the -`ca` option.) - -NOTE: adding this event listener will only have an effect on connections -established after the addition of the event listener. - -NOTE: An npm module like [asn1.js] may be used to parse the certificates. - -### Event: 'resumeSession' - -`function (sessionId, callback) { }` - -Emitted when the client wants to resume the previous TLS session. The event -listener may perform a lookup in external storage using the given `sessionId` -and invoke `callback(null, sessionData)` once finished. If the session can't be -resumed (i.e., doesn't exist in storage) one may call `callback(null, null)`. -Calling `callback(err)` will terminate incoming connection and destroy the -socket. - -NOTE: adding this event listener will only have an effect on connections -established after the addition of the event listener. - -Here's an example for using TLS session resumption: - -```js -var tlsSessionStore = {}; -server.on('newSession', (id, data, cb) => { - tlsSessionStore[id.toString('hex')] = data; - cb(); -}); -server.on('resumeSession', (id, cb) => { - cb(null, tlsSessionStore[id.toString('hex')] || null); -}); -``` - -### Event: 'secureConnection' - -`function (tlsSocket) {}` - -This event is emitted after the handshaking process for a new connection has -successfully completed. The argument is an instance of [`tls.TLSSocket`][] and -has all the common stream methods and events. - -`socket.authorized` is a boolean value which indicates if the -client has been verified by one of the supplied certificate authorities for the -server. If `socket.authorized` is false, then `socket.authorizationError` is -set to describe how authorization failed. Implied but worth mentioning: -depending on the settings of the TLS server, unauthorized connections may -be accepted. - -`socket.npnProtocol` is a string containing the selected NPN protocol -and `socket.alpnProtocol` is a string containing the selected ALPN -protocol. When both NPN and ALPN extensions are received, ALPN takes -precedence over NPN and the next protocol is selected by ALPN. When -ALPN has no selected protocol, this returns false. - -`socket.servername` is a string containing the server name requested with -SNI. - -### server.addContext(hostname, context) - -Add secure context that will be used if the client request's SNI hostname -matches the supplied `hostname` (wildcards can be used). `context` can contain -`key`, `cert`, `ca` or any other properties from -[`tls.createSecureContext()`][] `options` argument. - -### server.address() - -Returns the bound address, the address family name, and port of the -server as reported by the operating system. See [`net.Server.address()`][] for -more information. - -### server.close([callback]) - -Stops the server from accepting new connections. This function is -asynchronous, the server is finally closed when the server emits a `'close'` -event. Optionally, you can pass a callback to listen for the `'close'` event. - -### server.connections - -The number of concurrent connections on the server. - -### server.getTicketKeys() - -Returns a `Buffer` instance holding the keys currently used for -encryption/decryption of the [TLS Session Tickets][] - -### server.listen(port[, hostname][, callback]) - -Begin accepting connections on the specified `port` and `hostname`. If the -`hostname` is omitted, the server will accept connections on any IPv6 address -(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A -port value of zero will assign a random port. - -This function is asynchronous. The last parameter `callback` will be called -when the server has been bound. - -See `net.Server` for more information. - -### server.setTicketKeys(keys) - -Updates the keys for encryption/decryption of the [TLS Session Tickets][]. - -NOTE: the buffer should be 48 bytes long. See `ticketKeys` option in -[tls.createServer](#tlscreateserveroptions-secureconnectionlistener) for -more information on how it is used. - -NOTE: the change is effective only for future server connections. Existing -or currently pending server connections will use the previous keys. - -### server.maxConnections - -Set this property to reject connections when the server's connection count -exceeds the specified threshold. - - -## Class: tls.TLSSocket - -This is a wrapped version of [`net.Socket`][] that does transparent encryption -of written data and all required TLS negotiation. - -This instance implements the duplex [Stream][] interface. It has all the -common stream methods and events. - -Methods that return TLS connection metadata (e.g. -[`tls.TLSSocket.getPeerCertificate()`][] will only return data while the -connection is open. - -### new tls.TLSSocket(socket[, options]) - -Construct a new TLSSocket object from an existing TCP socket. - -`socket` is an instance of [`net.Socket`][] - -`options` is an optional object that might contain following properties: - - - `secureContext`: An optional TLS context object from - [`tls.createSecureContext()`][] - - - `isServer`: If `true` the TLS socket will be instantiated in server-mode. - Default: `false` - - - `server`: An optional [`net.Server`][] instance - - - `requestCert`: Optional, see [`tls.createSecurePair()`][] - - - `rejectUnauthorized`: Optional, see [`tls.createSecurePair()`][] - - - `NPNProtocols`: Optional, see [`tls.createServer()`][] - - - `ALPNProtocols`: Optional, see [`tls.createServer()`][] - - - `SNICallback`: Optional, see [`tls.createServer()`][] - - - `session`: Optional, a `Buffer` instance, containing a TLS session - - - `requestOCSP`: Optional, if `true` the OCSP status request extension will - be added to the client hello and an `'OCSPResponse'` event will be emitted - on the socket before establishing a secure communication - -### Event: 'OCSPResponse' - -`function (response) { }` - -This event will be emitted if the `requestOCSP` option was set. `response` is a -`Buffer` containing the server's OCSP response. - -Traditionally, the `response` is a signed object from the server's CA that -contains information about server's certificate revocation status. - -### Event: 'secureConnect' - -This event is emitted after the handshaking process for a new connection has -successfully completed. The listener will be called regardless of whether or not -the server's certificate has been authorized. It is the user's responsibility to -test `tlsSocket.authorized` to see if the server certificate was signed by one -of the specified CAs. If `tlsSocket.authorized === false` then the error can be -found in `tlsSocket.authorizationError`. Also, if either ALPN or NPN was used -`tlsSocket.alpnProtocol` or `tlsSocket.npnProtocol` can be checked for the -negotiated protocol. - -### tlsSocket.address() - -Returns the bound address, the address family name, and port of the -underlying socket as reported by the operating system. Returns an -object with three properties, e.g., -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - -### tlsSocket.authorized - -A boolean that is `true` if the peer certificate was signed by one of the -specified CAs, otherwise `false`. - -### tlsSocket.authorizationError - -The reason why the peer's certificate has not been verified. This property -becomes available only when `tlsSocket.authorized === false`. - -### tlsSocket.encrypted - -Static boolean value, always `true`. May be used to distinguish TLS sockets -from regular ones. - -### tlsSocket.getCipher() - -Returns an object representing the cipher name and the SSL/TLS protocol version -that first defined the cipher. - -Example: -`{ name: 'AES256-SHA', version: 'TLSv1/SSLv3' }` - -See SSL_CIPHER_get_name() and SSL_CIPHER_get_version() in -https://www.openssl.org/docs/manmaster/ssl/SSL_CIPHER_get_name.html for more -information. - -### tlsSocket.getEphemeralKeyInfo() - -Returns an object representing the type, name, and size of parameter of -an ephemeral key exchange in [Perfect Forward Secrecy][] on a client -connection. It returns an empty object when the key exchange is not -ephemeral. As this is only supported on a client socket, it returns `null` -if called on a server socket. The supported types are 'DH' and 'ECDH'. The -`name` property is only available in 'ECDH'. - -Example: - - { type: 'ECDH', name: 'prime256v1', size: 256 } - -### tlsSocket.getPeerCertificate([ detailed ]) - -Returns an object representing the peer's certificate. The returned object has -some properties corresponding to the fields of the certificate. If the -`detailed` argument is `true` the full chain with the `issuer` property will be -returned, if `false` only the top certificate without the `issuer` property. - -Example: - -``` -{ subject: - { C: 'UK', - ST: 'Acknack Ltd', - L: 'Rhys Jones', - O: 'node.js', - OU: 'Test TLS Certificate', - CN: 'localhost' }, - issuerInfo: - { C: 'UK', - ST: 'Acknack Ltd', - L: 'Rhys Jones', - O: 'node.js', - OU: 'Test TLS Certificate', - CN: 'localhost' }, - issuer: - { ... another certificate ... }, - raw: < RAW DER buffer >, - valid_from: 'Nov 11 09:52:22 2009 GMT', - valid_to: 'Nov 6 09:52:22 2029 GMT', - fingerprint: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF', - serialNumber: 'B9B0D332A1AA5635' } -``` - -If the peer does not provide a certificate, it returns `null` or an empty -object. - -### tlsSocket.getProtocol() - -Returns a string containing the negotiated SSL/TLS protocol version of the -current connection. `'unknown'` will be returned for connected sockets that have -not completed the handshaking process. `null` will be returned for server -sockets or disconnected client sockets. - -Examples: -``` -'SSLv3' -'TLSv1' -'TLSv1.1' -'TLSv1.2' -'unknown' -``` - -See https://www.openssl.org/docs/manmaster/ssl/SSL_get_version.html for more -information. - -### tlsSocket.getSession() - -Returns the ASN.1 encoded TLS session or `undefined` if none was negotiated. -Could be used to speed up handshake establishment when reconnecting to the -server. - -### tlsSocket.getTLSTicket() - -NOTE: Works only with client TLS sockets. Useful only for debugging, for -session reuse provide `session` option to [`tls.connect()`][]. - -Returns the TLS session ticket or `undefined` if none was negotiated. - -### tlsSocket.localAddress - -The string representation of the local IP address. - -### tlsSocket.localPort - -The numeric representation of the local port. - -### tlsSocket.remoteAddress - -The string representation of the remote IP address. For example, -`'74.125.127.100'` or `'2001:4860:a005::68'`. - -### tlsSocket.remoteFamily - -The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - -### tlsSocket.remotePort - -The numeric representation of the remote port. For example, `443`. - -### tlsSocket.renegotiate(options, callback) - -Initiate TLS renegotiation process. The `options` object may contain the -following fields: `rejectUnauthorized`, `requestCert`. (See [`tls.createServer -()`][] for details.) `callback(err)` will be executed with `null` as `err`, -once the renegotiation is successfully completed. - -NOTE: Can be used to request peer's certificate after the secure connection -has been established. - -ANOTHER NOTE: When running as the server, socket will be destroyed -with an error after `handshakeTimeout` timeout. - -### tlsSocket.setMaxSendFragment(size) - -Set maximum TLS fragment size (default and maximum value is: `16384`, minimum -is: `512`). Returns `true` on success, `false` otherwise. - -Smaller fragment sizes decrease the buffering latency on the client: larger -fragments are buffered by the TLS layer until the entire fragment is received -and its integrity is verified; large fragments can span multiple roundtrips -and their processing can be delayed due to packet loss or reordering. However, -smaller fragments add extra TLS framing bytes and CPU overhead, which may -decrease overall server throughput. - - -## tls.connect(options[, callback]) -## tls.connect(port[, host][, options][, callback]) - -Creates a new client connection to the given `port` and `host` (old API) or -`options.port` and `options.host`. (If `host` is omitted, it defaults to -`localhost`.) `options` should be an object which specifies: - - - `host`: Host the client should connect to. - - - `port`: Port the client should connect to. - - - `socket`: Establish secure connection on a given socket rather than - creating a new socket. If this option is specified, `host` and `port` - are ignored. - - - `path`: Creates unix socket connection to path. If this option is - specified, `host` and `port` are ignored. - - - `pfx`: A string or `Buffer` containing the private key, certificate, and - CA certs of the client in PFX or PKCS12 format. - - - `key`: A string, `Buffer`, array of strings, or array of `Buffer`s - containing the private key of the client in PEM format. - - - `passphrase`: A string containing the passphrase for the private key or pfx. - - - `cert`: A string, `Buffer`, array of strings, or array of `Buffer`s - containing the certificate key of the client in PEM format. - - - `ca`: A string, `Buffer`, array of strings, or array of `Buffer`s of trusted - certificates in PEM format. If this is omitted several well known "root" - CAs (like VeriSign) will be used. These are used to authorize connections. - - - `ciphers`: A string describing the ciphers to use or exclude, separated by - `:`. Uses the same default cipher suite as [`tls.createServer()`][]. - - - `rejectUnauthorized`: If `true`, the server certificate is verified against - the list of supplied CAs. An `'error'` event is emitted if verification - fails; `err.code` contains the OpenSSL error code. Default: `true`. - - - `NPNProtocols`: An array of strings or `Buffer`s containing supported NPN - protocols. `Buffer`s should have the following format: - `0x05hello0x05world`, where the first byte is the next protocol name's - length. (Passing an array is usually be much simpler: `['hello', 'world']`.) - - - `ALPNProtocols`: An array of strings or `Buffer`s containing the - supported ALPN protocols. `Buffer`s should have following format: - `0x05hello0x05world`, where the first byte is the next protocol - name's length. (Passing an array is usually be much simpler: - `['hello', 'world']`.) - - - `servername`: Server name for the SNI (Server Name Indication) TLS - extension. - - - `checkServerIdentity(servername, cert)`: Provide an override for checking - the server's hostname against the certificate. Should return an error if - verification fails. Returns `undefined` if passing. - - - `secureProtocol`: The SSL method to use, e.g., `SSLv3_method` to force - SSL version 3. The possible values depend on the version of OpenSSL - installed in the environment and are defined in the constant - [SSL_METHODS][]. - - - `secureContext`: An optional TLS context object from - `tls.createSecureContext( ... )`. It can be used for caching client - certificates, keys, and CA certificates. - - - `session`: A `Buffer` instance, containing TLS session. - - - `minDHSize`: Minimum size of the DH parameter in bits to accept a TLS - connection. When a server offers a DH parameter with a size less - than this, the TLS connection is destroyed and an error is thrown. Default: - 1024. - -The `callback` parameter will be added as a listener for the -[`'secureConnect'`][] event. - -`tls.connect()` returns a [`tls.TLSSocket`][] object. - -Here is an example of a client of echo server as described previously: - -```js -const tls = require('tls'); -const fs = require('fs'); - -const options = { - // These are necessary only if using the client certificate authentication - key: fs.readFileSync('client-key.pem'), - cert: fs.readFileSync('client-cert.pem'), - - // This is necessary only if the server uses the self-signed certificate - ca: [ fs.readFileSync('server-cert.pem') ] -}; - -var socket = tls.connect(8000, options, () => { - console.log('client connected', - socket.authorized ? 'authorized' : 'unauthorized'); - process.stdin.pipe(socket); - process.stdin.resume(); -}); -socket.setEncoding('utf8'); -socket.on('data', (data) => { - console.log(data); -}); -socket.on('end', () => { - server.close(); -}); -``` - -Or - -```js -const tls = require('tls'); -const fs = require('fs'); - -const options = { - pfx: fs.readFileSync('client.pfx') -}; - -var socket = tls.connect(8000, options, () => { - console.log('client connected', - socket.authorized ? 'authorized' : 'unauthorized'); - process.stdin.pipe(socket); - process.stdin.resume(); -}); -socket.setEncoding('utf8'); -socket.on('data', (data) => { - console.log(data); -}); -socket.on('end', () => { - server.close(); -}); -``` - - -## tls.createSecureContext(options) - -Creates a credentials object; the `options` object may contain the following -fields: - -* `pfx` : A string or `Buffer` holding the PFX or PKCS12 encoded private - key, certificate, and CA certificates. -* `key`: A string or `Buffer` containing the private key of the server in - PEM format. To support multiple keys using different algorithms, an array - can be provided. It can either be a plain array of keys or an array of - objects in the format `{pem: key, passphrase: passphrase}`. (Required) -* `passphrase` : A string containing the passphrase for the private key or pfx. -* `cert` : A string containing the PEM encoded certificate -* `ca`: A string, `Buffer`, array of strings, or array of `Buffer`s of trusted - certificates in PEM format. If this is omitted several well known "root" - CAs (like VeriSign) will be used. These are used to authorize connections. -* `crl` : Either a string or list of strings of PEM encoded CRLs - (Certificate Revocation List). -* `ciphers`: A string describing the ciphers to use or exclude. - Consult - - for details on the format. -* `honorCipherOrder` : When choosing a cipher, use the server's preferences - instead of the client preferences. For further details see `tls` module - documentation. - -If no 'CA' details are given, then Node.js will use the default -publicly trusted list of CAs as given in -. - -## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) - -Creates a new secure pair object with two streams, one of which reads and writes -the encrypted data and the other of which reads and writes the cleartext data. -Generally, the encrypted stream is piped to/from an incoming encrypted data -stream and the cleartext one is used as a replacement for the initial encrypted -stream. - - - `credentials`: A secure context object from `tls.createSecureContext( ... )`. - - - `isServer`: A boolean indicating whether this TLS connection should be - opened as a server or a client. - - - `requestCert`: A boolean indicating whether a server should request a - certificate from a connecting client. Only applies to server connections. - - - `rejectUnauthorized`: A boolean indicating whether a server should - automatically reject clients with invalid certificates. Only applies to - servers with `requestCert` enabled. - - - `options`: An object with common SSL options. See [`tls.TLSSocket`][]. - -`tls.createSecurePair()` returns a SecurePair object with `cleartext` and -`encrypted` stream properties. - -NOTE: `cleartext` has the same API as [`tls.TLSSocket`][] - -## tls.createServer(options[, secureConnectionListener]) - -Creates a new [tls.Server][]. The `connectionListener` argument is -automatically set as a listener for the [`'secureConnection'`][] event. The -`options` object may contain the following fields: - - - `pfx`: A string or `Buffer` containing the private key, certificate and - CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with - the `key`, `cert`, and `ca` options.) - - - `key`: A string or `Buffer` containing the private key of the server in - PEM format. To support multiple keys using different algorithms an array - can be provided. It can either be a plain array of keys or an array of - objects in the format `{pem: key, passphrase: passphrase}`. (Required) - - - `passphrase`: A string containing the passphrase for the private key or pfx. - - - `cert`: A string, `Buffer`, array of strings, or array of `Buffer`s - containing the certificate key of the server in PEM format. (Required) - - - `ca`: A string, `Buffer`, array of strings, or array of `Buffer`s of trusted - certificates in PEM format. If this is omitted several well known "root" - CAs (like VeriSign) will be used. These are used to authorize connections. - - - `crl` : Either a string or array of strings of PEM encoded CRLs (Certificate - Revocation List). - - - `ciphers`: A string describing the ciphers to use or exclude, separated by - `:`. The default cipher suite is: - - ```js - ECDHE-RSA-AES128-GCM-SHA256: - ECDHE-ECDSA-AES128-GCM-SHA256: - ECDHE-RSA-AES256-GCM-SHA384: - ECDHE-ECDSA-AES256-GCM-SHA384: - DHE-RSA-AES128-GCM-SHA256: - ECDHE-RSA-AES128-SHA256: - DHE-RSA-AES128-SHA256: - ECDHE-RSA-AES256-SHA384: - DHE-RSA-AES256-SHA384: - ECDHE-RSA-AES256-SHA256: - DHE-RSA-AES256-SHA256: - HIGH: - !aNULL: - !eNULL: - !EXPORT: - !DES: - !RC4: - !MD5: - !PSK: - !SRP: - !CAMELLIA - ``` - - The default cipher suite prefers GCM ciphers for [Chrome's 'modern - cryptography' setting] and also prefers ECDHE and DHE ciphers for Perfect - Forward Secrecy, while offering *some* backward compatibility. - - 128 bit AES is preferred over 192 and 256 bit AES in light of [specific - attacks affecting larger AES key sizes]. - - Old clients that rely on insecure and deprecated RC4 or DES-based ciphers - (like Internet Explorer 6) cannot complete the handshaking process with - the default configuration. If these clients _must_ be supported, the - [TLS recommendations] may offer a compatible cipher suite. For more details - on the format, see the [OpenSSL cipher list format documentation]. - - - `ecdhCurve`: A string describing a named curve to use for ECDH key agreement - or false to disable ECDH. - - Defaults to `prime256v1` (NIST P-256). Use [`crypto.getCurves()`][] to - obtain a list of available curve names. On recent releases, - `openssl ecparam -list_curves` will also display the name and description of - each available elliptic curve. - - - `dhparam`: A string or `Buffer` containing Diffie Hellman parameters, - required for Perfect Forward Secrecy. Use `openssl dhparam` to create it. - Its key length should be greater than or equal to 1024 bits, otherwise - it throws an error. It is strongly recommended to use 2048 bits or - larger for stronger security. If omitted or invalid, it is silently - discarded and DHE ciphers won't be available. - - - `handshakeTimeout`: Abort the connection if the SSL/TLS handshake does not - finish in the specified number of milliseconds. The default is 120 seconds. - - A `'clientError'` is emitted on the `tls.Server` object whenever a handshake - times out. - - - `honorCipherOrder` : When choosing a cipher, use the server's preferences - instead of the client preferences. Default: `true`. - - - `requestCert`: If `true` the server will request a certificate from - clients that connect and attempt to verify that certificate. Default: - `false`. - - - `rejectUnauthorized`: If `true` the server will reject any connection - which is not authorized with the list of supplied CAs. This option only - has an effect if `requestCert` is `true`. Default: `false`. - - - `NPNProtocols`: An array or `Buffer` of possible NPN protocols. (Protocols - should be ordered by their priority.) - - - `ALPNProtocols`: An array or `Buffer` of possible ALPN - protocols. (Protocols should be ordered by their priority.) When - the server receives both NPN and ALPN extensions from the client, - ALPN takes precedence over NPN and the server does not send an NPN - extension to the client. - - - `SNICallback(servername, cb)`: A function that will be called if the client - supports SNI TLS extension. Two arguments will be passed to it: - `servername` and `cb`. `SNICallback` should invoke `cb(null, ctx)`, where - `ctx` is a SecureContext instance. (`tls.createSecureContext(...)` can be - used to get a proper SecureContext.) If `SNICallback` wasn't provided the - default callback with high-level API will be used (see below). - - - `sessionTimeout`: An integer specifying the number of seconds after which - the TLS session identifiers and TLS session tickets created by the server - will time out. See [SSL_CTX_set_timeout] for more details. - - - `ticketKeys`: A 48-byte `Buffer` instance consisting of a 16-byte prefix, - a 16-byte HMAC key, and a 16-byte AES key. This can be used to accept TLS - session tickets on multiple instances of the TLS server. - - NOTE: Automatically shared between `cluster` module workers. - - - `sessionIdContext`: A string containing an opaque identifier for session - resumption. If `requestCert` is `true`, the default is a 128 bit - truncated SHA1 hash value generated from the command-line. Otherwise, a - default is not provided. - - - `secureProtocol`: The SSL method to use, e.g., `SSLv3_method` to force - SSL version 3. The possible values depend on the version of OpenSSL - installed in the environment and are defined in the constant [SSL_METHODS][]. - -Here is a simple example echo server: - -```js -const tls = require('tls'); -const fs = require('fs'); - -const options = { - key: fs.readFileSync('server-key.pem'), - cert: fs.readFileSync('server-cert.pem'), - - // This is necessary only if using the client certificate authentication. - requestCert: true, - - // This is necessary only if the client uses the self-signed certificate. - ca: [ fs.readFileSync('client-cert.pem') ] -}; - -var server = tls.createServer(options, (socket) => { - console.log('server connected', - socket.authorized ? 'authorized' : 'unauthorized'); - socket.write('welcome!\n'); - socket.setEncoding('utf8'); - socket.pipe(socket); -}); -server.listen(8000, () => { - console.log('server bound'); -}); -``` - -Or - -```js -const tls = require('tls'); -const fs = require('fs'); - -const options = { - pfx: fs.readFileSync('server.pfx'), - - // This is necessary only if using the client certificate authentication. - requestCert: true, - -}; - -var server = tls.createServer(options, (socket) => { - console.log('server connected', - socket.authorized ? 'authorized' : 'unauthorized'); - socket.write('welcome!\n'); - socket.setEncoding('utf8'); - socket.pipe(socket); -}); -server.listen(8000, () => { - console.log('server bound'); -}); -``` - -You can test this server by connecting to it with `openssl s_client`: - -``` -openssl s_client -connect 127.0.0.1:8000 -``` - -## tls.getCiphers() - -Returns an array with the names of the supported SSL ciphers. - -Example: - -```js -var ciphers = tls.getCiphers(); -console.log(ciphers); // ['AES128-SHA', 'AES256-SHA', ...] -``` - - -[OpenSSL cipher list format documentation]: https://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT -[Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Deprecation-of-TLS-Features-Algorithms-in-Chrome -[specific attacks affecting larger AES key sizes]: https://www.schneier.com/blog/archives/2009/07/another_new_aes.html -[BEAST attacks]: https://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html -[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves -[`tls.createServer()`]: #tls_tls_createserver_options_secureconnectionlistener -[`tls.createSecurePair()`]: #tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options -[`tls.TLSSocket`]: #tls_class_tls_tlssocket -[`net.Server`]: net.html#net_class_net_server -[`net.Socket`]: net.html#net_class_net_socket -[`net.Server.address()`]: net.html#net_server_address -[`'secureConnect'`]: #tls_event_secureconnect -[`'secureConnection'`]: #tls_event_secureconnection -[Perfect Forward Secrecy]: #tls_perfect_forward_secrecy -[Stream]: stream.html#stream_stream -[SSL_METHODS]: https://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS -[tls.Server]: #tls_class_tls_server -[SSL_CTX_set_timeout]: https://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html -[RFC 4492]: https://www.rfc-editor.org/rfc/rfc4492.txt -[Forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy -[DHE]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange -[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman -[asn1.js]: https://npmjs.org/package/asn1.js -[OCSP request]: https://en.wikipedia.org/wiki/OCSP_stapling -[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS -[TLS Session Tickets]: https://www.ietf.org/rfc/rfc5077.txt -[`tls.TLSSocket.getPeerCertificate()`]: #tls_tlssocket_getpeercertificate_detailed -[`tls.createSecureContext()`]: #tls_tls_createsecurecontext_details -[`tls.connect()`]: #tls_tls_connect_options_callback diff --git a/doc/api/tls.md b/doc/api/tls.md new file mode 100644 index 00000000000000..caec8a7b123c57 --- /dev/null +++ b/doc/api/tls.md @@ -0,0 +1,1146 @@ +# TLS (SSL) + + Stability: 2 - Stable + +The `tls` module provides an implementation of the Transport Layer Security +(TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. +The module can be accessed using: + +```js +const tls = require('tls'); +``` + +## TLS/SSL Concepts + +The TLS/SSL is a public/private key infrastructure (PKI). For most common +cases, each client and server must have a *private key*. + +Private keys can be generated in multiple ways. The example below illustrates +use of the OpenSSL command-line interface to generate a 2048-bit RSA private +key: + +``` +openssl genrsa -out ryans-key.pem 2048 +``` + +With TLS/SSL, all servers (and some clients) must have a *certificate*. +Certificates are *public keys* that correspond to a private key, and that are +digitally signed either by a Certificate Authority or by the owner of the +private key (such certificates are referred to as "self-signed"). The first +step to obtaining a certificate is to create a *Certificate Signing Request* +(CSR) file. + +The OpenSSL command-line interface can be used to generate a CSR for a private +key: + +``` +openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem +``` + +Once the CSR file is generated, it can either be sent to a Certificate +Authority for signing or used to generate a self-signed certificate. + +Creating a self-signed certificate using the OpenSSL command-line interface +is illustrated in the example below: + +``` +openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem +``` + +Once the certificate is generated, it can be used to generate a `.pfx` or +`.p12` file: + +``` +openssl pkcs12 -export -in ryans-cert.pem -inkey ryans-key.pem \ + -certfile ca-cert.pem -out ryans.pfx +``` + +Where: + +* `in`: is the signed certificate +* `inkey`: is the associated private key +* `certfile`: is a concatenation of all Certificate Authority (CA) certs into + a single file, e.g. `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem` + +### Perfect Forward Secrecy + + + +The term "[Forward Secrecy]" or "Perfect Forward Secrecy" describes a feature of +key-agreement (i.e., key-exchange) methods. That is, the server and client keys +are used to negotiate new temporary keys that are used specifically and only for +the current communication session. Practically, this means that even if the +server's private key is compromised, communication can only be decrypted by +eavesdroppers if the attacker manages to obtain the key-pair specifically +generated for the session. + +Perfect Forward Secrecy is achieved by randomly generating a key pair for +key-agreement on every TLS/SSL handshake (in contrast to using the same key for +all sessions). Methods implementing this technique are called "ephemeral". + +Currently two methods are commonly used to achieve Perfect Forward Secrecy (note +the character "E" appended to the traditional abbreviations): + +* [DHE] - An ephemeral version of the Diffie Hellman key-agreement protocol. +* [ECDHE] - An ephemeral version of the Elliptic Curve Diffie Hellman + key-agreement protocol. + +Ephemeral methods may have some performance drawbacks, because key generation +is expensive. + +To use Perfect Forward Secrecy using `DHE` with the `tls` module, it is required +to generate Diffie-Hellman parameters. The following illustrates the use of the +OpenSSL command-line interface to generate such parameters: + +``` +openssl dhparam -outform PEM -out dhparam.pem 2048 +``` + +If using Perfect Foward Secrecy using `ECDHE`, Diffie-Hellman parameters are +not required and a default ECDHE curve will be used. The `ecdheCurve` property +can be used when creating a TLS Server to specify the name of an +alternative curve to use. + +### ALPN, NPN and SNI + + + +ALPN (Application-Layer Protocol Negotiation Extension), NPN (Next +Protocol Negotiation) and, SNI (Server Name Indication) are TLS +handshake extensions: + +* ALPN/NPN - Allows the use of one TLS server for multiple protocols (HTTP, + SPDY, HTTP/2) +* SNI - Allows the use of one TLS server for multiple hostnames with different + SSL certificates. + +*Note*: Use of ALPN is recommended over NPN. The NPN extension has never been +formally defined or documented and generally not recommended for use. + +### Client-initiated renegotiation attack mitigation + + + +The TLS protocol allows clients to renegotiate certain aspects of the TLS +session. Unfortunately, session renegotiation requires a disproportionate amount +of server-side resources, making it a potential vector for denial-of-service +attacks. + +To mitigate the risk, renegotiation is limited to three times every ten minutes. +An `'error'` event is emitted on the [`tls.TLSSocket`][] instance when this +threshold is exceeded. The limits are configurable: + +* `tls.CLIENT_RENEG_LIMIT` {number} Specifies the number of renegotiation + requests. Defaults to `3`. +* `tls.CLIENT_RENEG_WINDOW` {number} Specifies the time renegotiation window + in seconds. Defaults to `600` (10 minutes). + +*Note*: The default renegotiation limits should not be modified without a full +understanding of the implications and risks. + +To test the renegotiation limits on a server, connect to it using the OpenSSL +command-line client (`openssl s_client -connect address:port`) then input +`R` (i.e., the letter `R` followed by a carriage return) multiple times. + +## Modifying the Default TLS Cipher suite + +Node.js is built with a default suite of enabled and disabled TLS ciphers. +Currently, the default cipher suite is: + +``` +ECDHE-RSA-AES128-GCM-SHA256: +ECDHE-ECDSA-AES128-GCM-SHA256: +ECDHE-RSA-AES256-GCM-SHA384: +ECDHE-ECDSA-AES256-GCM-SHA384: +DHE-RSA-AES128-GCM-SHA256: +ECDHE-RSA-AES128-SHA256: +DHE-RSA-AES128-SHA256: +ECDHE-RSA-AES256-SHA384: +DHE-RSA-AES256-SHA384: +ECDHE-RSA-AES256-SHA256: +DHE-RSA-AES256-SHA256: +HIGH: +!aNULL: +!eNULL: +!EXPORT: +!DES: +!RC4: +!MD5: +!PSK: +!SRP: +!CAMELLIA +``` + +This default can be replaced entirely using the `--tls-cipher-list` command +line switch. For instance, the following makes +`ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS cipher suite: + +``` +node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4" +``` + +*Note*: The default cipher suite included within Node.js has been carefully +selected to reflect current security best practices and risk mitigation. +Changing the default cipher suite can have a significant impact on the security +of an application. The `--tls-cipher-list` switch should by used only if +absolutely necessary. + +## Class: tls.Server + +The `tls.Server` class is a subclass of `net.Server` that accepts encrypted +connections using TLS or SSL. + +### Event: 'tlsClientError' + +The `'tlsClientError'` event is emitted when an error occurs before a secure +connection is established. The listener callback is passed two arguments when +called: + +* `exception` {Error} The `Error` object describing the error +* `tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance from which the + error originated. + +### Event: 'newSession' + +The `'newSession'` event is emitted upon creation of a new TLS session. This may +be used to store sessions in external storage. The listener callback is passed +three arguments when called: + +* `sessionId` - The TLS session identifier +* `sessionData` - The TLS session data +* `callback` {Function} A callback function taking no arguments that must be + invoked in order for data to be sent or received over the secure connection. + +*Note*: Listening for this event will have an effect only on connections +established after the addition of the event listener. + +### Event: 'OCSPRequest' + +The `'OCSPRequest'` event is emitted when the client sends a certificate status +request. The listener callback is passed three arguments when called: + +* `certificate` {Buffer} The server certificate +* `issuer` {Buffer} The issuer's certificate +* `callback` {Function} A callback function that must be invoked to provide + the results of the OCSP request. + +The server's current certificate can be parsed to obtain the OCSP URL +and certificate ID; after obtaining an OCSP response, `callback(null, resp)` is +then invoked, where `resp` is a `Buffer` instance containing the OCSP response. +Both `certificate` and `issuer` are `Buffer` DER-representations of the +primary and issuer's certificates. These can be used to obtain the OCSP +certificate ID and OCSP endpoint URL. + +Alternatively, `callback(null, null)` may be called, indicating that there was +no OCSP response. + +Calling `callback(err)` will result in a `socket.destroy(err)` call. + +The typical flow of an OCSP Request is as follows: + +1. Client connects to the server and sends an `'OCSPRequest'` (via the status + info extension in ClientHello). +2. Server receives the request and emits the `'OCSPRequest'` event, calling the + listener if registered. +3. Server extracts the OCSP URL from either the `certificate` or `issuer` and + performs an [OCSP request] to the CA. +4. Server receives `OCSPResponse` from the CA and sends it back to the client + via the `callback` argument +5. Client validates the response and either destroys the socket or performs a + handshake. + +*Note*: The `issuer` can be `null` if the certificate is either self-signed or +the issuer is not in the root certificates list. (An issuer may be provided +via the `ca` option when establishing the TLS connection.) + +*Note*: Listening for this event will have an effect only on connections +established after the addition of the event listener. + +*Note*: An npm module like [asn1.js] may be used to parse the certificates. + +### Event: 'resumeSession' + +The `'resumeSession'` event is emitted when the client requests to resume a +previous TLS session. The listener callback is passed two arguments when +called: + +* `sessionId` - The TLS/SSL session identifier +* `callback` {Function} A callback function to be called when the prior session + has been recovered. + +When called, the event listener may perform a lookup in external storage using +the given `sessionId` and invoke `callback(null, sessionData)` once finished. If +the session cannot be resumed (i.e., doesn't exist in storage) the callback may +be invoked as `callback(null, null)`. Calling `callback(err)` will terminate the +incoming connection and destroy the socket. + +*Note*: Listening for this event will have an effect only on connections +established after the addition of the event listener. + +The following illustrates resuming a TLS session: + +```js +const tlsSessionStore = {}; +server.on('newSession', (id, data, cb) => { + tlsSessionStore[id.toString('hex')] = data; + cb(); +}); +server.on('resumeSession', (id, cb) => { + cb(null, tlsSessionStore[id.toString('hex')] || null); +}); +``` + +### Event: 'secureConnection' + +The `'secureConnection'` event is emitted after the handshaking process for a +new connection has successfully completed. The listener callback is passed a +single argument when called: + +* `tlsSocket` {tls.TLSSocket} The established TLS socket. + +The `tlsSocket.authorized` property is a `boolean` indicating whether the +client has been verified by one of the supplied Certificate Authorities for the +server. If `tlsSocket.authorized` is `false`, then `socket.authorizationError` +is set to describe how authorization failed. Note that depending on the settings +of the TLS server, unauthorized connections may still be accepted. + +The `tlsSocket.npnProtocol` and `tlsSocket.alpnProtocol` properties are strings +that contain the selected NPN and ALPN protocols, respectively. When both NPN +and ALPN extensions are received, ALPN takes precedence over NPN and the next +protocol is selected by ALPN. + +When ALPN has no selected protocol, `tlsSocket.alpnProtocol` returns `false`. + +The `tlsSocket.servername` property is a string containing the server name +requested via SNI. + +### server.addContext(hostname, context) + +* `hostname` {string} A SNI hostname or wildcard (e.g. `'*'`) +* `context` {Object} An object containing any of the possible properties + from the [`tls.createSecureContext()`][] `options` arguments (e.g. `key`, + `cert`, `ca`, etc). + +The `server.addContext()` method adds a secure context that will be used if +the client request's SNS hostname matches the supplied `hostname` (or wildcard). + +### server.address() + +Returns the bound address, the address family name, and port of the +server as reported by the operating system. See [`net.Server.address()`][] for +more information. + +### server.close([callback]) + +* `callback` {Function} An optional listener callback that will be registered to + listen for the server instance's `'close'` event. + +The `server.close()` method stops the server from accepting new connections. + +This function operates asynchronously. The `'close'` event will be emitted +when the the server is finally closed. + +### server.connections + +Returns the current number of concurrent connections on the server. + +### server.getTicketKeys() + +Returns a `Buffer` instance holding the keys currently used for +encryption/decryption of the [TLS Session Tickets][] + +### server.listen(port[, hostname][, callback]) + +* `port` {number} The TCP/IP port on which to begin listening for connections. + A value of `0` (zero) will assign a random port. +* `hostname` {string} The hostname, IPv4, or IPv6 address on which to begin + listening for connections. If `undefined`, the server will accept connections + on any IPv6 address (`::`) when IPv6 is available, or any IPv4 address + (`0.0.0.0`) otherwise. +* `callback` {Function} A callback function to be invoked when the server has + begun listening the the `port` and `hostname`. + +The `server.listen()` methods instructs the server to begin accepting +connections on the specified `port` and `hostname`. + +This function operates asynchronously. If the `callback` is given, it will be +called when the server has started listening. + +See `net.Server` for more information. + +### server.setTicketKeys(keys) + +* `keys` {Buffer} The keys used for encryption/decryption of the + [TLS Session Tickets][]. + +Updates the keys for encryption/decryption of the [TLS Session Tickets][]. + +*Note*: The key's `Buffer` should be 48 bytes long. See `ticketKeys` option in +[tls.createServer](#tls_tls_createserver_options_secureconnectionlistener) for +more information on how it is used. + +*Note*: Changes to the ticket keys are effective only for future server +connections. Existing or currently pending server connections will use the +previous keys. + + +## Class: tls.TLSSocket + +The `tls.TLSSocket` is a subclass of [`net.Socket`][] that performs transparent +encryption of written data and all required TLS negotiation. + +Instances of `tls.TLSSocket` implement the duplex [Stream][] interface. + +*Note*: Methods that return TLS connection metadata (e.g. +[`tls.TLSSocket.getPeerCertificate()`][] will only return data while the +connection is open. + +### new tls.TLSSocket(socket[, options]) + +* `socket` {net.Socket} An instance of [`net.Socket`][] +* `options` {Object} + * `secureContext`: An optional TLS context object from + [`tls.createSecureContext()`][] + * `isServer`: If `true` the TLS socket will be instantiated in server-mode. + Defaults to `false`. + * `server` {net.Server} An optional [`net.Server`][] instance. + * `requestCert`: Optional, see [`tls.createServer()`][] + * `rejectUnauthorized`: Optional, see [`tls.createServer()`][] + * `NPNProtocols`: Optional, see [`tls.createServer()`][] + * `ALPNProtocols`: Optional, see [`tls.createServer()`][] + * `SNICallback`: Optional, see [`tls.createServer()`][] + * `session` {Buffer} An optional `Buffer` instance containing a TLS session. + * `requestOCSP` {boolean} If `true`, specifies that the OCSP status request + extension will be added to the client hello and an `'OCSPResponse'` event + will be emitted on the socket before establishing a secure communication + +Construct a new `tls.TLSSocket` object from an existing TCP socket. + +### Event: 'OCSPResponse' + +The `'OCSPResponse'` event is emitted if the `requestOCSP` option was set +when the `tls.TLSSocket` was created and an OCSP response has been received. +The listener callback is passed a single argument when called: + +* `response` {Buffer} The server's OCSP response + +Typically, the `response` is a digitally signed object from the server's CA that +contains information about server's certificate revocation status. + +### Event: 'secureConnect' + +The `'secureConnect'` event is emitted after the handshaking process for a new +connection has successfully completed. The listener callback will be called +regardless of whether or not the server's certificate has been authorized. It +is the client's responsibility to check the `tlsSocket.authorized` property to +determine if the server certificate was signed by one of the specified CAs. If +`tlsSocket.authorized === false`, then the error can be found by examining the +`tlsSocket.authorizationError` property. If either ALPN or NPN was used, +the `tlsSocket.alpnProtocol` or `tlsSocket.npnProtocol` properties can be +checked to determine the negotiated protocol. + +### tlsSocket.address() + +Returns the bound address, the address family name, and port of the +underlying socket as reported by the operating system. Returns an +object with three properties, e.g., +`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + +### tlsSocket.authorized + +Returns `true` if the peer certificate was signed by one of the CAs specified +when creating the `tls.TLSSocket` instance, otherwise `false`. + +### tlsSocket.authorizationError + +Returns the reason why the peer's certificate was not been verified. This +property is set only when `tlsSocket.authorized === false`. + +### tlsSocket.encrypted + +Always returns `true`. This may be used to distinguish TLS sockets from regular +`net.Socket` instances. + +### tlsSocket.getCipher() + +Returns an object representing the cipher name and the SSL/TLS protocol version +that first defined the cipher. + +For example: `{ name: 'AES256-SHA', version: 'TLSv1/SSLv3' }` + +See `SSL_CIPHER_get_name()` and `SSL_CIPHER_get_version()` in +https://www.openssl.org/docs/manmaster/ssl/SSL_CIPHER_get_name.html for more +information. + +### tlsSocket.getEphemeralKeyInfo() + +Returns an object representing the type, name, and size of parameter of +an ephemeral key exchange in [Perfect Forward Secrecy][] on a client +connection. It returns an empty object when the key exchange is not +ephemeral. As this is only supported on a client socket; `null` is returned +if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The +`name` property is available only when type is 'ECDH'. + +For Example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }` + +### tlsSocket.getPeerCertificate([ detailed ]) + +* `detailed` {boolean} Specify `true` to request that the full certificate + chain with the `issuer` property be returned; `false` to return only the + top certificate without the `issuer` property. + +Returns an object representing the peer's certificate. The returned object has +some properties corresponding to the fields of the certificate. + +For example: + +```text +{ subject: + { C: 'UK', + ST: 'Acknack Ltd', + L: 'Rhys Jones', + O: 'node.js', + OU: 'Test TLS Certificate', + CN: 'localhost' }, + issuerInfo: + { C: 'UK', + ST: 'Acknack Ltd', + L: 'Rhys Jones', + O: 'node.js', + OU: 'Test TLS Certificate', + CN: 'localhost' }, + issuer: + { ... another certificate ... }, + raw: < RAW DER buffer >, + valid_from: 'Nov 11 09:52:22 2009 GMT', + valid_to: 'Nov 6 09:52:22 2029 GMT', + fingerprint: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF', + serialNumber: 'B9B0D332A1AA5635' } +``` + +If the peer does not provide a certificate, `null` or an empty object will be +returned. + +### tlsSocket.getProtocol() + +Returns a string containing the negotiated SSL/TLS protocol version of the +current connection. The value `'unknown'` will be returned for connected +sockets that have not completed the handshaking process. The value `null` will +be returned for server sockets or disconnected client sockets. + +Example responses include: + +* `SSLv3` +* `TLSv1` +* `TLSv1.1` +* `TLSv1.2` +* `unknown` + +See https://www.openssl.org/docs/manmaster/ssl/SSL_get_version.html for more +information. + +### tlsSocket.getSession() + +Returns the ASN.1 encoded TLS session or `undefined` if no session was +negotiated. Can be used to speed up handshake establishment when reconnecting +to the server. + +### tlsSocket.getTLSTicket() + +Returns the TLS session ticket or `undefined` if no session was negotiated. + +*Note*: This only works with client TLS sockets. Useful only for debugging, for +session reuse provide `session` option to [`tls.connect()`][]. + +### tlsSocket.localAddress + +Returns the string representation of the local IP address. + +### tlsSocket.localPort + +Returns the numeric representation of the local port. + +### tlsSocket.remoteAddress + +Returns the string representation of the remote IP address. For example, +`'74.125.127.100'` or `'2001:4860:a005::68'`. + +### tlsSocket.remoteFamily + +Returns the string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + +### tlsSocket.remotePort + +Returns the numeric representation of the remote port. For example, `443`. + +### tlsSocket.renegotiate(options, callback) + +* `options` {Object} + * `rejectUnauthorized` {boolean} + * `requestCert` +* `callback` {Function} A function that will be called when the renegotiation + request has been completed. + +The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. +Upon completion, the `callback` function will be passed a single argument +that is either an `Error` (if the request failed) or `null`. + +*Note*: This method can be used to request a peer's certificate after the +secure connection has been established. + +*Note*: When running as the server, the socket will be destroyed with an error +after `handshakeTimeout` timeout. + +### tlsSocket.setMaxSendFragment(size) + +* `size` {number} The maximum TLS fragment size. Defaults to `16384`. The + maximum value is `16384`. + +The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. +Returns `true` if setting the limit succeeded; `false` otherwise. + +Smaller fragment sizes decrease the buffering latency on the client: larger +fragments are buffered by the TLS layer until the entire fragment is received +and its integrity is verified; large fragments can span multiple roundtrips +and their processing can be delayed due to packet loss or reordering. However, +smaller fragments add extra TLS framing bytes and CPU overhead, which may +decrease overall server throughput. + + +## tls.connect(options[, callback]) + +* `options` {Object} + * `host` {string} Host the client should connect to. + * `port` {number} Port the client should connect to. + * `socket` {net.Socket} Establish secure connection on a given socket rather + than creating a new socket. If this option is specified, `host` and `port` + are ignored. + * `path` {string} Creates unix socket connection to path. If this option is + specified, `host` and `port` are ignored. + * `pfx` {string|Buffer} A string or `Buffer` containing the private key, + certificate, and CA certs of the client in PFX or PKCS12 format. + * `key` {string|stringp[]|Buffer|Buffer[]} A string, `Buffer`, array of + strings, or array of `Buffer`s containing the private key of the client in + PEM format. + * `passphrase` {string} A string containing the passphrase for the private key + or pfx. + * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of + strings, or array of `Buffer`s containing the certificate key of the client + in PEM format. + * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings, + or array of `Buffer`s of trusted certificates in PEM format. If this is + omitted several well known "root" CAs (like VeriSign) will be used. These + are used to authorize connections. + * `ciphers` {string} A string describing the ciphers to use or exclude, + separated by `:`. Uses the same default cipher suite as + [`tls.createServer()`][]. + * `rejectUnauthorized` {boolean} If `true`, the server certificate is verified + against the list of supplied CAs. An `'error'` event is emitted if + verification fails; `err.code` contains the OpenSSL error code. Defaults to + `true`. + * `NPNProtocols` {string[]|Buffer[]} An array of strings or `Buffer`s + containing supported NPN protocols. `Buffer`s should have the format + `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first + byte is the length of the next protocol name. Passing an array is usually + much simpler, e.g. `['hello', 'world']`. + * `ALPNProtocols`: {string[]|Buffer[]} An array of strings or `Buffer`s + containing the supported ALPN protocols. `Buffer`s should have the format + `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte + is the length of the next protocol name. Passing an array is usually much + simpler: `['hello', 'world']`.) + * `servername`: {string} Server name for the SNI (Server Name Indication) TLS + extension. + * `checkServerIdentity(servername, cert)` {Function} A callback function + to be used when checking the server's hostname against the certificate. + This should throw an error if verification fails. The method should return + `undefined` if the `servername` and `cert` are verified. + * `secureProtocol` {string} The SSL method to use, e.g., `SSLv3_method` to + force SSL version 3. The possible values depend on the version of OpenSSL + installed in the environment and are defined in the constant + [SSL_METHODS][]. + * `secureContext` {object} An optional TLS context object as returned by from + `tls.createSecureContext( ... )`. It can be used for caching client + certificates, keys, and CA certificates. + * `session` {Buffer} A `Buffer` instance, containing TLS session. + * `minDHSize` {number} Minimum size of the DH parameter in bits to accept a + TLS connection. When a server offers a DH parameter with a size less + than `minDHSize`, the TLS connection is destroyed and an error is thrown. + Defaults to `1024`. +* `callback` {Function} + +Creates a new client connection to the given `options.port` and `options.host` +If `options.host` is omitted, it defaults to `localhost`. + +The `callback` function, if specified, will be added as a listener for the +[`'secureConnect'`][] event. + +`tls.connect()` returns a [`tls.TLSSocket`][] object. + +## tls.connect(port[, host][, options][, callback]) + +* `port` {number} +* `host` {string} +* `options` {Object} + * `host` {string} Host the client should connect to. + * `port` {number} Port the client should connect to. + * `socket` {net.Socket} Establish secure connection on a given socket rather + than creating a new socket. If this option is specified, `host` and `port` + are ignored. + * `path` {string} Creates unix socket connection to path. If this option is + specified, `host` and `port` are ignored. + * `pfx` {string|Buffer} A string or `Buffer` containing the private key, + certificate, and CA certs of the client in PFX or PKCS12 format. + * `key` {string|stringp[]|Buffer|Buffer[]} A string, `Buffer`, array of + strings, or array of `Buffer`s containing the private key of the client in + PEM format. + * `passphrase` {string} A string containing the passphrase for the private key + or pfx. + * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of + strings, or array of `Buffer`s containing the certificate key of the client + in PEM format. + * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings, + or array of `Buffer`s of trusted certificates in PEM format. If this is + omitted several well known "root" CAs (like VeriSign) will be used. These + are used to authorize connections. + * `ciphers` {string} A string describing the ciphers to use or exclude, + separated by `:`. Uses the same default cipher suite as + [`tls.createServer()`][]. + * `rejectUnauthorized` {boolean} If `true`, the server certificate is verified + against the list of supplied CAs. An `'error'` event is emitted if + verification fails; `err.code` contains the OpenSSL error code. Defaults to + `true`. + * `NPNProtocols` {string[]|Buffer[]} An array of strings or `Buffer`s + containing supported NPN protocols. `Buffer`s should have the format + `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first + byte is the length of the next protocol name. Passing an array is usually + much simpler, e.g. `['hello', 'world']`. + * `ALPNProtocols`: {string[]|Buffer[]} An array of strings or `Buffer`s + containing the supported ALPN protocols. `Buffer`s should have the format + `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte + is the length of the next protocol name. Passing an array is usually much + simpler: `['hello', 'world']`.) + * `servername`: {string} Server name for the SNI (Server Name Indication) TLS + extension. + * `checkServerIdentity(servername, cert)` {Function} A callback function + to be used when checking the server's hostname against the certificate. + This should throw an error if verification fails. The method should return + `undefined` if the `servername` and `cert` are verified. + * `secureProtocol` {string} The SSL method to use, e.g., `SSLv3_method` to + force SSL version 3. The possible values depend on the version of OpenSSL + installed in the environment and are defined in the constant + [SSL_METHODS][]. + * `secureContext` {object} An optional TLS context object as returned by from + `tls.createSecureContext( ... )`. It can be used for caching client + certificates, keys, and CA certificates. + * `session` {Buffer} A `Buffer` instance, containing TLS session. + * `minDHSize` {number} Minimum size of the DH parameter in bits to accept a + TLS connection. When a server offers a DH parameter with a size less + than `minDHSize`, the TLS connection is destroyed and an error is thrown. + Defaults to `1024`. +* `callback` {Function} + +Creates a new client connection to the given `port` and `host` or +`options.port` and `options.host`. (If `host` is omitted, it defaults to +`localhost`.) + +The `callback` function, if specified, will be added as a listener for the +[`'secureConnect'`][] event. + +`tls.connect()` returns a [`tls.TLSSocket`][] object. + +The following implements a simple "echo server" example: + +```js +const tls = require('tls'); +const fs = require('fs'); + +const options = { + // Necessary only if using the client certificate authentication + key: fs.readFileSync('client-key.pem'), + cert: fs.readFileSync('client-cert.pem'), + + // Necessary only if the server uses the self-signed certificate + ca: [ fs.readFileSync('server-cert.pem') ] +}; + +const socket = tls.connect(8000, options, () => { + console.log('client connected', + socket.authorized ? 'authorized' : 'unauthorized'); + process.stdin.pipe(socket); + process.stdin.resume(); +}); +socket.setEncoding('utf8'); +socket.on('data', (data) => { + console.log(data); +}); +socket.on('end', () => { + server.close(); +}); +``` + +Or + +```js +const tls = require('tls'); +const fs = require('fs'); + +const options = { + pfx: fs.readFileSync('client.pfx') +}; + +const socket = tls.connect(8000, options, () => { + console.log('client connected', + socket.authorized ? 'authorized' : 'unauthorized'); + process.stdin.pipe(socket); + process.stdin.resume(); +}); +socket.setEncoding('utf8'); +socket.on('data', (data) => { + console.log(data); +}); +socket.on('end', () => { + server.close(); +}); +``` + + +## tls.createSecureContext(options) + +* `options` {Object} + * `pfx` {string|Buffer} A string or `Buffer` holding the PFX or PKCS12 encoded + private key, certificate, and CA certificates. + * `key` {string|string[]|Buffer|Object[]} The private key of the server in + PEM format. To support multiple keys using different algorithms, an array + can be provided either as an array of key strings or as an array of objects + in the format `{pem: key, passphrase: passphrase}`. This option is + *required* for ciphers that make use of private keys. + * `passphrase` {string} A string containing the passphrase for the private key + or pfx. + * `cert` {string} A string containing the PEM encoded certificate + * `ca`{string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings, + or array of `Buffer`s of trusted certificates in PEM format. If omitted, + several well known "root" CAs (like VeriSign) will be used. These are used + to authorize connections. + * `crl` {string|string[]} Either a string or array of strings of PEM encoded + CRLs (Certificate Revocation List). + * `ciphers` {string} A string describing the ciphers to use or exclude. + Consult + + for details on the format. + * `honorCipherOrder` {boolean} If `true`, when a cipher is being selected, + the server's preferences will be used instead of the client preferences. + +The `tls.createSecureContext()` method creates a credentials object. + +If the 'ca' option is not given, then Node.js will use the default +publicly trusted list of CAs as given in +. + + +## tls.createServer(options[, secureConnectionListener]) + +* `options` {Object} + * `pfx` {string|Buffer} A string or `Buffer` containing the private key, + certificate and CA certs of the server in PFX or PKCS12 format. (Mutually + exclusive with the `key`, `cert`, and `ca` options.) + * `key` {string|string[]|Buffer|Object[]} The private key of the server in + PEM format. To support multiple keys using different algorithms an array can + be provided either as a plain array of key strings or an array of objects + in the format `{pem: key, passphrase: passphrase}`. This option is + *required* for ciphers that make use of private keys. + * `passphrase` {string} A string containing the passphrase for the private + key or pfx. + * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of + strings, or array of `Buffer`s containing the certificate key of the server + in PEM format. (Required) + * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings, + or array of `Buffer`s of trusted certificates in PEM format. If this is + omitted several well known "root" CAs (like VeriSign) will be used. These + are used to authorize connections. + * `crl` {string|string[]} Either a string or array of strings of PEM encoded + CRLs (Certificate Revocation List). + * `ciphers` {string} A string describing the ciphers to use or exclude, + separated by `:`. + * `ecdhCurve` {string} A string describing a named curve to use for ECDH key + agreement or `false` to disable ECDH. Defaults to `prime256v1` (NIST P-256). + Use [`crypto.getCurves()`][] to obtain a list of available curve names. On + recent releases, `openssl ecparam -list_curves` will also display the name + and description of each available elliptic curve. + * `dhparam` {string|Buffer} A string or `Buffer` containing Diffie Hellman + parameters, required for [Perfect Forward Secrecy][]. Use + `openssl dhparam` to create the parameters. The key length must be greater + than or equal to 1024 bits, otherwise an error will be thrown. It is + strongly recommended to use 2048 bits or larger for stronger security. If + omitted or invalid, the parameters are silently discarded and DHE ciphers + will not be available. + * `handshakeTimeout` {number} Abort the connection if the SSL/TLS handshake + does not finish in the specified number of milliseconds. Defaults to `120` + seconds. A `'clientError'` is emitted on the `tls.Server` object whenever a + handshake times out. + * `honorCipherOrder` {boolean} When choosing a cipher, use the server's + preferences instead of the client preferences. Defaults to `true`. + * `requestCert` {boolean} If `true` the server will request a certificate from + clients that connect and attempt to verify that certificate. Defaults to + `false`. + * `rejectUnauthorized` {boolean} If `true` the server will reject any + connection which is not authorized with the list of supplied CAs. This + option only has an effect if `requestCert` is `true`. Defaults to `false`. + * `NPNProtocols` {string[]|Buffer} An array of strings or a `Buffer` naming + possible NPN protocols. (Protocols should be ordered by their priority.) + * `ALPNProtocols` {string[]|Buffer} An array of strings or a `Buffer` naming + possible ALPN protocols. (Protocols should be ordered by their priority.) + When the server receives both NPN and ALPN extensions from the client, + ALPN takes precedence over NPN and the server does not send an NPN + extension to the client. + * `SNICallback(servername, cb)` {Function} A function that will be called if + the client supports SNI TLS extension. Two arguments will be passed when + called: `servername` and `cb`. `SNICallback` should invoke `cb(null, ctx)`, + where `ctx` is a SecureContext instance. (`tls.createSecureContext(...)` can + be used to get a proper SecureContext.) If `SNICallback` wasn't provided the + default callback with high-level API will be used (see below). + * `sessionTimeout` {number} An integer specifying the number of seconds after + which the TLS session identifiers and TLS session tickets created by the + server will time out. See [SSL_CTX_set_timeout] for more details. + * `ticketKeys`: A 48-byte `Buffer` instance consisting of a 16-byte prefix, + a 16-byte HMAC key, and a 16-byte AES key. This can be used to accept TLS + session tickets on multiple instances of the TLS server. *Note* that this is + automatically shared between `cluster` module workers. + * `sessionIdContext` {string} A string containing an opaque identifier for + session resumption. If `requestCert` is `true`, the default is a 128 bit + truncated SHA1 hash value generated from the command-line. Otherwise, a + default is not provided. + * `secureProtocol` {string} The SSL method to use, e.g., `SSLv3_method` to + force SSL version 3. The possible values depend on the version of OpenSSL + installed in the environment and are defined in the constant + [SSL_METHODS][]. +* `secureConnectionListener` {Function} + +Creates a new [tls.Server][]. The `secureConnectionListener`, if provided, is +automatically set as a listener for the [`'secureConnection'`][] event. + +For the `ciphers` option, the default cipher suite is: + +```text +ECDHE-RSA-AES128-GCM-SHA256: +ECDHE-ECDSA-AES128-GCM-SHA256: +ECDHE-RSA-AES256-GCM-SHA384: +ECDHE-ECDSA-AES256-GCM-SHA384: +DHE-RSA-AES128-GCM-SHA256: +ECDHE-RSA-AES128-SHA256: +DHE-RSA-AES128-SHA256: +ECDHE-RSA-AES256-SHA384: +DHE-RSA-AES256-SHA384: +ECDHE-RSA-AES256-SHA256: +DHE-RSA-AES256-SHA256: +HIGH: +!aNULL: +!eNULL: +!EXPORT: +!DES: +!RC4: +!MD5: +!PSK: +!SRP: +!CAMELLIA +``` + +The default cipher suite prefers GCM ciphers for [Chrome's 'modern +cryptography' setting] and also prefers ECDHE and DHE ciphers for Perfect +Forward Secrecy, while offering *some* backward compatibility. + +128 bit AES is preferred over 192 and 256 bit AES in light of [specific +attacks affecting larger AES key sizes]. + +Old clients that rely on insecure and deprecated RC4 or DES-based ciphers +(like Internet Explorer 6) cannot complete the handshaking process with +the default configuration. If these clients _must_ be supported, the +[TLS recommendations] may offer a compatible cipher suite. For more details +on the format, see the [OpenSSL cipher list format documentation]. + +The following illustrates a simple echo server: + +```js +const tls = require('tls'); +const fs = require('fs'); + +const options = { + key: fs.readFileSync('server-key.pem'), + cert: fs.readFileSync('server-cert.pem'), + + // This is necessary only if using the client certificate authentication. + requestCert: true, + + // This is necessary only if the client uses the self-signed certificate. + ca: [ fs.readFileSync('client-cert.pem') ] +}; + +const server = tls.createServer(options, (socket) => { + console.log('server connected', + socket.authorized ? 'authorized' : 'unauthorized'); + socket.write('welcome!\n'); + socket.setEncoding('utf8'); + socket.pipe(socket); +}); +server.listen(8000, () => { + console.log('server bound'); +}); +``` + +Or + +```js +const tls = require('tls'); +const fs = require('fs'); + +const options = { + pfx: fs.readFileSync('server.pfx'), + + // This is necessary only if using the client certificate authentication. + requestCert: true, + +}; + +const server = tls.createServer(options, (socket) => { + console.log('server connected', + socket.authorized ? 'authorized' : 'unauthorized'); + socket.write('welcome!\n'); + socket.setEncoding('utf8'); + socket.pipe(socket); +}); +server.listen(8000, () => { + console.log('server bound'); +}); +``` + +This server can be tested by connecting to it using `openssl s_client`: + +``` +openssl s_client -connect 127.0.0.1:8000 +``` + +## tls.getCiphers() + +Returns an array with the names of the supported SSL ciphers. + +For example: + +```js +console.log(tls.getCiphers()); // ['AES128-SHA', 'AES256-SHA', ...] +``` + +## Deprecated APIs + +### Class: CryptoStream + + Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +The `tls.CryptoStream` class represents a stream of encrypted data. This class +has been deprecated and should no longer be used. + +#### cryptoStream.bytesWritten + +The `cryptoStream.bytesWritten` property returns the total number of bytes +written to the underlying socket *including* the bytes required for the +implementation of the TLS protocol. + +### Class: SecurePair + + Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +Returned by `tls.createSecurePair()`. + +#### Event: 'secure' + +The `'secure'` event is emitted by the `SecurePair` object once a secure +connection has been established. + +As with checking for the server [`secureConnection`](#tls_event_secureconnection) +event, `pair.cleartext.authorized` should be inspected to confirm whether the +certificate used is properly authorized. + +## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) + + Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead. + +* `context` {Object} A secure context object as returned by + `tls.createSecureContext()` +* `isServer` {boolean} `true` to specify that this TLS connection should be + opened as a server. +* `requestCert` {boolean} `true` to specify whether a server should request a + certificate from a connecting client. Only applies when `isServer` is `true`. +* `rejectUnauthorized` {boolean} `true` to specify whether a server should + automatically reject clients with invalid certificates. Only applies when + `isServer` is `true`. +* `options` + * `secureContext`: An optional TLS context object from + [`tls.createSecureContext()`][] + * `isServer`: If `true` the TLS socket will be instantiated in server-mode. + Defaults to `false`. + * `server` {net.Server} An optional [`net.Server`][] instance + * `requestCert`: Optional, see [`tls.createServer()`][] + * `rejectUnauthorized`: Optional, see [`tls.createServer()`][] + * `NPNProtocols`: Optional, see [`tls.createServer()`][] + * `ALPNProtocols`: Optional, see [`tls.createServer()`][] + * `SNICallback`: Optional, see [`tls.createServer()`][] + * `session` {Buffer} An optional `Buffer` instance containing a TLS session. + * `requestOCSP` {boolean} If `true`, specifies that the OCSP status request + extension will be added to the client hello and an `'OCSPResponse'` event + will be emitted on the socket before establishing a secure communication + +Creates a new secure pair object with two streams, one of which reads and writes +the encrypted data and the other of which reads and writes the cleartext data. +Generally, the encrypted stream is piped to/from an incoming encrypted data +stream and the cleartext one is used as a replacement for the initial encrypted +stream. + +`tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and +`encrypted` stream properties. + +*Note*: `cleartext` has the same API as [`tls.TLSSocket`][]. + +*Note*: The `tls.createSecurePair()` method is now deprecated in favor of +`tls.TLSSocket()`. For example, the code: + +```js +pair = tls.createSecurePair( ... ); +pair.encrypted.pipe(socket); +socket.pipe(pair.encrypted); +``` + +can be replaced by: + +```js +secure_socket = tls.TLSSocket(socket, options); +``` + +where `secure_socket` has the same API as `pair.cleartext`. + +[OpenSSL cipher list format documentation]: https://www.openssl.org/docs/apps/ciphers.html#CIPHER-LIST-FORMAT +[Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites +[specific attacks affecting larger AES key sizes]: https://www.schneier.com/blog/archives/2009/07/another_new_aes.html +[BEAST attacks]: https://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html +[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves +[`tls.createServer()`]: #tls_tls_createserver_options_secureconnectionlistener +[`tls.createSecurePair()`]: #tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options +[`tls.TLSSocket`]: #tls_class_tls_tlssocket +[`net.Server`]: net.html#net_class_net_server +[`net.Socket`]: net.html#net_class_net_socket +[`net.Server.address()`]: net.html#net_server_address +[`'secureConnect'`]: #tls_event_secureconnect +[`'secureConnection'`]: #tls_event_secureconnection +[Perfect Forward Secrecy]: #tls_perfect_forward_secrecy +[Stream]: stream.html#stream_stream +[SSL_METHODS]: https://www.openssl.org/docs/ssl/ssl.html#DEALING-WITH-PROTOCOL-METHODS +[tls.Server]: #tls_class_tls_server +[SSL_CTX_set_timeout]: https://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html +[RFC 4492]: https://www.rfc-editor.org/rfc/rfc4492.txt +[Forward secrecy]: https://en.wikipedia.org/wiki/Perfect_forward_secrecy +[DHE]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange +[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman +[asn1.js]: https://npmjs.org/package/asn1.js +[OCSP request]: https://en.wikipedia.org/wiki/OCSP_stapling +[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS +[TLS Session Tickets]: https://www.ietf.org/rfc/rfc5077.txt +[`tls.TLSSocket.getPeerCertificate()`]: #tls_tlssocket_getpeercertificate_detailed +[`tls.createSecureContext()`]: #tls_tls_createsecurecontext_options +[`tls.connect()`]: #tls_tls_connect_options_callback diff --git a/doc/api/tty.markdown b/doc/api/tty.markdown deleted file mode 100644 index 770990a8dee651..00000000000000 --- a/doc/api/tty.markdown +++ /dev/null @@ -1,72 +0,0 @@ -# TTY - - Stability: 2 - Stable - -The `tty` module houses the `tty.ReadStream` and `tty.WriteStream` classes. In -most cases, you will not need to use this module directly. - -When Node.js detects that it is being run inside a TTY context, then `process.stdin` -will be a `tty.ReadStream` instance and `process.stdout` will be -a `tty.WriteStream` instance. The preferred way to check if Node.js is being run -in a TTY context is to check `process.stdout.isTTY`: - -``` -$ node -p -e "Boolean(process.stdout.isTTY)" -true -$ node -p -e "Boolean(process.stdout.isTTY)" | cat -false -``` - -## Class: ReadStream - -A `net.Socket` subclass that represents the readable portion of a tty. In normal -circumstances, `process.stdin` will be the only `tty.ReadStream` instance in any -Node.js program (only when `isatty(0)` is true). - -### rs.isRaw - -A `Boolean` that is initialized to `false`. It represents the current "raw" state -of the `tty.ReadStream` instance. - -### rs.setRawMode(mode) - -`mode` should be `true` or `false`. This sets the properties of the -`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set -to the resulting mode. - -## Class: WriteStream - -A `net.Socket` subclass that represents the writable portion of a tty. In normal -circumstances, `process.stdout` will be the only `tty.WriteStream` instance -ever created (and only when `isatty(1)` is true). - -### Event: 'resize' - -`function () {}` - -Emitted by `refreshSize()` when either of the `columns` or `rows` properties -has changed. - -```js -process.stdout.on('resize', () => { - console.log('screen size has changed!'); - console.log(`${process.stdout.columns}x${process.stdout.rows}`); -}); -``` - -### ws.columns - -A `Number` that gives the number of columns the TTY currently has. This property -gets updated on `'resize'` events. - -### ws.rows - -A `Number` that gives the number of rows the TTY currently has. This property -gets updated on `'resize'` events. - -## tty.isatty(fd) - -Returns `true` or `false` depending on if the `fd` is associated with a -terminal. - -[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode diff --git a/doc/api/tty.md b/doc/api/tty.md new file mode 100644 index 00000000000000..ca5f2aacea7258 --- /dev/null +++ b/doc/api/tty.md @@ -0,0 +1,110 @@ +# TTY + + Stability: 2 - Stable + +The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. +In most cases, it will not be necessary or possible to use this module directly. +However, it can be accessed using: + +```js +const tty = require('tty'); +``` + +When Node.js detects that it is being run inside a text terminal ("TTY") +context, the `process.stdin` will, by default, be initialized as an instance of +`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by +default be instances of `tty.WriteStream`. The preferred method of determining +whether Node.js is being run within a TTY context is to check that the value of +the `process.stdout.isTTY` property is `true`: + +``` +$ node -p -e "Boolean(process.stdout.isTTY)" +true +$ node -p -e "Boolean(process.stdout.isTTY)" | cat +false +``` + +In most cases, there should be little to no reason for an application to +create instances of the `tty.ReadStream` and `tty.WriteStream` classes. + +## Class: tty.ReadStream + + +The `tty.ReadStream` class is a subclass of `net.Socket` that represents the +readable side of a TTY. In normal circumstances `process.stdin` will be the +only `tty.ReadStream` instance in a Node.js process and there should be no +reason to create additional instances. + +### readStream.isRaw + + +A `boolean` that is `true` if the TTY is currently configured to operate as a +raw device. Defaults to `false`. + +### readStream.setRawMode(mode) + + +* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a + raw device. If `false`, configures the `tty.ReadStream` to operate in its + default mode. The `readStream.isRaw` property will be set to the resulting + mode. + +## Class: tty.WriteStream + + +The `tty.WriteStream` class is a subclass of `net.Socket` that represents the +writable side of a TTY. In normal circumstances, `process.stdout` and +`process.stderr` will be the only `tty.WriteStream` instances created for a +Node.js process and there should be no reason to create additional instances. + +### Event: 'resize' + + +The `'resize'` event is emitted whenever either of the `writeStream.columns` +or `writeStream.rows` properties have changed. No arguments are passed to the +listener callback when called. + +```js +process.stdout.on('resize', () => { + console.log('screen size has changed!'); + console.log(`${process.stdout.columns}x${process.stdout.rows}`); +}); +``` + +### writeStream.columns + + +A `number` specifying the number of columns the TTY currently has. This property +is updated whenever the `'resize'` event is emitted. + +### writeStream.rows + + +A `number` specifying the number of rows the TTY currently has. This property +is updated whenever the `'resize'` event is emitted. + +## tty.isatty(fd) + + +* `fd` {number} A numeric file descriptor + +The `tty.isatty()` method returns `true` if the given `fd` is associated with +a TTY and `false` if is not. + +[tty.ReadStream#setRawMode]: #tty_readstream_setrawmode_mode diff --git a/doc/api/url.markdown b/doc/api/url.markdown deleted file mode 100644 index ab29c500d80335..00000000000000 --- a/doc/api/url.markdown +++ /dev/null @@ -1,131 +0,0 @@ -# URL - - Stability: 2 - Stable - -This module has utilities for URL resolution and parsing. -Call `require('url')` to use it. - -## URL Parsing - -Parsed URL objects have some or all of the following fields, depending on -whether or not they exist in the URL string. Any parts that are not in the URL -string will not be in the parsed object. Examples are shown for the URL - -`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - -* `href`: The full URL that was originally parsed. Both the protocol and host are lowercased. - - Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - -* `protocol`: The request protocol, lowercased. - - Example: `'http:'` - -* `slashes`: The protocol requires slashes after the colon. - - Example: true or false - -* `host`: The full lowercased host portion of the URL, including port - information. - - Example: `'host.com:8080'` - -* `auth`: The authentication information portion of a URL. - - Example: `'user:pass'` - -* `hostname`: Just the lowercased hostname portion of the host. - - Example: `'host.com'` - -* `port`: The port number portion of the host. - - Example: `'8080'` - -* `pathname`: The path section of the URL, that comes after the host and - before the query, including the initial slash if present. No decoding is - performed. - - Example: `'/p/a/t/h'` - -* `search`: The 'query string' portion of the URL, including the leading - question mark. - - Example: `'?query=string'` - -* `path`: Concatenation of `pathname` and `search`. No decoding is performed. - - Example: `'/p/a/t/h?query=string'` - -* `query`: Either the 'params' portion of the query string, or a - querystring-parsed object. - - Example: `'query=string'` or `{'query':'string'}` - -* `hash`: The 'fragment' portion of the URL including the pound-sign. - - Example: `'#hash'` - -### Escaped Characters - -Spaces (`' '`) and the following characters will be automatically escaped in the -properties of URL objects: - -``` -< > " ` \r \n \t { } | \ ^ ' -``` - ---- - -The following methods are provided by the URL module: - -## url.format(urlObj) - -Take a parsed URL object, and return a formatted URL string. - -Here's how the formatting process works: - -* `href` will be ignored. -* `path` will be ignored. -* `protocol` is treated the same with or without the trailing `:` (colon). - * The protocols `http`, `https`, `ftp`, `gopher`, `file` will be - postfixed with `://` (colon-slash-slash) as long as `host`/`hostname` are present. - * All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will - be postfixed with `:` (colon). -* `slashes` set to `true` if the protocol requires `://` (colon-slash-slash) - * Only needs to be set for protocols not previously listed as requiring - slashes, such as `mongodb://localhost:8000/`, or if `host`/`hostname` are absent. -* `auth` will be used if present. -* `hostname` will only be used if `host` is absent. -* `port` will only be used if `host` is absent. -* `host` will be used in place of `hostname` and `port`. -* `pathname` is treated the same with or without the leading `/` (slash). -* `query` (object; see `querystring`) will only be used if `search` is absent. -* `search` will be used in place of `query`. - * It is treated the same with or without the leading `?` (question mark). -* `hash` is treated the same with or without the leading `#` (pound sign, anchor). - -## url.parse(urlStr[, parseQueryString][, slashesDenoteHost]) - -Take a URL string, and return an object. - -Pass `true` as the second argument to also parse the query string using the -`querystring` module. If `true` then the `query` property will always be -assigned an object, and the `search` property will always be a (possibly -empty) string. If `false` then the `query` property will not be parsed or -decoded. Defaults to `false`. - -Pass `true` as the third argument to treat `//foo/bar` as -`{ host: 'foo', pathname: '/bar' }` rather than -`{ pathname: '//foo/bar' }`. Defaults to `false`. - -## url.resolve(from, to) - -Take a base URL, and a href URL, and resolve them as a browser would for -an anchor tag. Examples: - -```js -url.resolve('/one/two/three', 'four') // '/one/two/four' -url.resolve('http://example.com/', '/one') // 'http://example.com/one' -url.resolve('http://example.com/one', '/two') // 'http://example.com/two' -``` diff --git a/doc/api/url.md b/doc/api/url.md new file mode 100644 index 00000000000000..c041f9bd8f2136 --- /dev/null +++ b/doc/api/url.md @@ -0,0 +1,249 @@ +# URL + + Stability: 2 - Stable + +The `url` module provides utilities for URL resolution and parsing. It can be +accessed using: + +```js +const url = require('url'); +``` + +## URL Strings and URL Objects + +A URL string is a structured string containing multiple meaningful components. +When parsed, a URL object is returned containing properties for each of these +components. + +The following details each of the components of a parsed URL. The example +`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` is used to +illustrate each. + +``` +┌─────────────────────────────────────────────────────────────────────────────┐ +│ href │ +├──────────┬┬───────────┬─────────────────┬───────────────────────────┬───────┤ +│ protocol ││ auth │ host │ path │ hash │ +│ ││ ├──────────┬──────┼──────────┬────────────────┤ │ +│ ││ │ hostname │ port │ pathname │ search │ │ +│ ││ │ │ │ ├─┬──────────────┤ │ +│ ││ │ │ │ │ │ query │ │ +" http: // user:pass @ host.com : 8080 /p/a/t/h ? query=string #hash " +│ ││ │ │ │ │ │ │ │ +└──────────┴┴───────────┴──────────┴──────┴──────────┴─┴──────────────┴───────┘ +(all spaces in the "" line should be ignored -- they're purely for formatting) +``` + +### urlObject.href + +The `href` property is the full URL string that was parsed with both the +`protocol` and `host` components converted to lower-case. + +For example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +### urlObject.protocol + +The `protocol` property identifies the URL's lower-cased protocol scheme. + +For example: `'http:'` + +### urlObject.slashes + +The `slashes` property is a `boolean` with a value of `true` if two ASCII +forward-slash characters (`/`) are required following the colon in the +`protocol`. + +### urlObject.host + +The `host` property is the full lower-cased host portion of the URL, including +the `port` if specified. + +For example: `'host.com:8080'` + +### urlObject.auth + +The `auth` property is the username and password portion of the URL, also +referred to as "userinfo". This string subset follows the `protocol` and +double slashes (if present) and preceeds the `host` component, delimited by an +ASCII "at sign" (`@`). The format of the string is `{username}[:{password}]`, +with the `[:{password}]` portion being optional. + +For example: `'user:pass'` + +### urlObject.hostname + +The `hostname` property is the lower-cased host name portion of the `host` +component *without* the `port` included. + +For example: `'host.com'` + +### urlObject.port + +The `port` property is the numeric port portion of the `host` component. + +For example: `'8080'` + +### urlObject.pathname + +The `pathname` property consists of the entire path section of the URL. This +is everything following the `host` (including the `port`) and before the start +of the `query` or `hash` components, delimited by either the ASCII question +mark (`?`) or hash (`#`) characters. + +For example `'/p/a/t/h'` + +No decoding of the path string is performed. + +### urlObject.search + +The `search` property consists of the entire "query string" portion of the +URL, including the leading ASCII question mark (`?`) character. + +For example: `'?query=string'` + +No decoding of the query string is performed. + +### urlObject.path + +The `path` property is a concatenation of the `pathname` and `search` +components. + +For example: `'/p/a/t/h?query=string'` + +No decoding of the `path` is performed. + +### urlObject.query + +The `query` property is either the "params" portion of the query string ( +everything *except* the leading ASCII question mark (`?`), or an object +returned by the [`querystring`][] module's `parse()` method: + +For example: `'query=string'` or `{'query': 'string'}` + +If returned as a string, no decoding of the query string is performed. If +returned as an object, both keys and values are decoded. + +### urlObject.hash + +The `hash` property consists of the "fragment" portion of the URL including +the leading ASCII hash (`#`) character. + +For example: `'#hash'` + +## url.format(urlObject) + + +* `urlObject` {Object} A URL object (either as returned by `url.parse()` or + constructed otherwise). + +The `url.format()` method processes the given URL object and returns a formatted +URL string. + +The formatting process essentially operates as follows: + +* A new empty string `result` is created. +* If `urlObject.protocol` is a string, it is appended as-is to `result`. +* Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an + [`Error`][] is thrown. +* For all string values of `urlObject.protocol` that *do not end* with an ASCII + colon (`:`) character, the literal string `:` will be appended to `result`. +* If either the `urlObject.slashes` property is true, `urlObject.protocol` + begins with one of `http`, `https`, `ftp`, `gopher`, or `file`, or + `urlObject.protocol` is `undefined`, the literal string `//` will be appended + to `result`. +* If the value of the `urlObject.auth` property is truthy, and either + `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of + `urlObject.auth` will be coerced into a string and appended to `result` + followed by the literal string `@`. +* If the `urlObject.host` property is `undefined` then: + * If the `urlObject.hostname` is a string, it is appended to `result`. + * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + an [`Error`][] is thrown. + * If the `urlObject.port` property value is truthy, and `urlObject.hostname` + is not `undefined`: + * The literal string `:` is appended to `result`, and + * The value of `urlObject.port` is coerced to a string and appended to + `result`. +* Otherwise, if the `urlObject.host` property value is truthy, the value of + `urlObject.host` is coerced to a string and appended to `result`. +* If the `urlObject.pathname` property is a string that is not an empty string: + * If the `urlObject.pathname` *does not start* with an ASCII forward slash + (`/`), then the literal string '/' is appended to `result`. + * The value of `urlObject.pathname` is appended to `result`. +* Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an + [`Error`][] is thrown. +* If the `urlObject.search` property is `undefined` and if the `urlObject.query` + property is an `Object`, the literal string `?` is appended to `result` + followed by the output of calling the [`querystring`][] module's `stringify()` + method passing the value of `urlObject.query`. +* Otherwise, if `urlObject.search` is a string: + * If the value of `urlObject.search` *does not start* with the ASCII question + mark (`?`) character, the literal string `?` is appended to `result`. + * The value of `urlObject.search` is appended to `result`. +* Otherwise, if `urlObject.search` is not `undefined` and is not a string, an + [`Error`][] is thrown. +* If the `urlObject.hash` property is a string: + * If the value of `urlObject.hash` *does not start* with the ASCII hash (`#`) + character, the literal string `#` is appended to `result`. + * The value of `urlObject.hash` is appended to `result`. +* Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + string, an [`Error`][] is thrown. +* `result` is returned. + + +## url.parse(urlString[, parseQueryString[, slashesDenoteHost]]) + + +* `urlString` {string} The URL string to parse. +* `parseQueryString` {boolean} If `true`, the `query` property will always + be set to an object returned by the [`querystring`][] module's `parse()` + method. If `false`, the `query` property on the returned URL object will be an + unparsed, undecoded string. Defaults to `false`. +* `slashesDenoteHost` {boolean} If `true`, the first token after the literal + string `//` and preceeding the next `/` will be interpreted as the `host`. + For instance, given `//foo/bar`, the result would be + `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + Defaults to `false`. + +The `url.parse()` method takes a URL string, parses it, and returns a URL +object. + +## url.resolve(from, to) + + +* `from` {string} The Base URL being resolved against. +* `to` {string} The HREF URL being resolved. + +The `url.resolve()` method resolves a target URL relative to a base URL in a +manner similar to that of a Web browser resolving an anchor tag HREF. + +For example: + +```js +url.resolve('/one/two/three', 'four') // '/one/two/four' +url.resolve('http://example.com/', '/one') // 'http://example.com/one' +url.resolve('http://example.com/one', '/two') // 'http://example.com/two' +``` + +## Escaped Characters + +URLs are only permitted to contain a certain range of characters. Spaces (`' '`) +and the following characters will be automatically escaped in the +properties of URL objects: + +``` +< > " ` \r \n \t { } | \ ^ ' +``` + +For example, the ASCII space character (`' '`) is encoded as `%20`. The ASCII +forward slash (`/`) character is encoded as `%3C`. + + +[`Error`]: errors.html#errors_class_error +[`querystring`]: querystring.html diff --git a/doc/api/util.markdown b/doc/api/util.markdown deleted file mode 100644 index c059be8c0dd027..00000000000000 --- a/doc/api/util.markdown +++ /dev/null @@ -1,587 +0,0 @@ -# util - - Stability: 2 - Stable - -These functions are in the module `'util'`. Use `require('util')` to -access them. - -The `util` module is primarily designed to support the needs of Node.js's -internal APIs. Many of these utilities are useful for your own -programs. If you find that these functions are lacking for your -purposes, however, you are encouraged to write your own utilities. We -are not interested in any future additions to the `util` module that -are unnecessary for Node.js's internal functionality. - -## util.debug(string) - - Stability: 0 - Deprecated: Use [`console.error()`][] instead. - -Deprecated predecessor of `console.error`. - -## util.debuglog(section) - -* `section` {String} The section of the program to be debugged -* Returns: {Function} The logging function - -This is used to create a function which conditionally writes to stderr -based on the existence of a `NODE_DEBUG` environment variable. If the -`section` name appears in that environment variable, then the returned -function will be similar to `console.error()`. If not, then the -returned function is a no-op. - -For example: - -```js -var debuglog = util.debuglog('foo'); - -var bar = 123; -debuglog('hello from foo [%d]', bar); -``` - -If this program is run with `NODE_DEBUG=foo` in the environment, then -it will output something like: - -``` -FOO 3245: hello from foo [123] -``` - -where `3245` is the process id. If it is not run with that -environment variable set, then it will not print anything. - -You may separate multiple `NODE_DEBUG` environment variables with a -comma. For example, `NODE_DEBUG=fs,net,tls`. - -## util.deprecate(function, string) - -Marks that a method should not be used any more. - -```js -const util = require('util'); - -exports.puts = util.deprecate(() => { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stdout.write(arguments[i] + '\n'); - } -}, 'util.puts: Use console.log instead'); -``` - -It returns a modified function which warns once by default. - -If `--no-deprecation` is set then this function is a NO-OP. Configurable -at run-time through the `process.noDeprecation` boolean (only effective -when set before a module is loaded.) - -If `--trace-deprecation` is set, a warning and a stack trace are logged -to the console the first time the deprecated API is used. Configurable -at run-time through the `process.traceDeprecation` boolean. - -If `--throw-deprecation` is set then the application throws an exception -when the deprecated API is used. Configurable at run-time through the -`process.throwDeprecation` boolean. - -`process.throwDeprecation` takes precedence over `process.traceDeprecation`. - -## util.error([...]) - - Stability: 0 - Deprecated: Use [`console.error()`][] instead. - -Deprecated predecessor of `console.error`. - -## util.format(format[, ...]) - -Returns a formatted string using the first argument as a `printf`-like format. - -The first argument is a string that contains zero or more *placeholders*. -Each placeholder is replaced with the converted value from its corresponding -argument. Supported placeholders are: - -* `%s` - String. -* `%d` - Number (both integer and float). -* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument -contains circular references. -* `%%` - single percent sign (`'%'`). This does not consume an argument. - -If the placeholder does not have a corresponding argument, the placeholder is -not replaced. - -```js -util.format('%s:%s', 'foo'); // 'foo:%s' -``` - -If there are more arguments than placeholders, the extra arguments are -coerced to strings (for objects and symbols, `util.inspect()` is used) -and then concatenated, delimited by a space. - -```js -util.format('%s:%s', 'foo', 'bar', 'baz'); // 'foo:bar baz' -``` - -If the first argument is not a format string then `util.format()` returns -a string that is the concatenation of all its arguments separated by spaces. -Each argument is converted to a string with `util.inspect()`. - -```js -util.format(1, 2, 3); // '1 2 3' -``` - -## util.inherits(constructor, superConstructor) - -Inherit the prototype methods from one [constructor][] into another. The -prototype of `constructor` will be set to a new object created from -`superConstructor`. - -As an additional convenience, `superConstructor` will be accessible -through the `constructor.super_` property. - -```js -const util = require('util'); -const EventEmitter = require('events'); - -function MyStream() { - EventEmitter.call(this); -} - -util.inherits(MyStream, EventEmitter); - -MyStream.prototype.write = function(data) { - this.emit('data', data); -} - -var stream = new MyStream(); - -console.log(stream instanceof EventEmitter); // true -console.log(MyStream.super_ === EventEmitter); // true - -stream.on('data', (data) => { - console.log(`Received data: "${data}"`); -}) -stream.write('It works!'); // Received data: "It works!" -``` - -## util.inspect(object[, options]) - -Return a string representation of `object`, which is useful for debugging. - -An optional *options* object may be passed that alters certain aspects of the -formatted string: - - - `showHidden` - if `true` then the object's non-enumerable and symbol - properties will be shown too. Defaults to `false`. - - - `depth` - tells `inspect` how many times to recurse while formatting the - object. This is useful for inspecting large complicated objects. Defaults to - `2`. To make it recurse indefinitely pass `null`. - - - `colors` - if `true`, then the output will be styled with ANSI color codes. - Defaults to `false`. Colors are customizable, see [Customizing - `util.inspect` colors][]. - - - `customInspect` - if `false`, then custom `inspect(depth, opts)` functions - defined on the objects being inspected won't be called. Defaults to `true`. - -Example of inspecting all properties of the `util` object: - -```js -const util = require('util'); - -console.log(util.inspect(util, { showHidden: true, depth: null })); -``` - -Values may supply their own custom `inspect(depth, opts)` functions, when -called they receive the current depth in the recursive inspection, as well as -the options object passed to `util.inspect()`. - -### Customizing `util.inspect` colors - - - -Color output (if enabled) of `util.inspect` is customizable globally -via `util.inspect.styles` and `util.inspect.colors` objects. - -`util.inspect.styles` is a map assigning each style a color -from `util.inspect.colors`. -Highlighted styles and their default values are: - * `number` (yellow) - * `boolean` (yellow) - * `string` (green) - * `date` (magenta) - * `regexp` (red) - * `null` (bold) - * `undefined` (grey) - * `special` - only function at this time (cyan) - * `name` (intentionally no styling) - -Predefined color codes are: `white`, `grey`, `black`, `blue`, `cyan`, -`green`, `magenta`, `red` and `yellow`. -There are also `bold`, `italic`, `underline` and `inverse` codes. - -### Custom `inspect()` function on Objects - - - -Objects also may define their own `inspect(depth)` function which `util.inspect()` -will invoke and use the result of when inspecting the object: - -```js -const util = require('util'); - -var obj = { name: 'nate' }; -obj.inspect = function(depth) { - return `{${this.name}}`; -}; - -util.inspect(obj); - // "{nate}" -``` - -You may also return another Object entirely, and the returned String will be -formatted according to the returned Object. This is similar to how -`JSON.stringify()` works: - -```js -var obj = { foo: 'this will not show up in the inspect() output' }; -obj.inspect = function(depth) { - return { bar: 'baz' }; -}; - -util.inspect(obj); - // "{ bar: 'baz' }" -``` - -## util.isArray(object) - - Stability: 0 - Deprecated - -Internal alias for [`Array.isArray`][]. - -Returns `true` if the given "object" is an `Array`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isArray([]) - // true -util.isArray(new Array) - // true -util.isArray({}) - // false -``` - -## util.isBoolean(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `Boolean`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isBoolean(1) - // false -util.isBoolean(0) - // false -util.isBoolean(false) - // true -``` - -## util.isBuffer(object) - - Stability: 0 - Deprecated: Use [`Buffer.isBuffer()`][] instead. - -Returns `true` if the given "object" is a `Buffer`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isBuffer({ length: 0 }) - // false -util.isBuffer([]) - // false -util.isBuffer(new Buffer('hello world')) - // true -``` - -## util.isDate(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `Date`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isDate(new Date()) - // true -util.isDate(Date()) - // false (without 'new' returns a String) -util.isDate({}) - // false -``` - -## util.isError(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is an [`Error`][]. Otherwise, returns -`false`. - -```js -const util = require('util'); - -util.isError(new Error()) - // true -util.isError(new TypeError()) - // true -util.isError({ name: 'Error', message: 'an error occurred' }) - // false -``` - -Note that this method relies on `Object.prototype.toString()` behavior. It is -possible to obtain an incorrect result when the `object` argument manipulates -`@@toStringTag`. - -```js -// This example requires the `--harmony-tostring` flag -const util = require('util'); -const obj = { name: 'Error', message: 'an error occurred' }; - -util.isError(obj); - // false -obj[Symbol.toStringTag] = 'Error'; -util.isError(obj); - // true -``` - -## util.isFunction(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `Function`. Otherwise, returns -`false`. - -```js -const util = require('util'); - -function Foo() {} -var Bar = function() {}; - -util.isFunction({}) - // false -util.isFunction(Foo) - // true -util.isFunction(Bar) - // true -``` - -## util.isNull(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is strictly `null`. Otherwise, returns -`false`. - -```js -const util = require('util'); - -util.isNull(0) - // false -util.isNull(undefined) - // false -util.isNull(null) - // true -``` - -## util.isNullOrUndefined(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is `null` or `undefined`. Otherwise, -returns `false`. - -```js -const util = require('util'); - -util.isNullOrUndefined(0) - // false -util.isNullOrUndefined(undefined) - // true -util.isNullOrUndefined(null) - // true -``` - -## util.isNumber(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `Number`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isNumber(false) - // false -util.isNumber(Infinity) - // true -util.isNumber(0) - // true -util.isNumber(NaN) - // true -``` - -## util.isObject(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is strictly an `Object` __and__ not a -`Function`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isObject(5) - // false -util.isObject(null) - // false -util.isObject({}) - // true -util.isObject(function(){}) - // false -``` - -## util.isPrimitive(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a primitive type. Otherwise, returns -`false`. - -```js -const util = require('util'); - -util.isPrimitive(5) - // true -util.isPrimitive('foo') - // true -util.isPrimitive(false) - // true -util.isPrimitive(null) - // true -util.isPrimitive(undefined) - // true -util.isPrimitive({}) - // false -util.isPrimitive(function() {}) - // false -util.isPrimitive(/^$/) - // false -util.isPrimitive(new Date()) - // false -``` - -## util.isRegExp(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `RegExp`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isRegExp(/some regexp/) - // true -util.isRegExp(new RegExp('another regexp')) - // true -util.isRegExp({}) - // false -``` - -## util.isString(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `String`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isString('') - // true -util.isString('foo') - // true -util.isString(String('foo')) - // true -util.isString(5) - // false -``` - -## util.isSymbol(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is a `Symbol`. Otherwise, returns `false`. - -```js -const util = require('util'); - -util.isSymbol(5) - // false -util.isSymbol('foo') - // false -util.isSymbol(Symbol('foo')) - // true -``` - -## util.isUndefined(object) - - Stability: 0 - Deprecated - -Returns `true` if the given "object" is `undefined`. Otherwise, returns `false`. - -```js -const util = require('util'); - -var foo; -util.isUndefined(5) - // false -util.isUndefined(foo) - // true -util.isUndefined(null) - // false -``` - -## util.log(string) - -Output with timestamp on `stdout`. - - require('util').log('Timestamped message.'); - -## util.print([...]) - - Stability: 0 - Deprecated: Use [`console.log()`][] instead. - -Deprecated predecessor of `console.log`. - -## util.puts([...]) - - Stability: 0 - Deprecated: Use [`console.log()`][] instead. - -Deprecated predecessor of `console.log`. - -## util._extend(obj) - - Stability: 0 - Deprecated: Use Object.assign() instead. - -`_extend` was never intended to be used outside of internal NodeJS modules. The -community found and used it anyway. - -It is deprecated and should not be used in new code. JavaScript comes with very -similar built-in functionality through `Object.assign`. - -[`Array.isArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray -[constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor -[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors -[here]: #util_customizing_util_inspect_colors -[`Error`]: errors.html#errors_class_error -[`console.log()`]: console.html#console_console_log_data -[`console.error()`]: console.html#console_console_error_data -[`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj diff --git a/doc/api/util.md b/doc/api/util.md new file mode 100644 index 00000000000000..05687698f05f38 --- /dev/null +++ b/doc/api/util.md @@ -0,0 +1,667 @@ +# util + + Stability: 2 - Stable + +The `util` module is primarily designed to support the needs of Node.js' own +internal APIs. However, many of the utilities are useful for application and +module developers as well. It can be accessed using: + +```js +const util = require('util'); +``` + +## util.debuglog(section) + +* `section` {String} A string identifying the portion of the application for + which the `debuglog` function is being created. +* Returns: {Function} The logging function + +The `util.debuglog()` method is used to create a function that conditionally +writes debug messages to `stderr` based on the existence of the `NODE_DEBUG` +environment variable. If the `section` name appears within the value of that +environment variable, then the returned function operates similar to +`console.error()`. If not, then the returned function is a no-op. + +For example: + +```js +const util = require('util'); +const debuglog = util.debuglog('foo'); + +debuglog('hello from foo [%d]', 123); +``` + +If this program is run with `NODE_DEBUG=foo` in the environment, then +it will output something like: + +``` +FOO 3245: hello from foo [123] +``` + +where `3245` is the process id. If it is not run with that +environment variable set, then it will not print anything. + +Multiple comma-separated `section` names may be specified in the `NODE_DEBUG` +environment variable. For example: `NODE_DEBUG=fs,net,tls`. + +## util.deprecate(function, string) + +The `util.deprecate()` method wraps the given `function` in such a way that +it is marked as deprecated. + +```js +const util = require('util'); + +exports.puts = util.deprecate(() => { + for (var i = 0, len = arguments.length; i < len; ++i) { + process.stdout.write(arguments[i] + '\n'); + } +}, 'util.puts: Use console.log instead'); +``` + +When called, `util.deprecate()` will return a function that will emit a +`DeprecationWarning` using the `process.on('warning')` event. By default, +this warning will be emitted and printed to `stderr` exactly once, the first +time it is called. After the warning is emitted, the wrapped `function` +is called. + +If either the `--no-deprecation` or `--no-warnings` command line flags are +used, or if the `process.noDeprecation` property is set to `true` *prior* to +the first deprecation warning, the `util.deprecate()` method does nothing. + +If the `--trace-deprecation` or `--trace-warnings` command line flags are set, +or the `process.traceDeprecation` property is set to `true`, a warning and a +stack trace are printed to `stderr` the first time the deprecated function is +called. + +If the `--throw-deprecation` command line flag is set, or the +`process.throwDeprecation` property is set to `true`, then an exception will be +thrown when the deprecated function is called. + +The `--throw-deprecation` command line flag and `process.throwDeprecation` +property take precedence over `--trace-deprecation` and +`process.traceDeprecation`. + +## util.format(format[, ...]) + +* `format` {string} A `printf`-like format string. + +The `util.format()` method returns a formatted string using the first argument +as a `printf`-like format. + +The first argument is a string containing zero or more *placeholder* tokens. +Each placeholder token is replaced with the converted value from the +corresponding argument. Supported placeholders are: + +* `%s` - String. +* `%d` - Number (both integer and float). +* `%j` - JSON. Replaced with the string `'[Circular]'` if the argument +contains circular references. +* `%%` - single percent sign (`'%'`). This does not consume an argument. + +If the placeholder does not have a corresponding argument, the placeholder is +not replaced. + +```js +util.format('%s:%s', 'foo'); + // Returns 'foo:%s' +``` + +If there are more arguments passed to the `util.format()` method than the +number of placeholders, the extra arguments are coerced into strings (for +objects and symbols, `util.inspect()` is used) then concatenated to the +returned string, each delimited by a space. + +```js +util.format('%s:%s', 'foo', 'bar', 'baz'); // 'foo:bar baz' +``` + +If the first argument is not a format string then `util.format()` returns +a string that is the concatenation of all arguments separated by spaces. +Each argument is converted to a string using `util.inspect()`. + +```js +util.format(1, 2, 3); // '1 2 3' +``` + +## util.inherits(constructor, superConstructor) + +_Note: usage of `util.inherits()` is discouraged. Please use the ES6 `class` and +`extends` keywords to get language level inheritance support. Also note that +the two styles are [semantically incompatible][]._ + +* `constructor` {Function} +* `superConstructor` {Function} + +Inherit the prototype methods from one [constructor][] into another. The +prototype of `constructor` will be set to a new object created from +`superConstructor`. + +As an additional convenience, `superConstructor` will be accessible +through the `constructor.super_` property. + +```js +const util = require('util'); +const EventEmitter = require('events'); + +function MyStream() { + EventEmitter.call(this); +} + +util.inherits(MyStream, EventEmitter); + +MyStream.prototype.write = function(data) { + this.emit('data', data); +} + +const stream = new MyStream(); + +console.log(stream instanceof EventEmitter); // true +console.log(MyStream.super_ === EventEmitter); // true + +stream.on('data', (data) => { + console.log(`Received data: "${data}"`); +}) +stream.write('It works!'); // Received data: "It works!" +``` + +## util.inspect(object[, options]) + +* `object` {any} Any JavaScript primitive or Object. +* `options` {Object} + * `showHidden` {boolean} If `true`, the `object`'s non-enumerable symbols and + properties will be included in the formatted result. Defaults to `false`. + * `depth` {number} Specifies the number of times to recurse while formatting + the `object`. This is useful for inspecting large complicated objects. + Defaults to `2`. To make it recurse indefinitely pass `null`. + * `colors` {boolean} If `true`, the output will be styled with ANSI color + codes. Defaults to `false`. Colors are customizable, see + [Customizing `util.inspect` colors][]. + * `customInspect` {boolean} If `false`, then custom `inspect(depth, opts)` + functions exported on the `object` being inspected will not be called. + Defaults to `true`. + * `showProxy` {boolean} If `true`, then objects and functions that are + `Proxy` objects will be introspected to show their `target` and `handler` + objects. Defaults to `false`. + * `maxArrayLength` {number} Specifies the maximum number of array and + `TypedArray` elements to include when formatting. Defaults to `100`. Set to + `null` to show all array elements. Set to `0` or negative to show no array + elements. + +The `util.inspect()` method returns a string representation of `object` that is +primarily useful for debugging. Additional `options` may be passed that alter +certain aspects of the formatted string. + +The following example inspects all properties of the `util` object: + +```js +const util = require('util'); + +console.log(util.inspect(util, { showHidden: true, depth: null })); +``` + +Values may supply their own custom `inspect(depth, opts)` functions, when +called these receive the current `depth` in the recursive inspection, as well as +the options object passed to `util.inspect()`. + +### Customizing `util.inspect` colors + + + +Color output (if enabled) of `util.inspect` is customizable globally +via the `util.inspect.styles` and `util.inspect.colors` properties. + +`util.inspect.styles` is a map associating a style name to a color from +`util.inspect.colors`. + +The default styles and associated colors are: + + * `number` - `yellow` + * `boolean` - `yellow` + * `string` - `green` + * `date` - `magenta` + * `regexp` - `red` + * `null` - `bold` + * `undefined` - `grey` + * `special` - `cyan` (only applied to functions at this time) + * `name` - (no styling) + +The predefined color codes are: `white`, `grey`, `black`, `blue`, `cyan`, +`green`, `magenta`, `red` and `yellow`. There are also `bold`, `italic`, +`underline` and `inverse` codes. + +Color styling uses ANSI control codes that may not be supported on all +terminals. + +### Custom `inspect()` function on Objects + + + +Objects may also define their own `inspect(depth, opts)` function that +`util.inspect()` will invoke and use the result of when inspecting the object: + +```js +const util = require('util'); + +const obj = { name: 'nate' }; +obj.inspect = function(depth) { + return `{${this.name}}`; +}; + +util.inspect(obj); + // "{nate}" +``` + +Custom `inspect(depth, opts)` functions typically return a string but may +return a value of any type that will be formatted accordingly by +`util.inspect()`. + +```js +const util = require('util'); + +const obj = { foo: 'this will not show up in the inspect() output' }; +obj.inspect = function(depth) { + return { bar: 'baz' }; +}; + +util.inspect(obj); + // "{ bar: 'baz' }" +``` + +## Deprecated APIs + +The following APIs have been deprecated and should no longer be used. Existing +applications and modules should be updated to find alternative approaches. + +### util.debug(string) + + Stability: 0 - Deprecated: Use [`console.error()`][] instead. + +* `string` {string} The message to print to `stderr` + +Deprecated predecessor of `console.error`. + +### util.error([...]) + + Stability: 0 - Deprecated: Use [`console.error()`][] instead. + +* `string` {string} The message to print to `stderr` + +Deprecated predecessor of `console.error`. + +### util.isArray(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Internal alias for [`Array.isArray`][]. + +Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isArray([]); + // true +util.isArray(new Array); + // true +util.isArray({}); + // false +``` + +### util.isBoolean(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isBoolean(1); + // false +util.isBoolean(0); + // false +util.isBoolean(false); + // true +``` + +### util.isBuffer(object) + + Stability: 0 - Deprecated: Use [`Buffer.isBuffer()`][] instead. + +* `object` {any} + +Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isBuffer({ length: 0 }); + // false +util.isBuffer([]); + // false +util.isBuffer(Buffer.from('hello world')); + // true +``` + +### util.isDate(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isDate(new Date()); + // true +util.isDate(Date()); + // false (without 'new' returns a String) +util.isDate({}); + // false +``` + +### util.isError(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is an [`Error`][]. Otherwise, returns +`false`. + +```js +const util = require('util'); + +util.isError(new Error()); + // true +util.isError(new TypeError()); + // true +util.isError({ name: 'Error', message: 'an error occurred' }); + // false +``` + +Note that this method relies on `Object.prototype.toString()` behavior. It is +possible to obtain an incorrect result when the `object` argument manipulates +`@@toStringTag`. + +```js +const util = require('util'); +const obj = { name: 'Error', message: 'an error occurred' }; + +util.isError(obj); + // false +obj[Symbol.toStringTag] = 'Error'; +util.isError(obj); + // true +``` + +### util.isFunction(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `Function`. Otherwise, returns +`false`. + +```js +const util = require('util'); + +function Foo() {} +const Bar = function() {}; + +util.isFunction({}); + // false +util.isFunction(Foo); + // true +util.isFunction(Bar); + // true +``` + +### util.isNull(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is strictly `null`. Otherwise, returns +`false`. + +```js +const util = require('util'); + +util.isNull(0); + // false +util.isNull(undefined); + // false +util.isNull(null); + // true +``` + +### util.isNullOrUndefined(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is `null` or `undefined`. Otherwise, +returns `false`. + +```js +const util = require('util'); + +util.isNullOrUndefined(0); + // false +util.isNullOrUndefined(undefined); + // true +util.isNullOrUndefined(null); + // true +``` + +### util.isNumber(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isNumber(false); + // false +util.isNumber(Infinity); + // true +util.isNumber(0); + // true +util.isNumber(NaN); + // true +``` + +### util.isObject(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is strictly an `Object` __and__ not a +`Function`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isObject(5); + // false +util.isObject(null); + // false +util.isObject({}); + // true +util.isObject(function(){}); + // false +``` + +### util.isPrimitive(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a primitive type. Otherwise, returns +`false`. + +```js +const util = require('util'); + +util.isPrimitive(5); + // true +util.isPrimitive('foo'); + // true +util.isPrimitive(false); + // true +util.isPrimitive(null); + // true +util.isPrimitive(undefined); + // true +util.isPrimitive({}); + // false +util.isPrimitive(function() {}); + // false +util.isPrimitive(/^$/); + // false +util.isPrimitive(new Date()); + // false +``` + +### util.isRegExp(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isRegExp(/some regexp/); + // true +util.isRegExp(new RegExp('another regexp')); + // true +util.isRegExp({}); + // false +``` + +### util.isString(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isString(''); + // true +util.isString('foo'); + // true +util.isString(String('foo')); + // true +util.isString(5); + // false +``` + +## util.isSymbol(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. + +```js +const util = require('util'); + +util.isSymbol(5); + // false +util.isSymbol('foo'); + // false +util.isSymbol(Symbol('foo')); + // true +``` + +### util.isUndefined(object) + + Stability: 0 - Deprecated + +* `object` {any} + +Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. + +```js +const util = require('util'); + +const foo = undefined; +util.isUndefined(5); + // false +util.isUndefined(foo); + // true +util.isUndefined(null); + // false +``` + +### util.log(string) + + Stability: 0 - Deprecated: Use a third party module instead. + +* `string` {string} + +The `util.log()` method prints the given `string` to `stdout` with an included +timestamp. + +```js +const util = require('util'); + +util.log('Timestamped message.'); +``` + +### util.print([...]) + + Stability: 0 - Deprecated: Use [`console.log()`][] instead. + +Deprecated predecessor of `console.log`. + +### util.puts([...]) + + Stability: 0 - Deprecated: Use [`console.log()`][] instead. + +Deprecated predecessor of `console.log`. + +### util._extend(obj) + + Stability: 0 - Deprecated: Use Object.assign() instead. + +The `util._extend()` method was never intended to be used outside of internal +Node.js modules. The community found and used it anyway. + +It is deprecated and should not be used in new code. JavaScript comes with very +similar built-in functionality through `Object.assign()`. + +[`Array.isArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray +[constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor +[semantically incompatible]: https://github.com/nodejs/node/issues/4179 +[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors +[here]: #util_customizing_util_inspect_colors +[`Error`]: errors.html#errors_class_error +[`console.log()`]: console.html#console_console_log_data +[`console.error()`]: console.html#console_console_error_data +[`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj diff --git a/doc/api/v8.markdown b/doc/api/v8.markdown deleted file mode 100644 index 4761355141d2c2..00000000000000 --- a/doc/api/v8.markdown +++ /dev/null @@ -1,93 +0,0 @@ -# V8 - - Stability: 2 - Stable - -This module exposes events and interfaces specific to the version of [V8][] -built with Node.js. These interfaces are subject to change by upstream and are -therefore not covered under the stability index. - -## getHeapStatistics() - -Returns an object with the following properties - -```js -{ - total_heap_size: 7326976, - total_heap_size_executable: 4194304, - total_physical_size: 7326976, - total_available_size: 1152656, - used_heap_size: 3476208, - heap_size_limit: 1535115264 -} -``` - -## getHeapSpaceStatistics() - -Returns statistics about the V8 heap spaces, i.e. the segments which make up -the V8 heap. Order of heap spaces nor availability of a heap space can be -guaranteed as the statistics are provided via the V8 `GetHeapSpaceStatistics` -function. - -Example result: - -``` -[ - { - "space_name": "new_space", - "space_size": 2063872, - "space_used_size": 951112, - "space_available_size": 80824, - "physical_space_size": 2063872 - }, - { - "space_name": "old_space", - "space_size": 3090560, - "space_used_size": 2493792, - "space_available_size": 0, - "physical_space_size": 3090560 - }, - { - "space_name": "code_space", - "space_size": 1260160, - "space_used_size": 644256, - "space_available_size": 960, - "physical_space_size": 1260160 - }, - { - "space_name": "map_space", - "space_size": 1094160, - "space_used_size": 201608, - "space_available_size": 0, - "physical_space_size": 1094160 - }, - { - "space_name": "large_object_space", - "space_size": 0, - "space_used_size": 0, - "space_available_size": 1490980608, - "physical_space_size": 0 - } -] -``` - -## setFlagsFromString(string) - -Set additional V8 command line flags. Use with care; changing settings -after the VM has started may result in unpredictable behavior, including -crashes and data loss. Or it may simply do nothing. - -The V8 options available for a version of Node.js may be determined by running -`node --v8-options`. An unofficial, community-maintained list of options -and their effects is available [here][]. - -Usage: - -```js -// Print GC events to stdout for one minute. -const v8 = require('v8'); -v8.setFlagsFromString('--trace_gc'); -setTimeout(function() { v8.setFlagsFromString('--notrace_gc'); }, 60e3); -``` - -[V8]: https://developers.google.com/v8/ -[here]: https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md diff --git a/doc/api/v8.md b/doc/api/v8.md new file mode 100644 index 00000000000000..a589a0fbb13527 --- /dev/null +++ b/doc/api/v8.md @@ -0,0 +1,124 @@ +# V8 + +The `v8` module exposes APIs that are specific to the version of [V8][] +built into the Node.js binary. It can be accessed using: + +```js +const v8 = require('v8'); +``` + +*Note*: The APIs and implementation are subject to change at any time. + +## v8.getHeapStatistics() + + +Returns an object with the following properties: + +* `total_heap_size` {number} +* `total_heap_size_executable` {number} +* `total_physical_size` {number} +* `total_available_size` {number} +* `used_heap_size` {number} +* `heap_size_limit` {number} + +For example: + +```js +{ + total_heap_size: 7326976, + total_heap_size_executable: 4194304, + total_physical_size: 7326976, + total_available_size: 1152656, + used_heap_size: 3476208, + heap_size_limit: 1535115264 +} +``` + +## v8.getHeapSpaceStatistics() + + +Returns statistics about the V8 heap spaces, i.e. the segments which make up +the V8 heap. Neither the ordering of heap spaces, nor the availability of a +heap space can be guaranteed as the statistics are provided via the V8 +[`GetHeapSpaceStatistics`][] function and may change from one V8 version to the +next. + +The value returned is an array of objects containing the following properties: +* `space_name` {string} +* `space_size` {number} +* `space_used_size` {number} +* `space_available_size` {number} +* `physical_space_size` {number} + +For example: + +``` +[ + { + "space_name": "new_space", + "space_size": 2063872, + "space_used_size": 951112, + "space_available_size": 80824, + "physical_space_size": 2063872 + }, + { + "space_name": "old_space", + "space_size": 3090560, + "space_used_size": 2493792, + "space_available_size": 0, + "physical_space_size": 3090560 + }, + { + "space_name": "code_space", + "space_size": 1260160, + "space_used_size": 644256, + "space_available_size": 960, + "physical_space_size": 1260160 + }, + { + "space_name": "map_space", + "space_size": 1094160, + "space_used_size": 201608, + "space_available_size": 0, + "physical_space_size": 1094160 + }, + { + "space_name": "large_object_space", + "space_size": 0, + "space_used_size": 0, + "space_available_size": 1490980608, + "physical_space_size": 0 + } +] +``` + +## v8.setFlagsFromString(string) + + +The `v8.setFlagsFromString()` method can be used to programmatically set +V8 command line flags. This method should be used with care. Changing settings +after the VM has started may result in unpredictable behavior, including +crashes and data loss; or it may simply do nothing. + +The V8 options available for a version of Node.js may be determined by running +`node --v8-options`. An unofficial, community-maintained list of options +and their effects is available [here][]. + +Usage: + +```js +// Print GC events to stdout for one minute. +const v8 = require('v8'); +v8.setFlagsFromString('--trace_gc'); +setTimeout(function() { v8.setFlagsFromString('--notrace_gc'); }, 60e3); +``` + +[V8]: https://developers.google.com/v8/ +[here]: https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md +[`GetHeapSpaceStatistics`]: https://v8docs.nodesource.com/node-5.0/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4 diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown deleted file mode 100644 index 28d760a798e836..00000000000000 --- a/doc/api/vm.markdown +++ /dev/null @@ -1,316 +0,0 @@ -# Executing JavaScript - - Stability: 2 - Stable - - - -You can access this module with: - -```js -const vm = require('vm'); -``` - -JavaScript code can be compiled and run immediately or compiled, saved, and run -later. - -## Class: Script - -A class for holding precompiled scripts, and running them in specific sandboxes. - -### new vm.Script(code, options) - -Creating a new `Script` compiles `code` but does not run it. Instead, the -created `vm.Script` object represents this compiled code. This script can be run -later many times using methods below. The returned script is not bound to any -global object. It is bound before each run, just for that run. - -The options when creating a script are: - -- `filename`: allows you to control the filename that shows up in any stack - traces produced from this script. -- `lineOffset`: allows you to add an offset to the line number that is - displayed in stack traces -- `columnOffset`: allows you to add an offset to the column number that is - displayed in stack traces -- `displayErrors`: if `true`, on error, attach the line of code that caused - the error to the stack trace. Applies only to syntax errors compiling the - code; errors while running the code are controlled by the options to the - script's methods. -- `timeout`: a number of milliseconds to execute `code` before terminating - execution. If execution is terminated, an [`Error`][] will be thrown. -- `cachedData`: an optional `Buffer` with V8's code cache data for the supplied - source. When supplied `cachedDataRejected` value will be set to either - `true` or `false` depending on acceptance of the data by V8. -- `produceCachedData`: if `true` and no `cachedData` is present - V8 tries to - produce code cache data for `code`. Upon success, a `Buffer` with V8's code - cache data will be produced and stored in `cachedData` property of the - returned `vm.Script` instance. `cachedDataProduced` value will be set to - either `true` or `false` depending on whether code cache data is produced - successfully. - -### script.runInContext(contextifiedSandbox[, options]) - -Similar to [`vm.runInContext()`][] but a method of a precompiled `Script` -object. `script.runInContext()` runs `script`'s compiled code in -`contextifiedSandbox` and returns the result. Running code does not have access -to local scope. - -`script.runInContext()` takes the same options as -[`script.runInThisContext()`][]. - -Example: compile code that increments a global variable and sets one, then -execute the code multiple times. These globals are contained in the sandbox. - -```js -const util = require('util'); -const vm = require('vm'); - -var sandbox = { - animal: 'cat', - count: 2 -}; - -var context = new vm.createContext(sandbox); -var script = new vm.Script('count += 1; name = "kitty"'); - -for (var i = 0; i < 10; ++i) { - script.runInContext(context); -} - -console.log(util.inspect(sandbox)); - -// { animal: 'cat', count: 12, name: 'kitty' } -``` - -Note that running untrusted code is a tricky business requiring great care. -`script.runInContext()` is quite useful, but safely running untrusted code -requires a separate process. - -### script.runInNewContext([sandbox][, options]) - -Similar to [`vm.runInNewContext()`][] but a method of a precompiled `Script` -object. `script.runInNewContext()` contextifies `sandbox` if passed or creates a -new contextified sandbox if it's omitted, and then runs `script`'s compiled code -with the sandbox as the global object and returns the result. Running code does -not have access to local scope. - -`script.runInNewContext()` takes the same options as -[`script.runInThisContext()`][]. - -Example: compile code that sets a global variable, then execute the code -multiple times in different contexts. These globals are set on and contained in -the sandboxes. - -```js -const util = require('util'); -const vm = require('vm'); - -const sandboxes = [{}, {}, {}]; - -const script = new vm.Script('globalVar = "set"'); - -sandboxes.forEach((sandbox) => { - script.runInNewContext(sandbox); -}); - -console.log(util.inspect(sandboxes)); - -// [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] -``` - -Note that running untrusted code is a tricky business requiring great care. -`script.runInNewContext()` is quite useful, but safely running untrusted code -requires a separate process. - -### script.runInThisContext([options]) - -Similar to [`vm.runInThisContext()`]() but a method of a precompiled `Script` -object. `script.runInThisContext()` runs `script`'s compiled code and returns -the result. Running code does not have access to local scope, but does have -access to the current `global` object. - -Example of using `script.runInThisContext()` to compile code once and run it -multiple times: - -```js -const vm = require('vm'); - -global.globalVar = 0; - -const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - -for (var i = 0; i < 1000; ++i) { - script.runInThisContext(); -} - -console.log(globalVar); - -// 1000 -``` - -The options for running a script are: - -- `filename`: allows you to control the filename that shows up in any stack - traces produced. -- `lineOffset`: allows you to add an offset to the line number that is - displayed in stack traces -- `columnOffset`: allows you to add an offset to the column number that is - displayed in stack traces -- `displayErrors`: if `true`, on error, attach the line of code that caused - the error to the stack trace. Applies only to runtime errors executing the - code; it is impossible to create a `Script` instance with syntax errors, as - the constructor will throw. -- `timeout`: a number of milliseconds to execute the script before terminating - execution. If execution is terminated, an [`Error`][] will be thrown. - -## vm.createContext([sandbox]) - -If given a `sandbox` object, will "contextify" that sandbox so that it can be -used in calls to [`vm.runInContext()`][] or [`script.runInContext()`][]. Inside -scripts run as such, `sandbox` will be the global object, retaining all its -existing properties but also having the built-in objects and functions any -standard [global object][] has. Outside of scripts run by the vm module, -`sandbox` will be unchanged. - -If not given a sandbox object, returns a new, empty contextified sandbox object -you can use. - -This function is useful for creating a sandbox that can be used to run multiple -scripts, e.g. if you were emulating a web browser it could be used to create a -single sandbox representing a window's global object, then run all ` + + +
+ + + +``` -Benchmarks for other engines to come (?). +## marked(markdownString [,options] [,callback]) -## Install +### markdownString + +Type: `string` + +String of markdown source to be compiled. + +### options + +Type: `object` + +Hash of options. Can also be set using the `marked.setOptions` method as seen +above. + +### callback + +Type: `function` + +Function called when the `markdownString` has been fully parsed when using +async highlighting. If the `options` argument is omitted, this can be used as +the second argument. + +## Options + +### highlight + +Type: `function` + +A function to highlight code blocks. The first example below uses async highlighting with +[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using +[highlight.js][highlight]: + +```js +var marked = require('marked'); + +var markdownString = '```js\n console.log("hello"); \n```'; + +// Async highlighting with pygmentize-bundled +marked.setOptions({ + highlight: function (code, lang, callback) { + require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { + callback(err, result.toString()); + }); + } +}); + +// Using async version of marked +marked(markdownString, function (err, content) { + if (err) throw err; + console.log(content); +}); + +// Synchronous highlighting with highlight.js +marked.setOptions({ + highlight: function (code) { + return require('highlight.js').highlightAuto(code).value; + } +}); + +console.log(marked(markdownString)); +``` + +#### highlight arguments + +`code` + +Type: `string` + +The section of code to pass to the highlighter. + +`lang` + +Type: `string` + +The programming language specified in the code block. + +`callback` + +Type: `function` + +The callback function to call when using an async highlighter. + +### renderer + +Type: `object` +Default: `new Renderer()` + +An object containing functions to render tokens to HTML. + +#### Overriding renderer methods + +The renderer option allows you to render tokens in a custom manner. Here is an +example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: + +```javascript +var marked = require('marked'); +var renderer = new marked.Renderer(); + +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return '' + + text + ''; +}, + +console.log(marked('# heading+', { renderer: renderer })); +``` +This code will output the following HTML: +```html +

+ + + + heading+ +

+``` + +#### Block level renderer methods + +- code(*string* code, *string* language) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level) +- hr() +- list(*string* body, *boolean* ordered) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +#### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) + +### gfm + +Type: `boolean` +Default: `true` + +Enable [GitHub flavored markdown][gfm]. + +### tables + +Type: `boolean` +Default: `true` + +Enable GFM [tables][tables]. +This option requires the `gfm` option to be true. + +### breaks + +Type: `boolean` +Default: `false` + +Enable GFM [line breaks][breaks]. +This option requires the `gfm` option to be true. + +### pedantic + +Type: `boolean` +Default: `false` + +Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of +the original markdown bugs or poor behavior. + +### sanitize + +Type: `boolean` +Default: `false` + +Sanitize the output. Ignore any HTML that has been input. + +### smartLists + +Type: `boolean` +Default: `true` + +Use smarter list behavior than the original markdown. May eventually be +default with the old behavior moved into `pedantic`. + +### smartypants + +Type: `boolean` +Default: `false` + +Use "smart" typograhic punctuation for things like quotes and dashes. + +## Access to lexer and parser + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +## CLI ``` bash -$ npm install marked +$ marked -o hello.html +hello world +^D +$ cat hello.html +

hello world

``` -## Another javascript markdown parser +## Philosophy behind marked The point of marked was to create a markdown compiler where it was possible to frequently parse huge chunks of markdown without having to worry about @@ -58,78 +310,97 @@ of performance, but did not in order to be exactly what you expect in terms of a markdown rendering. In fact, this is why marked could be considered at a disadvantage in the benchmarks above. -Along with implementing every markdown feature, marked also implements -[GFM features](http://github.github.com/github-flavored-markdown/). +Along with implementing every markdown feature, marked also implements [GFM +features][gfmf]. -## Usage +## Benchmarks -``` js -var marked = require('marked'); -console.log(marked('i am using __markdown__.')); +node v0.8.x + +``` bash +$ node test --bench +marked completed in 3411ms. +marked (gfm) completed in 3727ms. +marked (pedantic) completed in 3201ms. +robotskirt completed in 808ms. +showdown (reuse converter) completed in 11954ms. +showdown (new converter) completed in 17774ms. +markdown-js completed in 17191ms. ``` +__Marked is now faster than Discount, which is written in C.__ + +For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. + +### Pro level + You also have direct access to the lexer and parser if you so desire. ``` js -var tokens = marked.lexer(str); +var tokens = marked.lexer(text, options); console.log(marked.parser(tokens)); ``` +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + ``` bash $ node > require('marked').lexer('> i am using marked.') [ { type: 'blockquote_start' }, - { type: 'text', text: ' i am using marked.' }, + { type: 'paragraph', + text: 'i am using marked.' }, { type: 'blockquote_end' }, links: {} ] ``` -## CLI +## Running Tests & Contributing -``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

hello world

-``` +If you want to submit a pull request, make sure your changes pass the test +suite. If you're adding a new feature, be sure to add your own test. -## Syntax Highlighting +The marked test suite is set up slightly strangely: `test/new` is for all tests +that are not part of the original markdown.pl test suite (this is where your +test should go if you make one). `test/original` is only for the original +markdown.pl tests. `test/tests` houses both types of tests after they have been +combined and moved/generated by running `node test --fix` or `marked --test +--fix`. -Marked has an interface that allows for a syntax highlighter to highlight code -blocks before they're output. +In other words, if you have a test to add, add it to `test/new/` and then +regenerate the tests with `node test --fix`. Commit the result. If your test +uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you +can add `.nogfm` to the filename. So, `my-test.text` becomes +`my-test.nogfm.text`. You can do this with any marked option. Say you want +line breaks and smartypants enabled, your filename should be: +`my-test.breaks.smartypants.text`. -Example implementation: +To run the tests: -``` js -var highlight = require('my-syntax-highlighter') - , marked_ = require('marked'); - -var marked = function(text) { - var tokens = marked_.lexer(text) - , l = tokens.length - , i = 0 - , token; - - for (; i < l; i++) { - token = tokens[i]; - if (token.type === 'code') { - token.text = highlight(token.text, token.lang); - // marked should not escape this - token.escaped = true; - } - } - - text = marked_.parser(tokens); +``` bash +cd marked/ +node test +``` - return text; -}; +### Contribution and License Agreement -module.exports = marked; -``` +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` ## License -Copyright (c) 2011-2012, Christopher Jeffrey. (MIT License) +Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) See LICENSE for more info. + +[gfm]: https://help.github.com/articles/github-flavored-markdown +[gfmf]: http://github.github.com/github-flavored-markdown/ +[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled +[highlight]: https://github.com/isagalaev/highlight.js +[badge]: http://badge.fury.io/js/marked +[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables +[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/tools/doc/node_modules/marked/bin/marked b/tools/doc/node_modules/marked/bin/marked index 7d00504ed16803..64254fc3eb2e08 100755 --- a/tools/doc/node_modules/marked/bin/marked +++ b/tools/doc/node_modules/marked/bin/marked @@ -2,7 +2,7 @@ /** * Marked CLI - * Copyright (c) 2011-2012, Christopher Jeffrey (MIT License) + * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) */ var fs = require('fs') @@ -13,7 +13,7 @@ var fs = require('fs') * Man Page */ -var help = function() { +function help() { var spawn = require('child_process').spawn; var options = { @@ -26,32 +26,54 @@ var help = function() { spawn('man', [__dirname + '/../man/marked.1'], options); -}; +} /** * Main */ -var main = function(argv) { +function main(argv, callback) { var files = [] - , data = '' + , options = {} , input , output , arg - , tokens; + , tokens + , opt; - var getarg = function() { + function getarg() { var arg = argv.shift(); - arg = arg.split('='); - if (arg.length > 1) { - argv.unshift(arg.slice(1).join('=')); + + if (arg.indexOf('--') === 0) { + // e.g. --opt + arg = arg.split('='); + if (arg.length > 1) { + // e.g. --opt=val + argv.unshift(arg.slice(1).join('=')); + } + arg = arg[0]; + } else if (arg[0] === '-') { + if (arg.length > 2) { + // e.g. -abc + argv = arg.substring(1).split('').map(function(ch) { + return '-' + ch; + }).concat(argv); + arg = argv.shift(); + } else { + // e.g. -a + } + } else { + // e.g. foo } - return arg[0]; - }; + + return arg; + } while (argv.length) { arg = getarg(); switch (arg) { + case '--test': + return require('../test').main(process.argv.slice()); case '-o': case '--output': output = argv.shift(); @@ -68,48 +90,98 @@ var main = function(argv) { case '--help': return help(); default: - files.push(arg); + if (arg.indexOf('--') === 0) { + opt = camelize(arg.replace(/^--(no-)?/, '')); + if (!marked.defaults.hasOwnProperty(opt)) { + continue; + } + if (arg.indexOf('--no-') === 0) { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? null + : false; + } else { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? argv.shift() + : true; + } + } else { + files.push(arg); + } break; } } - if (!input) { - if (files.length <= 2) { - var stdin = process.stdin; - - stdin.setEncoding('utf8'); - stdin.resume(); - - stdin.on('data', function(text) { - data += text; - }); - - stdin.on('end', write); - - return; + function getData(callback) { + if (!input) { + if (files.length <= 2) { + return getStdin(callback); + } + input = files.pop(); } - input = files.pop(); + return fs.readFile(input, 'utf8', callback); } - data = fs.readFileSync(input, 'utf8'); - write(); + return getData(function(err, data) { + if (err) return callback(err); - function write() { data = tokens - ? JSON.stringify(marked.lexer(data), null, 2) - : marked(data); + ? JSON.stringify(marked.lexer(data, options), null, 2) + : marked(data, options); if (!output) { process.stdout.write(data + '\n'); - } else { - fs.writeFileSync(output, data); + return callback(); } + + return fs.writeFile(output, data, callback); + }); +} + +/** + * Helpers + */ + +function getStdin(callback) { + var stdin = process.stdin + , buff = ''; + + stdin.setEncoding('utf8'); + + stdin.on('data', function(data) { + buff += data; + }); + + stdin.on('error', function(err) { + return callback(err); + }); + + stdin.on('end', function() { + return callback(null, buff); + }); + + try { + stdin.resume(); + } catch (e) { + callback(e); } -}; +} + +function camelize(text) { + return text.replace(/(\w)-(\w)/g, function(_, a, b) { + return a + b.toUpperCase(); + }); +} + +/** + * Expose / Entry Point + */ if (!module.parent) { process.title = 'marked'; - main(process.argv.slice()); + main(process.argv.slice(), function(err, code) { + if (err) throw err; + return process.exit(code || 0); + }); } else { module.exports = main; } diff --git a/tools/doc/node_modules/marked/bower.json b/tools/doc/node_modules/marked/bower.json new file mode 100644 index 00000000000000..a2a8187759f7c9 --- /dev/null +++ b/tools/doc/node_modules/marked/bower.json @@ -0,0 +1,24 @@ +{ + "name": "marked", + "version": "0.3.4", + "homepage": "https://github.com/chjj/marked", + "authors": [ + "Christopher Jeffrey " + ], + "description": "A markdown parser built for speed", + "keywords": [ + "markdown", + "markup", + "html" + ], + "main": "lib/marked.js", + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "app/bower_components", + "test", + "tests" + ] +} diff --git a/tools/doc/node_modules/marked/component.json b/tools/doc/node_modules/marked/component.json new file mode 100644 index 00000000000000..1d672877f6e712 --- /dev/null +++ b/tools/doc/node_modules/marked/component.json @@ -0,0 +1,10 @@ +{ + "name": "marked", + "version": "0.3.4", + "repo": "chjj/marked", + "description": "A markdown parser built for speed", + "keywords": ["markdown", "markup", "html"], + "scripts": ["lib/marked.js"], + "main": "lib/marked.js", + "license": "MIT" +} diff --git a/tools/doc/node_modules/marked/doc/broken.md b/tools/doc/node_modules/marked/doc/broken.md new file mode 100644 index 00000000000000..7bfa49e8a9adf9 --- /dev/null +++ b/tools/doc/node_modules/marked/doc/broken.md @@ -0,0 +1,426 @@ +# Markdown is broken + +I have a lot of scraps of markdown engine oddities that I've collected over the +years. What you see below is slightly messy, but it's what I've managed to +cobble together to illustrate the differences between markdown engines, and +why, if there ever is a markdown specification, it has to be absolutely +thorough. There are a lot more of these little differences I have documented +elsewhere. I know I will find them lingering on my disk one day, but until +then, I'll continue to add whatever strange nonsensical things I find. + +Some of these examples may only mention a particular engine compared to marked. +However, the examples with markdown.pl could easily be swapped out for +discount, upskirt, or markdown.js, and you would very easily see even more +inconsistencies. + +A lot of this was written when I was very unsatisfied with the inconsistencies +between markdown engines. Please excuse the frustration noticeable in my +writing. + +## Examples of markdown's "stupid" list parsing + +``` +$ markdown.pl + + * item1 + + * item2 + + text +^D +
    +
  • item1

    + +
      +
    • item2
    • +
    + +

    text

  • +

+``` + + +``` +$ marked + * item1 + + * item2 + + text +^D +
    +
  • item1

    +
      +
    • item2
    • +
    +

    text

    +
  • +
+``` + +Which looks correct to you? + +- - - + +``` +$ markdown.pl +* hello + > world +^D +

    +
  • hello

    + +
    +

    world

  • +

+ +``` + +``` +$ marked +* hello + > world +^D +
    +
  • hello
    +

    world

    +
    +
  • +
+``` + +Again, which looks correct to you? + +- - - + +EXAMPLE: + +``` +$ markdown.pl +* hello + * world + * hi + code +^D +
    +
  • hello +
      +
    • world
    • +
    • hi + code
    • +
  • +
+``` + +The code isn't a code block even though it's after the bullet margin. I know, +lets give it two more spaces, effectively making it 8 spaces past the bullet. + +``` +$ markdown.pl +* hello + * world + * hi + code +^D +
    +
  • hello +
      +
    • world
    • +
    • hi + code
    • +
  • +
+``` + +And, it's still not a code block. Did you also notice that the 3rd item isn't +even its own list? Markdown screws that up too because of its indentation +unaware parsing. + +- - - + +Let's look at some more examples of markdown's list parsing: + +``` +$ markdown.pl + + * item1 + + * item2 + + text +^D +
    +
  • item1

    + +
      +
    • item2
    • +
    + +

    text

  • +

+``` + +Misnested tags. + + +``` +$ marked + * item1 + + * item2 + + text +^D +
    +
  • item1

    +
      +
    • item2
    • +
    +

    text

    +
  • +
+``` + +Which looks correct to you? + +- - - + +``` +$ markdown.pl +* hello + > world +^D +

    +
  • hello

    + +
    +

    world

  • +

+ +``` + +More misnested tags. + + +``` +$ marked +* hello + > world +^D +
    +
  • hello
    +

    world

    +
    +
  • +
+``` + +Again, which looks correct to you? + +- - - + +# Why quality matters - Part 2 + +``` bash +$ markdown.pl +* hello + > world +^D +

    +
  • hello

    + +
    +

    world

  • +

+ +``` + +``` bash +$ sundown # upskirt +* hello + > world +^D +
    +
  • hello +> world
  • +
+``` + +``` bash +$ marked +* hello + > world +^D +
  • hello

    world

+``` + +Which looks correct to you? + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/23 + +``` bash +$ markdown.pl # upskirt/markdown.js/discount +* hello + var a = 1; +* world +^D +
    +
  • hello +var a = 1;
  • +
  • world
  • +
+``` + +``` bash +$ marked +* hello + var a = 1; +* world +^D +
  • hello +
    code>var a = 1;
  • +
  • world
+``` + +Which looks more reasonable? Why shouldn't code blocks be able to appear in +list items in a sane way? + +- - - + +``` bash +$ markdown.js +
hello
+ +hello +^D +

<div>hello</div>

+ +

<span>hello</span>

+``` + +``` bash +$ marked +
hello
+ +hello +^D +
hello
+ + +

hello +

+``` + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/27 + +``` bash +$ markdown.js +[![an image](/image)](/link) +^D +

![an image

+``` + +``` bash +$ marked +[![an image](/image)](/link) +^D +

an image +

+``` + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/24 + +``` bash +$ markdown.js +> a + +> b + +> c +^D +

a

bundefined> c

+``` + +``` bash +$ marked +> a + +> b + +> c +^D +

a + +

+

b + +

+

c +

+``` + +- - - + +``` bash +$ markdown.pl +* hello + * world + how + + are + you + + * today +* hi +^D +
    +
  • hello

    + +
      +
    • world +how
    • +
    + +

    are +you

    + +
      +
    • today
    • +
  • +
  • hi
  • +
+``` + +``` bash +$ marked +* hello + * world + how + + are + you + + * today +* hi +^D +
    +
  • hello

    +
      +
    • world +how

      +

      are +you

      +
    • +
    • today

      +
    • +
    +
  • +
  • hi
  • +
+``` diff --git a/tools/doc/node_modules/marked/doc/todo.md b/tools/doc/node_modules/marked/doc/todo.md new file mode 100644 index 00000000000000..2e60b162aef82d --- /dev/null +++ b/tools/doc/node_modules/marked/doc/todo.md @@ -0,0 +1,2 @@ +# Todo + diff --git a/tools/doc/node_modules/marked/lib/marked.js b/tools/doc/node_modules/marked/lib/marked.js index e76178471a15bb..03251f3c58a761 100644 --- a/tools/doc/node_modules/marked/lib/marked.js +++ b/tools/doc/node_modules/marked/lib/marked.js @@ -1,6 +1,7 @@ /** - * marked - A markdown parser (https://github.com/chjj/marked) - * Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked */ ;(function() { @@ -11,82 +12,148 @@ var block = { newline: /^\n+/, - code: /^ {4,}[^\n]*(?:\n {4,}[^\n]*|\n)*(?:\n+|$)/, - gfm_code: /^ *``` *(\w+)? *\n([^\0]+?)\s*``` *(?:\n+|$)/, - hr: /^( *[\-*_]){3,} *(?:\n+|$)/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - lheading: /^([^\n]+)\n *(=|-){3,} *\n*/, - blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/, - list: /^( *)([*+-]|\d+\.) [^\0]+?(?:\n{2,}(?! )|\s*$)(?!\1bullet)\n*/, - html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, - def: /^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - paragraph: /^([^\n]+\n?(?!body))+\n*/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, text: /^[^\n]+/ }; -block.list = (function() { - var list = block.list.source; +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + +block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + +block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('lheading', block.lheading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); - list = list - .replace('bullet', /(?:[*+-](?!(?: *[-*]){2,})|\d+\.)/.source); - - return new RegExp(list); -})(); +/** + * Normal Block Grammar + */ -block.html = (function() { - var html = block.html.source; +block.normal = merge({}, block); - html = html - .replace('comment', //.source) - .replace('closed', /<(tag)[^\0]+?<\/\1>/.source) - .replace('closing', /])*?>/.source) - .replace(/tag/g, tag()); +/** + * GFM Block Grammar + */ - return new RegExp(html); -})(); +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ +}); -block.paragraph = (function() { - var paragraph = block.paragraph.source - , body = []; +block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + (); - (function push(rule) { - rule = block[rule] ? block[rule].source : rule; - body.push(rule.replace(/(^|[^\[])\^/g, '$1')); - return push; - }) - ('gfm_code') - ('hr') - ('heading') - ('lheading') - ('blockquote') - ('<' + tag()) - ('def'); +/** + * GFM + Tables Block Grammar + */ - return new - RegExp(paragraph.replace('body', body.join('|'))); -})(); +block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ +}); /** * Block Lexer */ -block.lexer = function(src) { - var tokens = []; +function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ - tokens.links = {}; +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { src = src .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' '); + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); - return block.token(src, tokens, true); + return this.token(src, true); }; -block.token = function(src, tokens, top) { +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top, bq) { var src = src.replace(/^ +$/gm, '') , next , loose , cap + , bull + , b , item , space , i @@ -94,41 +161,43 @@ block.token = function(src, tokens, top) { while (src) { // newline - if (cap = block.newline.exec(src)) { + if (cap = this.rules.newline.exec(src)) { src = src.substring(cap[0].length); if (cap[0].length > 1) { - tokens.push({ + this.tokens.push({ type: 'space' }); } } // code - if (cap = block.code.exec(src)) { + if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); cap = cap[0].replace(/^ {4}/gm, ''); - tokens.push({ + this.tokens.push({ type: 'code', - text: cap.replace(/\n+$/, '') + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap }); continue; } - // gfm_code - if (cap = block.gfm_code.exec(src)) { + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'code', - lang: cap[1], - text: cap[2] + lang: cap[2], + text: cap[3] || '' }); continue; } // heading - if (cap = block.heading.exec(src)) { + if (cap = this.rules.heading.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'heading', depth: cap[1].length, text: cap[2] @@ -136,10 +205,42 @@ block.token = function(src, tokens, top) { continue; } + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + // lheading - if (cap = block.lheading.exec(src)) { + if (cap = this.rules.lheading.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'heading', depth: cap[2] === '=' ? 1 : 2, text: cap[1] @@ -148,18 +249,19 @@ block.token = function(src, tokens, top) { } // hr - if (cap = block.hr.exec(src)) { + if (cap = this.rules.hr.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'hr' }); continue; } // blockquote - if (cap = block.blockquote.exec(src)) { + if (cap = this.rules.blockquote.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ + + this.tokens.push({ type: 'blockquote_start' }); @@ -168,27 +270,27 @@ block.token = function(src, tokens, top) { // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. - block.token(cap, tokens, top); + this.token(cap, top, true); - tokens.push({ + this.tokens.push({ type: 'blockquote_end' }); + continue; } // list - if (cap = block.list.exec(src)) { + if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); + bull = cap[2]; - tokens.push({ + this.tokens.push({ type: 'list_start', - ordered: isFinite(cap[2]) + ordered: bull.length > 1 }); // Get each top-level item. - cap = cap[0].match( - /^( *)([*+-]|\d+\.)[^\n]*(?:\n(?!\1(?:[*+-]|\d+\.))[^\n]*)*/gm - ); + cap = cap[0].match(this.rules.item); next = false; l = cap.length; @@ -200,13 +302,25 @@ block.token = function(src, tokens, top) { // Remove the list item's bullet // so it is seen as the next token. space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) */, ''); + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); // Outdent whatever the // list item contains. Hacky. if (~item.indexOf('\n ')) { space -= item.length; - item = item.replace(new RegExp('^ {1,' + space + '}', 'gm'), ''); + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } } // Determine whether item is loose or not. @@ -214,25 +328,25 @@ block.token = function(src, tokens, top) { // for discount behavior. loose = next || /\n\n(?!\s*$)/.test(item); if (i !== l - 1) { - next = item[item.length-1] === '\n'; + next = item.charAt(item.length - 1) === '\n'; if (!loose) loose = next; } - tokens.push({ + this.tokens.push({ type: loose ? 'loose_item_start' : 'list_item_start' }); // Recurse. - block.token(item, tokens); + this.token(item, false, bq); - tokens.push({ + this.tokens.push({ type: 'list_item_end' }); } - tokens.push({ + this.tokens.push({ type: 'list_end' }); @@ -240,76 +354,213 @@ block.token = function(src, tokens, top) { } // html - if (cap = block.html.exec(src)) { + if (cap = this.rules.html.exec(src)) { src = src.substring(cap[0].length); - tokens.push({ - type: 'html', + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: !this.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), text: cap[0] }); continue; } // def - if (top && (cap = block.def.exec(src))) { + if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); - tokens.links[cap[1].toLowerCase()] = { + this.tokens.links[cap[1].toLowerCase()] = { href: cap[2], title: cap[3] }; continue; } + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + // top-level paragraph - if (top && (cap = block.paragraph.exec(src))) { + if (top && (cap = this.rules.paragraph.exec(src))) { src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'paragraph', - text: cap[0] + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] }); continue; } // text - if (cap = block.text.exec(src)) { + if (cap = this.rules.text.exec(src)) { // Top-level should never reach here. src = src.substring(cap[0].length); - tokens.push({ + this.tokens.push({ type: 'text', text: cap[0] }); continue; } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } } - return tokens; + return this.tokens; }; /** - * Inline Processing + * Inline-Level Grammar */ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - gfm_autolink: /^(\w+:\/\/[^\s]+[^.,:;"')\]\s])/, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\[|\](?=[^[\]]*\]))*)\]\(([^\)]*)\)/, - reflink: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\[|\](?=[^[\]]*\]))*)\]\s*\[([^\]]*)\]/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - strong: /^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/, - em: /^\b_([^\0]+?)_\b|^\*((?:\*\*|[^\0])+?)\*(?!\*)/, - code: /^(`+)([^\0]*?[^`])\1(?!`)/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, - text: /^[^\0]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + +inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + +inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~|])')(), + url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + del: /^~~(?=\S)([\s\S]*?\S)~~/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () +}); + +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() +}); + /** - * Inline Lexer + * Inline Lexer & Compiler */ -inline.lexer = function(src) { +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer; + this.renderer.options = this.options; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { var out = '' - , links = tokens.links , link , text , href @@ -317,346 +568,718 @@ inline.lexer = function(src) { while (src) { // escape - if (cap = inline.escape.exec(src)) { + if (cap = this.rules.escape.exec(src)) { src = src.substring(cap[0].length); out += cap[1]; continue; } // autolink - if (cap = inline.autolink.exec(src)) { + if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { - text = cap[1][6] === ':' - ? mangle(cap[1].substring(7)) - : mangle(cap[1]); - href = mangle('mailto:') + text; + text = cap[1].charAt(6) === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; } else { text = escape(cap[1]); href = text; } - out += '' - + text - + ''; + out += this.renderer.link(href, null, text); continue; } - // gfm_autolink - if (cap = inline.gfm_autolink.exec(src)) { + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { src = src.substring(cap[0].length); text = escape(cap[1]); href = text; - out += '' - + text - + ''; + out += this.renderer.link(href, null, text); continue; } // tag - if (cap = inline.tag.exec(src)) { + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } src = src.substring(cap[0].length); - out += cap[0]; + out += this.options.sanitize + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0] continue; } // link - if (cap = inline.link.exec(src)) { + if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); - text = /^\s*?(?:\s+"([^\n]+)")?\s*$/.exec(cap[2]); - if (!text) { - out += cap[0][0]; - src = cap[0].substring(1) + src; - continue; - } - out += outputLink(cap, { - href: text[1], - title: text[2] + this.inLink = true; + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] }); + this.inLink = false; continue; } // reflink, nolink - if ((cap = inline.reflink.exec(src)) - || (cap = inline.nolink.exec(src))) { + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { src = src.substring(cap[0].length); link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; + link = this.links[link.toLowerCase()]; if (!link || !link.href) { - out += cap[0][0]; + out += cap[0].charAt(0); src = cap[0].substring(1) + src; continue; } - out += outputLink(cap, link); + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; continue; } // strong - if (cap = inline.strong.exec(src)) { + if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); - out += '' - + inline.lexer(cap[2] || cap[1]) - + ''; + out += this.renderer.strong(this.output(cap[2] || cap[1])); continue; } // em - if (cap = inline.em.exec(src)) { + if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); - out += '' - + inline.lexer(cap[2] || cap[1]) - + ''; + out += this.renderer.em(this.output(cap[2] || cap[1])); continue; } // code - if (cap = inline.code.exec(src)) { + if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); - out += '' - + escape(cap[2], true) - + ''; + out += this.renderer.codespan(escape(cap[2], true)); continue; } // br - if (cap = inline.br.exec(src)) { + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { src = src.substring(cap[0].length); - out += '
'; + out += this.renderer.del(this.output(cap[1])); continue; } // text - if (cap = inline.text.exec(src)) { + if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); - out += escape(cap[0]); + out += this.renderer.text(escape(this.smartypants(cap[0]))); continue; } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = escape(link.href) + , title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || {}; +} + +Renderer.prototype.code = function(code, lang, escaped) { + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
'
+      + (escaped ? code : escape(code, true))
+      + '\n
'; + } + + return '
'
+    + (escaped ? code : escape(code, true))
+    + '\n
\n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
\n' + quote + '
\n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + return '' + + text + + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
\n' : '
\n'; +}; + +Renderer.prototype.list = function(body, ordered) { + var type = ordered ? 'ol' : 'ul'; + return '<' + type + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
  • ' + text + '
  • \n'; +}; + +Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; +}; + +Renderer.prototype.table = function(header, body) { + return '\n' + + '\n' + + header + + '\n' + + '\n' + + body + + '\n' + + '
    \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' style="text-align:' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
    ' : '
    '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + if (this.options.sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return ''; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { + return ''; + } + } + var out = '
    '; + return out; +}; +Renderer.prototype.image = function(href, title, text) { + var out = '' + text + '' : '>'; return out; }; -var outputLink = function(cap, link) { - if (cap[0][0] !== '!') { - return '' - + inline.lexer(cap[1]) - + ''; - } else { - return ''
-      + escape(cap[1])
-      + ''; +Renderer.prototype.text = function(text) { + return text; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer; + this.renderer.options = this.options; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); } + + return out; }; /** - * Parsing + * Next Token */ -var tokens - , token; +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ -var next = function() { - return token = tokens.pop(); +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; }; -var tok = function() { - switch (token.type) { +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { case 'space': { return ''; } case 'hr': { - return '
    \n'; + return this.renderer.hr(); } case 'heading': { - return '' - + inline.lexer(token.text) - + '\n'; + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); } case 'code': { - return '
    '
    -        + (token.escaped
    -        ? token.text
    -        : escape(token.text, true))
    -        + '
    \n'; + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '' + , body = '' + , i + , row + , cell + , flags + , j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); } case 'blockquote_start': { var body = ''; - while (next().type !== 'blockquote_end') { - body += tok(); + while (this.next().type !== 'blockquote_end') { + body += this.tok(); } - return '
    \n' - + body - + '
    \n'; + return this.renderer.blockquote(body); } case 'list_start': { - var type = token.ordered ? 'ol' : 'ul' - , body = ''; + var body = '' + , ordered = this.token.ordered; - while (next().type !== 'list_end') { - body += tok(); + while (this.next().type !== 'list_end') { + body += this.tok(); } - return '<' - + type - + '>\n' - + body - + '\n'; + return this.renderer.list(body, ordered); } case 'list_item_start': { var body = ''; - while (next().type !== 'list_item_end') { - body += token.type === 'text' - ? parseText() - : tok(); + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); } - return '
  • ' - + body - + '
  • \n'; + return this.renderer.listitem(body); } case 'loose_item_start': { var body = ''; - while (next().type !== 'list_item_end') { - body += tok(); + while (this.next().type !== 'list_item_end') { + body += this.tok(); } - return '
  • ' - + body - + '
  • \n'; + return this.renderer.listitem(body); } case 'html': { - return inline.lexer(token.text); + var html = !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + return this.renderer.html(html); } case 'paragraph': { - return '

    ' - + inline.lexer(token.text) - + '

    \n'; + return this.renderer.paragraph(this.inline.output(this.token.text)); } case 'text': { - return '

    ' - + parseText() - + '

    \n'; + return this.renderer.paragraph(this.parseText()); } } }; -var parseText = function() { - var body = token.text - , top; - - while ((top = tokens[tokens.length-1]) - && top.type === 'text') { - body += '\n' + next().text; - } - - return inline.lexer(body); -}; - -var parse = function(src) { - tokens = src.reverse(); - - var out = ''; - while (next()) { - out += tok(); - } - - tokens = null; - token = null; - - return out; -}; - /** * Helpers */ -var escape = function(html, encode) { +function escape(html, encode) { return html .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); -}; +} -var mangle = function(text) { - var out = '' - , l = text.length - , i = 0 - , ch; +function unescape(html) { + return html.replace(/&([#\w]+);/g, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); +function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; +} + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } } - out += '&#' + ch + ';'; } - return out; -}; + return obj; +} -function tag() { - var tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+'; - return tag; +/** + * Marked + */ + +function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return '

    An error occured:

    '
    +        + escape(e.message + '', true)
    +        + '
    '; + } + throw e; + } } /** - * Expose + * Options */ -var marked = function(src) { - return parse(block.lexer(src)); +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; }; -marked.parser = parse; -marked.lexer = block.lexer; +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + sanitizer: null, + mangle: true, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; marked.parse = marked; -if (typeof module !== 'undefined') { +if (typeof module !== 'undefined' && typeof exports === 'object') { module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); } else { this.marked = marked; } -}).call(this); +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); diff --git a/tools/doc/node_modules/marked/man/marked.1 b/tools/doc/node_modules/marked/man/marked.1 index 214533390ce41a..b9bdc8c2123e3b 100644 --- a/tools/doc/node_modules/marked/man/marked.1 +++ b/tools/doc/node_modules/marked/man/marked.1 @@ -1,39 +1,91 @@ .ds q \N'34' -.TH marked 1 +.TH marked 1 "2014-01-31" "v0.3.1" "marked.js" + .SH NAME marked \- a javascript markdown parser + .SH SYNOPSIS -.nf -.B marked [\-o output] [\-i input] [\-th] -.fi +.B marked +[\-o \fI\fP] [\-i \fI\fP] [\-\-help] +[\-\-tokens] [\-\-pedantic] [\-\-gfm] +[\-\-breaks] [\-\-tables] [\-\-sanitize] +[\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] +[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] + .SH DESCRIPTION .B marked is a full-featured javascript markdown parser, built for speed. It also includes multiple GFM features. + +.SH EXAMPLES +.TP +cat in.md | marked > out.html +.TP +echo "hello *world*" | marked +.TP +marked \-o out.html in.md \-\-gfm +.TP +marked \-\-output="hello world.html" \-i in.md \-\-no-breaks + .SH OPTIONS .TP -.BI \-o,\ \-\-output\ [output] +.BI \-o,\ \-\-output\ [\fIoutput\fP] Specify file output. If none is specified, write to stdout. .TP -.BI \-i,\ \-\-input\ [input] +.BI \-i,\ \-\-input\ [\fIinput\fP] Specify file input, otherwise use last argument as input file. If no input file is specified, read from stdin. .TP .BI \-t,\ \-\-tokens Output a token stream instead of html. .TP -.BI \-h,\ \-\-help -Display help information. -.SH EXAMPLES +.BI \-\-pedantic +Conform to obscure parts of markdown.pl as much as possible. Don't fix original +markdown bugs. .TP -cat in.md | marked > out.html +.BI \-\-gfm +Enable github flavored markdown. .TP -echo "hello *world*" | marked +.BI \-\-breaks +Enable GFM line breaks. Only works with the gfm option. +.TP +.BI \-\-tables +Enable GFM tables. Only works with the gfm option. +.TP +.BI \-\-sanitize +Sanitize output. Ignore any HTML input. +.TP +.BI \-\-smart\-lists +Use smarter list behavior than the original markdown. .TP -marked -o out.html in.md +.BI \-\-lang\-prefix\ [\fIprefix\fP] +Set the prefix for code block classes. .TP -marked --output="hello world.html" -i in.md +.BI \-\-mangle +Mangle email addresses. +.TP +.BI \-\-no\-sanitize,\ \-no-etc... +The inverse of any of the marked options above. +.TP +.BI \-\-silent +Silence error output. +.TP +.BI \-h,\ \-\-help +Display help information. + +.SH CONFIGURATION +For configuring and running programmatically. + +.B Example + + require('marked')('*foo*', { gfm: true }); + .SH BUGS Please report any bugs to https://github.com/chjj/marked. + .SH LICENSE -Copyright (c) 2011-2012, Christopher Jeffrey (MIT License) +Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). + +.SH "SEE ALSO" +.BR markdown(1), +.BR node.js(1) diff --git a/tools/doc/node_modules/marked/marked.min.js b/tools/doc/node_modules/marked/marked.min.js new file mode 100644 index 00000000000000..555c1dc1d9da18 --- /dev/null +++ b/tools/doc/node_modules/marked/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/tools/doc/node_modules/marked/package.json b/tools/doc/node_modules/marked/package.json index f47a9e12530731..d631092cb80f42 100644 --- a/tools/doc/node_modules/marked/package.json +++ b/tools/doc/node_modules/marked/package.json @@ -1,15 +1,95 @@ { - "name": "marked", + "_args": [ + [ + "marked", + "/Users/firedfox/git/node/tools/doc" + ] + ], + "_from": "marked@latest", + "_id": "marked@0.3.5", + "_inCache": true, + "_installable": true, + "_location": "/marked", + "_nodeVersion": "0.12.7", + "_npmUser": { + "email": "chjjeffrey@gmail.com", + "name": "chjj" + }, + "_npmVersion": "2.13.2", + "_phantomChildren": {}, + "_requested": { + "name": "marked", + "raw": "marked", + "rawSpec": "", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz", + "_shasum": "4113a15ac5d7bca158a5aae07224587b9fa15b94", + "_shrinkwrap": null, + "_spec": "marked", + "_where": "/Users/firedfox/git/node/tools/doc", + "author": { + "name": "Christopher Jeffrey" + }, + "bin": { + "marked": "./bin/marked" + }, + "bugs": { + "url": "http://github.com/chjj/marked/issues" + }, + "dependencies": {}, "description": "A markdown parser built for speed", - "author": "Christopher Jeffrey", - "version": "0.1.9", - "main": "./lib/marked.js", - "bin": "./bin/marked", - "man": "./man/marked.1", - "preferGlobal": false, - "repository": "git://github.com/chjj/marked.git", + "devDependencies": { + "gulp": "^3.8.11", + "gulp-concat": "^2.5.2", + "gulp-uglify": "^1.1.0", + "markdown": "*", + "showdown": "*" + }, + "directories": {}, + "dist": { + "shasum": "4113a15ac5d7bca158a5aae07224587b9fa15b94", + "tarball": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz" + }, + "gitHead": "88ce4df47c4d994dc1b1df1477a21fb893e11ddc", "homepage": "https://github.com/chjj/marked", - "bugs": "http://github.com/chjj/marked/issues", - "keywords": [ "markdown", "markup", "html" ], - "tags": [ "markdown", "markup", "html" ] + "keywords": [ + "markdown", + "markup", + "html" + ], + "license": "MIT", + "main": "./lib/marked.js", + "maintainers": [ + { + "email": "chjjeffrey@gmail.com", + "name": "chjj" + } + ], + "man": [ + "./man/marked.1" + ], + "name": "marked", + "optionalDependencies": {}, + "preferGlobal": true, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/chjj/marked.git" + }, + "scripts": { + "bench": "node test --bench", + "test": "node test" + }, + "tags": [ + "markdown", + "markup", + "html" + ], + "version": "0.3.5" } diff --git a/tools/doc/package.json b/tools/doc/package.json index d87c9345b33f2e..41a50ac04ed188 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -7,7 +7,8 @@ "node": ">=0.6.10" }, "dependencies": { - "marked": "~0.1.9" + "marked": "^0.3.5", + "js-yaml": "^3.5.2" }, "devDependencies": {}, "optionalDependencies": {}, diff --git a/tools/doc/preprocess.js b/tools/doc/preprocess.js index 8f802714bcb126..55d90996f71c13 100644 --- a/tools/doc/preprocess.js +++ b/tools/doc/preprocess.js @@ -30,7 +30,7 @@ function processIncludes(inputFile, input, cb) { if (incCount === 0) cb(null, input); includes.forEach(function(include) { var fname = include.replace(/^@include\s+/, ''); - if (!fname.match(/\.markdown$/)) fname += '.markdown'; + if (!fname.match(/\.md$/)) fname += '.md'; if (includeData.hasOwnProperty(fname)) { input = input.split(include).join(includeData[fname]); @@ -48,7 +48,11 @@ function processIncludes(inputFile, input, cb) { if (errState) return; if (er) return cb(errState = er); incCount--; - includeData[fname] = inc; + + // Add comments to let the HTML generator know how the anchors for + // headings should look like. + includeData[fname] = `\n` + + inc + `\n\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 index 4d83e872ec1930..652b87add5e12c 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -1,9 +1,9 @@ 'use strict'; const nodeDocUrl = ''; const jsDocUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/' + - 'Reference/Global_Objects/'; + 'Reference/Global_Objects/'; const jsPrimitiveUrl = 'https://developer.mozilla.org/en-US/docs/Web/' + - 'JavaScript/Data_structures'; + 'JavaScript/Data_structures'; const jsPrimitives = [ 'Number', 'String', 'Boolean', 'Null', 'Symbol' ]; @@ -11,7 +11,8 @@ const jsGlobalTypes = [ 'Error', 'Object', 'Function', 'Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp', - 'ArrayBuffer', 'DataView', 'Promise' + 'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError', + 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]; const typeMap = { 'Buffer': 'buffer.html#buffer_class_buffer', @@ -23,7 +24,7 @@ const typeMap = { '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', + 'EventEmitter': 'events.html#events_class_eventemitter', 'Timer': 'timers.html#timers_timers' }; diff --git a/tools/eslint-rules/align-function-arguments.js b/tools/eslint-rules/align-function-arguments.js new file mode 100644 index 00000000000000..55ce5a4fdbb7c9 --- /dev/null +++ b/tools/eslint-rules/align-function-arguments.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Align arguments in multiline function calls + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +function checkArgumentAlignment(context, node) { + + function isNodeFirstInLine(node, byEndLocation) { + const firstToken = byEndLocation === true ? context.getLastToken(node, 1) : + context.getTokenBefore(node); + const startLine = byEndLocation === true ? node.loc.end.line : + node.loc.start.line; + const endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; + } + + if (node.arguments.length === 0) + return; + + var msg = ''; + const first = node.arguments[0]; + var currentLine = first.loc.start.line; + const firstColumn = first.loc.start.column; + + const ignoreTypes = [ + 'ArrowFunctionExpression', + 'CallExpression', + 'FunctionExpression', + 'ObjectExpression', + ]; + + const args = node.arguments; + + // For now, don't bother trying to validate potentially complicating things + // like closures. Different people will have very different ideas and it's + // probably best to implement configuration options. + if (args.some((node) => { return ignoreTypes.indexOf(node.type) !== -1; })) { + return; + } + + if (!isNodeFirstInLine(node)) { + return; + } + + args.slice(1).forEach((argument) => { + if (argument.loc.start.line === currentLine + 1) { + if (argument.loc.start.column !== firstColumn) { + msg = 'Function called with argument in column ' + + `${argument.loc.start.column}, expected in ${firstColumn}`; + } + } + currentLine = argument.loc.start.line; + }); + + if (msg) + context.report(node, msg); +} + +module.exports = function(context) { + return { + 'CallExpression': (node) => checkArgumentAlignment(context, node) + }; +}; diff --git a/tools/eslint-rules/align-multiline-assignment.js b/tools/eslint-rules/align-multiline-assignment.js new file mode 100644 index 00000000000000..80896b5e96296d --- /dev/null +++ b/tools/eslint-rules/align-multiline-assignment.js @@ -0,0 +1,68 @@ +/** + * @fileoverview Align multiline variable assignments + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +function getBinaryExpressionStarts(binaryExpression, starts) { + function getStartsFromOneSide(side, starts) { + starts.push(side.loc.start); + if (side.type === 'BinaryExpression') { + starts = getBinaryExpressionStarts(side, starts); + } + return starts; + } + + starts = getStartsFromOneSide(binaryExpression.left, starts); + starts = getStartsFromOneSide(binaryExpression.right, starts); + return starts; +} + +function checkExpressionAlignment(expression) { + if (!expression) + return; + + var msg = ''; + + switch (expression.type) { + case 'BinaryExpression': + var starts = getBinaryExpressionStarts(expression, []); + var startLine = starts[0].line; + const startColumn = starts[0].column; + starts.forEach((loc) => { + if (loc.line > startLine) { + startLine = loc.line; + if (loc.column !== startColumn) { + msg = 'Misaligned multiline assignment'; + } + } + }); + break; + } + return msg; +} + +function testAssignment(context, node) { + const msg = checkExpressionAlignment(node.right); + if (msg) + context.report(node, msg); +} + +function testDeclaration(context, node) { + node.declarations.forEach((declaration) => { + const msg = checkExpressionAlignment(declaration.init); + // const start = declaration.init.loc.start; + if (msg) + context.report(node, msg); + }); +} + +module.exports = function(context) { + return { + 'AssignmentExpression': (node) => testAssignment(context, node), + 'VariableDeclaration': (node) => testDeclaration(context, node) + }; +}; diff --git a/tools/eslint-rules/assert-fail-single-argument.js b/tools/eslint-rules/assert-fail-single-argument.js new file mode 100644 index 00000000000000..4ce790238181cc --- /dev/null +++ b/tools/eslint-rules/assert-fail-single-argument.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Prohibit use of a single argument only in `assert.fail()`. It + * is almost always an error. + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const msg = 'assert.fail() message should be third argument'; + +function isAssert(node) { + return node.callee.object && node.callee.object.name === 'assert'; +} + +function isFail(node) { + return node.callee.property && node.callee.property.name === 'fail'; +} + +module.exports = function(context) { + return { + 'CallExpression': function(node) { + if (isAssert(node) && isFail(node) && node.arguments.length === 1) { + context.report(node, msg); + } + } + }; +}; diff --git a/tools/eslint-rules/no-deepEqual.js b/tools/eslint-rules/no-deepEqual.js new file mode 100644 index 00000000000000..46341d7d9238e7 --- /dev/null +++ b/tools/eslint-rules/no-deepEqual.js @@ -0,0 +1,32 @@ +/** + * @fileoverview Prohibit use of assert.deepEqual() + * @author Rich Trott + * + * This rule is imperfect, but will find the most common forms of + * assert.deepEqual() usage. + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const msg = 'assert.deepEqual() disallowed. Use assert.deepStrictEqual()'; + +function isAssert(node) { + return node.callee.object && node.callee.object.name === 'assert'; +} + +function isDeepEqual(node) { + return node.callee.property && node.callee.property.name === 'deepEqual'; +} + +module.exports = function(context) { + return { + 'CallExpression': function(node) { + if (isAssert(node) && isDeepEqual(node)) { + context.report(node, msg); + } + } + }; +}; diff --git a/tools/eslint-rules/no-definegetter-definesetter.js b/tools/eslint-rules/no-definegetter-definesetter.js new file mode 100644 index 00000000000000..3de010f47f203c --- /dev/null +++ b/tools/eslint-rules/no-definegetter-definesetter.js @@ -0,0 +1,32 @@ +/** + * @fileoverview Rule to flag usage of __defineGetter__ and __defineSetter__ + * @author Rich Trott + */ + +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + create: function(context) { + const disallowed = ['__defineGetter__', '__defineSetter__']; + + return { + MemberExpression: function(node) { + var prop; + if (node.property) { + if (node.property.type === 'Identifier' && !node.computed) { + prop = node.property.name; + } else if (node.property.type === 'Literal') { + prop = node.property.value; + } + if (disallowed.includes(prop)) { + context.report(node, `The ${prop} property is deprecated.`); + } + } + } + }; + } +}; diff --git a/tools/eslint/CHANGELOG.md b/tools/eslint/CHANGELOG.md new file mode 100644 index 00000000000000..9b40e8ce14cfc8 --- /dev/null +++ b/tools/eslint/CHANGELOG.md @@ -0,0 +1,2984 @@ +v2.9.0 - April 29, 2016 + +* a8a2cd8 Fix: Avoid autoconfig crashes from inline comments (fixes #5992) (#5999) (Ian VanSchooten) +* 23b00e0 Upgrade: npm-license to 0.3.2 (fixes #5996) (#5998) (alberto) +* 377167d Upgrade: ignore to 3.1.2 (fixes #5979) (#5988) (alberto) +* 141b778 Fix: no-control-regex literal handling fixed. (fixes #5737) (#5943) (Efe Gürkan YALAMAN) +* 577757d Fix: Clarify color option (fixes #5928) (#5974) (Grant Snodgrass) +* e7e6581 Docs: Update CLA link (#5980) (Gustav Nikolaj) +* 0be26bc Build: Add nodejs 6 to travis (fixes #5971) (#5973) (Gyandeep Singh) +* e606523 New: Rule `no-unsafe-finally` (fixes #5808) (#5932) (Onur Temizkan) +* 42d1ecc Chore: Add metadata to existing rules - Batch 7 (refs #5417) (#5969) (Vitor Balocco) +* e2ad1ec Update: object-shorthand lints computed methods (fixes #5871) (#5963) (Chris Sauvé) +* d24516a Chore: Add metadata to existing rules - Batch 6 (refs #5417) (#5966) (Vitor Balocco) +* 1e7a3ef Fix: `id-match` false positive in property values (fixes #5885) (#5960) (Mike Sherov) +* 51ddd4b Update: Use process @abstract when processing @return (fixes #5941) (#5945) (Simon Schick) +* 52a4bea Update: Add autofix for `no-whitespace-before-property` (fixes #5927) (#5951) (alberto) +* 46e058d Docs: Correct typo in configuring.md (#5957) (Nick S. Plekhanov) +* 5f8abab Chore: Add metadata to existing rules - Batch 5 (refs #5417) (#5944) (Vitor Balocco) +* 0562f77 Chore: Add missing newlines to test cases (fixes #5947) (Rich Trott) +* fc78e78 Chore: Enable quote-props rule in eslint-config-eslint (refs #5188) (#5938) (Gyandeep Singh) +* 43f6d05 Docs: Update docs to refer to column (#5937) (Sashko Stubailo) +* 586478e Update: Add autofix for `comma-dangle` (fixes #3805) (#5925) (alberto) +* a4f9c5a Docs: Distinguish examples in rules under Stylistic Issues part 3 (Kenneth Williams) +* e7c0737 Chore: Enable no-console rule in eslint-config-eslint (refs #5188) (Kevin Partington) +* 0023fe6 Build: Add “chore” to commit tags (fixes #5880) (#5929) (Mike Sherov) +* 25d626a Upgrade: espree 3.1.4 (fixes #5923, fixes #5756) (Kai Cataldo) +* a01b412 New: Add `no-useless-computed-key` rule (fixes #5402) (Burak Yigit Kaya) +* 9afb9cb Chore: Remove workaround for espree and escope bugs (fixes #5852) (alberto) +* 3ffc582 Chore: Update copyright and license info (alberto) +* 249eb40 Docs: Clarify init sets up local installation (fixes #5874) (Kai Cataldo) +* 6cd8c86 Docs: Describe options in rules under Possible Errors part 1 (Mark Pedrotti) +* f842d18 Fix: `no-this-before-super` crash on unreachable paths (fixes #5894) (Toru Nagashima) +* a02960b Docs: Fix missing delimiter in README links (Kevin Partington) +* 3a9e72c Docs: Update developer guide with new standards (Nicholas C. Zakas) +* cb78585 Update: Add `allowUnboundThis` to `prefer-arrow-callback` (fixes #4668) (Burak Yigit Kaya) +* 02be29f Chore: Remove CLA check from bot (Nicholas C. Zakas) +* 220713e Chore: Add metadata to existing rules - Batch 4 (refs #5417) (Vitor Balocco) +* df53414 Chore: Include jQuery Foundation info (Nicholas C. Zakas) +* f1b2992 Fix: `no-useless-escape` false positive in JSXAttribute (fixes #5882) (Toru Nagashima) +* 74674ad Docs: Move `sort-imports` to 'ECMAScript 6' (Kenneth Williams) +* ae69ddb Docs: Fix severity type in example (Kenneth Williams) +* 19f6fff Update: Autofixing does multiple passes (refs #5329) (Nicholas C. Zakas) +* 1e4b0ca Docs: Reduce length of paragraphs in rules index (Mark Pedrotti) +* 8cfe1eb Docs: Fix a wrong option (Zach Orlovsky) +* 8f6739f Docs: Add alberto as reviewer (alberto) +* 2ae4938 Docs: Fix message for `inline-config` option (alberto) +* 089900b Docs: Fix a wrong rule name in an example (Toru Nagashima) +* c032b41 Docs: Fix emphasis (Toru Nagashima) +* ae606f0 Docs: Update JSCS info in README (alberto) +* a9c5323 Fix: Install ESLint on init if not installed (fixes #5833) (Kai Cataldo) +* ed38358 Docs: Removed incorrect example (James M. Greene) +* af3113c Docs: Fix config comments in indent docs (Brandon Mills) +* 2b39461 Update: `commentPattern` option for `default-case` rule (fixes #5803) (Artyom Lvov) + +v2.8.0 - April 15, 2016 + +* a8821a5 Docs: Distinguish examples in rules under Stylistic Issues part 2 (Kenneth Williams) +* 76913b6 Update: Add metadata to existing rules - Batch 3 (refs #5417) (Vitor Balocco) +* 34ad8d2 Fix: Check that module.paths exists (fixes #5791) (Nicholas C. Zakas) +* 37239b1 Docs: Add new members of the team (Ilya Volodin) +* fb3c2eb Update: allow template literals (fixes #5234) (Jonathan Haines) +* 5a4a935 Update: Add metadata to existing rules - Batch 2 (refs #5417) (Vitor Balocco) +* ea2e625 Fix: newline-before-return handles return as first token (fixes #5816) (Kevin Partington) +* f8db9c9 Update: add nestedBinaryExpressions to no-extra-parens (fixes #3065) (Ilya Volodin) +* 0045d57 Update: `allowNamedFunctions` in `prefer-arrow-callback` (fixes #5675) (alberto) +* 19da72a Update: Add metadata to existing rules - Batch 1 (refs #5417) (Vitor Balocco) +* cc14e43 Fix: `no-fallthrough` empty case with comment (fixes #5799) (alberto) +* 13c8b14 Fix: LogicalExpression checks for short circuit (fixes #5693) (Vamshi krishna) +* 73b225e Fix: Document and fix metadata (refs #5417) (Ilya Volodin) +* 882d199 Docs: Improve options description in `no-redeclare` (alberto) +* 6a71ceb Docs: Improve options description in `no-params-reassign` (alberto) +* 24b6215 Update: Include 'typeof' in rule 'no-constant-condition' (fixes #5228) (Vamshi krishna) +* a959063 Docs: Remove link to deprecated ESLintTester project (refs #3110) (Trey Thomas) +* 6fd7d82 Update: Change order in `eslint --init` env options (fixes #5742) (alberto) +* c59d909 Fix: Extra paren check around object arrow bodies (fixes #5789) (Brandon Mills) +* 6f88546 Docs: Use double quotes for better Win compatibility (fixes #5796) (alberto) +* 02743d5 Fix: catch self-assignment operators in `no-magic-number` (fixes #4400) (alberto) +* c94e74e Docs: Make rule descriptions more consistent (Kenneth Williams) +* 6028252 Docs: Distinguish examples in rules under Stylistic Issues part 1 (Mark Pedrotti) +* ccd8ca9 Fix: Added property onlyDeclaration to id-match rule (fixes #3488) (Gajus Kuizinas) +* 6703c02 Update: no-useless-escape / exact locations of errors (fixes #5751) (Onur Temizkan) +* 3d84b91 Fix: ignore trailing whitespace in template literal (fixes #5786) (Kai Cataldo) +* b0e6bc4 Update: add allowEmptyCatch option to no-empty (fixes #5800) (Kai Cataldo) +* f1f1dd7 Docs: Add @pedrottimark as a committer (Brandon Mills) +* 228f201 Update: `commentPattern` option for `no-fallthrough` rule (fixes #5757) (Artyom Lvov) +* 41db670 Docs: Clarify disable inline comments (Kai Cataldo) +* 9c9a295 Docs: Add note about shell vs node glob parameters in cli (alberto) +* 5308ff9 Docs: Add code backticks to sentence in fixable rules (Mark Pedrotti) +* 965ec06 Docs: fix the examples for space-before-function-paren. (Craig Silverstein) +* 2b202fc Update: Add ignore option to space-before-function-parens (fixes #4127) (Craig Silverstein) +* 24c12ba Fix: improve `constructor-super` errors for literals (fixes #5449) (Toru Nagashima) + +v2.7.0 - April 4, 2016 + +* 134cb1f Revert "Update: adds nestedBinaryExpressions for no-extra-parens rule (fixes #3065)" (Ilya Volodin) +* 7e80867 Docs: Update sentence in fixable rules (Mark Pedrotti) +* 1b6d5a3 Update: adds nestedBinaryExpressions for no-extra-parens (fixes #3065) (Nick Fisher) +* 4f93c32 Docs: Clarify `array-bracket-spacing` with newlines (fixes #5768) (alberto) +* 161ddac Fix: remove `console.dir` (fixes #5770) (Toru Nagashima) +* 0c33f6a Fix: indent rule uses wrong node for class indent level (fixes #5764) (Paul O’Shannessy) + +v2.6.0 - April 1, 2016 + +* ce2accd Fix: vars-on-top now accepts exported variables (fixes #5711) (Olmo Kramer) +* 7aacba7 Update: Deprecate option `maximum` in favor of `max` (fixes #5685) (Vitor Balocco) +* 5fe6fca Fix: no-useless-escape \B regex escape (fixes #5750) (Onur Temizkan) +* 9b73ffd Update: `destructuring` option of `prefer-const` rule (fixes #5594) (Toru Nagashima) +* 8ac9206 Docs: Typo in `sort-imports` (alberto) +* 12902c5 Fix: valid-jsdoc crash w/ Field & Array Type (fixes #5745) (fixes #5746) (Burak Yigit Kaya) +* 2c8b65a Docs: Edit examples for a few rules (Mark Pedrotti) +* d736bc2 Fix: Treat SwitchCase like a block in lines-around-comment (fixes #5718) (Scott O'Hara) +* 24a61a4 Update: make `no-useless-escape` allowing line breaks (fixes #5689) (Toru Nagashima) +* 4ecd45e Fix: Ensure proper lookup of config files (fixes #5175, fixes #5468) (Nicholas C. Zakas) +* 088e26b Fix: Update doctrine to allow hyphens in JSDoc names (fixes #5612) (Kai Cataldo) +* 692fd5d Upgrade: Old Chalk.JS deprecated method (fixes #5716) (Morris Singer) +* f59d91d Update: no-param-reassign error msgs (fixes #5705) (Isaac Levy) +* c1b16cd Fix: Object spread throws error in key-spacing rule. (fixes #5724) (Ziad El Khoury Hanna) +* 3091613 Docs: Correct explanation about properties (James Monger) +* cb0f0be Fix: Lint issue with `valid-jsdoc` rule (refs #5188) (Gyandeep Singh) +* aba1954 Build: Ignore jsdoc folder internally (fixes #5714) (alberto) +* a35f127 Fix: Lint for eslint project in regards to vars (refs #5188) (Gyandeep Singh) +* d9ab4f0 Fix: Windows scoped package configs (fixes #5644) (Nicholas C. Zakas) +* 8d0cd0d Update: Basic valid-jsdoc default parameter support (fixes #5658) (Tom Andrews) + +v2.5.3 - March 28, 2016 + +* 8749ac5 Build: Disable bundling dependencies (fixes #5687) (Nicholas C. Zakas) + +v2.5.2 - March 28, 2016 + +* 1cc7f8e Docs: Remove mention of minimatch for .eslintignore (Ian VanSchooten) +* 5bd69a9 Docs: Reorder FAQ in README (alberto) +* 98e6bd9 Fix: Correct default for indentation in `eslint --init` (fixes #5698) (alberto) +* 679095e Fix: make the default of `options.cwd` in runtime (fixes #5694) (Toru Nagashima) +* 4f06f2f Docs: Distinguish examples in rules under Best Practices part 2 (Mark Pedrotti) +* 013a18e Build: Fix bundling script (fixes #5680) (Nicholas C. Zakas) +* 8c5d954 Docs: Typo fix (István Donkó) +* 09659d6 Docs: Use string severity (Kenneth Williams) +* a4ae769 Docs: Manual changelog update for v2.5.1 (Nicholas C. Zakas) +* c41fab9 Fix: don't use path.extname with undefined value (fixes #5678) (Myles Borins) + +v2.5.1 - March 25, 2016 + +* Build: No functional changes, just republished with a working package. + +v2.5.0 - March 25, 2016 + +* 7021aa9 Fix: lines-around-comment in ESLint repo, part 2 (refs #5188) (Kevin Partington) +* 095c435 Docs: Remove ES2016 from experimental section of README (Kevin Partington) +* 646f863 Build: Bundle dependencies in package.json (fixes #5013) (Nicholas C. Zakas) +* ea06868 Docs: Clarify --ext does not apply to globs (fixes #5452) (Ian VanSchooten) +* 569c478 Build: Fix phantomjs CI problems (fixes #5666) (alberto) +* 6022426 Docs: Add link to chat room in README primary links (alberto) +* 2fbb530 Docs: Add link to "Proposing a Rule Change" in README (alberto) +* 25bf491 Upgrade: globals 9.x (fixes #5668) (Toru Nagashima) +* d6f8409 New: Rule - No useless escape (fixes #5460) (Onur Temizkan) +* 12a43f1 Docs: remove brace expansion from configuring.md (refs #5314) (Jonathan Haines) +* 92d1749 New: max-statements-per-line (fixes #5424) (Kenneth Williams) +* aaf324a Fix: missing support for json sub configs (fixes #5413) (Noam Okman) +* 48ad5fe Update: Add 'caughtErrors' to rule no-unused-vars (fixes #3837) (vamshi) +* ad90c2b Fix: incorrect config message (fixes #5653) (s0ph1e) +* a551831 Docs: Distinguish examples in rules under Node.js and CommonJS (Mark Pedrotti) +* 83cd651 Upgrade: chai to 3.5.0 (fixes #5647) (alberto) +* 32748dc Fix: `radix` rule false positive at shadowed variables (fixes #5639) (Toru Nagashima) +* 66db38d Fix: `--no-ignore` should not un-ignore default ignores (fixes #5547) (alberto) +* e3e06f3 Docs: Distinguish examples in rules under Best Practices part 4 (Mark Pedrotti) +* a9f0865 Docs: Update no-sequences rule docs for clarity (fixes #5536) (Kai Cataldo) +* bae7b30 Docs: Add michaelficarra as committer (alberto) +* e2990e7 Docs: Consistent wording in rules README (alberto) +* 49b4d2a Docs: Update team list with new members (Ilya Volodin) +* d0ae66c Update: Allow autoconfiguration for JSX code (fixes #5511) (Ian VanSchooten) +* 38a0a64 Docs: Clarify `linebreak-style` docs (fixes #5628) (alberto) +* 4b7305e Fix: Allow default ignored files to be unignored (fixes #5410) (Ian VanSchooten) +* 4b05ce6 Update: Enforce repo coding conventions via ESLint (refs #5188) (Kevin Partington) +* 051b255 Docs: Remove or rewrite references to former ecmaFeatures (Mark Pedrotti) +* 9a22625 Fix: `prefer-const` false positive at non-blocked if (fixes #5610) (Toru Nagashima) +* b1fd482 Fix: leading comments added from previous node (fixes #5531) (Kai Cataldo) +* c335650 Docs: correct the no-confusing-arrow docs (Daniel Norman) +* e94b77d Fix: Respect 'ignoreTrailingComments' in max-len rule (fixes #5563) (Vamshi Krishna) +* 9289ef8 Fix: handle personal package.json without config (fixes #5496) (Denny Christochowitz) +* 87d74b2 Fix: `prefer-const` got to not change scopes (refs #5284) (Toru Nagashima) +* 5a881e7 Docs: Fix typo in code snippet for no-unmodified-loop-condition rule (Chris Rebert) +* 03037c2 Update: Overrides for space-unary-ops (fixes #5060) (Afnan Fahim) +* 24d986a Update: replace MD5 hashing of cache files with MurmurHash (fixes #5522) (Michael Ficarra) +* f405030 Fix: Ensure allowing `await` as a property name (fixes #5564) (Toru Nagashima) +* aefc90c Fix: `no-useless-constructor` clash (fixes #5573) (Toru Nagashima) +* 9eaa20d Docs: Fix typo in CLI help message (ryym) +* a7c3e67 Docs: Invalid json in `configuring.md` (alberto) +* 4e50332 Docs: Make `prefer-template` examples consistent. (alberto) +* cfc14a9 Fix: valid-jsdoc correctly checks type union (fixes #5260) (Kai Cataldo) +* 689cb7d Fix: `quote-props` false positive on certain keys (fixes #5532) (Burak Yigit Kaya) +* 167a03a Fix: `brace-style` erroneously ignoring certain errors (fixes #5197) (Burak Yigit Kaya) +* 3133f28 Fix: object-curly-spacing doesn't know types (fixes #5537) (fixes #5538) (Burak Yigit Kaya) +* d0ca171 Docs: Separate parser and config questions in issue template (Kevin Partington) +* bc769ca Fix: Improve file path resolution (fixes #5314) (Ian VanSchooten) +* 9ca8567 Docs: Distinguish examples in rules under Best Practices part 3 (Mark Pedrotti) +* b9c69f1 Docs: Distinguish examples in rules under Variables part 2 (Mark Pedrotti) +* c289414 New: `no-duplicate-imports` rule (fixes #3478) (Simen Bekkhus) + +v2.4.0 - March 11, 2016 + +* 97b2466 Fix: estraverse/escope to work with unknowns (fixes #5476) (Nicholas C. Zakas) +* 641b3f7 Fix: validate the type of severity level (fixes #5499) (Shinnosuke Watanabe) +* 9ee8869 Docs: no-unused-expressions - add more edge unusable and usable examples (Brett Zamir) +* 56bf864 Docs: Create parity between no-sequences examples (Brett Zamir) +* 13ef1c7 New: add `--parser-options` to CLI (fixes #5495) (Jordan Harband) +* ae1ee54 Docs: fix func-style arrow exception option (Craig Martin) +* 91852fd Docs: no-lone-blocks - show non-problematic (and problematic) label (Brett Zamir) +* b34458f Docs: Rearrange rules for better categories (and improve rule summaries) (Brett Zamir) +* 1198b26 Docs: Minor README clarifications (Brett Zamir) +* 03e6869 Fix: newline-before-return: bug with comment (fixes #5480) (mustafa) +* ad100fd Fix: overindent in VariableDeclarator parens or brackets (fixes #5492) (David Greenspan) +* 9b8e04b Docs: Replace all node references to Node.js which is the official name (Brett Zamir) +* cc1f2f0 Docs: Minor fixes in no-new-func (Brett Zamir) +* 6ab81d4 Docs: Distinguish examples in rules under Best Practices part 1 (Mark Pedrotti) +* 9c6c70c Update: add `allowParens` option to `no-confusing-arrow` (fixes #5332) (Burak Yigit Kaya) +* 979c096 Docs: Document linebreak-style as fixable. (Afnan Fahim) +* 9f18a81 Fix: Ignore destructuring assignment in `object-shorthand` (fixes #5488) (alberto) +* 5d9a798 Docs: README.md, prefer-const; change modified to reassigned (Michiel de Bruijne) +* 38eb7f1 Fix: key-spacing checks ObjectExpression is multiline (fixes #5479) (Kevin Partington) +* 9592c45 Fix: `no-unmodified-loop-condition` false positive (fixes #5445) (Toru Nagashima) + +v2.3.0 - March 4, 2016 + +* 1b2c6e0 Update: Proposed no-magic-numbers option: ignoreJSXNumbers (fixes #5348) (Brandon Beeks) +* 63c0b7d Docs: Fix incorrect environment ref. in Rules in Plugins. (fixes #5421) (Jesse McCarthy) +* 124c447 Build: Add additional linebreak to docs (fixes #5464) (Ilya Volodin) +* 0d3831b Docs: Add RuleTester parserOptions migration steps (Kevin Partington) +* 50f4d5a Fix: extends chain (fixes #5411) (Toru Nagashima) +* 0547072 Update: Replace getLast() with lodash.last() (fixes #5456) (Jordan Eldredge) +* 8c29946 Docs: Distinguish examples in rules under Possible Errors part 1 (Mark Pedrotti) +* 5319b4a Docs: Distinguish examples in rules under Possible Errors part 2 (Mark Pedrotti) +* 1da2420 Fix: crash when SourceCode object was reused (fixes #5007) (Toru Nagashima) +* 9e9daab New: newline-before-return rule (fixes #5009) (Kai Cataldo) +* e1bbe45 Fix: Check space after anonymous generator star (fixes #5435) (alberto) +* 119e0ed Docs: Distinguish examples in rules under Variables (Mark Pedrotti) +* 905c049 Fix: `no-undef` false positive at new.target (fixes #5420) (Toru Nagashima) +* 4a67b9a Update: Add ES7 support (fixes #5401) (Brandon Mills) +* 89c757d Docs: Replace ecmaFeatures with parserOptions in working-with-rules (Kevin Partington) +* 804c08e Docs: Add parserOptions to RuleTester section of working-with-rules (Kevin Partington) +* 1982c50 Docs: Document string option for `no-unused-vars`. (alberto) +* 4f82b2b Update: Support classes in `padded-blocks` (fixes #5092) (alberto) +* ed5564f Docs: Specify results of `no-unused-var` with `args` (fixes #5334) (chinesedfan) +* de0a4ef Fix: `getFormatter` throws an error when called as static (fixes #5378) (cowchimp) +* 78f7ca9 Fix: Prevent crash from swallowing console.log (fixes #5381) (Ian VanSchooten) +* 34b648d Fix: remove tests which have invalid syntax (fixes #5405) (Toru Nagashima) +* 7de5ae4 Docs: Missing allow option in docs (Scott O'Hara) +* cf14c71 Fix: `no-useless-constructor` rule crashes sometimes (fixes #5290) (Burak Yigit Kaya) +* 70e3a02 Update: Allow string severity in config (fixes #3626) (Nicholas C. Zakas) +* 13c7c19 Update: Exclude ES5 constructors from consistent-return (fixes #5379) (Kevin Locke) +* 784d3bf Fix: Location info in `dot-notation` rule (fixes #5397) (Gyandeep Singh) +* 6280b2d Update: Support switch statements in padded-blocks (fixes #5056) (alberto) +* 25a5b2c Fix: Allow irregular whitespace in comments (fixes #5368) (Christophe Porteneuve) +* 560c0d9 New: no-restricted-globals rule implementation (fixes #3966) (Benoît Zugmeyer) +* c5bb478 Fix: `constructor-super` false positive after a loop (fixes #5394) (Toru Nagashima) +* 6c0c4aa Docs: Add Issue template (fixes #5313) (Kai Cataldo) +* 1170e67 Fix: indent rule doesn't handle constructor instantiation (fixes #5384) (Nate Cavanaugh) +* 6bc9932 Fix: Avoid magic numbers in rule options (fixes #4182) (Brandon Beeks) +* 694e1c1 Fix: Add tests to cover default magic number tests (fixes #5385) (Brandon Beeks) +* 0b5349d Fix: .eslintignore paths should be absolute (fixes #5362) (alberto) +* 8f6c2e7 Update: Better error message for plugins (refs #5221) (Nicholas C. Zakas) +* 972d41b Update: Improve error message for rule-tester (fixes #5369) (Jeroen Engels) +* fe3f6bd Fix: `no-self-assign` false positive at shorthand (fixes #5371) (Toru Nagashima) +* 2376291 Docs: Missing space in `no-fallthrough` doc. (alberto) +* 5aedb87 Docs: Add mysticatea as reviewer (Nicholas C. Zakas) +* 1f9fd10 Update: no-invalid-regexp allows custom flags (fixes #5249) (Afnan Fahim) +* f1eab9b Fix: Support for dash and slash in `valid-jsdoc` (fixes #1598) (Gyandeep Singh) +* cd12a4b Fix:`newline-per-chained-call` should only warn on methods (fixes #5289) (Burak Yigit Kaya) +* 0d1377d Docs: Add missing `symbol` type into valid list (Plusb Preco) +* 6aa2380 Update: prefer-const; change modified to reassigned (fixes #5350) (Michiel de Bruijne) +* d1d62c6 Fix: indent check for else keyword with Stroustrup style (fixes #5218) (Gyandeep Singh) +* 7932f78 Build: Fix commit message validation (fixes #5340) (Nicholas C. Zakas) +* 1c347f5 Fix: Cleanup temp files from tests (fixes #5338) (Nick) +* 2f3e1ae Build: Change rules to warnings in perf test (fixes #5330) (Brandon Mills) +* 36f40c2 Docs: Achieve consistent order of h2 in rule pages (Mark Pedrotti) + +v2.2.0 - February 19, 2016 + +* 45a22b5 Docs: remove esprima-fb from suggested parsers (Henry Zhu) +* a4d9cd3 Docs: Fix semi rule typo (Brandon Mills) +* 9d005c0 Docs: Correct option name in `no-implicit-coercion` rule (Neil Kistner) +* 2977248 Fix: Do not cache `.eslintrc.js` (fixes #5067) (Nick) +* 211eb8f Fix: no-multi-spaces conflicts with smart tabs (fixes #2077) (Afnan Fahim) +* 6dc9483 Fix: Crash in `constructor-super` (fixes #5319) (Burak Yigit Kaya) +* 3f48875 Docs: Fix yield star spacing examples (Dmitriy Lazarev) +* 4dab76e Docs: Update `preferType` heading to keep code format (fixes #5307) (chinesedfan) +* 7020b82 Fix: `sort-imports` warned between default and members (fixes #5305) (Toru Nagashima) +* 2f4cd1c Fix: `constructor-super` and `no-this-before-super` false (fixes #5261) (Toru Nagashima) +* 59e9c5b New: eslint-disable-next-line (fixes #5206) (Kai Cataldo) +* afb6708 Fix: `indent` rule forgot about some CallExpressions (fixes #5295) (Burak Yigit Kaya) +* d18d406 Docs: Update PR creation bot message (fixes #5268) (Nicholas C. Zakas) +* 0b1cd19 Fix: Ignore parser option if set to default parser (fixes #5241) (Kai Cataldo) + +v2.1.0 - February 15, 2016 + +* 7981ef5 Build: Fix release script (Nicholas C. Zakas) +* c9c34ea Fix: Skip computed members in `newline-per-chained-call` (fixes #5245) (Burak Yigit Kaya) +* b32ddad Build: `npm run perf` command should check the exit code (fixes #5279) (Burak Yigit Kaya) +* 6580d1c Docs: Fix incorrect `api.verify` JSDoc for `config` param (refs #5104) (Burak Yigit Kaya) +* 1f47868 Docs: Update yield-star-spacing documentation for 2.0.0 (fixes #5272) (Burak Yigit Kaya) +* 29da8aa Fix: `newline-after-var` crash on a switch statement (fixes #5277) (Toru Nagashima) +* 86c5a20 Fix: `func-style` should ignore ExportDefaultDeclarations (fixes #5183) (Burak Yigit Kaya) +* ba287aa Fix: Consolidate try/catches to top levels (fixes #5243) (Ian VanSchooten) +* 3ef5da1 Docs: Update no-magic-numbers#ignorearrayindexes. (KazuakiM) +* 0d6850e Update: Allow var declaration at end of block (fixes #5246) (alberto) +* c1e3a73 Fix: Popular style init handles missing package.json keys (refs #5243) (Brandon Mills) +* 68c6e22 Docs: fix default value of `keyword-spacing`'s overrides option. (Toru Nagashima) +* 00fe46f Upgrade: inquirer (fixes #5265) (Bogdan Chadkin) +* ef729d7 Docs: Remove option that is not being used in max-len rule (Thanos Lefteris) +* 4a5ddd5 Docs: Fix rule config above examples for require-jsdoc (Thanos Lefteris) +* c5cbc1b Docs: Add rule config above each example in jsx-quotes (Thanos Lefteris) +* f0aceba Docs: Correct alphabetical ordering in rule list (Randy Coulman) +* 1651ffa Docs: update migrating to 2.0.0 (fixes #5232) (Toru Nagashima) +* 9078537 Fix: `indent` on variable declaration with separate array (fixes #5237) (Burak Yigit Kaya) +* f8868b2 Docs: Typo fix in consistent-this rule doc fixes #5240 (Nicolas Froidure) +* 44f6915 Fix: ESLint Bot mentions the wrong person for extra info (fixes #5229) (Burak Yigit Kaya) +* c612a8e Fix: `no-empty-function` crash (fixes #5227) (Toru Nagashima) +* ae663b6 Docs: Add links for issue documentation (Nicholas C. Zakas) +* 717bede Build: Switch to using eslint-release (fixes #5223) (Nicholas C. Zakas) +* 980e139 Fix: Combine all answers for processAnswers (fixes #5220) (Ian VanSchooten) +* 1f2a1d5 Docs: Remove inline errors from doc examples (fixes #4104) (Burak Yigit Kaya) + +v2.0.0 - February 12, 2016 + +* cc3a66b Docs: Issue message when more info is needed (Nicholas C. Zakas) +* 2bc40fa Docs: Simplify hierarchy of headings in rule pages (Mark Pedrotti) +* 1666254 Docs: Add note about only-whitespace rule for `--fix` (fixes #4774) (Burak Yigit Kaya) +* 2fa09d2 Docs: Add `quotes` to related section of `prefer-template` (fixes #5192) (Burak Yigit Kaya) +* 7b12995 Fix: `key-spacing` not enforcing no-space in minimum mode (fixes #5008) (Burak Yigit Kaya) +* c1c4f4d Breaking: new `no-empty-function` rule (fixes #5161) (Toru Nagashima) + +v2.0.0-rc.1 - February 9, 2016 + +* 4dad82a Update: Adding shared environment for node and browser (refs #5196) (Eli White) +* b46c893 Fix: Config file relative paths (fixes #5164, fixes #5160) (Nicholas C. Zakas) +* aa5b2ac Fix: no-whitespace-before-property fixes (fixes #5167) (Kai Cataldo) +* 4e99924 Update: Replace several dependencies with lodash (fixes #5012) (Gajus Kuizinas) +* 718dc68 Docs: Remove periods in rules' README for consistency. (alberto) +* 7a47085 Docs: Correct `arrow-spacing` overview. (alberto) +* a4cde1b Docs: Clarify global-require inside try/catch (fixes #3834) (Brandon Mills) +* fd07925 Docs: Clarify docs for api.verify (fixes #5101, fixes #5104) (Burak Yigit Kaya) +* 413247f New: Add a --print-config flag (fixes #5099) (Christopher Crouzet) +* efeef42 Update: Implement auto fix for space-in-parens (fixes #5050) (alberto) +* e07fdd4 Fix: code path analysis and labels (fixes #5171) (Toru Nagashima) +* 2417bb2 Fix: `no-unmodified-loop-condition` false positive (fixes #5166) (Toru Nagashima) +* fae1884 Fix: Allow same-line comments in padded-blocks (fixes #5055) (Brandon Mills) +* a24d8ad Fix: Improve autoconfig logging (fixes #5119) (Ian VanSchooten) +* e525923 Docs: Correct obvious inconsistencies in rules h2 elements (Mark Pedrotti) +* 9675b5e Docs: `avoid-escape` does not allow backticks (fixes #5147) (alberto) +* a03919a Fix: `no-unexpected-multiline` false positive (fixes #5148) (Feross Aboukhadijeh) +* 74360d6 Docs: Note no-empty applies to empty block statements (fixes #5105) (alberto) +* 6eeaa3f Build: Remove pending tests (fixes #5126) (Ian VanSchooten) +* 02c83df Docs: Update docs/rules/no-plusplus.md (Sheldon Griffin) +* 0c4de5c New: Added "table" formatter (fixes #4037) (Gajus Kuizinas) +* 0a59926 Update: 'implied strict mode' ecmaFeature (fixes #4832) (Nick Evans) +* 53a6eb3 Fix: Handle singular case in rule-tester error message (fixes #5141) (Bryan Smith) +* 97ac91c Build: Increment eslint-config-eslint (Nicholas C. Zakas) + +v2.0.0-rc.0 - February 2, 2016 + +* 973c499 Fix: `sort-imports` crash (fixes #5130) (Toru Nagashima) +* e64b2c2 Breaking: remove `no-empty-label` (fixes #5042) (Toru Nagashima) +* 79ebbc9 Breaking: update `eslint:recommended` (fixes #5103) (Toru Nagashima) +* e1d7368 New: `no-extra-label` rule (fixes #5059) (Toru Nagashima) +* c83b48c Fix: find ignore file only in cwd (fixes #5087) (Nicholas C. Zakas) +* 3a24240 Docs: Fix jsdoc param names to match function param names (Thanos Lefteris) +* 1d79746 Docs: Replace ecmaFeatures setting with link to config page (Thanos Lefteris) +* e96ffd2 New: `template-curly-spacing` rule (fixes #5049) (Toru Nagashima) +* 4b02902 Update: Extended no-console rule (fixes #5095) (EricHenry) +* 757651e Docs: Remove reference to rules enabled by default (fixes #5100) (Brandon Mills) +* 0d87f5d Docs: Clarify eslint-disable comments only affect rules (fixes #5005) (Brandon Mills) +* 1e791a2 New: `no-self-assign` rule (fixes #4729) (Toru Nagashima) +* c706eb9 Fix: reduced `no-loop-func` false positive (fixes #5044) (Toru Nagashima) +* 3275e86 Update: Add extra aliases to consistent-this rule (fixes #4492) (Zachary Alexander Belford) +* a227360 Docs: Replace joyent org with nodejs (Thanos Lefteris) +* b2aedfe New: Rule to enforce newline after each call in the chain (fixes #4538) (Rajendra Patil) +* d67bfdd New: `no-unused-labels` rule (fixes #5052) (Toru Nagashima) + +v2.0.0-beta.3 - January 29, 2016 + +* 86a3e3d Update: Remove blank lines at beginning of files (fixes #5045) (Jared Sohn) +* 4fea752 New: Autoconfiguration from source inspection (fixes #3567) (Ian VanSchooten) +* 519f39f Breaking: Remove deprecated rules (fixes #5032) (Gyandeep Singh) +* c75ee4a New: Add support for configs in plugins (fixes #3659) (Ilya Volodin) +* 361377f Fix: `prefer-const` false positive reading before writing (fixes #5074) (Toru Nagashima) +* ff2551d Build: Improve `npm run perf` command (fixes #5028) (Toru Nagashima) +* bcca69b Update: add int32Hint option to `no-bitwise` rule (fixes #4873) (Maga D. Zandaqo) +* e3f2683 Update: config extends dependency lookup (fixes #5023) (Nicholas C. Zakas) +* a327a06 Fix: Indent rule for allman brace style scenario (fixes #5064) (Gyandeep Singh) +* afdff6d Fix: `no-extra-bind` false positive (fixes #5058) (Toru Nagashima) +* c1fad4f Update: add autofix support for spaced-comment (fixes #4969, fixes #5030) (Maga D. Zandaqo) +* 889b942 Revert "Docs: Update readme for legend describing rules icons (refs #4355)" (Nicholas C. Zakas) +* b0f21a0 Fix: `keyword-spacing` false positive in template strings (fixes #5043) (Toru Nagashima) +* 53fa5d1 Fix: `prefer-const` false positive in a loop condition (fixes #5024) (Toru Nagashima) +* 385d399 Docs: Update readme for legend describing rules icons (Kai Cataldo) +* 505f1a6 Update: Allow parser to be relative to config (fixes #4985) (Nicholas C. Zakas) +* 79e8a0b New: `one-var-declaration-per-line` rule (fixes #1622) (alberto) +* 654e6e1 Update: Check extra Boolean calls in no-extra-boolean-cast (fixes #3650) (Andrew Sutton) + +v2.0.0-beta.2 - January 22, 2016 + +* 3fa834f Docs: Fix formatter links (fixes #5006) (Gyandeep Singh) +* 54b1bc8 Docs: Fix link in strict.md (fixes #5026) (Nick Evans) +* e0c5cf7 Upgrade: Espree to 3.0.0 (fixes #5018) (Ilya Volodin) +* 69f149d Docs: language tweaks (Andres Kalle) +* 2b33c74 Update: valid-jsdoc to not require @return in constructors (fixes #4976) (Maga D. Zandaqo) +* 6ac2e01 Docs: Fix description of exported comment (Mickael Jeanroy) +* 29392f8 New: allow-multiline option on comma-dangle (fixes #4967) (Alberto Gimeno) +* 05b8cb3 Update: Module overrides all 'strict' rule options (fixes #4936) (Nick Evans) +* 8470474 New: Add metadata to few test rules (fixes #4494) (Ilya Volodin) +* ba11c1b Docs: Add Algolia as sponsor to README (Nicholas C. Zakas) +* b28a19d Breaking: Plugins envs and config removal (fixes #4782, fixes #4952) (Nicholas C. Zakas) +* a456077 Docs: newline-after-var doesn't allow invalid options. (alberto) +* 3e6a24e Breaking: Change `strict` default mode to "safe" (fixes #4961) (alberto) +* 5b96265 Breaking: Update eslint:recommended (fixes #4953) (alberto) +* 7457a4e Upgrade: glob to 6.x (fixes #4991) (Gyandeep Singh) +* d3f4bdd Build: Cleanup for code coverage (fixes #4983) (Gyandeep Singh) +* b8fbaa0 Fix: multiple message in TAP formatter (fixes #4975) (Simon Degraeve) +* 990f8da Fix: `getNodeByRangeIndex` performance issue (fixes #4989) (Toru Nagashima) +* 8ac1dac Build: Update markdownlint dependency to 0.1.0 (fixes #4988) (David Anson) +* 5cd5429 Fix: function expression doc in call expression (fixes #4964) (Tim Schaub) +* 4173baa Fix: `no-dupe-class-members` false positive (fixes #4981) (Toru Nagashima) +* 12fe803 Breaking: Supports Unicode BOM (fixes #4878) (Toru Nagashima) +* 1fc80e9 Build: Increment eslint-config-eslint (Nicholas C. Zakas) +* e0a9024 Update: Report newline between template tag and literal (fixes #4210) (Rajendra Patil) +* da3336c Update: Rules should get `sourceType` from Program node (fixes #4960) (Nick Evans) +* a2ac359 Update: Make jsx-quotes fixable (refs #4377) (Gabriele Petronella) +* ee1014d Fix: Incorrect error location for object-curly-spacing (fixes #4957) (alberto) +* b52ed17 Fix: Incorrect error location for space-in-parens (fixes #4956) (alberto) +* 9c1bafb Fix: Columns of parse errors are off by 1 (fixes #4896) (alberto) +* 5e4841e New: 'id-blacklist' rule (fixes #3358) (Keith Cirkel) +* 700b8bc Update: Add "allow" option to allow specific operators (fixes #3308) (Rajendra Patil) +* d82eeb1 Update: Add describe around rule tester blocks (fixes #4907) (Ilya Volodin) +* 2967402 Update: Add minimum value to integer values in schema (fixes #4941) (Ilya Volodin) +* 7b632f8 Upgrade: Globals to ^8.18.0 (fixes #4728) (Gyandeep Singh) +* 86e6e57 Fix: Incorrect error at EOF for no-multiple-empty-lines (fixes #4917) (alberto) +* 7f058f3 Fix: Incorrect location for padded-blocks (fixes #4913) (alberto) +* b3de8f7 Fix: Do not show ignore messages for default ignored files (fixes #4931) (Gyandeep Singh) +* b1360da Update: Support multiLine and singleLine options (fixes #4697) (Rajendra Patil) +* 82fbe09 Docs: Small semantic issue in documentation example (fixes #4937) (Marcelo Zarate) +* 13a4e30 Docs: Formatting inconsistencies (fixes #4912) (alberto) +* d487013 Update: Option to allow extra parens for cond assign (fixes #3317) (alberto) +* 0f469b4 Fix: JSDoc for function expression on object property (fixes #4900) (Tim Schaub) +* c2dee27 Update: Add module tests to no-extra-semi (fixes #4915) (Nicholas C. Zakas) +* 5a633bf Update: Add `preferType` option to `valid-jsdoc` rule (fixes #3056) (Gyandeep Singh) +* ebd01b7 Build: Fix version number on release (fixes #4921) (Nicholas C. Zakas) +* 2d626a3 Docs: Fix typo in changelog (Nicholas C. Zakas) +* c4c4139 Fix: global-require no longer warns if require is shadowed (fixes #4812) (Kevin Partington) +* bbf7f27 New: provide config.parser via `parserName` on RuleContext (fixes #3670) (Ben Mosher) + +v2.0.0-beta.1 - January 11, 2016 + +* 6c70d84 Build: Fix prerelease script (fixes #4919) (Nicholas C. Zakas) +* d5c9435 New: 'sort-imports' rule (refs #3143) (Christian Schuller) +* a8cfd56 Fix: remove duplicate of eslint-config-eslint (fixes #4909) (Toru Nagashima) +* 19a9fbb Breaking: `space-before-blocks` ignores after keywords (fixes #1338) (Toru Nagashima) +* c275b41 Fix: no-extra-parens ExpressionStatement restricted prods (fixes #4902) (Michael Ficarra) +* b795850 Breaking: don't load ~/.eslintrc when using --config flag (fixes #4881) (alberto) +* 3906481 Build: Add AppVeyor CI (fixes #4894) (Gyandeep Singh) +* 6390862 Docs: Fix missing footnote (Yoshiya Hinosawa) +* e5e06f8 Fix: Jsdoc comment for multi-line function expressions (fixes #4889) (Gyandeep Singh) +* 7c9be60 Fix: Fix path errors in windows (fixes #4888) (Gyandeep Singh) +* a1840e7 Fix: gray text was invisible on Solarized Dark theme (fixes #4886) (Jack Leigh) +* fc9f528 Docs: Modify unnecessary flag docs in quote-props (Matija Marohnić) +* 186e8f0 Update: Ignore camelcase in object destructuring (fixes #3185) (alberto) +* 7c97201 Upgrade: doctrine version to 1.1.0 (fixes #4854) (Tim Schaub) +* ceaf324 New: Add no-new-symbol rule (fixes #4862) (alberto) +* e2f2b66 Breaking: Remove defaults from `eslint:recommended` (fixes #4809) (Ian VanSchooten) +* 0b3c01e Docs: Specify default for func-style (fixes #4834) (Ian VanSchooten) +* 008ea39 Docs: Document default for operator assignment (fixes #4835) (alberto) +* b566f56 Docs: no-new-func typo (alberto) +* 1569695 Update: Adds default 'that' for consistent-this (fixes #4833) (alberto) +* f7b28b7 Docs: clarify `requireReturn` option for valid-jsdoc rule (fixes #4859) (Tim Schaub) +* 407f329 Build: Fix prerelease script (Nicholas C. Zakas) +* 688f277 Fix: Set proper exit code for Node > 0.10 (fixes #4691) (Nicholas C. Zakas) +* 58715e9 Fix: Use single quotes in context.report messages (fixes #4845) (Joe Lencioni) +* 5b7586b Fix: do not require a @return tag for @interface (fixes #4860) (Tim Schaub) +* d43f26c Breaking: migrate from minimatch to node-ignore (fixes #2365) (Stefan Grönke) +* c07ca39 Breaking: merges keyword spacing rules (fixes #3869) (Toru Nagashima) +* 871f534 Upgrade: Optionator version to 0.8.1 (fixes #4851) (Eric Johnson) +* 82d4cd9 Update: Add atomtest env (fixes #4848) (Andres Suarez) +* 9c9beb5 Update: Add "ignore" override for operator-linebreak (fixes #4294) (Rajendra Patil) +* 9c03abc Update: Add "allowCall" option (fixes #4011) (Rajendra Patil) +* 29516f1 Docs: fix migration guide for no-arrow-condition rule (Peter Newnham) +* 2ef7549 Docs: clarify remedy to some prefer-const errors (Turadg Aleahmad) +* 1288ba4 Update: Add default limit to `complexity` (fixes #4808) (Ian VanSchooten) +* d3e8179 Fix: env is rewritten by modules (fixes #4814) (Toru Nagashima) +* fd72aba Docs: Example fix for `no-extra-parens` rule (fixes #3527) (Gyandeep Singh) +* 315f272 Fix: Change max-warnings type to Int (fixes #4660) (George Zahariev) +* 5050768 Update: Ask for `commonjs` under config init (fixes #3553) (Gyandeep Singh) +* 4665256 New: Add no-whitespace-before-property rule (fixes #1086) (Kai Cataldo) +* f500d7d Fix: allow extending @scope/eslint/file (fixes #4800) (André Cruz) +* 5ab564e New: 'ignoreArrayIndexes' option for 'no-magic-numbers' (fixes #4370) (Christian Schuller) +* 97cdb95 New: Add no-useless-constructor rule (fixes #4785) (alberto) +* b9bcbaf Fix: Bug in no-extra-bind (fixes #4806) (Andres Kalle) +* 246a6d2 Docs: Documentation fix (Andres Kalle) +* 9ea6b36 Update: Ignore case in jsdoc tags (fixes #4576) (alberto) +* acdda24 Fix: ignore argument parens in no-unexpected-multiline (fixes #4658) (alberto) +* 4931f56 Update: optionally allow bitwise operators (fixes #4742) (Swaagie) + +v2.0.0-alpha-2 - December 23, 2015 + +* Build: Add prerelease script (Nicholas C. Zakas) +* Update: Allow to omit semi for one-line blocks (fixes #4385) (alberto) +* Fix: Handle getters and setters in key-spacing (fixes #4792) (Brandon Mills) +* Fix: ObjectRestSpread throws error in key-spacing rule (fixes #4763) (Ziad El Khoury Hanna) +* Docs: Typo in generator-star (alberto) +* Fix: Backtick behavior in quotes rule (fixes #3090) (Nicholas C. Zakas) +* Fix: Empty schemas forbid any options (fixes #4789) (Brandon Mills) +* Fix: Remove `isMarkedAsUsed` function name (fixes #4783) (Gyandeep Singh) +* Fix: support arrow functions in no-return-assign (fixes #4743) (alberto) +* Docs: Add license header to Working with Rules guide (Brandon Mills) +* Fix: RuleTester to show parsing errors (fixes #4779) (Nicholas C. Zakas) +* Docs: Escape underscores in no-path-concat (alberto) +* Update: configuration for classes in space-before-blocks (fixes #4089) (alberto) +* Docs: Typo in no-useless-concat (alberto) +* Docs: fix typos, suggests (molee1905) +* Docs: Typos in space-before-keywords and space-unary-ops (fixes #4771) (alberto) +* Upgrade: beefy to ^2.0.0, fixes installation errors (fixes #4760) (Kai Cataldo) +* Docs: Typo in no-unexpected-multiline (fixes #4756) (alberto) +* Update: option to ignore top-level max statements (fixes #4309) (alberto) +* Update: Implement auto fix for semi-spacing rule (fixes #3829) (alberto) +* Fix: small typos in code examples (Plusb Preco) +* Docs: Add section on file extensions to user-guide/configuring (adam) +* Fix: Comma first issue in `indent` (fixes #4739, fixes #3456) (Gyandeep Singh) +* Fix: no-constant-condition false positive (fixes #4737) (alberto) +* Fix: Add source property for fatal errors (fixes #3325) (Gyandeep Singh) +* New: Add a comment length option to the max-len rule (fixes #4665) (Ian) +* Docs: RuleTester doesn't require any tests (fixes #4681) (alberto) +* Fix: Remove path analysis from debug log (fixes #4631) (Ilya Volodin) +* Fix: Set null to property ruleId when fatal is true (fixes #4722) (Sébastien Règne) +* New: Visual Studio compatible formatter (fixes #4708) (rhpijnacker) +* New: Add greasemonkey environment (fixes #4715) (silverwind) +* Fix: always-multiline for comma-dangle import (fixes #4704) (Nicholas C. Zakas) +* Fix: Check 1tbs non-block else (fixes #4692) (Nicholas C. Zakas) +* Fix: Apply environment configs last (fixes #3915) (Nicholas C. Zakas) +* New: `no-unmodified-loop-condition` rule (fixes #4523) (Toru Nagashima) +* Breaking: deprecate `no-arrow-condition` rule (fixes #4417) (Luke Karrys) +* Update: Add cwd option for cli-engine (fixes #4472) (Ilya Volodin) +* New: Add no-confusing-arrow rule (refs #4417) (Luke Karrys) +* Fix: ensure `ConfigOps.merge` do a deep copy (fixes #4682) (Toru Nagashima) +* Fix: `no-invalid-this` allows this in static method (fixes #4669) (Toru Nagashima) +* Fix: Export class syntax for `require-jsdoc` rule (fixes #4667) (Gyandeep Singh) +* Update: Add "safe" mode to strict (fixes #3306) (Brandon Mills) + +v2.0.0-alpha-1 - December 11, 2015 + +* Breaking: Correct links between variables and references (fixes #4615) (Toru Nagashima) +* Fix: Update rule tests for parser options (fixes #4673) (Nicholas C. Zakas) +* Breaking: Implement parserOptions (fixes #4641) (Nicholas C. Zakas) +* Fix: max-len rule overestimates the width of some tabs (fixes #4661) (Nick Evans) +* New: Add no-implicit-globals rule (fixes #4542) (Joshua Peek) +* Update: `no-use-before-define` checks invalid initializer (fixes #4280) (Toru Nagashima) +* Fix: Use oneValuePerFlag for --ignore-pattern option (fixes #4507) (George Zahariev) +* New: `array-callback-return` rule (fixes #1128) (Toru Nagashima) +* Upgrade: Handlebars to >= 4.0.5 for security reasons (fixes #4642) (Jacques Favreau) +* Update: Add class body support to `indent` rule (fixes #4372) (Gyandeep Singh) +* Breaking: Remove space-after-keyword newline check (fixes #4149) (Nicholas C. Zakas) +* Breaking: Treat package.json like the rest of configs (fixes #4451) (Ilya Volodin) +* Docs: writing mistake (molee1905) +* Update: Add 'method' option to no-empty (fixes #4605) (Kai Cataldo) +* Breaking: Remove autofix from eqeqeq (fixes #4578) (Ilya Volodin) +* Breaking: Remove ES6 global variables from builtins (fixes #4085) (Brandon Mills) +* Fix: Handle forbidden LineTerminators in no-extra-parens (fixes #4229) (Brandon Mills) +* Update: Option to ignore constructor Fns object-shorthand (fixes #4487) (Kai Cataldo) +* Fix: Check YieldExpression argument in no-extra-parens (fixes #4608) (Brandon Mills) +* Fix: Do not cache `package.json` (fixes #4611) (Spain) +* Build: Consume no-underscore-dangle allowAfterThis option (fixes #4599) (Kevin Partington) +* New: Add no-restricted-imports rule (fixes #3196) (Guy Ellis) +* Docs: no-extra-semi no longer refers to deprecated rule (fixes #4598) (Kevin Partington) +* Fix: `consistent-return` checks the last (refs #3530, fixes #3373) (Toru Nagashima) +* Update: add class option to `no-use-before-define` (fixes #3944) (Toru Nagashima) +* Breaking: Simplify rule schemas (fixes #3625) (Nicholas C. Zakas) +* Docs: Update docs/rules/no-plusplus.md (Xiangyun Chi) +* Breaking: added bower_components to default ignore (fixes #3550) (Julian Laval) +* Fix: `no-unreachable` with the code path (refs #3530, fixes #3939) (Toru Nagashima) +* Fix: `no-this-before-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `no-fallthrough` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `constructor-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Breaking: Switch to Espree 3.0.0 (fixes #4334) (Nicholas C. Zakas) +* Breaking: Freeze context object (fixes #4495) (Nicholas C. Zakas) +* Docs: Add Code of Conduct (fixes #3095) (Nicholas C. Zakas) +* Breaking: Remove warnings of readonly from `no-undef` (fixes #4504) (Toru Nagashima) +* Update: allowAfterThis option in no-underscore-dangle (fixes #3435) (just-boris) +* Fix: Adding options unit tests for --ignore-pattern (refs #4507) (Kevin Partington) +* Breaking: Implement yield-star-spacing rule (fixes #4115) (Bryan Smith) +* New: `prefer-rest-params` rule (fixes #4108) (Toru Nagashima) +* Update: `prefer-const` begins to cover separating init (fixes #4474) (Toru Nagashima) +* Fix: `no-eval` come to catch indirect eval (fixes #4399, fixes #4441) (Toru Nagashima) +* Breaking: Default no-magic-numbers to none. (fixes #4193) (alberto) +* Breaking: Allow empty arrow body (fixes #4411) (alberto) +* New: Code Path Analysis (fixes #3530) (Toru Nagashima) + +v1.10.3 - December 1, 2015 + +* Docs: Update strict rule docs (fixes #4583) (Nicholas C. Zakas) +* Docs: Reference .eslintrc.* in contributing docs (fixes #4532) (Kai Cataldo) +* Fix: Add for-of to `curly` rule (fixes #4571) (Kai Cataldo) +* Fix: Ignore space before function in array start (fixes #4569) (alberto) + +v1.10.2 - November 27, 2015 + +* Upgrade: escope@3.3.0 (refs #4485) (Nicholas C. Zakas) +* Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553) (alberto) +* Fix: lines-around-comment with multiple comments (fixes #3509) (alberto) +* Upgrade: doctrine@0.7.1 (fixes #4545) (Kevin Partington) +* Fix: Bugfix for eqeqeq autofix (fixes #4540) (Kevin Partington) +* Fix: Add for-in to `curly` rule (fixes #4436) (Kai Cataldo) +* Fix: `valid-jsdoc` unneeded require check fix (fixes #4527) (Gyandeep Singh) +* Fix: `brace-style` ASI fix for if-else condition (fixes #4520) (Gyandeep Singh) +* Build: Add branch update during release process (fixes #4491) (Gyandeep Singh) +* Build: Allow revert commits in commit messages (fixes #4452) (alberto) +* Fix: Incorrect location in no-fallthrough (fixes #4516) (alberto) +* Fix: `no-spaced-func` had been crashed (fixes #4508) (Toru Nagashima) +* Fix: Add a RestProperty test of `no-undef` (fixes #3271) (Toru Nagashima) +* Docs: Load badge from HTTPS (Brian J Brennan) +* Build: Update eslint bot messages (fixes #4497) (Nicholas C. Zakas) + +v1.10.1 - November 20, 2015 + +* Fix: Revert freezing context object (refs #4495) (Nicholas C. Zakas) +* 1.10.0 (Nicholas C. Zakas) + +v1.10.0 - November 20, 2015 + +* Docs: Remove dupes from changelog (Nicholas C. Zakas) +* Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas) +* Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas) +* Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas) +* Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas) +* Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas) +* Update: Add class support to `require-jsdoc` rule (fixes #4268) (Gyandeep Singh) +* Update: return type error in `valid-jsdoc` rule (fixes #4443) (Gyandeep Singh) +* Update: Display errors at the place where fix should go (fixes #4470) (nightwing) +* Docs: Fix typo in default `cacheLocation` value (Andrew Hutchings) +* Fix: Handle comments in block-spacing (fixes #4387) (alberto) +* Update: Accept array for `ignorePattern` (fixes #3982) (Jesse McCarthy) +* Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko) +* Fix: space-before-keywords false positive (fixes #4449) (alberto) +* Fix: Improves performance (refs #3530) (Toru Nagashima) +* Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing) +* Docs: Update indent.md (Nathan Brown) +* New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson) +* New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas) +* Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)" (Brandon Mills) +* Update: Add JSX exceptions to no-extra-parens (fixes #4229) (Brandon Mills) +* Docs: Replace link to deprecated rule with newer rule (Andrew Marshall) +* Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438) (Toru Nagashima) +* Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto) +* Fix: `curly` warns wrong location for `else` (fixes #4362) (Toru Nagashima) +* Fix: `id-length` properties never option (fixes #4347) (Toru Nagashima) +* Docs: missing close rbracket in example (@storkme) +* Revert "Update: Allow empty arrow body (fixes #4411)" (Nicholas C. Zakas) +* Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington) +* Docs: Document semi-spacing behaviour (fixes #4404) (alberto) +* Update: Allow empty arrow body (fixes #4411) (alberto) +* Fix: Handle comments in comma-spacing (fixes #4389) (alberto) +* Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas) +* Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas) +* Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364) (Michał Gołębiowski) +* Fix: Display singular/plural version of "line" in message (fixes #4359) (Marius Schulz) +* Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson) +* Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington) +* Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko) + +v1.9.0 - November 6, 2015 + +* Update: Make radix accept a "as-needed" option (fixes #4048) (Michał Gołębiowski) +* Fix: Update the message to include number of lines (fixes #4342) (Brian Delahunty) +* Docs: ASI causes problem whether semicolons are used or not (Thai Pangsakulyanont) +* Fix: Fixer to not overlap ranges among fix objects (fixes #4321) (Gyandeep Singh) +* Update: Add default to `max-nested-callbacks` (fixes #4297) (alberto) +* Fix: Check comments in space-in-parens (fixes #4302) (alberto) +* Update: Add quotes to error messages to improve clarity (fixes #4313) (alberto) +* Fix: tests failing due to differences in temporary paths (fixes #4324) (alberto) +* Fix: Make tests compatible with Windows (fixes #4315) (Ian VanSchooten) +* Update: Extract glob and filesystem logic from cli-engine (fixes #4305) (Ian VanSchooten) +* Build: Clarify commit-check messages (fixes #4256) (Ian VanSchooten) +* Upgrade: Upgrade various dependencies (fixes #4303) (Gyandeep Singh) +* Build: Add node 5 to travis build (fixes #4310) (Gyandeep Singh) +* Fix: ensure using correct estraverse (fixes #3951) (Toru Nagashima) +* Docs: update docs about using gitignore (Mateusz Derks) +* Update: Detect and fix wrong linebreaks (fixes #3981) (alberto) +* New: Add no-case-declarations rule (fixes #4278) (Erik Arvidsson) + +v1.8.0 - October 30, 2015 + +* Fix: Check for node property before testing type (fixes #4298) (Ian VanSchooten) +* Docs: Specify 'double' as default for quotes (fixes #4270) (Ian VanSchooten) +* Fix: Missing errors in space-in-parens (fixes #4257, fixes #3996) (alberto) +* Docs: fixed typo (Mathieu M-Gosselin) +* Fix: `cacheLocation` handles paths in windows style. (fixes #4285) (royriojas) +* Docs: fixed typo (mpal9000) +* Update: Add support for class in `valid-jsdoc` rule (fixes #4279) (Gyandeep Singh) +* Update: cache-file accepts a directory. (fixes #4241) (royriojas) +* Update: Add `maxEOF` to no-multiple-empty-lines (fixes #4235) (Adrien Vergé) +* Update: fix option for comma-spacing (fixes #4232) (HIPP Edgar (PRESTA EXT)) +* Docs: Fix use of wrong word in configuration doc (Jérémie Astori) +* Fix: Prepare config before verifying SourceCode (fixes #4230) (Ian VanSchooten) +* Update: RuleTester come to check AST was not modified (fixes #4156) (Toru Nagashima) +* Fix: wrong count for 'no-multiple-empty-lines' on last line (fixes #4228) (alberto) +* Update: Add `allow` option to `no-shadow` rule (fixes #3035) (Gyandeep Singh) +* Doc: Correct the spelling of Alberto's surname (alberto) +* Docs: Add alberto as a committer (Gyandeep Singh) +* Build: Do not stub console in testing (fixes #1328) (Gyandeep Singh) +* Fix: Check node exists before checking type (fixes #4231) (Ian VanSchooten) +* Update: Option to exclude afterthoughts from no-plusplus (fixes #4093) (Brody McKee) +* New: Add rule no-arrow-condition (fixes #3280) (Luke Karrys) +* Update: Add linebreak style option to eol-last (fixes #4148) (alberto) +* New: arrow-body-style rule (fixes #4109) (alberto) + +v1.7.3 - October 21, 2015 + +* Fix: Support comma-first style in key-spacing (fixes #3877) (Brandon Mills) +* Fix: no-magic-numbers: variable declarations (fixes #4192) (Ilya Panasenko) +* Fix: Support ES6 shorthand in key-spacing (fixes #3678) (Brandon Mills) +* Fix: `indent` array with memberExpression (fixes #4203) (Gyandeep Singh) +* Fix: `indent` param function on sameline (fixes #4174) (Gyandeep Singh) +* Fix: no-multiple-empty-lines fails when empty line at EOF (fixes #4214) (alberto) +* Fix: `comma-dangle` false positive (fixes #4200) (Nicholas C. Zakas) +* Fix: `valid-jsdoc` prefer problem (fixes #4205) (Nicholas C. Zakas) +* Docs: Add missing single-quote (Kevin Lamping) +* Fix: correct no-multiple-empty-lines at EOF (fixes #4140) (alberto) + +v1.7.2 - October 19, 2015 + +* Fix: comma-dangle confused by parens (fixes #4195) (Nicholas C. Zakas) +* Fix: no-mixed-spaces-and-tabs (fixes #4189, fixes #4190) (alberto) +* Fix: no-extend-native disallow using Object.properties (fixes #4180) (Nathan Woltman) +* Fix: no-magic-numbers should ignore Number.parseInt (fixes #4167) (Henry Zhu) + +v1.7.1 - October 16, 2015 + +* Fix: id-match schema (fixes #4155) (Nicholas C. Zakas) +* Fix: no-magic-numbers should ignore parseInt (fixes #4167) (Nicholas C. Zakas) +* Fix: `indent` param function fix (fixes #4165, fixes #4164) (Gyandeep Singh) + +v1.7.0 - October 16, 2015 + +* Fix: array-bracket-spacing for empty array (fixes #4141) (alberto) +* Fix: `indent` arrow function check fix (fixes #4142) (Gyandeep Singh) +* Update: Support .js files for config (fixes #3102) (Gyandeep Singh) +* Fix: Make eslint-config-eslint work (fixes #4145) (Nicholas C. Zakas) +* Fix: `prefer-arrow-callback` had been wrong at arguments (fixes #4095) (Toru Nagashima) +* Docs: Update various rules docs (Nicholas C. Zakas) +* New: Create eslint-config-eslint (fixes #3525) (Nicholas C. Zakas) +* Update: RuleTester allows string errors in invalid cases (fixes #4117) (Kevin Partington) +* Docs: Reference no-unexpected-multiline in semi (fixes #4114) (alberto) +* Update: added exceptions to `lines-around-comment` rule. (fixes #2965) (Mathieu M-Gosselin) +* Update: Add `matchDescription` option to `valid-jsdoc` (fixes #2449) (Gyandeep Singh) +* Fix: check for objects or arrays in array-bracket-spacing (fixes #4083) (alberto) +* Docs: Alphabetize Rules lists (Kenneth Chung) +* Fix: message templates fail when no parameters are passed (fixes #4080) (Ilya Volodin) +* Fix: `indent` multi-line function call (fixes #4073, fixes #4075) (Gyandeep Singh) +* Docs: Improve comma-dangle documentation (Gilad Peleg) +* Fix: no-mixed-tabs-and-spaces fails with some comments (fixes #4086) (alberto) +* Fix: `semi` to check for do-while loops (fixes #4090) (Gyandeep Singh) +* Build: Fix path related failures on Windows in tests (fixes #4061) (Burak Yigit Kaya) +* Fix: `no-unused-vars` had been missing some parameters (fixes #4047) (Toru Nagashima) +* Fix: no-mixed-spaces-and-tabs with comments and templates (fixes #4077) (alberto) +* Update: Add `allow` option for `no-underscore-dangle` rule (fixes #2135) (Gyandeep Singh) +* Update: `allowArrowFunctions` option for `func-style` rule (fixes #1897) (Gyandeep Singh) +* Fix: Ignore template literals in no-mixed-tabs-and-spaces (fixes #4054) (Nicholas C. Zakas) +* Build: Enable CodeClimate (fixes #4068) (Nicholas C. Zakas) +* Fix: `no-cond-assign` had needed double parens in `for` (fixes #4023) (Toru Nagashima) +* Update: Ignore end of function in newline-after-var (fixes #3682) (alberto) +* Build: Performance perf to not ignore jshint file (refs #3765) (Gyandeep Singh) +* Fix: id-match bug incorrectly errors on `NewExpression` (fixes #4042) (Burak Yigit Kaya) +* Fix: `no-trailing-spaces` autofix to handle linebreaks (fixes #4050) (Gyandeep Singh) +* Fix: renamed no-magic-number to no-magic-numbers (fixes #4053) (Vincent Lemeunier) +* New: add "consistent" option to the "curly" rule (fixes #2390) (Benoît Zugmeyer) +* Update: Option to ignore for loops in init-declarations (fixes #3641) (alberto) +* Update: Add webextensions environment (fixes #4051) (Blake Winton) +* Fix: no-cond-assign should report assignment location (fixes #4040) (alberto) +* New: no-empty-pattern rule (fixes #3668) (alberto) +* Upgrade: Upgrade globals to 8.11.0 (fixes #3599) (Burak Yigit Kaya) +* Docs: Re-tag JSX code fences (fixes #4020) (Brandon Mills) +* New: no-magic-number rule (fixes #4027) (Vincent Lemeunier) +* Docs: Remove list of users from README (fixes #3881) (Brandon Mills) +* Fix: `no-redeclare` and `no-sahadow` for builtin globals (fixes #3971) (Toru Nagashima) +* Build: Add `.eslintignore` file for the project (fixes #3765) (Gyandeep Singh) + +v1.6.0 - October 2, 2015 + +* Fix: cache is basically not working (fixes #4008) (Richard Hansen) +* Fix: a test failure on Windows (fixes #3968) (Toru Nagashima) +* Fix: `no-invalid-this` had been missing globals in node (fixes #3961) (Toru Nagashima) +* Fix: `curly` with `multi` had false positive (fixes #3856) (Toru Nagashima) +* Build: Add load performance check inside perf function (fixes #3994) (Gyandeep Singh) +* Fix: space-before-keywords fails with super keyword (fixes #3946) (alberto) +* Fix: CLI should not fail on account of ignored files (fixes #3978) (Dominic Barnes) +* Fix: brace-style rule incorrectly flagging switch (fixes #4002) (Aparajita Fishman) +* Update: Implement auto fix for space-unary-ops rule (fixes #3976) (alberto) +* Update: Implement auto fix for computed-property-spacing (fixes #3975) (alberto) +* Update: Implement auto fix for no-multi-spaces rule (fixes #3979) (alberto) +* Fix: Report shorthand method names in complexity rule (fixes #3955) (Tijn Kersjes) +* Docs: Add note about typeof check for isNaN (fixes #3985) (Daniel Lo Nigro) +* Update: ESLint reports parsing errors with clear prefix. (fixes #3555) (Kevin Partington) +* Build: Update markdownlint dependency (fixes #3954) (David Anson) +* Update: `no-mixed-require` to have non boolean option (fixes #3922) (Gyandeep Singh) +* Fix: trailing spaces auto fix to check for line breaks (fixes #3940) (Gyandeep Singh) +* Update: Add `typeof` option to `no-undef` rule (fixes #3684) (Gyandeep Singh) +* Docs: Fix explanation and typos for accessor-pairs (alberto) +* Docs: Fix typos for camelcase (alberto) +* Docs: Fix typos for max-statements (Danny Guo) +* Update: Implement auto fix for object-curly-spacing (fixes #3857) (alberto) +* Update: Implement auto fix for array-bracket-spacing rule (fixes #3858) (alberto) +* Fix: Add schema to `global-require` rule (fixes #3923) (Gyandeep Singh) +* Update: Apply lazy loading for rules (fixes #3930) (Gyandeep Singh) +* Docs: Fix typo for arrow-spacing (Danny Guo) +* Docs: Fix typos for wrap-regex (Danny Guo) +* Docs: Fix explanation for space-before-keywords (Danny Guo) +* Docs: Fix typos for operator-linebreak (Danny Guo) +* Docs: Fix typos for callback-return (Danny Guo) +* Fix: no-trailing-spaces autofix to account for blank lines (fixes #3912) (Gyandeep Singh) +* Docs: Fix example in no-negated-condition.md (fixes #3908) (alberto) +* Update:warn message use @return when prefer.returns=return (fixes #3889) (闲耘™) +* Update: Implement auto fix for generator-star-spacing rule (fixes #3873) (alberto) +* Update: Implement auto fix for arrow-spacing rule (fixes #3860) (alberto) +* Update: Implement auto fix for block-spacing rule (fixes #3859) (alberto) +* Fix: Support allman style for switch statement (fixes #3903) (Gyandeep Singh) +* New: no-negated-condition rule (fixes #3740) (alberto) +* Docs: Fix typo in blog post template (Nicholas C. Zakas) +* Update: Add env 'nashorn' to support Java 8 Nashorn Engine (fixes #3874) (Benjamin Winterberg) +* Docs: Prepare for rule doc linting (refs #2271) (Ian VanSchooten) + +v1.5.1 - September 22, 2015 + +* Fix: valid-jsdoc fix for param with properties (fixes #3476) (Gyandeep Singh) +* Fix: valid-jsdoc error with square braces (fixes #2270) (Gyandeep Singh) +* Upgrade: `doctrine` to 0.7.0 (fixes #3891) (Gyandeep Singh) +* Fix: `space-before-keywords` had been wrong on getters (fixes #3854) (Toru Nagashima) +* Fix: `no-dupe-args` had been wrong for nested destructure (fixes #3867) (Toru Nagashima) +* Docs: io.js is the new Node.js (thefourtheye) +* Docs: Fix method signature on working-with-rules docs (fixes #3862) (alberto) +* Docs: Add related ternary links (refs #3835) (Ian VanSchooten) +* Fix: don’t ignore config if cwd is the home dir (fixes #3846) (Mathias Schreck) +* Fix: `func-style` had been warning arrows with `this` (fixes #3819) (Toru Nagashima) +* Fix: `space-before-keywords`; allow opening curly braces (fixes #3789) (Marko Raatikka) +* Build: Fix broken .gitattributes generation (fixes #3566) (Nicholas C. Zakas) +* Build: Fix formatter docs generation (fixes #3847) (Nicholas C. Zakas) + +v1.5.0 - September 18, 2015 + +* Fix: invalidate cache when config changes. (fixes #3770) (royriojas) +* Fix: function body indent issues (fixes #3614, fixes #3799) (Gyandeep Singh) +* Update: Add configuration option to `space-before-blocks` (fixes #3758) (Phil Vargas) +* Fix: space checking between tokens (fixes #2211) (Nicholas C. Zakas) +* Fix: env-specified ecmaFeatures had been wrong (fixes #3735) (Toru Nagashima) +* Docs: Change example wording from warnings to problems (fixes #3676) (Ian VanSchooten) +* Build: Generate formatter example docs (fixes #3560) (Ian VanSchooten) +* New: Add --debug flag to CLI (fixes #2692) (Nicholas C. Zakas) +* Docs: Update no-undef-init docs (fixes #3170) (Nicholas C. Zakas) +* Docs: Update no-unused-expressions docs (fixes #3685) (Nicholas C. Zakas) +* Docs: Clarify node types in no-multi-spaces (fixes #3781) (Nicholas C. Zakas) +* Docs: Update new-cap docs (fixes #3798) (Nicholas C. Zakas) +* Fix: `space-before-blocks` had conflicted `arrow-spacing` (fixes #3769) (Toru Nagashima) +* Fix: `comma-dangle` had not been checking imports/exports (fixes #3794) (Toru Nagashima) +* Fix: tests fail due to differences in temporary paths. (fixes #3778) (royriojas) +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Update: Implement auto fix for `space-infix-ops` rule (fixes #3801) (Gyandeep Singh) +* Fix: `no-warning-comments` can't be set via config comment (fixes #3619) (Burak Yigit Kaya) +* Update: `key-spacing` should allow 1+ around colon (fixes #3363) (Burak Yigit Kaya) +* Fix: false alarm of semi-spacing with semi set to never (fixes #1983) (Chen Yicai) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) +* Docs: add more examples + tests for block-scoped-var (fixes #3791) (JT) +* Update: Implement auto fix for `indent` rule (fixes #3734) (Gyandeep Singh) +* Fix: `space-before-keywords` fails to handle some cases (fixes #3756) (Marko Raatikka) +* Docs: Add if-else example (fixes #3722) (Ian VanSchooten) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) +* Docs: Fix closing code fence on cli docs (Ian VanSchooten) +* Update: Implement auto fix for `space-before-blocks` rule (fixes #3776) (Gyandeep Singh) +* Update: Implement auto fix for `space-after-keywords` rule (fixes #3773) (Gyandeep Singh) +* Fix: `semi-spacing` had conflicted with `block-spacing` (fixes #3721) (Toru Nagashima) +* Update: Implement auto fix for `space-before-keywords` rule (fixes #3771) (Gyandeep Singh) +* Update: auto fix for space-before-function-paren rule (fixes #3766) (alberto) +* Update: Implement auto fix for `no-extra-semi` rule (fixes #3745) (Gyandeep Singh) +* Update: Refactors the traversing logic (refs #3530) (Toru Nagashima) +* Update: Implement auto fix for `space-return-throw-case` (fixes #3732) (Gyandeep Singh) +* Update: Implement auto fix for `no-spaced-func` rule (fixes #3728) (Gyandeep Singh) +* Update: Implement auto fix for `eol-last` rule (fixes #3725) (Gyandeep Singh) +* Update: Implement auto fix for `no-trailing-spaces` rule (fixes #3723) (Gyandeep Singh) + +v1.4.3 - September 15, 2015 + +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) + +v1.4.2 - September 15, 2015 + +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) + +v1.4.1 - September 11, 2015 + +* Fix: CLIEngine default cache parameter name (fixes #3755) (Daniel G. Taylor) +* Fix: Glob pattern from .eslintignore not applied (fixes #3750) (Burak Yigit Kaya) +* Fix: Skip JSDoc from NewExpression (fixes #3744) (Nicholas C. Zakas) +* Docs: Shorten and simplify autocomment for new issues (Nicholas C. Zakas) + +v1.4.0 - September 11, 2015 + +* Docs: Add new formatters to API docs (Ian VanSchooten) +* New: Implement autofixing (fixes #3134) (Nicholas C. Zakas) +* Fix: Remove temporary `"allow-null"` (fixes #3705) (Toru Nagashima) +* Fix: `no-unused-vars` had been crashed at `/*global $foo*/` (fixes #3714) (Toru Nagashima) +* Build: check-commit now checks commit message length. (fixes #3706) (Kevin Partington) +* Fix: make getScope acquire innermost scope (fixes #3700) (voideanvalue) +* Docs: Fix spelling mistake (domharrington) +* Fix: Allow whitespace in rule message parameters. (fixes #3690) (Kevin Partington) +* Fix: Eqeqeq rule with no option does not warn on 'a == null' (fixes #3699) (fediev) +* Fix: `no-unused-expressions` with `allowShortCircuit` false positive if left has no effect (fixes #3675) (Toru Nagashima) +* Update: Add Node 4 to travis builds (fixes #3697) (Ian VanSchooten) +* Fix: Not check for punctuator if on same line as last var (fixes #3694) (Gyandeep Singh) +* Docs: Make `quotes` docs clearer (fixes #3646) (Nicholas C. Zakas) +* Build: Increase mocha timeout (fixes #3692) (Nicholas C. Zakas) +* Fix: `no-extra-bind` to flag all arrow funcs (fixes #3672) (Nicholas C. Zakas) +* Docs: Update README with release and sponsor info (Nicholas C. Zakas) +* Fix: `object-curly-spacing` had been crashing on an empty object pattern (fixes #3658) (Toru Nagashima) +* Fix: `no-extra-parens` false positive at IIFE with member accessing (fixes #3653) (Toru Nagashima) +* Fix: `comma-dangle` with `"always"`/`"always-multiline"` false positive after a rest element (fixes #3627) (Toru Nagashima) +* New: `jsx-quotes` rule (fixes #2011) (Mathias Schreck) +* Docs: Add linting for second half of rule docs (refs #2271) (Ian VanSchooten) +* Fix: `no-unused-vars` had not shown correct locations for `/*global` (fixes #3617) (Toru Nagashima) +* Fix: `space-after-keywords` not working for `catch` (fixes #3654) (Burak Yigit Kaya) +* Fix: Incorrectly warning about ignored files (fixes #3649) (Burak Yigit Kaya) +* Fix: Indent rule VariableDeclarator doesn't apply to arrow functions (fixes #3661) (Burak Yigit Kaya) +* Upgrade: Consuming handlebars@^4.0.0 (fixes #3632) (Kevin Partington) +* Docs: Fixing typos in plugin processor section. (fixes #3648) (Kevin Partington) +* Fix: Invalid env keys would cause an unhandled exception.(fixes #3265) (Ray Booysen) +* Docs: Fixing broken link in documentation (Ilya Volodin) +* Update: Check for default assignment in no-unneeded-ternary (fixes #3232) (cjihrig) +* Fix: `consistent-as-needed` mode with `keyword: true` (fixes #3636) (Alex Guerrero) +* New: Implement cache in order to only operate on changed files since previous run. (fixes #2998) (Roy Riojas) +* Update: Grouping related CLI options. (fixes #3612) (Kevin Partington) +* Update: Using @override does not require @param or @returns (fixes #3629) (Whitney Young) +* Docs: Use eslint-env in no-undef (fixes #3616) (Ian VanSchooten) +* New: `require-jsdoc` rule (fixes #1842) (Gyandeep Singh) +* New: Support glob path on command line (fixes #3402) (Burak Yigit Kaya) +* Update: Short circuit and ternary support in no-unused-expressions (fixes #2733) (David Warkentin) +* Docs: Replace to npmjs.com (Ryuichi Okumura) +* Fix: `indent` should only indent chain calls if the first call is single line (fixes #3591) (Burak Yigit Kaya) +* Fix: `quote-props` should not crash for object rest spread syntax (fixes #3595) (Joakim Carlstein) +* Update: Use `globals` module for the `commonjs` globals (fixes #3606) (Sindre Sorhus) +* New: `no-restricted-syntax` rule to forbid certain syntax (fixes #2422) (Burak Yigit Kaya) +* Fix: `no-useless-concat` false positive at numbers (fixes #3575, fixes #3589) (Toru Nagashima) +* New: Add --max-warnings flag to CLI (fixes #2769) (Kevin Partington) +* New: Add `parser` as an option (fixes #3127) (Gyandeep Singh) +* New: `space-before-keywords` rule (fixes #1631) (Marko Raatikka) +* Update: Allowing inline comments to disable eslint rules (fixes #3472) (Whitney Young) +* Docs: Including for(;;) as valid case in no-constant-condition (Kevin Partington) +* Update: Add quotes around the label in `no-redeclare` error messages (fixes #3583) (Ian VanSchooten) +* Docs: correct contributing URL (Dieter Luypaert) +* Fix: line number for duplicate object keys error (fixes #3573) (Elliot Lynde) +* New: global-require rule (fixes #2318) (Jamund Ferguson) + +v1.3.1 - August 29, 2015 + +* Fix: `indent` to not crash on empty files (fixes #3570) (Gyandeep Singh) +* Fix: Remove unused config file (fixes #2227) (Gyandeep Singh) + +v1.3.0 - August 28, 2015 + +* Build: Autogenerate release blog post (fixes #3562) (Nicholas C. Zakas) +* New: `no-useless-concat` rule (fixes #3506) (Henry Zhu) +* Update: Add `keywords` flag to `consistent-as-needed` mode in `quote-props` (fixes #3532) (Burak Yigit Kaya) +* Update: adds `numbers` option to quote-props (fixes #2914) (Jose Roberto Vidal) +* Fix: `quote-props` rule should ignore computed and shorthand properties (fixes #3557) (fixes #3544) (Burak Yigit Kaya) +* Docs: Add config comments for rule examples 'accessor-pairs' to 'no-extra-semi' (refs #2271) (Ian VanSchooten) +* Update: Return to accept `undefined` type (fixes #3382) (Gyandeep Singh) +* New: Added HTML formatter (fixes #3505) (Julian Laval) +* Fix: check space after yield keyword in space-unary-ops (fixes #2707) (Mathias Schreck) +* Docs: (curly) Fix broken code in example (Kent C. Dodds) +* Update: Quote var name in `no-unused-vars` error messages (refs #3526) (Burak Yigit Kaya) +* Update: Move methods to SourceCode (fixes #3516) (Nicholas C. Zakas) +* Fix: Don't try too hard to find fault in `no-implicit-coercion` (refs #3402) (Burak Yigit Kaya) +* Fix: Detect ternary operator in operator-linebreak rule (fixes #3274) (Burak Yigit Kaya) +* Docs: Clearer plugin rule configuration (fixes #2022) (Nicholas C. Zakas) +* Update: Add quotes around the label in `no-empty-label` error reports (fixes #3526) (Burak Yigit Kaya) +* Docs: Turn off Liquid in example (Nicholas C. Zakas) +* Docs: Mention CommonJS along with Node.js (fixes #3388) (Nicholas C. Zakas) +* Docs: Make it clear which rules are recommended (fixes #3398) (Nicholas C. Zakas) +* Docs: Add links to JSON Schema resources (fixes #3411) (Nicholas C. Zakas) +* Docs: Add more info to migration guide (fixes #3439) (Nicholas C. Zakas) +* Fix: ASI indentation issue (fixes #3514) (Burak Yigit Kaya) +* Fix: Make `no-implicit-coercion` smarter about numerical expressions (fixes #3510) (Burak Yigit Kaya) +* Fix: `prefer-template` had not been handling TemplateLiteral as literal node (fixes #3507) (Toru Nagashima) +* Update: `newline-after-var` Allow comment + blank after var (fixes #2852) (Ian VanSchooten) +* Update: Add `unnecessary` option to `quote-props` (fixes #3381) (Burak Yigit Kaya) +* Fix: `indent` shouldn't check the last line unless it is a punctuator (fixes #3498) (Burak Yigit Kaya) +* Fix: `indent` rule does not indent when doing multi-line chain calls (fixes #3279) (Burak Yigit Kaya) +* Fix: sort-vars rule fails when memo is undefined (fixes #3474) (Burak Yigit Kaya) +* Fix: `brace-style` doesn't report some closing brace errors (fixes #3486) (Burak Yigit Kaya) +* Update: separate options for block and line comments in `spaced-comment` rule (fixes #2897) (Burak Yigit Kaya) +* Fix: `indent` does not check FunctionDeclaration nodes properly (fixes #3173) (Burak Yigit Kaya) +* Update: Added "properties" option to `id-length` rule to ignore property names. (fixes #3450) (Mathieu M-Gosselin) +* Update: add new ignore pattern options to no-unused-vars (fixes #2321) (Mathias Schreck) +* New: Protractor environment (fixes #3457) (James Whitney) +* Docs: Added section to shareable config (Gregory Waxman) +* Update: Allow pre-parsed code (fixes #1025, fixes #948) (Nicholas C. Zakas) + +v1.2.1 - August 20, 2015 + +* Fix: "key-spacing" crashes eslint on object literal shorthand properties (fixes #3463) (Burak Yigit Kaya) +* Fix: ignore leading space check for `null` elements in comma-spacing (fixes #3392) (Mathias Schreck) +* Fix: `prefer-arrow-callback` false positive at recursive functions (fixes #3454) (Toru Nagashima) +* Fix: one-var rule doesn’t have default options (fixes #3449) (Burak Yigit Kaya) +* Fix: Refactor `no-duplicate-case` to be simpler and more efficient (fixes #3440) (Burak Yigit Kaya) +* Docs: Fix trailing spaces in README (Nicholas C. Zakas) +* Docs: Update gyandeeps and add byk (Nicholas C. Zakas) +* Docs: Update plugins documentation for 1.0.0 (Nicholas C. Zakas) +* Docs: `object-curly-spacing` doc is inaccurate about exceptions (Burak Yigit Kaya) +* Fix: `object-curly-spacing` shows the incorrect column for opening brace (fixes #3438) (Burak Yigit Kaya) + +v1.2.0 - August 18, 2015 + +* Update: add support for semicolon in comma-first setup in indent rule (fixes #3423) (Burak Yigit Kaya) +* Docs: better JSDoc for indent rule (Burak Yigit Kaya) +* Docs: Document the second argument of `CLIEngine.executeOnText()` (Sindre Sorhus) +* New: `no-dupe-class-members` rule (fixes #3294) (Toru Nagashima) +* Fix: exclude `AssignmentExpression` and `Property` nodes from extra indentation on first line (fixes #3391) (Burak Yigit Kaya) +* Update: Separate indent options for var, let and const (fixes #3339) (Burak Yigit Kaya) +* Fix: Add AssignmentPattern to space-infix-ops (fixes #3380) (Burak Yigit Kaya) +* Docs: Fix typo: exception label (tienslebien) +* Update: Clean up tests for CLI config support (refs #2543) (Gyandeep Singh) +* New: `block-spacing` rule (fixes #3303) (Toru Nagashima) +* Docs: Update docs for no-iterator (fixes #3405) (Nicholas C. Zakas) +* Upgrade: bump `espree` dependency to `2.2.4` (fixes #3403) (Burak Yigit Kaya) +* Fix: false positive on switch 'no duplicate case', (fixes #3408) (Cristian Carlesso) +* Fix: `valid-jsdoc` test does not recognize aliases for `@param` (fixes #3399) (Burak Yigit Kaya) +* New: enable `-c` flag to accept a shareable config (fixes #2543) (Shinnosuke Watanabe) +* Fix: Apply plugin given in CLI (fixes #3383) (Ian VanSchooten) +* New: Add commonjs environment (fixes #3377) (Nicholas C. Zakas) +* Docs: Update no-unused-var docs (Nicholas C. Zakas) +* Fix: trailing commas in object-curly-spacing for import/export (fixes #3324) (Henry Zhu) +* Update: Make `baseConfig` to behave as other config options (fixes #3371) (Gyandeep Singh) +* Docs: Add "Compatibility" section to linebreak-style (Vitor Balocco) +* New: `prefer-arrow-callback` rule (fixes #3140) (Toru Nagashima) +* Docs: Clarify what an unused var is (fixes #2342) (Nicholas C. Zakas) +* Docs: Mention double-byte character limitation in max-len (fixes #2370) (Nicholas C. Zakas) +* Fix: object curly spacing incorrectly warning for import with default and multiple named specifiers (fixes #3370) (Luke Karrys) +* Fix: Indent rule errors with array of objects (fixes #3329) (Burak Yigit Kaya) +* Update: Make it clear that `space-infix-ops` support `const` (fixes #3299) (Burak Yigit Kaya) +* New: `prefer-template` rule (fixes #3014) (Toru Nagashima) +* Docs: Clarify `no-process-env` docs (fixes #3318) (Nicholas C. Zakas) +* Docs: Fix arrow name typo (fixes #3309) (Nicholas C. Zakas) +* Update: Improve error message for `indent` rule violation (fixes #3340) (Burak Yigit Kaya) +* Fix: radix rule does not apply for Number.parseInt (ES6) (fixes #3364) (Burak Yigit Kaya) +* Fix: `key-spacing.align` doesn't pay attention to non-whitespace before key (fixes #3267) (Burak Yigit Kaya) +* Fix: arrow-parens & destructuring/default params (fixes #3353) (Jamund Ferguson) +* Update: Add support for Allman to brace-style rule, brackets on newline (fixes #3347) (Burak Yigit Kaya) +* Fix: Regression no-catch-shadow (1.1.0) (fixes #3322) (Burak Yigit Kaya) +* Docs: remove note outdated in 1.0.0 (Denis Sokolov) +* Build: automatically convert line endings in release script (fixes #2642) (Burak Yigit Kaya) +* Update: allow disabling new-cap on object methods (fixes #3172) (Burak Yigit Kaya) +* Update: Improve checkstyle format (fixes #3183) (Burak Yigit Kaya) +* Fix: Indent rule errors if an array literal starts a new statement (fixes #3328) (Burak Yigit Kaya) +* Update: Improve validation error messages (fixes #3193) (Burak Yigit Kaya) +* Docs: fix syntax error in space-before-function-paren (Fabrício Matté) +* Fix: `indent` rule to check for last line correctly (fixes #3327) (Gyandeep Singh) +* Fix: Inconsistent off-by-one errors with column numbers (fixes #3231) (Burak Yigit Kaya) +* Fix: Keyword "else" must not be followed by a newline (fixes #3226) (Burak Yigit Kaya) +* Fix: `id-length` does not work for most of the new ES6 patterns (fixes #3286) (Burak Yigit Kaya) +* Fix: Spaced Comment Exceptions Not Working (fixes #3276) (Jamund Ferguson) + +v1.1.0 - August 7, 2015 + +* Update: Added as-needed option to arrow-parens (fixes #3277) (Jamund Ferguson) +* Fix: curly-spacing missing import case (fixes #3302) (Jamund Ferguson) +* Fix: `eslint-env` in comments had not been setting `ecmaFeatures` (fixes #2134) (Toru Nagashima) +* Fix: `es6` env had been missing `spread` and `newTarget` (fixes #3281) (Toru Nagashima) +* Fix: Report no-spaced-func on last token before paren (fixes #3289) (Benjamin Woodruff) +* Fix: Check for null elements in indent rule (fixes #3272) (Gyandeep Singh) +* Docs: Use backticks for option heading (Gyandeep Singh) +* Fix: `no-invalid-this` had been missing jsdoc comment (fixes #3287) (Toru Nagashima) +* Fix: `indent` rule for multi-line objects and arrays (fixes #3236) (Gyandeep Singh) +* Update: add new `multi-or-nest` option for the `curly` rule (fixes #1806) (Ivan Nikulin) +* Fix: `no-cond-assign` had been missing simplest pattern (fixes #3249) (Toru Nagashima) +* Fix: id-length rule doesn't catch violations in arrow function parameters (fixes #3275) (Burak Yigit Kaya) +* New: Added grep-style formatter (fixes #2991) (Nobody Really) +* Update: Split out generic AST methods into utility (fixes #962) (Gyandeep Singh) +* Fix: `accessor-pairs` false positive (fixes #3262) (Toru Nagashima) +* Fix: `context.getScope()` returns correct scope in blockBindings (fixes #3254) (Toru Nagashima) +* Update: Expose `getErrorResults` as a static method on `CLIEngine` (fixes #3242) (Gyandeep Singh) +* Update: Expose `getFormatter` as a static method on `CLIEngine` (fixes #3239) (Gyandeep Singh) +* Docs: use correct encoding for id-match.md (fixes #3246) (Matthieu Larcher) +* Docs: place id-match rule at correct place in README.md (fixes #3245) (Matthieu Larcher) +* Docs: Update no-proto.md (Joe Zimmerman) +* Docs: Fix typo in object-shorthand docs (Gunnar Lium) +* Upgrade: inquirer dependency (fixes #3241) (Gyandeep Singh) +* Fix: `indent` rule for objects and nested one line blocks (fixes #3238, fixes #3237) (Gyandeep Singh) +* Docs: Fix wrong options in examples of key-spacing (keik) +* Docs: Adds missing "not" to semi.md (Marius Schulz) +* Docs: Update no-multi-spaces.md (Kenneth Powers) +* Fix: `indent` to not error on same line nodes (fixes #3228) (Gyandeep Singh) +* New: Jest environment (fixes #3212) (Darshak Parikh) + +v1.0.0 - July 31, 2015 + +* Update: merge `no-reserved-keys` into `quote-props` (fixes #1539) (Jose Roberto Vidal) +* Fix: `indent` error message (fixes #3220) (Gyandeep Singh) +* Update: Add embertest env (fixes #3205) (ismay) +* Docs: Correct documentation errors for `id-length` rule. (Jess Telford) +* Breaking: `indent` rule to have node specific options (fixes #3210) (Gyandeep Singh) +* Fix: space-after-keyword shouldn't allow newlines (fixes #3198) (Brandon Mills) +* New: Add JSON formatter (fixes #3036) (Burak Yigit Kaya) +* Breaking: Switch to RuleTester (fixes #3186) (Nicholas C. Zakas) +* Breaking: remove duplicate warnings of `no-undef` from `block-scoped-var` (fixes #3201) (Toru Nagashima) +* Fix: `init-declarations` ignores in for-in/of (fixes #3202) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` ignores ModuleSpecifier and LiteralPropertyName (fixes #3181) (Toru Nagashima) +* Fix: space-in-parens in Template Strings (fixes #3182) (Ian VanSchooten) +* Fix: Check for concatenation in no-throw-literal (fixes #3099, fixes #3101) (Ian VanSchooten) +* Build: Remove `eslint-tester` from devDependencies (fixes #3189) (Gyandeep Singh) +* Fix: Use new ESLintTester (fixes #3187) (Nicholas C. Zakas) +* Update: `new-cap` supports fullnames (fixes #2584) (Toru Nagashima) +* Fix: Non object rule options merge (fixes #3179) (Gyandeep Singh) +* New: add id-match rule (fixes #2829) (Matthieu Larcher) +* Fix: Rule options merge (fixes #3175) (Gyandeep Singh) +* Fix: `spaced-comment` allows a mix of markers and exceptions (fixes #2895) (Toru Nagashima) +* Fix: `block-scoped-var` issues (fixes #2253, fixes #2747, fixes #2967) (Toru Nagashima) +* New: Add id-length rule (fixes #2784) (Burak Yigit Kaya) +* Update: New parameters for quote-props rule (fixes #1283, fixes #1658) (Tomasz Olędzki) + +v1.0.0-rc-3 - July 24, 2015 + +* Fix: Make Chai and Mocha as a dependency (fixes #3156) (Gyandeep Singh) +* Fix: traverse `ExperimentalSpread/RestProperty.argument` (fixes #3157) (Toru Nagashima) +* Fix: Check shareable config package prefix correctly (fixes #3146) (Gyandeep Singh) +* Update: move redeclaration checking for builtins (fixes #3070) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` allows directive prologues (fixes #3132) (Toru Nagashima) +* Fix: `ESLintTester` path in exposed API (fixes #3149) (Gyandeep Singh) +* Docs: Remove AppVeyor badge (Gyandeep Singh) +* Fix: Check no-new-func on CallExpressions (fixes #3145) (Benjamin Woodruff) + +v1.0.0-rc-2 - July 23, 2015 + +* Docs: Mention eslint-tester in migration guide (Nicholas C. Zakas) +* Docs: Mention variables defined in a global comment (fixes #3137) (William Becker) +* Docs: add documentation about custom-formatters. (fixes #1260) (royriojas) +* Fix: Multi-line variable declarations indent (fixes #3139) (Gyandeep Singh) +* Fix: handles blocks in no-use-before-define (fixes #2960) (Jose Roberto Vidal) +* Update: `props` option of `no-param-reassign` (fixes #1600) (Toru Nagashima) +* New: Support shared configs named `@scope/eslint-config`, with shortcuts of `@scope` and `@scope/` (fixes #3123) (Jordan Harband) +* New: Add ignorePattern, ignoreComments, and ignoreUrls options to max-len (fixes #2934, fixes #2221, fixes #1661) (Benjamin Woodruff) +* Build: Increase Windows Mocha timeout (fixes #3133) (Ian VanSchooten) +* Docs: incorrect syntax in the example for rule «one-var» (Alexander Burtsev) +* Build: Check commit message format at end of tests (fixes #3058) (Ian VanSchooten) +* Update: Move eslint-tester into repo (fixes #3110) (Nicholas C. Zakas) +* Fix: Not load configs outside config with `root: true` (fixes #3109) (Gyandeep Singh) +* Docs: Add config information to README (fixes #3074) (Nicholas C. Zakas) +* Docs: Add mysticatea as committer (Nicholas C. Zakas) +* Docs: Grammar fixes in rule descriptions (refs #3038) (Greg Cochard) +* Fix: Update sort-vars to ignore Array and ObjectPattern (fixes #2954) (Harry Ho) +* Fix: block-scoped-var rule incorrectly flagging break/continue with label (fixes #3082) (Aparajita Fishman) +* Fix: spaces trigger wrong in `no-useless-call` and `prefer-spread` (fixes #3054) (Toru Nagashima) +* Fix: `arrow-spacing` allow multi-spaces and line-endings (fixes #3079) (Toru Nagashima) +* Fix: add missing loop scopes to one-var (fixes #3073) (Jose Roberto Vidal) +* New: the `no-invalid-this` rule (fixes #2815) (Toru Nagashima) +* Fix: allow empty loop body in no-extra-semi (fixes #3075) (Mathias Schreck) +* Update: Add qunit to environments (fixes #2870) (Nicholas C. Zakas) +* Fix: `space-before-blocks` to consider classes (fixes #3062) (Gyandeep Singh) +* Fix: Include phantomjs globals (fixes #3064) (Linus Unnebäck) +* Fix: no-else-return handles multiple else-if blocks (fixes #3015) (Jose Roberto Vidal) +* Fix: `no-*-assgin` rules support destructuring (fixes #3029) (Toru Nagashima) +* New: the `no-implicit-coercion` rule (fixes #1621) (Toru Nagashima) +* Fix: Make no-implied-eval match more types of strings (fixes #2898) (Benjamin Woodruff) +* Docs: Clarify that bot message is automatic (Ian VanSchooten) +* Fix: Skip rest properties in no-dupe-keys (fixes 3042) (Nicholas C. Zakas) +* Docs: New issue template (fixes #3048) (Nicholas C. Zakas) +* Fix: strict rule supports classes (fixes #2977) (Toru Nagashima) +* New: the `prefer-reflect` rule (fixes #2939) (Keith Cirkel) +* Docs: make grammar consistent in rules index (Greg Cochard) +* Docs: Fix unmatched paren in rule description (Greg Cochard) +* Docs: Small typo fix in no-useless-call documentation (Paul O’Shannessy) +* Build: readd phantomjs dependency with locked down version (fixes #3026) (Mathias Schreck) +* Docs: Add IanVS as committer (Nicholas C. Zakas) +* docs: additional computed-property-spacing documentation (fixes #2941) (Jamund Ferguson) +* Docs: Add let and const examples for newline-after-var (fixes #3020) (James Whitney) +* Build: Remove unnecessary phantomjs devDependency (fixes #3021) (Gyandeep Singh) +* Update: added shared builtins list (fixes #2972) (Jose Roberto Vidal) + +v1.0.0-rc-1 - July 15, 2015 + +* Upgrade: Espree to 2.2.0 (fixes #3011) (Nicholas C. Zakas) +* Docs: fix a typo (bartmichu) +* Fix: indent rule should recognize single line statements with ASI (fixes #3001, fixes #3000) (Mathias Schreck) +* Update: Handle CRLF line endings in spaced-comment rule - 2 (fixes #3005) (Burak Yigit Kaya) +* Fix: Indent rule error on empty block body (fixes #2999) (Gyandeep Singh) +* New: the `no-class-assign` rule (fixes #2718) (Toru Nagashima) +* New: the `no-const-assign` rule (fixes #2719) (Toru Nagashima) +* Docs: Add 1.0.0 migration guide (fixes #2994) (Nicholas C. Zakas) +* Docs: Update changelog for 0.24.1 (fixes #2976) (Nicholas C. Zakas) +* Breaking: Remove deprecated rules (fixes #1898) (Ian VanSchooten) +* Fix: multi-line + fat arrow indent (fixes #2239) (Gyandeep Singh) +* Breaking: Create eslint:recommended and add to --init (fixes #2713) (Greg Cochard) +* Fix: Indent rule (fixes #1797, fixes #1799, fixes #2248, fixes #2343, fixes #2278, fixes #1800) (Gyandeep Singh) +* New: `context.getDeclaredVariables(node)` (fixes #2801) (Toru Nagashima) +* New: the `no-useless-call` rule (fixes #1925) (Toru Nagashima) +* New: the `prefer-spread` rule (fixes #2946) (Toru Nagashima) +* Fix: `valid-jsdoc` counts `return` for arrow expressions (fixes #2952) (Toru Nagashima) +* New: Add exported comment option (fixes #1200) (Jamund Ferguson) +* Breaking: Default to --reset behavior (fixes #2100) (Brandon Mills) +* New: Add arrow-parens and arrow-spacing rule (fixes #2628) (Jxck) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Add: Warn on missing rule definition or deprecation (fixes #1549) (Ian VanSchooten) +* Update: adding some tests for no-redeclare to test named functions (fixes #2953) (Dominic Barnes) +* New: Add support for root: true in config files (fixes #2736) (Ian VanSchooten) +* Fix: workaround for leading and trailing comments in padded-block (fixes #2336 and fixes #2788) (Mathias Schreck) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Update: `no-loop-func` allows block-scoped variables (fixes #2517) (Toru Nagashima) +* Docs: remove mistaken "off by default" (Jan Schär) +* Build: Add appveyor CI system (fixes #2923) (Gyandeep Singh) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Docs: clarification in no-unused-vars (Jan Schär) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Docs: missing quotes in JSON (Jan Schär) +* Breaking: Switch to 1-based columns (fixes #2284) (Nicholas C. Zakas) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* New: Add init-declarations rule (fixes #2606) (cjihrig) +* Docs: Fix typo in array-bracket-spacing rule (zallek) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Build: gensite target supports rule removal (refs #1898) (Brandon Mills) +* Update: Handle CRLF line endings in spaced-comment rule (fixes #2884) (David Anson) +* Update: Attach parent in getNodeByRangeIndex (fixes #2863) (Brandon Mills) +* Docs: Fix typo (Bryan Smith) +* New: Add serviceworker environment (fixes #2557) (Gyandeep Singh) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Update: Loosens regex rules around intentional fall through comments (Fixes #2811) (greg5green) +* Update: Add missing schema to rules (fixes #2858) (Ilya Volodin) +* New: `require-yield` rule (fixes #2822) (Toru Nagashima) +* New: add callback-return rule (fixes #994) (Jamund Ferguson) + +v0.24.1 - July 10, 2015 + +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Docs: clarification in no-unused-vars (Jan Schär) +* Docs: missing quotes in JSON (Jan Schär) +* Fix: Revert 1-based column changes in tests for patch (refs #2284) (Nicholas C. Zakas) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) + +v0.24.0 - June 26, 2015 + +* Upgrade: eslint-tester to 0.8.1 (Nicholas C. Zakas) +* Fix: no-dupe-args sparse array crash (fixes #2848) (Chris Walker) +* Fix: space-after-keywords should ignore extra parens (fixes #2847) (Mathias Schreck) +* New: add no-unexpected-multiline rule (fixes #746) (Glen Mailer) +* Update: refactor handle-callback-err to improve performance (fixes #2841) (Mathias Schreck) +* Fix: Add --init to the CLI options (fixes #2817) (Gyandeep Singh) +* Update: Add `except-parens` option to `no-return-assign` rule (fixes #2809) (Toru Nagashima) +* Fix: handle-callback-err missing arrow functions (fixes #2823) (Jamund Ferguson) +* Fix: `no-extra-semi` in class bodies (fixes #2794) (Toru Nagashima) +* Fix: Check type to be file when looking for config files (fixes #2790) (Gyandeep Singh) +* Fix: valid-jsdoc to work for object getters (fixes #2407) (Gyandeep Singh) +* Update: Add an option as an object to `generator-star-spacing` rule (fixes #2787) (Toru Nagashima) +* Build: Update markdownlint dependency (David Anson) +* Fix: context report message to handle more scenarios (fixes #2746) (Gyandeep Singh) +* Update: Ignore JsDoc comments by default for `spaced-comment` (fixes #2766) (Gyandeep Singh) +* Fix: one-var 'never' option for mixed initialization (Fixes #2786) (Ian VanSchooten) +* Docs: Fix a minor typo in a prefer-const example (jviide) +* Fix: comma-dangle always-multiline: no comma right before the last brace (fixes #2091) (Benoît Zugmeyer) +* Fix: Allow blocked comments with markers and new-line (fixes #2777) (Gyandeep Singh) +* Docs: small fix in quote-props examples (Jose Roberto Vidal) +* Fix: object-shorthand rule should not warn for NFEs (fixes #2748) (Michael Ficarra) +* Fix: arraysInObjects for object-curly-spacing (fixes #2752) (Jamund Ferguson) +* Docs: Clarify --rule description (fixes #2773) (Nicholas C. Zakas) +* Fix: object literals in arrow function bodies (fixes #2702) (Jose Roberto Vidal) +* New: `constructor-super` rule (fixes #2720) (Toru Nagashima) +* New: `no-this-before-super` rule (fixes #2721) (Toru Nagashima) +* Fix: space-unary-ops flags expressions starting w/ keyword (fixes #2764) (Michael Ficarra) +* Update: Add block options to `lines-around-comment` rule (fixes #2667) (Gyandeep Singh) +* New: array-bracket-spacing (fixes #2226) (Jamund Ferguson) +* Fix: No-shadow rule duplicating error messages (fixes #2706) (Aliaksei Shytkin) + +v0.23.0 - June 14, 2015 + +* Build: Comment out auto publishing of release notes (refs #2640) (Ilya Volodin) +* Fix: "extends" within package.json (fixes #2754) (Gyandeep Singh) +* Upgrade: globals@8.0.0 (fixes #2759) (silverwind) +* Docs: eol-last docs fix (fixes #2755) (Gyandeep Singh) +* Docs: btmills is a reviewer (Nicholas C. Zakas) +* Build: Revert lock io.js to v2.1.0 (refs #2745) (Brandon Mills) +* New: computed-property-spacing (refs #2226) (Jamund Ferguson) +* Build: Pin Sinon version (fixes #2742) (Ilya Volodin) +* Fix: `prefer-const` treats `for-in`/`for-of` with the same way (Fixes #2739) (Toru Nagashima) +* Docs: Add links to team members profile (Gyandeep Singh) +* Docs: add team and ES7 info to readme (Nicholas C. Zakas) +* Fix: don't try to strip "line:" prefix from parser errors with no such prefix (fixes #2698) (Tim Cuthbertson) +* Fix: never ignore config comment options (fixes #2725) (Brandon Mills) +* Update: Add clarification to spaced-comment (refs #2588) (Greg Cochard) +* Update: Add markers to spaced-comment (fixes #2588) (Greg Cochard) +* Fix: no-trailing-spaces now handles skipBlankLines (fixes #2575) (Greg Cochard) +* Docs: Mark global-strict on by default (fixes #2629) (Ilya Volodin) +* New: Allow extends to be an array (fixes #2699) (Justin Morris) +* New: globals@7.1.0 (fixes #2682) (silverwind) +* New: `prefer-const` rule (fixes #2333) (Toru Nagashima) +* Fix: remove hard-coded list of unary keywords in space-unary-ops rule (fixes #2696) (Tim Cuthbertson) +* Breaking: Automatically validate rule options (fixes #2595) (Brandon Mills) +* Update: no-lone-blocks does not report block-level scopes (fixes #2119) (Jose Roberto Vidal) +* Update: yoda onlyEquality option (fixes #2638) (Denis Sokolov) +* Docs: update comment to align with source code it's referencing (Michael Ficarra) +* Fix: Misconfigured default option for lines-around-comment rule (fixes #2677) (Gyandeep Singh) +* Fix: `no-shadow` allows shadowing in the TDZ (fixes #2568) (Toru Nagashima) +* New: spaced-comment rule (fixes #1088) (Gyandeep Singh) +* Fix: Check unused vars in exported functions (fixes #2678) (Gyandeep Singh) +* Build: Stringify payload of release notes (fixes #2640) (Greg Cochard) +* Fix: Allowing u flag in regex to properly lint no-empty-character-class (fixes #2679) (Dominic Barnes) +* Docs: deprecate no-wrap-func (fixes #2644) (Jose Roberto Vidal) +* Docs: Fixing grammar: then -> than (E) +* Fix: trailing commas in object-curly-spacing (fixes #2647) (Jamund Ferguson) +* Docs: be consistent about deprecation status (Matthew Dapena-Tretter) +* Docs: Fix mistakes in object-curly-spacing docs (Matthew Dapena-Tretter) +* New: run processors when calling executeOnText (fixes #2331) (Mordy Tikotzky) +* Update: move executeOnText() tests to the correct describe block (fixes #2648) (Mordy Tikotzky) +* Update: add tests to assert that the preprocessor is running (fixes #2651) (Mordy Tikotzky) +* Build: Lock io.js to v2.1.0 (fixes #2653) (Ilya Volodin) + +v0.22.1 - May 30, 2015 + +* Build: Remove release notes auto-publish (refs #2640) (Ilya Volodin) + +v0.22.0 - May 30, 2015 + +* Upgrade: escope 3.1.0 (fixes #2310, #2405) (Toru Nagashima) +* Fix: “consistent-this” incorrectly flagging destructuring of `this` (fixes #2633) (David Aurelio) +* Upgrade: eslint-tester to 0.7.0 (Ilya Volodin) +* Update: allow shadowed references in no-alert (fixes #1105) (Mathias Schreck) +* Fix: no-multiple-empty-lines and template strings (fixes #2605) (Jamund Ferguson) +* New: object-curly-spacing (fixes #2225) (Jamund Ferguson) +* Docs: minor fix for one-var rule (Jamund Ferguson) +* Fix: Shared config being clobbered by other config (fixes #2592) (Dominic Barnes) +* Update: adds "functions" option to no-extra-parens (fixes #2477) (Jose Roberto Vidal) +* Docs: Fix json formatting for lines-around-comments rule (Gyandeep Singh) +* Fix: Improve around function/class names of `no-shadow` (fixes #2556, #2552) (Toru Nagashima) +* Fix: Improve code coverage (fixes #2590) (Ilya Volodin) +* Fix: Allow scoped configs to have sub-configs (fixes #2594) (Greg Cochard) +* Build: Add auto-update of release tag on github (fixes #2566) (Greg Cochard) +* New: lines-around-comment (fixes #1344) (Jamund Ferguson) +* Build: Unblock build by increasing code coverage (Ilya Volodin) +* New: accessor-pairs rule to object initializations (fixes #1638) (Gyandeep Singh) +* Fix: counting of variables statements in one-var (fixes #2570) (Mathias Schreck) +* Build: Add sudo:false for Travis (fixes #2582) (Ilya Volodin) +* New: Add rule schemas (refs #2179) (Brandon Mills) +* Docs: Fix typo in shareable-configs example (fixes #2571) (Ted Piotrowski) +* Build: Relax markdownlint rules by disabling style-only items (David Anson) +* Fix: Object shorthand rule incorrectly flagging getters/setters (fixes #2563) (Brad Dougherty) +* New: Add config validator (refs #2179) (Brandon Mills) +* New: Add worker environment (fixes #2442) (Ilya Volodin) +* New no-empty-character class (fixes #2508) (Jamund Ferguson) +* New: Adds --ignore-pattern option. (fixes #1742) (Patrick McElhaney) + +v0.21.2 - May 18, 2015 + +* 0.21.2 (Nicholas C. Zakas) +* Fix: one-var exception for ForStatement.init (fixes #2505) (Brandon Mills) +* Fix: Don't throw spurious shadow errors for classes (fixes #2545) (Jimmy Jia) +* Fix: valid-jsdoc rule to support exported functions (fixes #2522) (Gyandeep Singh) +* Fix: Allow scoped packages in configuration extends (fixes #2544) (Eric Isakson) +* Docs: Add chatroom to FAQ (Nicholas C. Zakas) +* Docs: Move Gitter badge (Nicholas C. Zakas) + +v0.21.1 - May 15, 2015 + +* 0.21.1 (Nicholas C. Zakas) +* Fix: loc obj in report fn expects column (fixes #2481) (Varun Verma) +* Build: Make sure that all md files end with empty line (fixes #2520) (Ilya Volodin) +* Added Gitter badge (The Gitter Badger) +* Fix: forced no-shadow to check all scopes (fixes #2294) (Jose Roberto Vidal) +* Fix: --init indent setting (fixes #2493) (Nicholas C. Zakas) +* Docs: Mention bundling multiple shareable configs (Nicholas C. Zakas) +* Fix: Not to override the required extended config object directly (fixes #2487) (Gyandeep Singh) +* Build: Update markdownlint dependency (David Anson) +* Docs: added recursive function example to no-unused-vars (Jose Roberto Vidal) +* Docs: Fix typo (then -> than) (Vladimir Agafonkin) +* Revert "Fix: sanitise Jekyll interpolation during site generation (fixes #2297)" (Nicholas C. Zakas) +* Fix: dot-location should use correct dot token (fixes #2504) (Mathias Schreck) +* Fix: Stop linebreak-style from crashing (fixes #2490) (James Whitney) +* Fix: rule no-duplicate-case problem with CallExpressions. (fixes #2499) (Matthias Osswald) +* Fix: Enable full support for eslint-env comments (refs #2134) (Ilya Volodin) +* Build: Speed up site generation (fixes #2475) (Ilya Volodin) +* Docs: Fixing trailing spaces (Fixes #2478) (Ilya Volodin) +* Docs: Update README FAQs (Nicholas C. Zakas) +* Fix: Allow comment before comma for comma-spacing rule (fixes #2408) (Gyandeep Singh) + +v0.21.0 - May 9, 2015 + +* 0.21.0 (Nicholas C. Zakas) +* New: Shareable configs (fixes #2415) (Nicholas C. Zakas) +* Fix: Edge cases for no-wrap-func (fixes #2466) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures description (Nicholas C. Zakas) +* New: Add dot-location rule. (fixes #1884) (Greg Cochard) +* New: Add addPlugin method to CLI-engine (Fixes #1971) (Ilya Volodin) +* Breaking: Do not check unset declaration types (Fixes #2448) (Ilya Volodin) +* Fix: no-redeclare switch scoping (fixes #2337) (Nicholas C. Zakas) +* Fix: Check extra scope in no-use-before-define (fixes #2372) (Nicholas C. Zakas) +* Fix: Ensure baseConfig isn't changed (fixes #2380) (Nicholas C. Zakas) +* Fix: Don't warn for member expression functions (fixes #2402) (Nicholas C. Zakas) +* New: Adds skipBlankLines option to the no-trailing-spaces rule (fixes #2303) (Andrew Vaughan) +* Fix: Adding exception for last line (Refs #2423) (Greg Cochard) +* Fix: crash on 0 max (fixes #2423) (gcochard) +* Fix object-shorthand arrow functions (fixes #2414) (Jamund Ferguson) +* Fix: Improves detection of self-referential functions (fixes #2363) (Jose Roberto Vidal) +* Update: key-spacing groups must be consecutive lines (fixes #1728) (Brandon Mills) +* Docs: grammar fix in no-sync (Tony Lukasavage) +* Docs: Update configuring.md to fix incorrect link. (Ans) +* New: Check --stdin-filename by ignore settings (fixes #2432) (Aliaksei Shytkin) +* Fix: `no-loop-func` rule allows functions at init part (fixes #2427) (Toru Nagashima) +* New: Add init command (fixes #2302) (Ilya Volodin) +* Fix: no-irregular-whitespace should work with irregular line breaks (fixes #2316) (Mathias Schreck) +* Fix: generator-star-spacing with class methods (fixes #2351) (Brandon Mills) +* New: no-unneeded-ternary rule to disallow boolean literals in conditional expressions (fixes #2391) (Gyandeep Singh) +* Docs: Add `restParams` to `ecmaFeatures` options list (refs: #2346) (Bogdan Savluk) +* Fix: space-in-brackets Cannot read property 'range' (fixes #2392) (Gyandeep Singh) +* Docs: Sort the rules (Lukas Böcker) +* Add: Exception option for `no-extend-native` and `no-native-reassign` (fixes #2355) (Gyandeep Singh) +* Fix: space-in-brackets import declaration (fixes #2378) (Gyandeep Singh) +* Update: Add uninitialized and initialized options (fixes #2206) (Ian VanSchooten) +* Fix: brace-style to not warn about curly mix ifStatements (fixes #1739) (Gyandeep Singh) +* Fix: npm run profile script should use espree (fixes #2150) (Mathias Schreck) +* New: Add support for extending configurations (fixes #1637) (Espen Hovlandsdal) +* Fix: Include string literal keys in object-shorthand (Fixes #2374) (Jamund Ferguson) +* Docs: Specify language for all code fences, enable corresponding markdownlint rule. (David Anson) +* New: linebreak-style rule (fixes #1255) (Erik Müller) +* Update: Add "none" option to operator-linebreak rule (fixes #2295) (Casey Visco) +* Fix: sanitise Jekyll interpolation during site generation (fixes #2297) (Michael Ficarra) + +v0.20.0 - April 24, 2015 + +* 0.20.0 (Nicholas C. Zakas) +* Fix: support arrow functions in no-extra-parens (fixes #2367) (Michael Ficarra) +* Fix: Column position in space-infix-ops rule (fixes #2354) (Gyandeep Singh) +* Fix: allow plugins to be namespaced (fixes #2360) (Seth Pollack) +* Update: one-var: enable let & const (fixes #2301) (Joey Baker) +* Docs: Add meteor to avaiable environments list (bartmichu) +* Update: Use `Object.assign()` polyfill for all object merging (fixes #2348) (Sindre Sorhus) +* Docs: Update markdownlint dependency, resolve/suppress new issues. (David Anson) +* Fix: newline-after-var declare and export (fixes #2325) (Gyandeep Singh) +* Docs: Some typos and grammar. (AlexKVal) +* Fix: newline-after-var to ignore declare in for specifiers (fixes #2317) (Gyandeep Singh) +* New: add --stdin-filename option (fixes #1950) (Mordy Tikotzky) +* Fix: Load .eslintrc in $HOME only if no other .eslintrc is found (fixes #2279) (Jasper Woudenberg) +* Fix: Add `v8` module to no-mixed-requires rule (fixes #2320) (Gyandeep Singh) +* Fix: key-spacing with single properties (fixes #2311) (Brandon Mills) +* Docs: `no-invalid-regexp`: add `ecmaFeatures` flags for `u`/`y` (Jordan Harband) +* New: object-shorthand rule (refs: #1617) (Jamund Ferguson) +* Update: backticks support for quotes rule (fixes #2153) (borislavjivkov) +* Fix: space-in-brackets to work with modules (fixes #2216) (Nicholas C. Zakas) + +v0.19.0 - April 11, 2015 + +* 0.19.0 (Nicholas C. Zakas) +* Upgrade: Espree to 2.0.1 (Nicholas C. Zakas) +* Docs: Update one-var documentation (fixes #2210) (Nicholas C. Zakas) +* Update: Add test for no-undef (fixes #2214) (Nicholas C. Zakas) +* Fix: Report better location for padded-blocks error (fixes #2224) (Nicholas C. Zakas) +* Fix: Don't check concise methods in quote-props (fixes #2251) (Nicholas C. Zakas) +* Fix: Consider tabs for space-in-parens rule (fixes #2191) (Josh Quintana) +* Fix: block-scoped-var to work with classes (fixes #2280) (Nicholas C. Zakas) +* Docs: Remove trailing spaces, enable corresponding markdownlint rule. (David Anson) +* Fix: padded-blocks with ASI (fixes #2273) (Brandon Mills) +* Fix: Handle comment lines in newline-after-var (fixed #2237) (Casey Visco) +* Docs: Standardize on '*' for unordered lists, enable corresponding markdownlint rule. (David Anson) +* Fix: no-undef and no-underscore-dangle to use double quotes (fixes #2258) (Gyandeep Singh) +* Docs: Improve grammar and style in comma-dangle.md (Nate Eagleson) +* Docs: Improve grammar and style in padded-blocks.md (Nate Eagleson) +* Docs: Update URL in no-wrap-func.md to resolve 404 (Nate Eagleson) +* Docs: Fix typo in command-line-interface.md (Nate Eagleson) +* Docs: Fix typo in working-with-rules.md (Nate Eagleson) +* Docs: Remove hard tabs from *.md, enable corresponding markdownlint rule. (David Anson) +* Fix: Function id missing in parent scope when using ecmaFeature `modules` for rule block-scoped-var (fixes #2242) (Michael Ferris) +* Fix: Ignore single lines for vertical alignment (fixes #2018) (Ian VanSchooten) +* Fix: Allow inline comments in newline-after-var rule (fixes #2229) (Casey Visco) +* Upgrade: Espree 2.0.0 and escope 3.0.0 (fixes #2234, fixes #2201, fixes (Nicholas C. Zakas) +* Docs: Update --no-ignore warning (Brandon Mills) +* Build: Remove jshint files (fixes #2222) (Jeff Tan) +* Docs: no-empty fix comment change (refs #2188) (Gyandeep Singh) +* Fix: duplicate semi and no-extra-semi errors (fixes #2207) (Brandon Mills) +* Docs: Update processors description (Nicholas C. Zakas) +* Fix: semi error on export declaration (fixes #2194) (Brandon Mills) +* New: operator-linebreak rule (fixes #1405) (Benoît Zugmeyer) +* Docs: Fixing broken links in documentation (Ilya Volodin) +* Upgrade: Espree to 0.12.3 (fixes #2195) (Gyandeep Singh) +* Fix: camelcase rule with {properties: never} shouldn't check assignment (fixes #2189) (Gyandeep Singh) +* New: Allow modifying base config (fixes #2143) (Meo) +* New: no-continue rule (fixes #1945) (borislavjivkov) +* Fix: `no-empty` rule should allow any comments (fixes #2188) (Gyandeep Singh) +* Docs: Fix spell in camelcase doc (fixes #2190) (Gyandeep Singh) +* Fix: Require semicolon after import/export statements (fixes #2174) (Gyandeep Singh) +* Build: Add linting of Markdown files to "npm test" script (fixes #2182) (David Anson) +* Build: Fixing site generation (Ilya Volodin) +* Build: Fix gensite task to work even if files are missing (Nicholas C. Zakas) + +v0.18.0 - March 28, 2015 + +* 0.18.0 (Nicholas C. Zakas) +* Fix: Mark variables as used in module scope (fixes #2137) (Nicholas C. Zakas) +* Fix: arrow functions need wrapping (fixes #2113) (Nicholas C. Zakas) +* Fix: Don't crash on empty array pattern item (fixes #2111) (Nicholas C. Zakas) +* Fix: Don't error on destructured params (fixes #2051) (Nicholas C. Zakas) +* Docs: Fixing broken links (Ilya Volodin) +* Fix: no-constant-condition should not flag += (fixes #2155) (Nicholas C. Zakas) +* Fix: Ensure piped in code will trigger correct errors (fixes #2154) (Nicholas C. Zakas) +* Fix: block-scoped-var to handle imports (fixes #2087) (Nicholas C. Zakas) +* Fix: no-dupe-args to work with destructuring (fixes #2148) (Nicholas C. Zakas) +* Fix: key-spacing crash on computed properties (fixes #2120) (Brandon Mills) +* Fix: indent crash on caseless switch (fixes #2144) (Brandon Mills) +* Fix: Don't warn about destructured catch params (fixes #2125) (Nicholas C. Zakas) +* Update: Omit setter param from no-unused-vars (fixes #2133) (Nicholas C. Zakas) +* Docs: Cleaning dead links (Ilya Volodin) +* Docs: Moving documentation out of the repository and modifying build scripts (Ilya Volodin) +* Docs: Update link to Documentation (Kate Lizogubova) +* Docs: Adding back deprecated space-unary-word-ops documentation (Ilya Volodin) +* Fix: Unused recursive functions should be flagged (issue2095) (Nicholas C. Zakas) +* Breaking: Remove JSX support from no-undef (fixes #2093) (Nicholas C. Zakas) +* Fix: markVariableAsUsed() should work in Node.js env (fixes #2089) (Nicholas C. Zakas) +* New: Add "always" and "never" options to "one-var" rule. (fixes #1619) (Danny Fritz) +* New: newline-after-var rule (fixes #2057) (Gopal Venkatesan) +* Fix: func-names with ES6 classes (fixes #2103) (Marsup) +* Fix: Add "Error" to the "new-cap" rule exceptions (fixes #2098) (Mickaël Tricot) +* Fix: vars-on-top conflict with ES6 import (fixes #2099) (Gyandeep Singh) +* Docs: Fixed JSON syntax (Sajin) +* New: space-before-function-paren rule (fixes #2028) (Brandon Mills) +* Breaking: rule no-empty also checking for empty catch blocks. (fixes #1841) (Dieter Oberkofler) +* Update: rule camelcase to allow snake_case in object literals. (fixes #1919) (Dieter Oberkofler) +* New: Added option int32Hint for space-infix-ops (fixes #1295) (Kirill Efimov) +* New: no-param-reassign rule (fixes #1599) (Nat Burns) + +v0.17.1 - March 17, 2015 + +* 0.17.1 (Nicholas C. Zakas) +* Fix: no-func-assign should not fail on import declarations (fixes #2060) (Igor Zalutsky) +* Fix: block-scoped-var to work with destructuring (fixes #2059) (Nicholas C. Zakas) +* Fix: no-redeclare should check Node.js scope (fixes #2064) (Nicholas C. Zakas) +* Fix: space-before-function-parentheses generator methods (fixes #2082) (Brandon Mills) +* Fix: Method name resolution in complexity rule (fixes #2049) (Nicholas C. Zakas) +* Fix: no-unused-vars crash from escope workaround (fixes #2042) (Brandon Mills) +* Fix: restrict dot-notation keywords to actual ES3 keywords (fixes #2075) (Michael Ficarra) +* Fix: block-scoped-var to work with classes (fixes #2048) (Nicholas C. Zakas) +* Docs: Update no-new documentation (fixes #2044) (Nicholas C. Zakas) +* Fix: yoda range exceptions with this (fixes #2063) (Brandon Mills) +* Docs: Fix documentation on configuring eslint with comments (Miguel Ping) +* Fix: rule no-duplicate-case problem with MemberExpressions. (fixes #2038) (Dieter Oberkofler) +* Fix: Exempt \0 from no-octal-escape (fixes #1923) (Michael Ficarra) + +v0.17.0 - March 14, 2015 + +* 0.17.0 (Nicholas C. Zakas) +* Fix: module import specifiers should be defined (refs #1978) (Nicholas C. Zakas) +* Fix: Ignore super in no-undef (refs #1968) (Nicholas C. Zakas) +* Upgrade: Espree to v0.12.0 (refs #1968) (Nicholas C. Zakas) +* Fix: destructured arguments should work in block-scoped-var (fixes #1996) (Nicholas C. Zakas) +* Fix: Line breaking with just carriage return (fixes #2005) (Nicholas C. Zakas) +* Fix: location of new-cap error messages (fixes #2025) (Mathias Schreck) +* Breaking: Stop checking JSX variable use, expose API instead (fixes #1911) (Glen Mailer) +* Fix: Check spacing of class methods (fixes #1989) (Nicholas C. Zakas) +* New: no-duplicate-case rule to disallow a duplicate case label (fixes #2015) (Dieter Oberkofler) +* Clarify issue requirement for doc pull requests (Ian) +* Add quotes around object key (Ian) +* Fix: Add comma-dangle allow-multiline (fixes #1984) (Keith Cirkel) +* Fix: Don't explode on default export function (fixes #1985) (Nicholas C. Zakas) +* Update: Add AST node exceptions to comma-style. (fixes #1932) (Evan Simmons) +* Docs: Add spread operator to available language options (Nicholas C. Zakas) +* New: generator-star-spacing rule (fixes #1680, fixes #1949) (Brandon Mills) + +v0.16.2 - March 10, 2015 + +* 0.16.2 (Nicholas C. Zakas) +* Fix: Ensure globalReturn isn't on when node:false (fixes #1995) (Nicholas C. Zakas) +* Downgrade: escope pegged to 2.0.6 (refs #2001) (Nicholas C. Zakas) +* Upgrade: escope to 2.0.7 (fixes #1978) (Nicholas C. Zakas) +* Docs: Update descriptive text for --no-ignore option. (David Anson) +* Upgrade: estraverse to latest for ESTree support (fixes #1986) (Nicholas C. Zakas) +* Fix: Global block-scope-var check should work (fixes #1980) (Nicholas C. Zakas) +* Fix: Don't warn about parens around yield (fixes #1981) (Nicholas C. Zakas) + +v0.16.1 - March 8, 2015 + +* 0.16.1 (Nicholas C. Zakas) +* Fix: Node.js scoping in block-scoped-var (fixes #1969) (Nicholas C. Zakas) +* Update: Enable ES6 scoping for more options (Nicholas C. Zakas) +* Fix: Ensure all export nodes are traversable (fixes #1965) (Nicholas C. Zakas) +* Fix: Ensure class names are marked as used (fixes #1967) (Nicholas C. Zakas) +* Fix: remove typo that caused a crash (fixes #1963) (Fabricio C Zuardi) +* Docs: Added missing "are" (Sean Wilkinson) + +v0.16.0 - March 7, 2015 + +* 0.16.0 (Nicholas C. Zakas) +* Fix: Pass correct sourceType to escope (fixes #1959) (Nicholas C. Zakas) +* Fix: Scoping for Node.js (fixes #892) (Nicholas C. Zakas) +* Fix: strict rule should honor module code (fixes #1956) (Nicholas C. Zakas) +* New: Add es6 environment (fixes #1864, fixes #1944) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures list (fixes #1942) (Nicholas C. Zakas) +* Fix: Make no-unused-vars ignore exports (fixes #1903) (Nicholas C. Zakas) +* Upgrade: Espree to v1.11.0 (Nicholas C. Zakas) +* Fix: Comment configuration of rule doesn't work (fixes #1792) (Jary) +* Fix: Rest args should work in no-undef and block-scoped-var (fixes #1543) (Nicholas C. Zakas) +* Breaking: change no-comma-dangle to comma-dangle (fixes #1350) (Mathias Schreck) +* Update: space-before-function-parentheses to support generators (fixes #1929) (Brandon Mills) +* New: Adding support for "// eslint-disable-line rule" style comments (Billy Matthews) +* Fix: Use unversioned sinon file in browser test (fixes #1947) (Nicholas C. Zakas) +* Docs: Add mention of compatible parsers (Nicholas C. Zakas) +* Fix: Better error when given null as rule config (fixes #1760) (Glen Mailer) +* Update: no-empty to check TryStatement.handler (fixes #1930) (Brandon Mills) +* Fix: space-before-function-parentheses and object methods (fixes #1920) (Brandon Mills) +* New: no-dupe-args rule (fixes #1880) (Jamund Ferguson) +* Fix: comma-spacing should ignore JSX text (fixes #1916) (Brandon Mills) +* Breaking: made eol-last less strict (fixes #1460) (Glen Mailer) +* New: generator-star middle option (fixes #1808) (Jamund Ferguson) +* Upgrade: Espree to 1.10.0 for classes support (Nicholas C. Zakas) +* Docs: no-plusplus.md - auto semicolon insertion (Miroslav Obradović) +* Docs: Use union types in TokenStore JSDoc (refs #1878) (Brandon Mills) +* Fix: block-scoped-var to work with destructuring (fixes #1863) (Nicholas C. Zakas) +* Docs: Update docs for token-related methods (fixes #1878) (Nicholas C. Zakas) +* Update: Remove preferGlobal from package.json (fixes #1877) (Nicholas C. Zakas) +* Fix: allow block bindings in no-inner-declarations (fixes #1893) (Roberto Vidal) +* Fix: getScope and no-use-before-define for arrow functions (fixes #1895) (Brandon Mills) +* Fix: Make no-inner-declarations look for arrow functions (fixes #1892) (Brandon Mills) +* Breaking: Change no-space-before-semi to semi-spacing and add "after" option (fixes #1671) (Mathias Schreck) +* Update: Add support for custom preprocessors (fixes #1817) (Ilya Volodin) + +v0.15.1 - February 26, 2015 + +* 0.15.1 (Nicholas C. Zakas) +* Build: Fix release task (Nicholas C. Zakas) +* Fix: check all semicolons in no-space-before-semi (fixes #1885) (Mathias Schreck) +* Fix: Refactor comma-spacing (fixes #1587, fixes #1845) (Roberto Vidal) +* Fix: Allow globalReturn in consistent-return (fixes #1868) (Brandon Mills) +* Fix: semi rule should check throw statements (fixes #1873) (Mathias Schreck) +* Docs: Added HolidayCheck AG as user (0xPIT) +* Upgrade: `chalk` to 1.0.0 (Sindre Sorhus) +* Docs: Add CustomInk to the list of companies (Derek Lindahl) +* Docs: Alphabetize project & company usage list (Derek Lindahl) +* Docs: fix typo (Henry Zhu) +* Docs: Fix typo (Brenard Cubacub) + +v0.15.0 - February 21, 2015 + +* 0.15.0 (Nicholas C. Zakas) +* Upgrade: Espree to 1.9.1 (fixes #1816, fixes #1805) (Nicholas C. Zakas) +* Fix: make rules work with for-of statements (fixes #1859) (Mathias Schreck) +* Fix: Enable globalReturn for Node.js environment (fixes #1158) (Nicholas C. Zakas) +* Fix: Location of extra paren message (fixes #1814) (Nicholas C. Zakas) +* Fix: Remove unnecessary file exists check (fixes #1831) (Nicholas C. Zakas) +* Fix: Don't count else-if in max-depth (fixes #1835) (Nicholas C. Zakas) +* Fix: Don't flag for-of statement (fixes #1852) (Nicholas C. Zakas) +* Build: Test using io.js as well (Nicholas C. Zakas) +* Change customformat value to path (suisho) +* Docs: Add a missing word in the Contributing doc (Ben Linskey) +* Docs: Fix typo in wrap-iife rule doc title (Ben Linskey) +* Docs: Update pages to fix rendering of lists (David Anson) +* Fix: new-cap should allow defining exceptions (fixes #1424) (Brian Di Palma) +* Update: Add requireReturnDescription for valid-jsdoc (fixes #1833) (Brian Di Palma) +* New: rule no-throw-literal added (fixes #1791) (Dieter Oberkofler) +* New: multi-line option for the curly rule (fixes #1812) (Hugo Wood) +* Docs: fix typo in configuring docs (mendenhallmagic) +* Update: Backslashes in path (fixes #1818) (Jan Schär) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Docs: add webpack loader to the docs/integrations page (Maxime Thirouin) +* Breaking: space-before-function-parentheses replaces space-after-function-name and checkFunctionKeyword (fixes #1618) (Mathias Schreck) + +v0.14.1 - February 8, 2015 + +* 0.14.1 (Nicholas C. Zakas) +* Fix: Exit code should be 1 for any number of errors (fixes #1795) (Nicholas C. Zakas) +* Fix: Check indentation of first line (fixes #1796) (Nicholas C. Zakas) +* Fix: strict rules shouldn't throw on arrow functions (fixes #1789) (Nicholas C. Zakas) + +v0.14.0 - February 7, 2015 + +* 0.14.0 (Nicholas C. Zakas) +* Update: Fix indentation of comment (Nicholas C. Zakas) +* Fix: comma-spacing for template literals (fixes #1736) (Nicholas C. Zakas) +* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) +* Breaking: Remove node from results (fixes #957) (Nicholas C. Zakas) +* Breaking: Exit code is now error count (Nicholas C. Zakas) +* Docs: Correct getFormatter() documentation (refs #1723) (Nicholas C. Zakas) +* Update: Make rules work with arrow functions (fixes #1508, fixes #1509, fixes #1493) (Nicholas C. Zakas) +* Fix: Ensure template string references count (fixes #1542) (Nicholas C. Zakas) +* Fix: no-undef to work with arrow functions (fixes #1604) (Nicholas C. Zakas) +* Upgrade: Espree to version 1.8.0 (Nicholas C. Zakas) +* Fix: Don't throw error for arguments (fixes #1759) (Nicholas C. Zakas) +* Fix: Don't warn on computed nonliteral properties (fixes #1762) (Nicholas C. Zakas) +* New: Allow parser to be configured (fixes #1624) (Nicholas C. Zakas) +* Docs: Added double quotes for JSON keys for comma-spacing and key-spacing rule (Dmitry Polovka) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Revert "New: Rule indent (fixes #1022)" (Nicholas C. Zakas) +* Update: fix eslint indentations (fixes #1770) (Dmitriy Shekhovtsov) +* Fix: Scoping issues for no-unused-vars (fixes #1741) (Nicholas C. Zakas) +* Docs: Added `eslint-enable` inline (Ivan Fraixedes) +* New: Add predefined Meteor globals (fixes #1763) (Johan Brook) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Update: Check all assignments for consistent-this (fixes #1513) (Timothy Jones) +* Fix: Support exceptions in no-multi-spaces (fixes #1755) (Brandon Mills) +* Docs: Forgotten parentheses in code snippet (Ivan Fraixedes) +* Update: CLIEngine results include warning and error count (fixes #1732) (gyandeeps) +* Fix: Scoping issues for no-unused-vars (fixes #1733) (Nicholas C. Zakas) +* Update: Add getNodeByRangeIndex method (refs #1755) (Brandon Mills) +* Update: Replace getTokenByRange(Index->Start) (refs #1721) (Brandon Mills) +* Update: Fast-path for empty input (fixes #546) (Nicholas C. Zakas) +* Fix: Allow single line else-if (fixes #1739) (Nicholas C. Zakas) +* Fix: Don't crash when $HOME isn't set (fixes #1465) (Nicholas C. Zakas) +* Fix: Make no-multi-spaces work for every case (fixes #1603, fixes #1659) (Nicholas C. Zakas) +* Breaking: Show error and warning counts in stylish summary (fixes #1746) (Brandon Mills) +* Docs: fixed typo in no-lone-blocks docs (Vitor Balocco) +* Docs: fixed typo in consistent-return docs (Vitor Balocco) +* Breaking: remove implied eval check from no-eval (fixes #1202) (Mathias Schreck) +* Update: Improve CLIEngine.getFormatter() (refs #1723) (Nicholas C. Zakas) +* Docs: Add Backbone plugin link (Ilya Volodin) +* Docs: use npm's keyword route (Tom Vincent) +* Build: Update sitegen script (Closes #1725) (Ilya Volodin) + +v0.13.0 - January 24, 2015 + +* 0.13.0 (Nicholas C. Zakas) +* Update: The rule spaced-line-comment now also allows tabs and not only spaces as whitespace. (fixes #1713) (Dieter Oberkofler) +* Docs: add Jasmine rules and eslintplugin npm links (Tom Vincent) +* Fix: Make no-redeclare work with let (fixes #917) (Nicholas C. Zakas) +* Update: Add CLIEngine.getFormatter() (fixes #1653) (Nicholas C. Zakas) +* Breaking: Update escope (fixes #1642) (Nicholas C. Zakas) +* Update: Switch to using estraverse-fb (fixes #1712) (Nicholas C. Zakas) +* Docs: Update README FAQ (Nicholas C. Zakas) +* Update: no-warning-comments matches on whole word only (fixes #1709) (Nick Fisher) +* Build: Add JSDoc generation (fixes #1363) (Nicholas C. Zakas) +* Docs: Add more info about context (fixes #1330) (Nicholas C. Zakas) +* Upgrade: Espree to 1.7.1 (fixes #1706) (Nicholas C. Zakas) +* Docs: Make CLA notice more prominent (Nicholas C. Zakas) +* Update: Added globals for: phantom,jquery, prototypejs, shelljs (fixes #1704) (Dmitriy Shekhovtsov) +* Docs: Fixed example for the space-return-throw-case rule (mpal9000) +* Fix: Except object literal methods from func-names (fixes #1699) (Brandon Mills) +* Update: use global strict mode everywhere (fixes #1691) (Brandon Mills) +* Update: Add allowPattern option for dot-notation rule (fixes #1679) (Tim Schaub) +* Fix: Missing undeclared variables in JSX (fixes #1676) (Yannick Croissant) +* Fix: no-unused-expressions rule incorrectly flagging yield (fixes #1672) (Rémi Gérard-Marchant) +* Update: Combine strict mode rules (fixes #1246) (Brandon Mills) +* Fix: disregards leading './' in ignore pattern or file name (fixes #1685) (Chris Montrois) +* Upgrade: globals module to latest (fixes #1670) (Nicholas C. Zakas) +* Fix: generator-star should allow params (fixes #1677) (Brandon Mills) +* Fix: no-unused-vars for JSX (fixes #1673 and fixes #1534) (Yannick Croissant) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) + +v0.12.0 - January 17, 2015 + +* 0.12.0 (Nicholas C. Zakas) +* Fix: Track JSX global variable correctly (fixes #1534) (Nicholas C. Zakas) +* Fix: Property regex flag checking (fixes #1537) (Nicholas C. Zakas) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) +* Update: Expose ecmaFeatures on context (fixes #1648) (Nicholas C. Zakas) +* Docs: Added Fitbit to the list of companies (Igor Zalutsky) +* New: gen-star rule (refs #1617) (Jamund Ferguson) +* New: no-var rule (refs #1617) (Jamund Ferguson) +* Fix: Support JSX spread operator (fixes #1634) (Nicholas C. Zakas) +* Docs: Document ecmaFeatures (Nicholas C. Zakas) +* Upgrade: several dependencies (fixes #1377) (Nicholas C. Zakas) +* Fix: Broken JSX test (Nicholas C. Zakas) +* Fix: no-bitwise reports on bitwise assignment expressions (fixes #1643) (Mathias Schreck) +* Fix: Find JSXIdentifier refs in no-unused-vars (fixes #1534) (Nicholas C. Zakas) +* Update: Add a couple JSX tests (Nicholas C. Zakas) +* Fix: quotes rule ignores JSX literals (fixes #1477) (Nicholas C. Zakas) +* Fix: Don't warn on JSX literals with newlines (fixes #1533) (Nicholas C. Zakas) +* Update: Fully enable JSX support (fixes #1640) (Nicholas C. Zakas) +* Breaking: Allow parser feature flips (fixes #1602) (Nicholas C. Zakas) +* Fix: Allow comments in key-spacing groups (fixes #1632) (Brandon Mills) +* Fix: block-scoped-var reports labels (fixes #1630) (Michael Ficarra) +* Docs: add newline to no-process-env (fixes #1627) (Tom Vincent) +* Fix: Update optionator, --no in help (fixes #1134) (George Zahariev) +* Fix: Allow individual newlines in space-in-brackets (fixes #1614) (Brandon Mills) +* Docs: Correct alignment in example project tree (Tim Schaub) +* Docs: Remove references to Esprima (Nicholas C. Zakas) +* Docs: Remove illegal code fence (Nicholas C. Zakas) + +v0.11.0 - December 30, 2014 + +* 0.11.0 (Nicholas C. Zakas) +* Fix: Adding regexp literal exception (fixes #1589) (Greg Cochard) +* Fix: padded-blocks incorrectly complained on comments (fixes #1416) (Mathias Schreck) +* Fix: column location of key-spacing with additional tokens (fixes #1458) (Mathias Schreck) +* Build: tag correct commit (refs #1606) (Mathias Schreck) +* Upgrade: Updat Espree to 1.3.1 (Nicholas C. Zakas) +* Fix: add es3 config option to dot-notation rule (fixes #1484) (Michael Ficarra) +* Fix: valid-jsdoc should recognize @class (fixes #1585) (Nicholas C. Zakas) +* Update: Switch to use Espree (fixes #1595) (Nicholas C. Zakas) +* Fix: brace-style stroustrup should report on cuddled elseif (fixes #1583) (Ian Christian Myers) +* New: Configuration via package.json (fixes #698) (Michael Mclaughlin) +* Update: Set environments w/ globals (fixes #1577) (Elan Shanker) +* Fix: yoda treats negative numbers as literals (fixes #1571) (Brandon Mills) +* Fix: function arguments now count towards no-shadow check (fixes #1584) (Glen Mailer) +* Fix: check if next statement is on newline when warning against extra semicolons. (fixes #1580) (Evan You) +* Update: add yoda exception for range tests (fixes #1561) (Brandon Mills) +* New: space-after-function-name (fixes #1340) (Roberto Vidal) + +v0.10.2 - December 12, 2014 + +* 0.10.2 (Nicholas C. Zakas) +* Fix: detect for...in in no-loop-func (fixes #1573) (Greg Cochard) +* Update: simplify comma-spacing logic (fixes #1562) (Brandon Mills) +* Fix: operator-assignment addition is non-commutative (fixes#1556) (Brandon Mills) +* 0.10.1 (Nicholas C. Zakas) +* Update: Add new-cap exception configurations. (Fixes #1487) - `newCapsAllowed` - `nonNewCapsAllowed` (Jordan Harband) + +v0.10.1 - December 6, 2014 + +* 0.10.1 (Nicholas C. Zakas) +* Docs: Fix v0.10.0 changelog (Nicholas C. Zakas) +* Build: Ensure changelog works with large semver versions (Nicholas C. Zakas) +* Fix: comma-spacing and comma-style to work with array literals (fixes #1492) (Nicholas C. Zakas) +* Update: better operator regex in use-isnan rule (fixes #1551) (Michael Ficarra) +* Fix: wrong op index in no-multi-spaces (fixes #1547) (Brandon Mills) +* Fix: Restrict use-isnan violations to comparison operators. (Fixes #1535) (Jordan Harband) +* Fix: comma-spacing has false positives when parenthesis are used (fixes #1457) (Jamund Ferguson) +* Docs: alphabetize the "Stylistic Issues" section (Jeff Williams) +* Build: make the "gensite" target work when DOCS_DIR does not exist (fixes #1530) (Jeff Williams) +* Docs: badges should only refer to master branch (Mathias Schreck) +* Fix: prevent crash on empty blocks in no-else-return (fixes #1527) (Mathias Schreck) +* Build: Fix md to html conversion regex (fixes #1525) (Brandon Mills) +* 0.10.0 (Nicholas C. Zakas) + +v0.10.0 - November 27, 2014 + +* 0.10.0 (Nicholas C. Zakas) +* Fix: Add Object and Function as exceptions in new-cap (refs #1487) (Nicholas C. Zakas) +* Breaking: Allow extensionless files to be passed on CLI (fixes #1131) (Nicholas C. Zakas) +* Fix: typo: iffe to iife, none to non (Michael Ficarra) +* Update: refactor tokens API (refs #1212) (Brandon Mills) +* New: Allow other file extensions (fixes #801) (Nicholas C. Zakas) +* Update: Add Event to browser globals (fixes #1474) (Nicholas C. Zakas) +* Fix: check function call arguments in comma-spacing (fixes #1515) (Mathias Schreck) +* Update: Add no-cond-assign option to disallow nested assignments in conditionals (fixes #1444) (Jeff Williams) +* Fix: crash in no-multi-spaces on empty array elements (fixes #1418) (Brandon Mills) +* Fix: Don't explode on directory traversal (fixes #1452) (Nicholas C. Zakas) +* Fix: no-fallthrough should work when semis are missing (fixes #1447) (Nicholas C. Zakas) +* Fix: JSDoc parsing by updating doctrine (fixes #1442) (Nicholas C. Zakas) +* Update: restore the "runs" global present in Jasmine 1.3 (fixes #1498) (Michał Gołębiowski) +* Fix: ignore undefined identifiers in typeof (fixes #1482) (Mathias Schreck) +* Fix: Ignoring empty comments. (fixes #1488) (Greg Cochard) +* New: Add space-unary-ops rules (#1346) (Marcin Kumorek) +* Update: Remove shebang workaround in spaced-line-comment (fixes #1433) (Michael Ficarra) +* Docs: change 'and' to 'an' in docs/rules/valid-jsdoc.md (fixes #1441) (Michael Ficarra) +* Update: Add `beforeAll` and `afterAll` to the Jasmine globals (fixes #1478) (Gyandeep Singh) +* Update: Add exception options to space-in-parens (fixes #1368) (David Clark) +* Build: Add check for license issues (fixes #782) (Brandon Mills) +* Docs: update badges (Yoshua Wuyts) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Fix: env rules merging for command line config (fixes #1271) (Roberto Vidal) +* Fix: Collect variables declare in switch-case.(fixes #1453) (chris) +* Fix: remove extra capture group (Nate-Wilkins) +* Update: allow distinct alignment groups in key-spacing (fixes #1439) (Brandon Mills) +* Fix: message for numeric property names in quote-props (fixes #1459) (Brandon Mills) +* Docs: Remove assumption about the rule config (Alexander Schmidt) +* New: Add ability to time individual rules (fixes #1437) (Brandon Mills) +* Fix: single quotes (Nate-Wilkins) +* Docs: Fix broken code fences in key-spacing docs (Brandon Mills) +* Docs: Explain .eslintignore features (fixes #1094) (Brandon Mills) +* Breaking: ignore node_modules by default (fixes #1163) (Brandon Mills) +* Fix: Adds clamping to getSource beforeCount (fixes #1427) (Greg Gianforcaro) +* New: add no-inline-comment rule (fixes #1366) (Greg Cochard) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Build: Filter and sort versions in gensite (fixes #1430) (Brandon Mills) +* Build: Escape period in regex (fixes #1428) (Brandon Mills) +* Revert "Fix: '.md' to '.html' with anchors (fixes #1415)" (Nicholas C. Zakas) +* 0.9.2 (Nicholas C. Zakas) +* New: Add operator-assignment rule (fixes #1420) (Brandon Mills) + +v0.9.2 - November 1, 2014 + +* 0.9.2 (Nicholas C. Zakas) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Fix: Allow line breaks in key-spacing rule (fixes #1407) (Brandon Mills) +* Build: add coveralls integration (fixes #1411) (Mathias Schreck) +* Fix: add severity flag for ignored file warning (fixes #1401) (Mathias Schreck) +* Fix: Keep sinon at ~1.10.3 (fixes #1406) (Brandon Mills) +* Fix: ! negates .eslintignore patterns (fixes #1093) (Brandon Mills) +* Fix: let fs.stat throw if a file does not exist (fixes #1296) (Mathias Schreck) +* Fix: check switch statements in space-before-blocks (fixes #1397) (Mathias Schreck) +* Docs: fix rule name in example configuration (Mathias Schreck) +* Fix: disable colors during test run (fixes #1395) (Mathias Schreck) +* New: add isPathIgnored method to CLIEngine (fixes #1392) (Mathias Schreck) +* Docs: changing eslint to ESLint and add missing backtick (Mathias Schreck) +* Docs: Documents the functionality to load a custom formatter from a file (Adam Baldwin) +* 0.9.1 (Nicholas C. Zakas) +* Update: Option type for mixed tabs and spaces (fixes #1374) (Max Nordlund) +* Fix: Nested occurrences of no-else-return now show multiple reports (fixes #1369) (Jordan Hawker) + +v0.9.1 - October 25, 2014 + +* 0.9.1 (Nicholas C. Zakas) +* Docs: fix link on governance model (azu) +* Fix: plugins without rulesConfig causes crash (fixes #1388) (Mathias Schreck) +* 0.9.0 (Nicholas C. Zakas) + +v0.9.0 - October 24, 2014 + +* 0.9.0 (Nicholas C. Zakas) +* New: Allow reading from STDIN (fixes #368) (Nicholas C. Zakas) +* New: add --quiet option (fixes #905) (Mathias Schreck) +* Update: Add support for plugin default configuration (fixes #1358) (Ilya Volodin) +* Fix: Make sure shebang comment node is removed (fixes #1352) (Nicholas C. Zakas) +* New: Adding in rule for irregular whitespace checking. (fixes #1024) (Jonathan Kingston) +* Fix: space-in-parens should not throw for multiline statements (fixes #1351) (Jary) +* Docs: Explain global vs. local plugins (fixes #1238) (Nicholas C. Zakas) +* Docs: Add docs on Node.js API (fixes #1247) (Nicholas C. Zakas) +* Docs: Add recommended keywords for plugins (fixes #1248) (Nicholas C. Zakas) +* Update: Add CLIEngine#getConfigForFile (fixes #1309) (Nicholas C. Zakas) +* Update: turn on comma-style for project (fixes #1316) (Nicholas C. Zakas) +* Fix: Ensure messages are sorted by line (fixes #1343) (Nicholas C. Zakas) +* Update: Added arraysInObjects and objectsInObjects options to space-in-brackets rule (fixes #1265, fixes #1302) (vegetableman) +* Breaking: Removed comma spacing check from space-infix-ops (fixes #1361) (vegetableman) +* Fix: addressed linting errors (Nicholas C. Zakas) +* Docs: Add Contributor Model (fixes #1341) (Nicholas C. Zakas) +* Docs: Add reference to CLA (Nicholas C. Zakas) +* Build: add version numbers to docs (fixes #1170) (Mathias Schreck) +* Fix: no-fallthrough incorrectly flagged falls through annotations (fixes #1353) (Mathias Schreck) +* Build: separate site publishing form generation (fixes #1356) (Mathias Schreck) +* New: Add key-spacing rule (fixes #1280) (Brandon Mills) +* New: add spaced-line-comment rule (fixes #1345) (Greg Cochard) +* Docs: added more Related Rules sections (fixes #1347) (Delapouite) +* Fix: resolve linting issue in (fixes #1339) (Nicholas C. Zakas) +* New: add space-before-blocks rule (fixes #1277) (Mathias Schreck) +* Docs: Remove moot integration plugins (Sindre Sorhus) +* New: add rule for multiple empty lines (fixes #1254) (Greg Cochard) +* Fix: no-shadow rule should consider function expressions (fixes #1322) (Mathias Schreck) +* Update: remove globals present only in Jasmine plugins (fixes #1326) (Michał Gołębiowski) +* New: added no-multi-spaces rule (fixes #630) (vegetableman) +* New: Added comma-spacing rule (Fixes #628, Fixes #1319) (vegetableman) +* New: add rule for padded blocks (fixes #1278) (Mathias Schreck) +* Docs: fix eqeqeq isNullCheck comment (Denis Sokolov) +* Fix: no-comma-dangle violation in unit test and Makefile.js/lint not checking return codes (fixes #1306) (David Anson) +* Fix: allow comma-last with object properties having line breaks (fixes #1314) (vegetableman) +* New: Added comma-style rule (fixes #1282) (vegetableman) +* Update: add space after function keyword check (fixes #1276) (Mathias Schreck) +* Update: Add missing environments and fix sorting/grouping of rules (fixes #1307, fixes #1308) (David Anson) +* Docs: Fix sorting of rules within each section (David Anson) +* Docs: Correct a few misspelled words (David Anson) +* Docs: Update multiple pages to fix rendering of fenced code blocks (David Anson) +* New: Added no-process-env rule (fixes #657) (vegetableman) +* Fix: add rule ensuring #1258 is fixed by recent rewrite (fixes #1258) (Michael Ficarra) +* Update: split propertyName from singleValue in space-in-brackets (fixes #1253) (Michael Ficarra) +* Update: add "as-needed" option to quote-props rule (fixes #1279) (Michael Ficarra) +* Docs: fixed broken link and changed warning level to error level (vegetableman) +* Docs: Added "the native web" to the list of companies that use ESLint. (Golo Roden) +* Docs: Add BountySource badge to README (Nicholas C. Zakas) +* 0.8.2 (Nicholas C. Zakas) + +v0.8.2 - September 20, 2014 + +* 0.8.2 (Nicholas C. Zakas) +* Docs: Updated contribution guidelines to add accepted/bounty issues descriptions (Nicholas C. Zakas) +* Docs: Update README with links and FAQs (Nicholas C. Zakas) +* Docs: add finally to space-after-keywords documentation (Mathias Schreck) +* New: add ignoreCase option to sort-vars (fixes #1272) (Mathias Schreck) +* Docs: fix typo (Barry Handelman) +* Docs: Fix broken Markdown on configuration page (Nicholas C. Zakas) +* Docs: Fix reference to wrong rule name (Harry Wolff) +* Upgrade: Most dev dependencies (Nicholas C. Zakas) +* Upgrade: shelljs to 0.3.0 (Nicholas C. Zakas) +* Upgrade: doctrine to 0.5.2 (Nicholas C. Zakas) +* Upgrade: esprima to 1.2.2 (Nicholas C. Zakas) +* Upgrade: eslint-tester to latest (Nicholas C. Zakas) +* Fix: Load .eslintrc in directory with $HOME as an ancestor (fixes #1266) (Beau Gunderson) +* Fix: load .eslintrc from HOME (fixes #1262) (Beau Gunderson) +* New: Add sharable rule settings (fixes #1233) (Ilya Volodin) +* Upgrade: upgrade outdated dependencies (fixes #1251) (Mathias Schreck) +* Docs: fix typo in no-ex-assign documentation (Michael Ficarra) +* Docs: add intellij plugin to integrations (ido) +* Docs: Changing NPM to npm (Peter deHaan) +* Fix: strict should check function expressions (fixes #1244) (Brandon Mills) +* Docs: fix vars-on-top documentation (fixes #1234) (Mathias Schreck) +* 0.8.1 (Nicholas C. Zakas) +* Docs: Fixed a typo in brace-style.md (Anton Antonov) + +v0.8.1 - September 9, 2014 + +* 0.8.1 (Nicholas C. Zakas) +* Fix: Ensure exit code is 1 when there's a syntax error (fixes #1239) (Nicholas C. Zakas) +* Docs: fix up vars-on-top documentation (fixes #1234) (Michael Ficarra) +* Fix: vars-on-top directive support (fixes #1235) (Michael Ficarra) +* Fix: Avoid mutating node.range in max-len (fixes #1224) (Brandon Mills) +* Docs: Typo, add missing quotation mark (Ádám Lippai) +* Update: space-in-brackets to allow exceptions (fixes #1142) (Brandyn Bennett) +* 0.8.0 (Nicholas C. Zakas) + +v0.8.0 - September 5, 2014 + +* 0.8.0 (Nicholas C. Zakas) +* Perf-related revert "Fix: Speed up tokens API (refs #1212)" (Nicholas C. Zakas) +* Fix: no-fallthrough: continue affects control flow, too (fixes #1220) (Michael Ficarra) +* Fix: rewrite no-unused-vars rule (refs #1212) (Michael Ficarra) +* Fix: Error when there's a \r in .eslintrc (#1172) (Gyandeep Singh) +* Added rule disallowing reserved words being used as keys (fixes #1144) (Emil Bay) +* Fix: rewrite no-spaced-func rule (refs #1212) (Michael Ficarra) +* Fix: Speed up getScope() (refs #1212) (Brandon Mills) +* Fix: no-extra-strict behavior for named function expressions (fixes #1209) (Mathias Schreck) +* Add Date.UTC to allowed capitalized functions (David Brockman Smoliansky) +* New: Adding 'vars-on-top' rule (fixes #1148) (Gyandeep Singh) +* Fix: Speed up tokens API (refs #1212) (Brandon Mills) +* Docs: document plugin usage (fixes #1117) (Mathias Schreck) +* New: accept plugins from cli (fixes #1113) (Mathias Schreck) +* Docs: fix some typos. (Mathias Schreck) +* New: Load plugins from configs (fixes #1115). (Mathias Schreck) +* Fix: no-unused-expressions better directive detection (fixes #1195) (Michael Ficarra) +* Fix: no-unused-expressions directive support (fixes #1185) (Michael Ficarra) +* Update: Add 'allowSingleLine' option to brace-style (fixes #1089) (John Gozde) +* Docs: Spell checking and one extra closing curly in code example (Juga Paazmaya) +* Fix: mergeConfigs ensures the plugins property exists (fixes #1191). (Mathias Schreck) +* Update: Declare ES6 collections (Map, Set, WeakMap, WeakSet) as built-in globals (fixes #1189) (Michał Gołębiowski) +* New: Adding 'plugin' CLI option (fixes #1112) (Greg) +* Fix: Correct a typo in the error message in tests (Michał Gołębiowski) +* New: Add no-extra-bind rule to flag unnecessary bind calls (fixes #982) (Bence Dányi) +* Fix: Useless bind call in cli-engine (fixes #1181) (Bence Dányi) +* Docs: Updates `amd` description (fixes #1175) (James Whitney) +* New: Adds support for the `jasmine` env (fixes #1176) (James Whitney) +* Fix: for-in support to no-empty-label rule (fixes #1161) (Marc Harter) +* docs: Update link (Mathias Bynens) +* Fix: crash when loading empty eslintrc file (fixes #1164) (Michael Ficarra) +* Fix: no-unused-var should respect compound assignments (fixes #1166) (Michael Ficarra) +* Update: ES3 `ReservedWord`s (fixes #1151) Adds ES3 `ReservedWord`s to the list of keywords in the `dot-notation` rule (fixes #1151) (Emil Bay) +* Update: Update comment parser to read rule slashes (fixes #1116) (Jary) +* New: add no-void rule (fixes #1017). (Mike Sidorov) +* New: Add rules.import() (fixes #1114) (Mathias Schreck) +* New: Make mergeConfigs() merge plugin entries (fixes #1111) (Mathias Schreck) +* Breaking: Change no-global-strict to global-strict and add "always" option (fixes #989) (Brandon Mills) +* Fix: no-unreachable should check top-level statements (fixes #1138) (Brandon Mills) +* Fix: Speed up no-unreachable (fixes #1135) (Brandon Mills) +* New: advanced handle-callback-err configuration (fixes #1124) (Mathias Schreck) +* New: Expose CLIEngine (fixes #1083) (Gyandeep Singh) +* Docs: Add link to new Atom linter (fixes #1125) (Gil Pedersen) +* Fix: space-after-keywords checks finally of TryStatement (fixes #1122) (Michael Ficarra) +* Fix: space-after-keywords checks while of DoWhileStatement (fixes #1120) (Michael Ficarra) +* Fix: space-after-keywords w/ "never" should allow else-if (fixes #1118) (Michael Ficarra) +* Fix: dot-notation rule flags non-keyword reserved words (fixes #1102) (Michael Ficarra) +* Update: Use xml-escape instead of inline helper (Ref #848) (jrajav) +* Update: Added comments support to .eslintignore (fixes #1084) (Vitaly Puzrin) +* Update: enabled 'no-trailing-spaces' rule by default (fixes #1051) (Vitaly Puzrin) +* Breaking: Ignore children of all patterns by adding "/**" (Fixes #1069) (jrajav) +* Fix: skip dot files and ignored dirs on traverse (fixes #1077, related to #814) (Vitaly Puzrin) +* Docs: Added Gruntjs plugin on integrations page (Gyandeep Singh) +* Fix: don't break node offsets if hasbang present (fixes #1078) (Vitaly Puzrin) +* Build: Exclude readme/index from rules Resources generation (Fixes #1072) (jrajav) +* Docs: Change eol-last examples to `
    ` (Fixes #1068) (jrajav)
    +* 0.7.4 (Nicholas C. Zakas)
    +* New: space-in-parens rule (Closes #627) (jrajav)
    +
    +v0.7.4 - July 10, 2014
    +
    +* 0.7.4 (Nicholas C. Zakas)
    +* Docs: Fix 'lintinging' typo and ref links (Tom Vincent)
    +* Fix: Transform envs option to object in Config (Fixes #1064) (jrajav)
    +* 0.7.3 (Nicholas C. Zakas)
    +
    +v0.7.3 - July 9, 2014
    +
    +* 0.7.3 (Nicholas C. Zakas)
    +* Update: Address code review comment for strict rule (refs #1011) (Nicholas C. Zakas)
    +* Docs: Update copyright policy (Nicholas C. Zakas)
    +* Docs: Update documentation for max-len to include description of second option (fixes #1006) (Nicholas C. Zakas)
    +* Fix: Avoid double warnings for strict rule (fixes #1011) (Nicholas C. Zakas)
    +* Fix: Check envs for true/false (Fixes #1059) (jrajav)
    +* 0.7.2 (Nicholas C. Zakas)
    +
    +v0.7.2 - July 8, 2014
    +
    +* 0.7.2 (Nicholas C. Zakas)
    +* Fix: no-mixed-spaces-and-tabs incorrectly flagging multiline comments (fixes #1055) (Nicholas C. Zakas)
    +* Fix: new-cap error that throws on non-string member (fixes #1056) (Nicholas C. Zakas)
    +* Fix: Always make globals an object (Fixes #1049) (jrajav)
    +* 0.7.1 (Nicholas C. Zakas)
    +
    +v0.7.1 - July 7, 2014
    +
    +* 0.7.1 (Nicholas C. Zakas)
    +* Docs: Add Related Rules sections (Fixes #990) (jrajav)
    +* Fix: Check output file isn't dir, fix tests (Fixes #1034) (jrajav)
    +* Docs: Updated documentation for several rules (Nicholas C. Zakas)
    +* Docs: Updated contributor guide and dev env setup guide (Nicholas C. Zakas)
    +* Breaking: Implement configuration hierarchy (fixes #963) (Nicholas C. Zakas)
    +* Update: greatly simplify eqeqeq's operator finding logic (fixes #1037) (Michael Ficarra)
    +* New: Add getSourceLines() to core and rule context (fixed #1005) (Jary)
    +* Build + Docs: Adding generated resource links to rule docs (Fixes #1021) (jrajav)
    +* Fix: Ignore unused params for args: 'none' (Fixes #1026) (jrajav)
    +* Fix: Point eqeqeq error at operator (Fixes #1029) (jrajav)
    +* New: report output to a file (fixes #1027) (Gyandeep Singh)
    +* Breaking: CLIEngine abstraction for CLI operations; formatters no longer are passed configs (fixes #935) (Nicholas C. Zakas)
    +* Fix: Allow stdout to drain before exiting (fixes #317) (Nicholas C. Zakas)
    +* New: add no-undefined rule (fixes #1020) (Michael Ficarra)
    +* New: Added no-mixed-spaces-and-tabs rule (fixes #1003) (Jary)
    +* New: Added no-trailing-spaces rule (fixes #995) (Vitaly Puzrin)
    +* Update: Factor ignores out of Config (fixes #958) (jrajav)
    +* Fix: rewrite eol-last rule (fixes #1007) (fixes #1008) (Michael Ficarra)
    +* Fix: add additional IIFE exception in no-extra-parens (fixes #1004) (Michael Ficarra)
    +* Docs: Removed reference to brace-style Stroustrup default (fixes #1000) (Caleb Troughton)
    +* New: Added eol-last rule (Fixes #996) (Vitaly Puzrin)
    +* Fix: Put rule severity in messages (Fixes #984); deprecates passing full config to Formatters (jrajav)
    +* Fix: no-unused-vars to check only file globals (fixes #975) (Aliaksei Shytkin)
    +* Build: Makefile - Check for rule ids in docs titles (Fixes #969) (Delapouite)
    +* Docs: guard-for-in - added missing id in title (Fixes #969) (Delapouite)
    +* Breaking: Change 'no-yoda' rule to 'yoda' and add "always" option (Fixes #959) (jrajav)
    +* Fix: Fixes no-unused-vars to check /*globals*/ (Fixes #955) (jrajav)
    +* Update: no-eval to also warn on setTimeout and setInterval (fixes #721) (Nicholas C. Zakas)
    +* Remove: experimental match() method (Nicholas C. Zakas)
    +* Update: space-in-brackets now always allows empty object and array literals to have no spaces (fixes #797) (Nicholas C. Zakas)
    +* New: Allow the cli parameter "color" and "no-color" (fixes #954) (Tom Gallacher)
    +* Fix: valid-jsdoc no more warning for multi-level params (Fixes #925) (Delapouite)
    +* Update: Search parent directories for .eslintignore (Fixes #933) (jrajav)
    +* Fix: Correct order of arguments passed to assert.equal (fixes #945) (Michał Gołębiowski)
    +* Update: Write the summary in stylish formatter in yellow if no errors (fixes #906); test coloring of messages (Michał Gołębiowski)
    +* Fix: Corrects configs merging into base config (Fixes #838) (jrajav)
    +* Fix: Adding check if char is non-alphabetic to new-cap (Fixes #940) (jrajav)
    +* Docs: Update about page description (fixes #936) (Nicholas C. Zakas)
    +* Docs: Add '/', forgotten in first commit (Fixes #931) (jrajav)
    +* Update: Rule `new-cap` checks capitalized functions (fixes #904) (Aliaksei Shytkin)
    +* Docs: Mention allowed semicolons in "never" mode for 'semi' rule (fixes #931) (jrajav)
    +* Docs: Mention Yeoman generator in dev setup (fixes #914) (Nicholas C. Zakas)
    +* Build: Remove flaky perf test from Travis (Nicholas C. Zakas)
    +* Breaking: Refactor .eslintignore functionality (refs #928, fixes #901, fixes #837, fixes #853) (Nicholas C. Zakas)
    +* 0.6.2 (Nicholas C. Zakas)
    +* Breaking: Remove JSON support for .eslintignore (fixes #883) (icebox)
    +
    +v0.6.2 - May 23, 2014
    +
    +* 0.6.2 (Nicholas C. Zakas)
    +* Fix: Adding per-environment rule configs to docs and doc validation (Fixes #918) (jrajav)
    +* Docs: Updated contribution guidelines (Nicholas C. Zakas)
    +* Docs: Update description of eqeqeq to mention special cases (fixes #924) (Nicholas C. Zakas)
    +* Fix: block-scoped-var CatchClause handling (fixes #922) (Michael Ficarra)
    +* Fix: block-scoped-var respects decls in for and for-in (fixes #919) (Michael Ficarra)
    +* Update: Implement eqeqeq option "allow-null" (fixes #910) (Michał Gołębiowski)
    +* Fix: new-cap should allow non-alpha characters (fixes #897) (Michael Ficarra)
    +* Update: Refactor ESLintTester to fix dependency hell (fixes #602) (Nicholas C. Zakas)
    +* Fix: Merge configs with ancestors (Fixes #820) (jrajav)
    +* Fix: no-fallthrough should respect block statements in case statements (fixes #893) (Nicholas C. Zakas)
    +* Docs: Fix layout issue in configuration docs (fixes #889) (Nicholas C. Zakas)
    +* Build: Enable default-case rule (fixes #881) (icebox)
    +* Build: Enable space-after-keywords (fixes #884) (icebox)
    +* Fix api double emit on comment nodes (fixes #876) (Aliaksei Shytkin)
    +* 0.6.1 (Nicholas C. Zakas)
    +
    +v0.6.1 - May 17, 2014
    +
    +* 0.6.1 (Nicholas C. Zakas)
    +* Upgrade: Optionator to 0.4.0 (fixes #885) (Nicholas C. Zakas)
    +* 0.6.0 (Nicholas C. Zakas)
    +
    +v0.6.0 - May 17, 2014
    +
    +* 0.6.0 (Nicholas C. Zakas)
    +* Fix: Remove -r alias for --rule (fixes #882) (Nicholas C. Zakas)
    +* Docs: Update dev setup, contributing, default-case descriptions (Nicholas C. Zakas)
    +* Update: valid-jsdoc now allows you to optionally turn off parameter description checks (fixes #822) (Nicholas C. Zakas)
    +* Breaking: brace-style now disallows block statements where curlies are on the same line (fixes #758) (Nicholas C. Zakas)
    +* Add linting Makefile.js (fixes #870) (icebox)
    +* add rule flag, closes #692 (George Zahariev)
    +* Add check between rules doc and index (fixes #865) (icebox)
    +* Add Build Next mention in integrations README. (icebox)
    +* document new IIFE exception for no-extra parens added as part of #655 (Michael Ficarra)
    +* (fixes #622) Add rule ID on documentation pages (Delapouite)
    +* fixes #655: add IIFE exception to no-extra-parens (Michael Ficarra)
    +* add new rule "no-new-require" (Wil Moore III)
    +* exit with non-zero status when tests fail (fixes #858) (Márton Salomváry)
    +* removed unicode zero width space character from messages (fixes #857) (Márton Salomváry)
    +* Change: --rulesdir now can be specified multiple times (fixes #830) (Nicholas C. Zakas)
    +* Update: Node 0.8 no longer supported (fixes #734) (Nicholas C. Zakas)
    +* Update: Add typed arrays into builtin environment globals (fixes #846) (Nicholas C. Zakas)
    +* Fix: Add prototype methods to global scope (fixes #700) (Nicholas C. Zakas)
    +* Rule: no-restricted-modules (fixes #791) (Christian)
    +* Upgrade: Esprima to 1.2 (fixes #842) (Nicholas C. Zakas)
    +* Docs: reporting level 2 is an error (fixes #843) (Brandon Mills)
    +* Upgrade: Esprima to 1.2, switch to using Esprima comment attachment (fixes #730) (Nicholas C. Zakas)
    +* Fix: Semi rule incorrectly flagging extra semicolon (fixes #840) (Nicholas C. Zakas)
    +* Build: Update Travis to only test Node 0.10 (refs #734) (Nicholas C. Zakas)
    +* Add "nofunc" option (fixes #829) (Conrad Zimmerman)
    +* Rule: no-inner-declarations (fixes #587) (Brandon Mills)
    +* Rule 'block-scoped-var': correct scope for functions, arguments (fixes #832) (Aliaksei Shytkin)
    +* Rule: default-case (fixes #787) (Aliaksei Shytkin)
    +* Ignored files are excluded unless --force is passed on the CLI (Nick Fisher)
    +* Fixes a typo and a broken link in the documentation (Nick Fisher)
    +* Replaces .some() with .indexOf() where appropriate (Nick Fisher)
    +* Fix correct config merge for array values (fixes #819) (Aliaksei Shytkin)
    +* Remove warning about ESLint being in Alpha (Nick Fisher)
    +* Adds `space-after-keywords` rule (fixes #807) (Nick Fisher)
    +* Rule: no-lonely-if (fixes #790) (Brandon Mills)
    +* Add ignore comments in file (fixes #305) (Aliaksei Shytkin)
    +* 0.5.1 (Nicholas C. Zakas)
    +* Change: no-unused-vars default to 'all' (fixes #760) (Nicholas C. Zakas)
    +
    +v0.5.1 - April 17, 2014
    +
    +* 0.5.1 (Nicholas C. Zakas)
    +* Fix general config not to be modified by comment config in files (fixes #806) (Aliaksei Shytkin)
    +* SVG badges (Ryuichi Okumura)
    +* fixes #804: clean up implementation of #803 (which fixed #781) (Michael Ficarra)
    +* Build: Fix perf test to take median of three runs (fixes #781) (Nicholas C. Zakas)
    +* Fix: --reset will now properly ignore default rules in environments.json (fixes #800) (Nicholas C. Zakas)
    +* Docs: Updated contributor guidelines (Nicholas C. Zakas)
    +* Added Mocha global variables for TDD style. Fixes #793. (Golo Roden)
    +* Rule: no-sequences (fixes #561) (Brandon Mills)
    +* Change .eslintingore to plain text (fixes #761) (Brandon Mills)
    +* Change 'no-spaced-func' message (fixes #762) (Aliaksei Shytkin)
    +* Rule 'block-scoped-var' works correct when object inits (fixes #783) (Aliaksei Shytkin)
    +* Build: Always build docs site on top of origin/master (Nicholas C. Zakas)
    +* 0.5.0 (Nicholas C. Zakas)
    +
    +v0.5.0 - April 10, 2014
    +
    +* 0.5.0 (Nicholas C. Zakas)
    +* Build: Bump perf limit so Travis won't fail every time (fixes #780) (Nicholas C. Zakas)
    +* Add tests to cover 100% of eslint.js (Aliaksei Shytkin)
    +* Fix: Make sure no-path-concat doesn't flag non-concat operations (fixes #776) (Nicholas C. Zakas)
    +* Rule 'no-unused-var' in functional expression with identifier (fixes #775) (Aliaksei Shytkin)
    +* Rule: valid-typeof (Ian Christian Myers)
    +* Add global cli flag (ref #692) (Brandon Mills)
    +* update to latest Optionator (George Zahariev)
    +* Add options for rule 'no-unused-vars' to check all arguments in functions (fixes #728) (Aliaksei Shytkin)
    +* Fix: Cleanup package.json (Nicholas C. Zakas)
    +* New: Experimental support for CSS Auron (fixes #765) (Nicholas C. Zakas)
    +* Lint tests on build (fixes #764) (Aliaksei Shytkin)
    +* Rule block-scoped-var works correct with object properties (fixes #755) (Aliaksei Shytkin)
    +* Breaking: implement eslint-env and remove jshint/jslint environment comment support (fixes #759) (Aliaksei Shytkin)
    +* readme: npm i -> npm install (Linus Unnebäck)
    +* Add env flag to cli options summary (fixes #752) (Brandon Mills)
    +* Fix: Give the perf test a better calculated budget (fixes #749) (Nicholas C. Zakas)
    +* give the `env` flag type `[String]`, improve code (fixes #748) (George Zahariev)
    +* fixes #735: add new, more efficient getTokens interfaces (Michael Ficarra)
    +* Add --env cli flag (ref #692) (Brandon Mills)
    +* Fixes #740 - Make sure callbacks exist before marking them as 'handled'. (mstuart)
    +* fixes #743: wrap-regex rule warns on regex used in dynamic member access (Michael Ficarra)
    +* replace tab indents with 4 spaces in lib/rules/handle-callback-err.js (Michael Ficarra)
    +* Adding homepage and bugs links to package.json (Peter deHaan)
    +* JSDoc for rules (Anton Rudeshko)
    +* 0.4.5 (Nicholas C. Zakas)
    +
    +v0.4.5 - March 29, 2014
    +
    +* 0.4.5 (Nicholas C. Zakas)
    +* Build: Add perf check into Travis build to better monitor performance regressions (fixes #732) (Nicholas C. Zakas)
    +* Fix: Make sure semi reports correct location of missing semicolon (fixes #726) (Nicholas C. Zakas)
    +* Add --no-eslintrc cli flag (ref #717) (Brandon Mills)
    +* Fix #716 crash with reset flag (Brandon Mills)
    +* Fixed JSON formatting and highlighting (Anton Rudeshko (Tesla))
    +* fixes #723: block-scoped-var throws on unnamed function expression (Michael Ficarra)
    +* Fix: Make stroustrup brace-style closing message make sense (fixes #719) (Nicholas C. Zakas)
    +* no-comma-dangle reports correct line number (Andrey Popp)
    +* Upgrade: Esprima to 1.1.1 and EScope to 1.0.1 (fixes #718) (Nicholas C. Zakas)
    +* Add reset cli flag (refs #692) (Brandon Mills)
    +* Relax eqeqeq null check (fixes #669) (Brandon Mills)
    +* 0.4.4 (Nicholas C. Zakas)
    +* New Rule: handle-callback-err (fixes #567) (Jamund Ferguson)
    +
    +v0.4.4 - March 25, 2014
    +
    +* 0.4.4 (Nicholas C. Zakas)
    +* Fix no-used-vars to report FunctionExpression params (fixes #697). (Andrey Popp)
    +* fixes #711: eslint reports wrong line number for files with shebang (Michael Ficarra)
    +* Fix for no-unused-vars and MemberExpression (Andrey Popp)
    +* added no-warning-comments rule (Alexander Schmidt)
    +* fixes #699: brace-style does not check function expressions (Michael Ficarra)
    +* rewrite block-scoped-var (Michael Ficarra)
    +* recommend using hasOwnProperty from Object.prototype in guard-for-in docs (Michael Ficarra)
    +* change conf/environments.json spacing to be simpler and more consistent (Michael Ficarra)
    +* Update API to use context.getFilename() instead of .filename. (Loren Segal)
    +* Small changes, JSDoc is clarified (Aliaksei Shytkin)
    +* Move FileFinder to separate file (Aliaksei Shytkin)
    +* Cache if file is not found (Aliaksei Shytkin)
    +* Use cache on config files seach (Aliaksei Shytkin)
    +* Added .eslintignore to load from parents folders (fixes #681) (Aliaksei Shytkin)
    +* fix 'node-modules' typo in docs (Fred K. Schott)
    +* Upgrade to the latest version of doctrine. (Brian Di Palma)
    +* Document optional filename and default it to `input`. (Loren Segal)
    +* Fix: Compatibility for Node 0.8 (Nicholas C. Zakas)
    +* Update: Makefile.js now uses shelljs-nodecli (Nicholas C. Zakas)
    +* #681 apply all .eslintignore exclusions (Aliaksei Shytkin)
    +* Add RuleContext.filename property (for eslint/eslint#468). (Loren Segal)
    +* 0.4.3 (Nicholas C. Zakas)
    +
    +v0.4.3 - March 18, 2014
    +
    +* 0.4.3 (Nicholas C. Zakas)
    +* fixes #682: rewrite no-constant-condition rule (Michael Ficarra)
    +* Fixes #673 allow configuration of @return errors via requireReturn - (fixes #673) (Brian Di Palma)
    +* Tweaking inline code formatting for "if, while, dowhile" (Peter deHaan)
    +* Fixes #677 getJSDocComment() should not search beyond FunctionExpression or FunctionDeclaration parent nodes. (Brian Di Palma)
    +* Relaxed enforcement of camelcase rule (Ian Christian Myers)
    +* Fixing issue #675. Incorrect triggering of no-else-return rule. (Brian Di Palma)
    +* Added style option for wrap-iife (Mathias Schreck)
    +* Fix: Issues with named function expressions in no-unused-vars and no-shadow (fixes #662) (Nicholas C. Zakas)
    +* Update: camelcase rule now doesn't flag function calls (fixes #656) (Nicholas C. Zakas)
    +* Updating documentation description for: no-space-before-semi rule, changing rules to exempt strings with semicolons and test for that condition. Fixes #629. (Jonathan Kingston)
    +* Adding in rule no-space-before-semi to prevent spaces before semicolons. fixes #629 (Jonathan Kingston)
    +* show NPM version (Paul Verest)
    +* adapt code formatting (Mathias Schreck)
    +* Added a TextMate 2 integration to the docs (Nate Silva)
    +* 0.4.2 (Nicholas C. Zakas)
    +
    +v0.4.2 - March 3, 2014
    +
    +* 0.4.2 (Nicholas C. Zakas)
    +* fixes #651: disable no-catch-shadow rule in node environment (Michael Ficarra)
    +* Fixed context.report message parsing (Ian Christian Myers)
    +* fixe #648: wrap-iife rule should actually check that IIFEs are wrapped (Michael Ficarra)
    +* Added "stroustrup" option for brace-style (Ian Christian Myers)
    +* 0.4.1 (Nicholas C. Zakas)
    +
    +v0.4.1 - February 27, 2014
    +
    +* 0.4.1 (Nicholas C. Zakas)
    +* Created space-in-brackets rule (Ian Christian Myers)
    +* Update: Allow valid-jsdoc to specify replacement tags (fixes #637) (Nicholas C. Zakas)
    +* Fix: Ensure getJSDocComment() works for all function declarations (fixes #638) (Nicholas C. Zakas)
    +* Added broccoli-eslint to integration docs (Christian)
    +* fixes #634: getters/setters shouldn't trigger no-dupe-keys (Michael Ficarra)
    +* Update: semi to also enforce not using semicolons (fixes #618) (Nicholas C. Zakas)
    +* New Rule: no-constant-condition  - removed SwitchStatement discriminant check  - removed AssignmentExpression with right Identifier  - fixed copy paste error  - added DoWhileStatement, ForStatement based on discussion: https://github.com/eslint/eslint/pull/624 (fixes #621) (Christian)
    +* New Rule: no-constant-condition (fixes #621) (Christian)
    +* Adding mimosa-eslint to Build System list (dbashford)
    +* Fix: Make sure semi flags return statements without a semicolon (fixes #616) (Nicholas C. Zakas)
    +* Fix: stylish formatter blue text -> white text (fixes #607) (Nicholas C. Zakas)
    +* Fix: radix rule should warn (not throw error) when parseInt() is called without arguments (fixes #611) (Nicholas C. Zakas)
    +* Update README.md (Dmitry)
    +* Adding JSDoc comments for TAP format helper functions (Jonathan Kingston)
    +* Updating documentation to include TAP format option (Jonathan Kingston)
    +* Fixing validation issues to TAP formatter (Jonathan Kingston)
    +* Adding TAP formatter and basic tests (Jonathan Kingston)
    +* Docs: Updated integrations page (Nicholas C. Zakas)
    +* 0.4.0 (Nicholas C. Zakas)
    +
    +v0.4.0 - February 12, 2014
    +
    +* 0.4.0 (Nicholas C. Zakas)
    +* Change: Switch :after to :exit (fixes #605) (Nicholas C. Zakas)
    +* Fix: Make sure no-unused-vars doesn't get confused by nested functions (fixes #584) (Nicholas C. Zakas)
    +* Update: .eslintrc to check more things (Nicholas C. Zakas)
    +* Fix: Make sure JSDoc parser accepts JSDoc3-style optional parameters (Nicholas C. Zakas)
    +* Docs: Update documentation with linking instructions for ESLintTester (Nicholas C. Zakas)
    +* New Rule: valid-jsdoc (fixes #536) (Nicholas C. Zakas)
    +* #595 improved func-names documentation (Kyle Nunery)
    +* #595 added more func-names tests (Kyle Nunery)
    +* #595 fix rule message and add more tests (Kyle Nunery)
    +* use optionator for option parsing, not optimist (George Zahariev)
    +* Include instructions for working with ESLintTester (Nicholas C. Zakas)
    +* #595 remove needless 'function Foo() {}' in tests (Kyle Nunery)
    +* #595 fix whitespace (Kyle Nunery)
    +* #595 fix markdown for js code blocks (Kyle Nunery)
    +* Adding information about Yeomen generator (Ilya Volodin)
    +* #595 add docs for rule func-names (Kyle Nunery)
    +* #595 add func-names rule (Kyle Nunery)
    +* migrate variables array to map (Brandon Mills)
    +* Perf: Move try-catch out of verify() function to allow V8 optimization (refs #574) (Nicholas C. Zakas)
    +* Docs: Added instructions for running npm run profile (Nicholas C. Zakas)
    +* refactor variable name lookup into a separate function (Brandon Mills)
    +* optimize findVariable() in no-unused-vars (Brandon Mills)
    +* move to tests/bench (Chris Dickinson)
    +* add `npm run profile`. (Chris Dickinson)
    +* #586 refactor based on https://github.com/eslint/eslint/pull/590#discussion_r9476367 (Christian)
    +* #586 added no-unreachable jsdoc, documentation note on hoisting case (Christian)
    +* #586 add hoisting check to no-unreachable (Christian)
    +* readme: Remove stray asterisk (Timo Tijhof)
    +* #580 Remove eslint.getAllComments(), related docs, related tests (Christian)
    +* Added test for bug fix #582. Test Passes (Shmueli Englard)
    +* Added curly braces to if statment (Shmueli Englard)
    +* Added new test for fix to #582 (fixes 582) (Shmueli Englard)
    +* Bug #582: Added check if node.value isn't a string just exit (Shmueli Englard)
    +* Update Rule: implement curly options for single-statement bodies (fixes #511) (Nicholas C. Zakas)
    +* New Rule: no-extra-boolean-cast (fixes #557) (Brandon Mills)
    +* New Rule: no-sparse-arrays (fixes #499) (Nicholas C. Zakas)
    +* Fix: no-spaced-func is now an error (Nicholas C. Zakas)
    +* New Rule: no-process-exit (fixes #568) (Nicholas C. Zakas)
    +* New Rule: no-labels (fixes #550) (Nicholas C. Zakas)
    +* New Rule: no-lone-blocks (fixes #512) (Brandon Mills)
    +* Added Emacs/Flycheck integration (Nikolai Prokoschenko)
    +* Build: Add perf test (Nicholas C. Zakas)
    +* Fix: no-cond-assign shouldn't throw error when there's a for loop with an empty conditional (fixes #53) (Nicholas C. Zakas)
    +* Docs: Add docs for no-regex-spaces and all doc errors now break build (closes #562) (Nicholas C. Zakas)
    +* Rename: regex-spaces to no-regex-spaces (Nicholas C. Zakas)
    +* Docs: Add docs for no-underscore-dangle (refs #562) (Nicholas C. Zakas)
    +* Docs: Add docs for no-undef-init (refs #562) (Nicholas C. Zakas)
    +* Docs: Add docs for no-return-assign (refs #562) (Nicholas C. Zakas)
    +* Fix: Misspelling in no-return-assign message (Nicholas C. Zakas)
    +* Docs: Add docs for no-new-wrappers (refs #562) (Nicholas C. Zakas)
    +* Docs: Add docs for no-new-object (refs #562) (Nicholas C. Zakas)
    +* Docs: Add docs for no-implied-eval (refs #562) (Nicholas C. Zakas)
    +* Docs: Updated documentation for developing rules (Nicholas C. Zakas)
    +* Testing: Move ESLintTester to be external dependency (fixes #480) (Nicholas C. Zakas)
    +* Docs: Add list of known integrations (Nicholas C. Zakas)
    +* Fix #570 (dmp42)
    +* document no-array-constructor rule (Michael Ficarra)
    +* fixes #500: no-array-constructor should not flag 1-argument construction (Michael Ficarra)
    +* fixes #501: no-array-constructor recognises CallExpression form (Michael Ficarra)
    +* rename no-new-array rule to no-array-constructor; ref #501 (Michael Ficarra)
    +* Fix: Make radix rule warn on invalid second parameter (fixes #563) (Nicholas C. Zakas)
    +* Docs: Added no-floating-decimal docs (refs #562) (Nicholas C. Zakas)
    +* New Rule: no-path-concat (fixes #540) (Nicholas C. Zakas)
    +* Docs: Add some missing rule docs (refs #562) (Nicholas C. Zakas)
    +* Fix: CLI should not output anything when there are no warnings (fixes #558) (Nicholas C. Zakas)
    +* New Rule: no-yoda (fixes #504) (Nicholas C. Zakas)
    +* New Rule: consistent-return (fixes #481) (Nicholas C. Zakas)
    +* Rewrite configuration documentation to include information about globals (fixes #555) (Nicholas C. Zakas)
    +* Allow YAML configuration files (fixes #491) (Nicholas C. Zakas)
    +* 0.3.0 (Nicholas C. Zakas)
    +
    +v0.3.0 - January 20, 2014
    +
    +* 0.3.0 (Nicholas C. Zakas)
    +* Config: Allow comments in JSON configuration files (fixes #492) (Nicholas C. Zakas)
    +* Bug: max-len fix to report correct line number (fixes #552) (Nicholas C. Zakas)
    +* Build: Use browserify to create browser-ready ESLint (fixes #119) (Nicholas C. Zakas)
    +* Docs: Ensure all rules have entry on top-level rules index page (Nicholas C. Zakas)
    +* Docs: Add docs for no-fallthrough rule (Nicholas C. Zakas)
    +* Update README.md (Peter deHaan)
    +* Update README.md (Peter deHaan)
    +* Update package.json (Peter deHaan)
    +* Docs: Added documentation for semi rule (Nicholas C. Zakas)
    +* Build: Reset branch coverage target (Nicholas C. Zakas)
    +* Update build system to generate eslint.org during release (Nicholas C. Zakas)
    +* Updated setup doc (Nicholas C. Zakas)
    +* Fix #525 & #528 (Mangled Deutz)
    +* Improve no-negated-in-lhs description (David Bruant)
    +* Fixing typo (David Bruant)
    +* Update no-new.md (Tamas Fodor)
    +* Update no-extra-semi.md (Tamas Fodor)
    +* Fixing broken links in documentation (Ilya Volodin)
    +* Update about page (Nicholas C. Zakas)
    +* Site generation build step and documentation updates to support it (fixes #478) (Nicholas C. Zakas)
    +* Change message for brace-style rule (fixes #490) (Nicholas C. Zakas)
    +* Add question about ES6 support to FAQ (fixes #530) (Nicholas C. Zakas)
    +* Set unlimited number of listeners for event emitter (fixes #524) (Nicholas C. Zakas)
    +* Add support for comment events (fixes #531) Add :after events for comments (Nicholas C. Zakas)
    +* Add :after events for comments (Nicholas C. Zakas)
    +* Allow config files to have any name (fixes #486). (Aparajita Fishman)
    +* List available formatters (fixes #533). (Aparajita Fishman)
    +* Add support for comment events (fixes #531) (Nicholas C. Zakas)
    +* Add Stylish formatter and make it default. Fixes #517 (Sindre Sorhus)
    +* Fix missing code exit (Mangled Deutz)
    +* Added unit test for calling Config.getConfig with no arguments. (Aparajita Fishman)
    +* Typo (Mangled Deutz)
    +* Fixed docs typo (Nicholas C. Zakas)
    +* Mark functions as used when any method is called on them (Nicholas C. Zakas)
    +* Fixed: Config.getConfig is called either with a file path or with no args (fixes #520) (Aparajita Fishman)
    +* Fix minor bug in no-empty rule (Nicholas C. Zakas)
    +* add more info for failure messages (Nicholas C. Zakas)
    +* Add ruleId to all formatters output (fixes #472) (Nicholas C. Zakas)
    +* Remove unused code (Nicholas C. Zakas)
    +* Correctly handle case with both finally and catch in no-empty (Nicholas C. Zakas)
    +* Update documentation for no-unused-vars (Nicholas C. Zakas)
    +* Ensure that bound function expressions are reported as being used (fixes #510) (Nicholas C. Zakas)
    +* Allow empty catch/finally blocks (fixes #514) and update documentation (fixes #513) (Nicholas C. Zakas)
    +* Updated contribution guidelines (Nicholas C. Zakas)
    +* Add default setting for no-cond-assign (Nicholas C. Zakas)
    +* Add build step to check rule consistency (Nicholas C. Zakas)
    +* update docs: explicit cli args are exempt from eslintignore exclusions (Michael Ficarra)
    +* fixes #505: no-cond-assign should ignore doubly parenthesised tests (Michael Ficarra)
    +* Renamed unnecessary-strict to no-extra-strict (Nicholas C. Zakas)
    +* Fixed missing documentation links (Nicholas C. Zakas)
    +* Add build task to check for missing docs and tests for rules (Nicholas C. Zakas)
    +* Slight reorganization of rule groups (Nicholas C. Zakas)
    +* Added one-var and sorted some rules (Nicholas C. Zakas)
    +* Updated Travis badge for new location (Nicholas C. Zakas)
    +* fixes #494: allow shebangs in processed JS files (Michael Ficarra)
    +* fixes #496: lint ignored files when explicitly specified via the CLI (Michael Ficarra)
    +* More tests (Ilya Volodin)
    +* Upgrade Istanbul (Ilya Volodin)
    +* fixes #495: holey arrays cause no-comma-dangle rule to throw (Michael Ficarra)
    +* Documentation and minor changes (Ilya Volodin)
    +* Adding missing package registration (Ilya Volodin)
    +* Adding support for .eslintignore and .jshintignore (Closes #484) (Ilya Volodin)
    +* fixes #482: brace-style bug with multiline conditions (Michael Ficarra)
    +* Switching Travis to use ESLint (Closes #462) (Ilya Volodin)
    +* 0.2.0 (Nicholas C. Zakas)
    +
    +v0.2.0 - January 1, 2014
    +
    +* 0.2.0 (Nicholas C. Zakas)
    +* Bump code coverage checks (Nicholas C. Zakas)
    +* Take care of unreachable code in case statement (Nicholas C. Zakas)
    +* Updated rule messaging and added extra tests (Nicholas C. Zakas)
    +* Fixing eslint errors and unittests (Ilya Volodin)
    +* Rule: max-nested-callbacks (Ian Christian Myers)
    +* Fix fall-through rule with nested switch statements (fixes #430) (Nicholas C. Zakas)
    +* Fixed trailing comma (Nicholas C. Zakas)
    +* Added more tests for func-style (Nicholas C. Zakas)
    +* Fixed documentation for func-style (Nicholas C. Zakas)
    +* Fixed linting error (Nicholas C. Zakas)
    +* Rule to enforce function style (fixes #460) (Nicholas C. Zakas)
    +* Rule is off by default. Updated documentation (Ilya Volodin)
    +* Rule: sort variables. Closes #457 (Ilya Volodin)
    +* Update architecture.md (Nicholas C. Zakas)
    +* Change quotes option to avoid-escapes and update docs (fixes #199) (Brandon Payton)
    +* Add allow-avoiding-escaped-quotes option to quotes rule (fixes #199) (Brandon Payton)
    +* Update no-empty-class.md (Nicholas C. Zakas)
    +* Updated titles on all rule documentation (fixes #348) (Nicholas C. Zakas)
    +* Fixing eslint errors in codebase (Ilya Volodin)
    +* fixes #464: space-infix-ops checks for VariableDeclarator init spacing (Michael Ficarra)
    +* Add options to no-unused-vars. Fixes #367 (Ilya Volodin)
    +* rename escape function to xmlEscape in checkstyle formatter (Michael Ficarra)
    +* The semi rule now reports correct line number (Ian Christian Myers)
    +* context.report now takes optional location (Ian Christian Myers)
    +* fixes #454: escape values for XML in checkstyle formatter (Michael Ficarra)
    +* Add color to Mocha test reporting (Ian Christian Myers)
    +* Rule no-nested-ternary (Ian Christian Myers)
    +* Fixing no-unused-var and no-redeclare (Ilya Volodin)
    +* fixes #449: no-mixed-requires throws TypeError when grouping is enabled (Michael Ficarra)
    +* Fixed reported line number for trailing comma error (Ian Christian Myers)
    +* Update doc title for quote (Matthew DuVall)
    +* fixes #446: join paths without additional delimiters (Michael Ficarra)
    +* docs: add documentation for quotes rule (Matthew DuVall)
    +* minor style changes to lib/rules/space-infix-ops.js as requested in #444 (Michael Ficarra)
    +* remove "function invalid(){ return D }" from some tests (Michael Ficarra)
    +* fixes #429: require spaces around infix operators; enabled by default (Michael Ficarra)
    +* simplify fix for #442 (Michael Ficarra)
    +* Fix broken test, ensure tests get run before a release is pushed (Nicholas C. Zakas)
    +* 0.1.4 (Nicholas C. Zakas)
    +
    +v0.1.4 - December 5, 2013
    +
    +* 0.1.4 (Nicholas C. Zakas)
    +* Add release scripts to package.json (Nicholas C. Zakas)
    +* Fixed release error in Makefile (Nicholas C. Zakas)
    +* Fix JSHint warnings (Nicholas C. Zakas)
    +* Make sure 'default' isn't flagged by no-space-returns-throw rule (fixes #442) (Nicholas C. Zakas)
    +* Fixing documentation (Ilya Volodin)
    +* Fixing disabling rules with invalid comments Closes #435 (Ilya Volodin)
    +* improve assertion on wrong number of errors (Christoph Neuroth)
    +* fixes #431: no-unused-expressions should not flag statement level void (Michael Ficarra)
    +* fixes #437: fragile no-extend-native rule (Michael Ficarra)
    +* change space-* rule documentation headers to be more descriptive (Michael Ficarra)
    +* Moved to tabs, added comments, a few more tests (Jamund Ferguson)
    +* split GH-332 rule into space-unary-word-ops and space-return-throw-case (Michael Ficarra)
    +* fixes #346: validate strings passed to the RegExp constructor (Michael Ficarra)
    +* change some documentation extensions from js to md (Michael Ficarra)
    +* fixes #332: unary word operators must be followed by whitespace (Michael Ficarra)
    +* Add some docs (Jamund Ferguson)
    +* DRYing cli tests and improving code coverage (Ilya Volodin)
    +* fixes #371: add no-shadow-restricted-names rule (Michael Ficarra)
    +* Added Support for Object.defineProperty() checking (Jamund Ferguson)
    +* fixes #333: add rule to disallow gratuitously parenthesised expressions (Michael Ficarra)
    +* improve rule test coverage (Michael Ficarra)
    +* No Extend Native (Jamund Ferguson)
    +* change getTokens 2nd/3rd arguments to count tokens, not characters (Michael Ficarra)
    +* fixes #416: no-fallthrough flagging last case + reporting wrong line num (Michael Ficarra)
    +* fixes #415: fix unnecessary-strict rule false positives (Michael Ficarra)
    +* Add missing dependency (Nicholas C. Zakas)
    +* Update docs related to running unit tests (Nicholas C. Zakas)
    +* Add JSHint as missing dependency (Nicholas C. Zakas)
    +* Switch to using ShellJS makefile (fixes #418) (Nicholas C. Zakas)
    +* Updated documentation to reflect test changes (refs #417) (Nicholas C. Zakas)
    +* Change to eslintTester.addRuleTest (fixes #417) (Nicholas C. Zakas)
    +* Fix false positives for no-script-url (fixes #400) (Nicholas C. Zakas)
    +* Fix lint warning (Nicholas C. Zakas)
    +* Fixing ESLint warnings, introducing Makefile.js (not yet wired in) (Nicholas C. Zakas)
    +* fixes #384: include builtin module list to avoid repl dependency (Michael Ficarra)
    +* 0.1.3 (Nicholas C. Zakas)
    +
    +v0.1.3 - November 25, 2013
    +
    +* 0.1.3 (Nicholas C. Zakas)
    +* Updated changelog (Nicholas C. Zakas)
    +* Vows is gone. Mocha is now default (Ilya Volodin)
    +* fixes #412: remove last remaining false positives in no-spaced-func (Michael Ficarra)
    +* fixes #407: no-spaced-func rule flagging non-argument-list spaced parens (Michael Ficarra)
    +* Add no-extra-semi to configuration (fixes #386) (Nicholas C. Zakas)
    +* Converting formatter tests and core (Ilya Volodin)
    +* Don't output anything when there are no errors in compact formatter (fixes #408) (Nicholas C. Zakas)
    +* Removing Node 0.11 test - it fails all the time (Nicholas C. Zakas)
    +* Completing conversion of rule's tests to mocha (Ilya Volodin)
    +* added mocha conversion tests for strict, quote-props and one-var; enhanced one of the invalid one-var tests that was expecting two messages (Michael Paulukonis)
    +
    +
    +v0.1.2 - November 23, 2013
    +
    +* 0.1.2 (Nicholas C. Zakas)
    +* added mocha tests for radix and quotes; fixed some of the internals on quotes from vows annotations (Michael Paulukonis)
    +* added tests for regex-spaces, strict, unnecessary-strict; fixed some types in overview/author notes in other tests. (Michael Paulukonis)
    +* Converting unittests to mocha (Ilya Volodin)
    +* mocha conversions of tests for 'use-isnan' and 'wrap-iife' (Michael Paulukonis)
    +* added mocha tests semi.js and wrap-regex.js (Michael Paulukonis)
    +* Converting more tests to mocha (Ilya Volodin)
    +* Update CONTRIBUTING.md (Nicholas C. Zakas)
    +* Cleaning up eslintTester (Ilya Volodin)
    +* DRYing unittests and converting them to mocha (Ilya Volodin)
    +* Reformatted Gruntfile (Nicholas C. Zakas)
    +* Add tests to config load order: base, env, user. (icebox)
    +* Fixing indent in gruntfile (Ilya Volodin)
    +* Removing jake, adding Grunt, Travis now runs grunt (Ilya Volodin)
    +* Add rules per environments to config. (icebox)
    +* Add globals property to the environments. (icebox)
    +* Fix error about IIFE if the function is in a new (Marsup)
    +* Fix a broken link in the docs (Brian J Brennan)
    +* Add test coverage for additional cases, fix open paren at beginning of expr (Matthew DuVall)
    +* Fixing no-undef for eval use case (Ilya Volodin)
    +* fixes #372: disallow negated left operand in `in` operator (Michael Ficarra)
    +* Fixing no-self-compare rule to check for operator (Ilya Volodin)
    +* bug: open parens in args causes no-spaced-func to trigger (Matthew DuVall)
    +* fixes #369: restrict UnaryExpressions to delete in no-unused-expressions (Michael Ficarra)
    +* Make sure delete operator isn't flagged as unused expression (fixes #364) (Nicholas C. Zakas)
    +* Don't flag ++ or -- as unused expressions (fixes #366) (Nicholas C. Zakas)
    +* Ensure that 'use strict' isn't flagged as an unused expression (fixes #361) (Nicholas C. Zakas)
    +* Increase test coverage for strict-related rules (refs #361) (Nicholas C. Zakas)
    +* Up code coverage numbers (Nicholas C. Zakas)
    +* Fixes error in new-cap rule when 'new' is used without a constructor (fixes #360) (Nicholas C. Zakas)
    +* added files array in package json (Christian)
    +* removed unused jshint dependency (Christian)
    +* Add test coverage for new Foo constructor usage (Matt DuVall)
    +* Pull code coverage up by removing unused method (Matt DuVall)
    +* recognise CallExpression variant of RegExp ctor in no-control-regex rule (Michael Ficarra)
    +* Merge smart-eqeqeq into eqeqeq (Matt DuVall)
    +* Catch additional cases for a.b, new F, iife (Matt DuVall)
    +* 0.2.0-dev (Nicholas C. Zakas)
    +* Version 0.1.0 (Nicholas C. Zakas)
    +* rule: no-spaced-func disallow spaces between function identifier and application (Matt DuVall)
    +
    +v0.1.1 - November 09, 2013
    +
    +* Ensure mergeConfigs() doesn't thrown an error when keys are missing in base config (fixes #358) (Nicholas C. Zakas)
    +
    +v0.1.0 - November 03, 2013
    +
    +* Version 0.1.0 (Nicholas C. Zakas)
    +* Updated Readme for v0.1.0 (Nicholas C. Zakas)
    +* Bump code coverage verification to 95% across the board (Nicholas C. Zakas)
    +* Fixed broken links (Nicholas C. Zakas)
    +* Added information about runtime rules (Nicholas C. Zakas)
    +* Added documentation about configuration files (Nicholas C. Zakas)
    +* Added description of -v option (Nicholas C. Zakas)
    +* Updated architecture documentation (Nicholas C. Zakas)
    +* Fix bug in no-control-regex (fixes #347) (Nicholas C. Zakas)
    +* Fix link to architecture doc in readme (azu)
    +* Rule: No control characters in regular expressions (fixes #338) (Nicholas C. Zakas)
    +* Add escaping \= test (Matt DuVall)
    +* Add docs for rule (Matt DuVall)
    +* rule: no-div-regex for catching ambiguous division operators in regexes (Matt DuVall)
    +* Change context-var to block-scoped-var (Matt DuVall)
    +* Implement config.globals (Oleg Grenrus)
    +* Add 'config-declared global' test (Oleg Grenrus)
    +* Adding ability to separate rules with comma (Ilya Volodin)
    +* Added rule for missing 'use strict' (fixes #321) (Nicholas C. Zakas)
    +* Fixing unittests and finishing code (Ilya Volodin)
    +* Disabling/enabling rules through comments (Ilya Volodin)
    +* Rename rule to context-var and add documentation (Matt DuVall)
    +* Added link to no-global-strict doc in readme (Nicholas C. Zakas)
    +* Add try-catch scoping with tests (Matt DuVall)
    +* Fix linting error (Matt DuVall)
    +* Store FunctionDeclarations in scope as they can be used as literals (Matt DuVall)
    +* Fix to use getTokens and add test for MemberExpression usage (Matt DuVall)
    +* rule: block-scope-var to check for variables declared in block-scope (Matt DuVall)
    +* no-unused-expressions rule: add test and doc mention for `a && b()` (Michael Ficarra)
    +* rule: wrap-regex for parens around regular expression literals (Matt DuVall)
    +* fixes #308: implement no-unused-expressions rule; ref. jshint rule W030 (Michael Ficarra)
    +* Updated change log script to filter out merge messages (Nicholas C. Zakas)
    +* Updated changelog (Nicholas C. Zakas)
    +* 0.1.0-dev (Nicholas C. Zakas)
    +
    +v0.0.9 - October 5, 2013
    +
    +* Version 0.0.9 release (Nicholas C. Zakas)
    +* Added rule for no global strict mode (fixes #322) (Nicholas C. Zakas)
    +* Change default on to be errors instead of warnings (fixes #326) (Nicholas C. Zakas)
    +* Fixed bug where JSHint was using the wrong file in lint task (Nicholas C. Zakas)
    +* Updated docs for no-unused vars rule. (Andrew de Andrade)
    +* Removed console.log in tests. (Andrew de Andrade)
    +* Added link to roadmap and JSHint feature parity list. (Andrew de Andrade)
    +* Fixed warning when unused var declared as param in FunctionExpression/Declaration can be ignored because later param is used (Andrew de Andrade)
    +* Rename test for smartereqeqeq.js to smarter-eqeqeq.js (Andrew de Andrade)
    +* Keep test filename inline with rule name (Andrew de Andrade)
    +* Added further instructions for multiline test cases. (Andrew de Andrade)
    +* Protecting private method (Seth McLaughlin)
    +* Updating look up algorithm for local config files (Seth McLaughlin)
    +* Fixing ESLint errors (Ilya Volodin)
    +* Implemented local default config file (Seth McLaughlin)
    +* Upgrading escope version and fixing related bugs (Ilya Volodin)
    +* Fixing assignment during initialization issue (Ilya Volodin)
    +* add plain-English regexp description to no-empty-class rule (Michael Ficarra)
    +* fixes #289: no-empty-class flags regexps with... flags (Michael Ficarra)
    +* Rule: no-catch-shadow (Ian Christian Myers)
    +* Update no-empty for compatibility with esprima@1.0.4 (fixes #290) (Mark Macdonald)
    +* Fixing bug with _ in MemberExpression (Ilya Volodin)
    +* Rule: no-func-assign (Ian Christian Myers)
    +* Fix false warning from no-undef rule (fixes #283) (Mark Macdonald)
    +* Adding eslint to jake (Ilya Volodin)
    +* Rule no redeclare (Ilya Volodin)
    +* Fixing no use before define issues (Ilya Volodin)
    +* Rule: no-octal-escape (Ian Christian Myers)
    +* Fix for `no-proto` and `no-iterator` false positive (Ian Christian Myers)
    +* Rule: no-iterator (Ian Christian Myers)
    +* Fixing type in guard-for-in documentation (Ilya Volodin)
    +* Rule No use before define (Ilya Volodin)
    +* Added documentation for the `no-new` rule (Ian Christian Myers)
    +* Added documentation for the `no-eval` rule (Ian Christian Myers)
    +* Added documentation for the `no-caller` rule (Ian Christian Myers)
    +* Added documentation for the `no-bitwise` rule (Ian Christian Myers)
    +* simplify no-empty-class rule (Michael Ficarra)
    +* Fix `no-empty-class` false negatives (Ian Christian Myers)
    +* Added documentation for the `no-alert` rule (Ian Christian Myers)
    +* Added documentation for the `new-parens` rule (Ian Christian Myers)
    +* Added documentation for the `max-params` rule (Ian Christian Myers)
    +* Added documentation for `max-len` rule (Ian Christian Myers)
    +* Created link from rules README.md to no-plusplus.md documentation (Ian Christian Myers)
    +* Added documentation for `guard-for-in` rule (Ian Christian Myers)
    +* Added documentation for `dot-notation` rule (Ian Christian Myers)
    +* Added documentation for `curly` rule (Ian Christian Myers)
    +* Updated `camelcase` rule documentation (Ian Christian Myers)
    +* Added documentation for `complexity` rule (Ian Christian Myers)
    +* Changed `no-dangle` documentation to `no-comma-dangle` (Ian Christian Myers)
    +* Rule: no-empty-class (Ian Christian Myers)
    +* Increased test coverage for max-depth (Ian Christian Myers)
    +* Increased test coverage for no-shadow (Ian Christian Myers)
    +* Increased test coverage on no-mixed-requires (Ian Christian Myers)
    +* Added docs for eqeqeq and no-with (fixes #262) (Raphael Pigulla)
    +* Create camelcase.md (Micah Eschbacher)
    +* Fix issues with function in no-unused-vars (Ilya Volodin)
    +* Rule: No shadow (Ilya Volodin)
    +* fixes #252: semi rule errors on VariableDeclarations in ForInStatements (Michael Ficarra)
    +* rule: max-len to lint maximum length of a line (Matt DuVall)
    +* Fixes #249 (Raphael Pigulla)
    +* Merge branch 'master' of https://github.com/beardtwizzle/eslint (Jonathan Mahoney)
    +* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
    +* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
    +* Rule: no-else-return (Ian Christian Myers)
    +* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
    +* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
    +* Fix no-unused-vars to report correct line numbers (Ilya Volodin)
    +* Rule: no proto (Ilya Volodin)
    +* Rule: No Script URL (Ilya Volodin)
    +* Rule: max-depth (Ian Christian Myers)
    +* Fix: Error severity for rules with options. (Ian Christian Myers)
    +* Rule: No wrap func (Ilya Volodin)
    +* bug: Fixes semi rule for VariableDeclaration in ForStatement (Matt DuVall)
    +* Individual perf tests for rules (Ilya Volodin)
    +* Fix loading rules from a rules directory (Ian Christian Myers)
    +* Rule no-mixed-requires (fixes #221) (Raphael Pigulla)
    +* bug: Add ForStatement for no-cond-assign check (Matthew DuVall)
    +* JSLint XML formatter now escapes special characters in the evidence and reason attributes. (Ian Christian Myers)
    +* Formatter: JSLint XML (Ian Christian Myers)
    +* Refactored `max-statements` rule. (Ian Christian Myers)
    +* Fix tests broken due to new rule message text (James Allardice)
    +* Merge branch 'master' into match-jshint-messages (James Allardice)
    +* Refactored `one-var` rule. (Ian Christian Myers)
    +* split eslint.define into eslint.defineRule and eslint.defineRules (Michael Ficarra)
    +* Removed unnecessary rules.js test. (Ian Christian Myers)
    +* Rule: one-var (Ian Christian Myers)
    +* Rule: No unused variables (Ilya Volodin)
    +* expose interface for defining new rules at runtime without fs access (Michael Ficarra)
    +* disallow 00 in no-octal rule (Michael Ficarra)
    +* Increased test coverage for `lib/cli.js`. (Ian Christian Myers)
    +* Increased test coverage for `lib/rules.js` (Ian Christian Myers)
    +* Increased test coverage for jUnit formatter. (Ian Christian Myers)
    +* scripts/bundle: output bundle+map to /build directory (Michael Ficarra)
    +* add test for 0X... hex literals in no-octal tests (Michael Ficarra)
    +* fixes #200: no-octals should not see leading-0 floats as violations (Michael Ficarra)
    +* add back tests for loading rules from a directory (Michael Ficarra)
    +* add back in ability to load rules from a directory (Michael Ficarra)
    +* Increased test coverage for `complexity` rule. (Ian Christian Myers)
    +* Increased test coverage for `max-params` rule. (Ian Christian Myers)
    +* also output source map when generating bundle (Michael Ficarra)
    +* Rule: unnecessary-strict (Ian Christian Myers)
    +* Improve performance of getTokens (Ilya Volodin)
    +* Performance jake task (Ilya Volodin)
    +* don't force explicit listing of rules; generate listing for bundle (Michael Ficarra)
    +* Rule: no-dupe-keys (Ian Christian Myers)
    +* fixes #145: create a browser bundle (Michael Ficarra)
    +* Fixing no-caller bug (Ilya Volodin)
    +* Check for use of underscore library as an exception for var declarations (Matthew DuVall)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matthew DuVall)
    +* Fixing spelling (Ilya Volodin)
    +* Rule: no-empty-label (Ilya Volodin)
    +* Add builtin globals to the global scope (fixes #185) (Mark Macdonald)
    +* Rule: no-loop-func (Ilya Volodin)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matt DuVall)
    +* Use proper node declarations and __proto__ exception (Matt DuVall)
    +* Updating no-undef patch (see pull request #164) - Simplify parseBoolean() - Make knowledge of```/*jshint*/``` and ```/*global */``` internal to eslint object - Put user-declared globals in Program scope (Mark Macdonald)
    +* Rule: no-eq-null (Ian Christian Myers)
    +* fixed broken merge (Raphael Pigulla)
    +* fixes #143 (Raphael Pigulla)
    +* added consistent-this rule (Raphael Pigulla)
    +* Rule: no-sync to encourage async usage (Matt DuVall)
    +* Update eslint.json with no-underscore-dangle rule (Matt DuVall)
    +* Rule: no-underscore-dangle for func/var declarations (Matt DuVall)
    +* Warn on finding the bitwise NOT operator (James Allardice)
    +* Updating no-undef patch (see pull request #164) 3. Move parsing of ```/*global */``` and ```/*jshint */``` to eslint.js (Mark Macdonald)
    +* Warn on finding a bitwise shift operator (fixes #170) (James Allardice)
    +* Fix broken test (James Allardice)
    +* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
    +* Removing nasty leading underscores (Patrick Brosset)
    +* Added tests and test cases for a few files (Patrick Brosset)
    +* CLI: -f now accepts a file path (Ian Christian Myers)
    +* Updating no-undef patch (see pull request #164) 1. Move predefined globals to ```conf/environments.json``` 2. Move mixin() to ```lib/util.js``` (Mark Macdonald)
    +* Match messages to JS[LH]int where appropriate, and ensure consistent message formatting (closes #163) (James Allardice)
    +* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
    +* Removing nasty leading underscores (Patrick Brosset)
    +* Added tests and test cases for a few files (Patrick Brosset)
    +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
    +* Added acceptance criteria for rules to docs (Nicholas C. Zakas)
    +* Add no-undef (fixes #6) (Mark Macdonald)
    +* Fixing no-self-compare (Ilya Volodin)
    +* Rule: No multiline strings (Ilya Volodin)
    +* CLI refactor to remove process.exit(), file not found now a regular error message, updated formatters to handle this case (Nicholas C. Zakas)
    +* Rule: no-self-compare (Ilya Volodin)
    +* Rule: No unnecessary semicolons (fixes #158) (Nicholas C. Zakas)
    +* Fixed error in no-ex-assign when return statement as found in catch clause (Nicholas C. Zakas)
    +* Rename no-exc-assign to no-ex-assign and add to config (Nicholas C. Zakas)
    +* Renamed count-spaces to regex-spaces (Nicholas C. Zakas)
    +* Documentation updates (Nicholas C. Zakas)
    +* Put all rules into strict mode and update docs accordingly (Nicholas C. Zakas)
    +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
    +* Ensure getScope() works properly when called from Program node (fixes #148) (Nicholas C. Zakas)
    +* Rule: wrap-iife (Ilya Volodin)
    +* add additional test for no-cond-assign rule (Stephen Murray)
    +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
    +* Experimental support for Jake as a build system (fixes #151) (Nicholas C. Zakas)
    +* fixes #152 (Stephen Murray)
    +* add docs for no-exc-assign (Stephen Murray)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into no-new-object-array-literals (Matt DuVall)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into count-spaces (Matt DuVall)
    +* Added a test for getting global scope from Program node (refs #148) (Nicholas C. Zakas)
    +* Add positive test case for `object.Array` (Matthew DuVall)
    +* Only support space characters for repetitions (Matthew DuVall)
    +* fix line length per code conventions (Stephen Murray)
    +* fix indentation per code conventions (Stephen Murray)
    +* fixes #149 (Stephen Murray)
    +* Rule: no-ternary (Ian Christian Myers)
    +* Check that the return statement has an argument before checking its type (James Allardice)
    +* Rule: count-spaces for multiple spaces in regular expressions (Matt DuVall)
    +* Update eslint.json configuration file for literal rules (Matt DuVall)
    +* Created no-label-var rule. (Ian Christian Myers)
    +* Rule: no-new-array and no-new-object (Matt DuVall)
    +* Added ability to retrieve scope using escope. (Ian Christian Myers)
    +* Corrected unused arguments (Patrick Brosset)
    +* Reporting function complexity on function:after and using array push/pop to handle nesting (Patrick Brosset)
    +* Fixing style issues discovered while npm testing (Patrick Brosset)
    +* First draft proposal for a cyclomatic complexity ESLint rule (Patrick Brosset)
    +* Corrected file extension on no-plusplus rule documentation. (Ian Christian Myers)
    +* Documentation for no-delete-var rule. Closes #129 (Ilya Volodin)
    +* Rule: max-statements (Ian Christian Myers)
    +* Better documentation for the `no-plusplus` rule. (Ian Christian Myers)
    +* Rule: no-plusplus (Ian Christian Myers)
    +* Rule: no assignment in return statement (Ilya Volodin)
    +* Updating max-params rule name (Ilya Volodin)
    +* Rule: Function has too many parameters (Ilya Volodin)
    +* Removing merge originals (Ilya Volodin)
    +* Rebasing on master (Ilya Volodin)
    +* Rule: Variables should not be deleted (Ilya Volodin)
    +* Fixes incorrect reporting of missing semicolon (Ian Christian Myers)
    +* Rebase against master branch (Mathias Bynens)
    +* Rule to warn on use of Math and JSON as functions (James Allardice)
    +* Formatter: Checkstyle (Ian Christian Myers)
    +* docs: Clean up structure (Mathias Bynens)
    +* Merging no-native-reassign and no-redefine (Ilya Volodin)
    +* Rule: no native reassignment (Ilya Volodin)
    +* 0.0.8-dev (Nicholas C. Zakas)
    +* v0.0.7 released (Nicholas C. Zakas)
    +* Updated Tests, etc. (Jamund Ferguson)
    +* Added jUnit Support (Fixes #16) (Jamund Ferguson)
    +
    +v0.0.7 - July 22, 2013
    +
    +* 0.0.7 (Nicholas C. Zakas)
    +* Add code coverage checks to npm test and update rule tests to have better coverage (Nicholas C. Zakas)
    +* Fixed CLI output on serial programatic executions (Ian Christian Myers)
    +* Removes line length from code style convention docs (Josh Perez)
    +* Adds escapeRegExp and fixes documentation (Josh Perez)
    +* Add quotes rule and test coverage for configuration options (Matt DuVall)
    +* Adds templating for lint messages and refactors rules to use it (Josh Perez)
    +* Fixes lint rules for unchecked test file (Josh Perez)
    +* Changes dotnotation rule to match JSHint style (Josh Perez)
    +* Change configInfo to options and add test coverage (Matt DuVall)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into optional-args-for-rule (Matt DuVall)
    +* Adds dot notation lint rule (Josh Perez)
    +* Strip trailing underscores in camelcase rule - Fixes #94 (Patrick Brosset)
    +* add mailing list link (Douglas Campos)
    +* Strip leading underscores in camelcase rule - Fixes #94 (Patrick Brosset)
    +* Created no-dangle rule. (Ian Christian Myers)
    +* Fixed rule name (James Allardice)
    +* Make sure the callee type is Identifier (James Allardice)
    +* Add rule for implied eval via setTimeout/Interval (James Allardice)
    +* Fix rule name in config (James Allardice)
    +* Fixes #90 -- updates docstrings (Stephen Murray)
    +* Fixes issue with fs.existsSync on NodeJS 0.6 (Ian Christian Myers)
    +* Fixing -c config option. (Ian Christian Myers)
    +* Allow arrays to be passed as multiple args to rule (Matt DuVall)
    +* Test to make sure empty case with one line break is safe (Matt DuVall)
    +* Rule: The Function constructor is eval (Ilya Volodin)
    +* Enabled require("eslint") and exposed out CLI. (Ian Christian Myers)
    +* Adds test and fix for issue #82 (Mark Macdonald)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into ok (Yusuke Suzuki)
    +* Created brace-style rule. (Ian Christian Myers)
    +* Formatters can now process multiple files at once (Jamund Ferguson)
    +* Rule: Do not use 'new' for side effects (Ilya Volodin)
    +* Adds smarter-eqeqeq rule (Josh Perez)
    +* Add EditorConfig file for consistent editor/IDE behavior (Jed Hunsaker)
    +* Fix the positive case for no-unreachable where there is no return statement at all, or if the return is at the end. Those cases should not return any errors. The error condition was not be checked before throwing the rule error. (Joel Feenstra)
    +* Adds test and fix for no-octal on 0 literal (Mark Macdonald)
    +* Don't report no-empty warnings when a parent is FunctionExpression / FunctionDeclaration (Yusuke Suzuki)
    +* Add api.getAncestors (Yusuke Suzuki)
    +* Ensure estraverse version 1.2.0 or later (Yusuke Suzuki)
    +* Fixes no-alert lint rule for non identifier calls (Josh Perez)
    +* Fixes exception when init is null (Josh Perez)
    +* Fixes no-octal check to only check for numbers (Josh Perez)
    +* 0.0.7-dev (Nicholas C. Zakas)
    +* 0.0.6 (Nicholas C. Zakas)
    +* Follow the rule naming conventions (James Allardice)
    +* Add rule for missing radix argument to parseInt (James Allardice)
    +* Allow return, falls-through comment, and throw for falls-through (Matt DuVall)
    +* Merge branch 'master' of https://github.com/nzakas/eslint into rule-fall-through (Matt DuVall)
    +* Globals are not good, declare len (Matt DuVall)
    +* Rule to add no-fall-through (Matt DuVall)
    +
    +v0.0.6 - July 16, 2013
    +
    +* 0.0.6 (Nicholas C. Zakas)
    +* Changed semi rule to use tokens instead of source (Nicholas C. Zakas)
    +* Renaming new-parens rule (Ilya Volodin)
    +* Renaming no-new-wrappers rule and adding tests (Ilya Volodin)
    +* Add license URL (Nick Schonning)
    +* Remove unused sinon requires (Nick Schonning)
    +* Remove redundant JSHint directives (Nick Schonning)
    +* Rule: Do not use constructor for wrapper objects (Ilya Volodin)
    +* Test node 0.11 unstable but allow it to fail (Nick Schonning)
    +* Rule: Constructor should use parentheses (Ilya Volodin)
    +* Fix reference to "CSS Lint" in Contributing documentation (Brian McKenna)
    +* Add git attributes file for line endings (Andy Hu)
    +* Rename to create an 'index' file in GH web view (Evan Goer)
    +* Avoid accidentally creating a markdown link (Evan Goer)
    +* Add headings and correct internal links (Evan Goer)
    +* Add wiki files to docs directory (Evan Goer)
    +* Add rules for leading/trailing decimal points (James Allardice)
    +* Add rule to prevent comparisons with value NaN (James Allardice)
    +* Fixing jshint error (Ilya Volodin)
    +* Rule: no octal literals (Ilya Volodin)
    +* Rule: no undefined when initializing variables (Ilya Volodin)
    +* Updated CONTRIBUTING.md (Nicholas C. Zakas)
    +* Make sure namespaces are honored in new-cap (Nicholas C. Zakas)
    +* Make sure no-empty also checks for ';;' (Nicholas C. Zakas)
    +* Add CLI option to output version (Nicholas C. Zakas)
    +* Updated contribution guidelines (Nicholas C. Zakas)
    +* Fixing jshint complaints. (Joel Feenstra)
    +* Converting to a switch statement and declaring variables. (Joel Feenstra)
    +* Added .jshintrc file (until ESLint can lint itself) and cleaned up JSHint warnings (Nicholas C. Zakas)
    +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
    +* A bit of cleanup (Nicholas C. Zakas)
    +* Add unreachable code detection for switch cases and after continue/break. (Joel Feenstra)
    +* Add support for detecting unreachable code after a throw or return statement. (Joel Feenstra)
    +* Fix curly brace check when an if statement is the alternate. (Joel Feenstra)
    +* Check for empty switch statements with no cases. (Matt DuVall)
    +* Added CONTRIBUTING.md (Nicholas C. Zakas)
    +* Added rule to check for missing semicolons (fixes #9) (Nicholas C. Zakas)
    +* Verify that file paths exist before reading the file (Matt DuVall)
    +* Added guard-for-in rule (fixes #1) (Nicholas C. Zakas)
    +* Run linting with npm test as well (Nicholas C. Zakas)
    +* Removed foo.txt (Nicholas C. Zakas)
    +* Updated config file with new no-caller ID (Nicholas C. Zakas)
    +* Changed name of no-arg to no-caller (Nicholas C. Zakas)
    +* Increased test coverage (Nicholas C. Zakas)
    +* Got npm test to work with istanbul, huzzah\! (Nicholas C. Zakas)
    +* Moved /config to /conf (Nicholas C. Zakas)
    +* Added script to auto-generate changelog (Nicholas C. Zakas)
    +* Add `quote-props` rule (Mathias Bynens)
    +* Cleaned up relationship between bin/eslint, lib/cli.js, and lib/eslint.js (Nicholas C. Zakas)
    +* Add problem count to compact formatter (Nicholas C. Zakas)
    +* Fix merge conflict (Nicholas C. Zakas)
    +* Change reporters to formatters, add format command line option. Also added tests for compact format. (Nicholas C. Zakas)
    +* Change reporters to formatters, add format command line option (Nicholas C. Zakas)
    +* Start development of 0.0.6-dev (Nicholas C. Zakas)
    diff --git a/tools/eslint/LICENSE b/tools/eslint/LICENSE
    index 3f7b4baaa16466..d41bdf7951f077 100644
    --- a/tools/eslint/LICENSE
    +++ b/tools/eslint/LICENSE
    @@ -1,5 +1,5 @@
     ESLint
    -Copyright (c) 2013 Nicholas C. Zakas. All rights reserved.
    +Copyright jQuery Foundation and other contributors, https://jquery.org/
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    diff --git a/tools/eslint/README.md b/tools/eslint/README.md
    index d8c797affdd252..9cbb090926474b 100644
    --- a/tools/eslint/README.md
    +++ b/tools/eslint/README.md
    @@ -8,7 +8,15 @@
     
     # 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)
    +[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) |
    +[Code of Conduct](https://jquery.org/conduct/) |
    +[Twitter](https://twitter.com/geteslint) |
    +[Mailing List](https://groups.google.com/group/eslint) |
    +[Chat Room](https://gitter.im/eslint/eslint)
     
     ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
     
    @@ -32,6 +40,8 @@ After that, you can run ESLint on any JavaScript file:
     
         eslint test.js test2.js
     
    +**Note:** `eslint --init` is intended for setting up and configuring ESLint on a per-project basis and will perform a local installation of ESLint and its plugins in the directory in which it is run. If you prefer using a global installation of ESLint, any plugins used in your configuration must also be installed globally.
    +
     ## Configuration
     
     After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
    @@ -39,17 +49,17 @@ After running `eslint --init`, you'll have a `.eslintrc` file in your directory.
     ```json
     {
         "rules": {
    -        "semi": [2, "always"],
    -        "quotes": [2, "double"]
    +        "semi": ["error", "always"],
    +        "quotes": ["error", "double"]
         }
     }
     ```
     
     The names `"semi"` and `"quotes"` are the names of [rules](http://eslint.org/docs/rules) in ESLint. The number is the error level of the rule and can be one of the three values:
     
    -* `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)
    +* `"off"` or `0` - turn the rule off
    +* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
    +* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
     
     The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](http://eslint.org/docs/user-guide/configuring)).
     
    @@ -66,12 +76,20 @@ These folks keep the project moving and are resources for help:
     * Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
     * Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
     * Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
    +* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - reviewer
    +* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - reviewer
     * Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - 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
    +* Kai Cataldo ([@kaicataldo](https://github.com/kaicataldo)) - committer
    +* Michael Ficarra ([@michaelficarra](https://github.com/michaelficarra)) - committer
    +* Mark Pedrotti ([@pedrottimark](https://github.com/pedrottimark)) - committer
    +* Oleg Gaidarenko ([@markelog](https://github.com/markelog)) - committer
    +* Mike Sherov [@mikesherov](https://github.com/mikesherov)) - committer
    +* Henry Zhu ([@hzoo](https://github.com/hzoo)) - committer
    +* Marat Dulin ([@mdevils](https://github.com/mdevils)) - committer
    +* Alexej Yaroshevich ([@zxqfox](https://github.com/zxqfox)) - committer
     
     ## Releases
     
    @@ -83,6 +101,7 @@ Before filing an issue, please be sure to read the guidelines for what you're re
     
     * [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
     * [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
    +* [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes)
     * [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
     
     ## Frequently Asked Questions
    @@ -95,32 +114,41 @@ I do like JSHint. And I like Anton and Rick. Neither of those were deciding fact
     
     That's not really a question, but I got it. I'm not trying to convince you that ESLint is better than JSHint. The only thing I know is that ESLint is better than JSHint for what I'm doing. In the off chance you're doing something similar, it might be better for you. Otherwise, keep using JSHint, I'm certainly not going to tell you to stop using it.
     
    -### How does ESLint performance compare to JSHint and JSCS?
    +### How does ESLint performance compare to JSHint?
     
     ESLint is slower than JSHint, usually 2-3x slower on a single file. This is because ESLint uses Espree to construct an AST before it can evaluate your code whereas JSHint evaluates your code as it's being parsed. The speed is also based on the number of rules you enable; the more rules you enable, the slower the process.
     
     Despite being slower, we believe that ESLint is fast enough to replace JSHint without causing significant pain.
     
    -ESLint is faster than JSCS, as ESLint uses a single-pass traversal for analysis whereas JSCS using a querying model.
    +### I heard ESLint is going to replace JSCS?
     
    -If you are using both JSHint and JSCS on your files, then using just ESLint will be faster.
    +Yes. Since we are solving the same problems, ESLint and JSCS teams have decided to join forces and work together in the development of ESLint instead of competing with each other. You can read more about this in both [ESLint](http://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) and [JSCS](https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.u76sx334n) announcements.
     
    -### Is ESLint just linting or does it also check style?
    +### So, should I stop using JSCS and start using ESLint?
     
    -ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both.
    +Not yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time. Meanwhile, we recommend you to upgrade to JSCS 3.0 and provide feedback to the team.
     
    -### What about ECMAScript 6 support?
    +### Is ESLint just linting or does it also check style?
     
    -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).
    +ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both.
     
     ### Does ESLint support JSX?
     
     Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
     
    -### What about ECMAScript 7/2016 and experimental features?
    +### What about 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).
    +
    +### What about experimental features?
     
     ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.
     
    +Once a language feature has been adopted into the ECMAScript standard, we will accept
    +issues and pull requests related to the new feature, subject to our [contributing
    +guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use
    +the appropriate parser and plugin(s) for your experimental feature.
    +
     ### Where to ask for help?
     
     Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint)
    diff --git a/tools/eslint/bin/eslint.js b/tools/eslint/bin/eslint.js
    index 598b568ba4e0d4..1dbdbe8338e5d0 100755
    --- a/tools/eslint/bin/eslint.js
    +++ b/tools/eslint/bin/eslint.js
    @@ -3,8 +3,6 @@
     /**
      * @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";
    @@ -29,12 +27,31 @@ if (debug) {
     
     // now we can safely include the other modules that use debug
     var concat = require("concat-stream"),
    -    cli = require("../lib/cli");
    +    cli = require("../lib/cli"),
    +    path = require("path"),
    +    fs = require("fs");
     
     //------------------------------------------------------------------------------
     // Execution
     //------------------------------------------------------------------------------
     
    +process.on("uncaughtException", function(err){
    +    // lazy load
    +    var lodash = require("lodash");
    +
    +    if (typeof err.messageTemplate === "string" && err.messageTemplate.length > 0) {
    +        var template = lodash.template(fs.readFileSync(path.resolve(__dirname, "../messages/" + err.messageTemplate + ".txt"), "utf-8"));
    +
    +        console.log("\nOops! Something went wrong! :(");
    +        console.log("\n" + template(err.messageData || {}));
    +    } else {
    +        console.log(err.message);
    +        console.log(err.stack);
    +    }
    +
    +    process.exit(1);
    +});
    +
     if (useStdIn) {
         process.stdin.pipe(concat({ encoding: "string" }, function(text) {
             try {
    diff --git a/tools/eslint/conf/cli-options.js b/tools/eslint/conf/cli-options.js
    index f3daaff9b47ab7..83c815987b83e5 100644
    --- a/tools/eslint/conf/cli-options.js
    +++ b/tools/eslint/conf/cli-options.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Default CLIEngineOptions.
      * @author Ian VanSchooten
    - * @copyright 2016 Ian VanSchooten. All rights reserved.
    - * See LICENSE in root directory for full license.
      */
     
     "use strict";
    @@ -28,6 +26,5 @@ module.exports = {
         cacheLocation: "",
         cacheFile: ".eslintcache",
         fix: false,
    -    allowInlineConfig: true,
    -    cwd: process.cwd()
    +    allowInlineConfig: true
     };
    diff --git a/tools/eslint/conf/environments.js b/tools/eslint/conf/environments.js
    index 13c6da81f1afc2..ee76503827cb24 100644
    --- a/tools/eslint/conf/environments.js
    +++ b/tools/eslint/conf/environments.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Defines environment settings and globals.
      * @author Elan Shanker
    - * @copyright 2014 Elan Shanker. All rights reserved.
      */
     "use strict";
     
    diff --git a/tools/eslint/conf/eslint.json b/tools/eslint/conf/eslint.json
    index 9cd9c008302c4a..33336a504f66e3 100644
    --- a/tools/eslint/conf/eslint.json
    +++ b/tools/eslint/conf/eslint.json
    @@ -2,210 +2,216 @@
         "parser": "espree",
         "ecmaFeatures": {},
         "rules": {
    -        "no-alert": 0,
    -        "no-array-constructor": 0,
    -        "no-bitwise": 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-character-class": 2,
    -        "no-empty-function": 0,
    -        "no-empty-pattern": 2,
    -        "no-eq-null": 0,
    -        "no-eval": 0,
    -        "no-ex-assign": 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-fallthrough": 2,
    -        "no-floating-decimal": 0,
    -        "no-func-assign": 2,
    -        "no-implicit-coercion": 0,
    -        "no-implicit-globals": 0,
    -        "no-implied-eval": 0,
    -        "no-inline-comments": 0,
    -        "no-inner-declarations": 2,
    -        "no-invalid-regexp": 2,
    -        "no-invalid-this": 0,
    -        "no-irregular-whitespace": 2,
    -        "no-iterator": 0,
    -        "no-label-var": 0,
    -        "no-labels": 0,
    -        "no-lone-blocks": 0,
    -        "no-lonely-if": 0,
    -        "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": 0,
    -        "no-new-func": 0,
    -        "no-new-object": 0,
    -        "no-new-require": 0,
    -        "no-new-symbol": 2,
    -        "no-new-wrappers": 0,
    -        "no-obj-calls": 2,
    -        "no-octal": 2,
    -        "no-octal-escape": 0,
    -        "no-param-reassign": 0,
    -        "no-path-concat": 0,
    -        "no-plusplus": 0,
    -        "no-process-env": 0,
    -        "no-process-exit": 0,
    -        "no-proto": 0,
    -        "no-redeclare": 2,
    -        "no-regex-spaces": 2,
    -        "no-restricted-imports": 0,
    -        "no-restricted-modules": 0,
    -        "no-restricted-syntax": 0,
    -        "no-return-assign": 0,
    -        "no-script-url": 0,
    -        "no-self-assign": 2,
    -        "no-self-compare": 0,
    -        "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": 0,
    -        "no-this-before-super": 2,
    -        "no-throw-literal": 0,
    -        "no-undef": 2,
    -        "no-undef-init": 0,
    -        "no-undefined": 0,
    -        "no-unexpected-multiline": 2,
    -        "no-underscore-dangle": 0,
    -        "no-unmodified-loop-condition": 0,
    -        "no-unneeded-ternary": 0,
    -        "no-unreachable": 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,
    -        "no-warning-comments": 0,
    -        "no-with": 0,
    -        "no-magic-numbers": 0,
    -
    -        "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,
    -        "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,
    -        "consistent-return": 0,
    -        "consistent-this": 0,
    -        "constructor-super": 2,
    -        "curly": 0,
    -        "default-case": 0,
    -        "dot-location": 0,
    -        "dot-notation": 0,
    -        "eol-last": 0,
    -        "eqeqeq": 0,
    -        "func-names": 0,
    -        "func-style": 0,
    -        "generator-star-spacing": 0,
    -        "global-require": 0,
    -        "guard-for-in": 0,
    -        "handle-callback-err": 0,
    -        "id-length": 0,
    -        "indent": 0,
    -        "init-declarations": 0,
    -        "jsx-quotes": 0,
    -        "key-spacing": 0,
    -        "keyword-spacing": 0,
    -        "lines-around-comment": 0,
    -        "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,
    -        "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": 0,
    -        "radix": 0,
    -        "id-match": 0,
    -        "id-blacklist": 0,
    -        "require-jsdoc": 0,
    -        "require-yield": 0,
    -        "semi": 0,
    -        "semi-spacing": 0,
    -        "sort-vars": 0,
    -        "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,
    -        "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,
    -        "yield-star-spacing": 0,
    -        "yoda": 0
    +        "no-alert": "off",
    +        "no-array-constructor": "off",
    +        "no-bitwise": "off",
    +        "no-caller": "off",
    +        "no-case-declarations": "error",
    +        "no-catch-shadow": "off",
    +        "no-class-assign": "error",
    +        "no-cond-assign": "error",
    +        "no-confusing-arrow": "off",
    +        "no-console": "error",
    +        "no-const-assign": "error",
    +        "no-constant-condition": "error",
    +        "no-continue": "off",
    +        "no-control-regex": "error",
    +        "no-debugger": "error",
    +        "no-delete-var": "error",
    +        "no-div-regex": "off",
    +        "no-dupe-class-members": "error",
    +        "no-dupe-keys": "error",
    +        "no-dupe-args": "error",
    +        "no-duplicate-case": "error",
    +        "no-duplicate-imports": "off",
    +        "no-else-return": "off",
    +        "no-empty": "error",
    +        "no-empty-character-class": "error",
    +        "no-empty-function": "off",
    +        "no-empty-pattern": "error",
    +        "no-eq-null": "off",
    +        "no-eval": "off",
    +        "no-ex-assign": "error",
    +        "no-extend-native": "off",
    +        "no-extra-bind": "off",
    +        "no-extra-boolean-cast": "error",
    +        "no-extra-label": "off",
    +        "no-extra-parens": "off",
    +        "no-extra-semi": "error",
    +        "no-fallthrough": "error",
    +        "no-floating-decimal": "off",
    +        "no-func-assign": "error",
    +        "no-implicit-coercion": "off",
    +        "no-implicit-globals": "off",
    +        "no-implied-eval": "off",
    +        "no-inline-comments": "off",
    +        "no-inner-declarations": "error",
    +        "no-invalid-regexp": "error",
    +        "no-invalid-this": "off",
    +        "no-irregular-whitespace": "error",
    +        "no-iterator": "off",
    +        "no-label-var": "off",
    +        "no-labels": "off",
    +        "no-lone-blocks": "off",
    +        "no-lonely-if": "off",
    +        "no-loop-func": "off",
    +        "no-mixed-requires": "off",
    +        "no-mixed-spaces-and-tabs": "error",
    +        "linebreak-style": "off",
    +        "no-multi-spaces": "off",
    +        "no-multi-str": "off",
    +        "no-multiple-empty-lines": "off",
    +        "no-native-reassign": "off",
    +        "no-negated-condition": "off",
    +        "no-negated-in-lhs": "error",
    +        "no-nested-ternary": "off",
    +        "no-new": "off",
    +        "no-new-func": "off",
    +        "no-new-object": "off",
    +        "no-new-require": "off",
    +        "no-new-symbol": "error",
    +        "no-new-wrappers": "off",
    +        "no-obj-calls": "error",
    +        "no-octal": "error",
    +        "no-octal-escape": "off",
    +        "no-param-reassign": "off",
    +        "no-path-concat": "off",
    +        "no-plusplus": "off",
    +        "no-process-env": "off",
    +        "no-process-exit": "off",
    +        "no-proto": "off",
    +        "no-redeclare": "error",
    +        "no-regex-spaces": "error",
    +        "no-restricted-globals": "off",
    +        "no-restricted-imports": "off",
    +        "no-restricted-modules": "off",
    +        "no-restricted-syntax": "off",
    +        "no-return-assign": "off",
    +        "no-script-url": "off",
    +        "no-self-assign": "error",
    +        "no-self-compare": "off",
    +        "no-sequences": "off",
    +        "no-shadow": "off",
    +        "no-shadow-restricted-names": "off",
    +        "no-whitespace-before-property": "off",
    +        "no-spaced-func": "off",
    +        "no-sparse-arrays": "error",
    +        "no-sync": "off",
    +        "no-ternary": "off",
    +        "no-trailing-spaces": "off",
    +        "no-this-before-super": "error",
    +        "no-throw-literal": "off",
    +        "no-undef": "error",
    +        "no-undef-init": "off",
    +        "no-undefined": "off",
    +        "no-unexpected-multiline": "error",
    +        "no-underscore-dangle": "off",
    +        "no-unmodified-loop-condition": "off",
    +        "no-unneeded-ternary": "off",
    +        "no-unreachable": "error",
    +        "no-unsafe-finally": "off",
    +        "no-unused-expressions": "off",
    +        "no-unused-labels": "error",
    +        "no-unused-vars": "error",
    +        "no-use-before-define": "off",
    +        "no-useless-call": "off",
    +        "no-useless-computed-key": "off",
    +        "no-useless-concat": "off",
    +        "no-useless-constructor": "off",
    +        "no-useless-escape": "off",
    +        "no-void": "off",
    +        "no-var": "off",
    +        "no-warning-comments": "off",
    +        "no-with": "off",
    +        "no-magic-numbers": "off",
    +        "array-bracket-spacing": "off",
    +        "array-callback-return": "off",
    +        "arrow-body-style": "off",
    +        "arrow-parens": "off",
    +        "arrow-spacing": "off",
    +        "accessor-pairs": "off",
    +        "block-scoped-var": "off",
    +        "block-spacing": "off",
    +        "brace-style": "off",
    +        "callback-return": "off",
    +        "camelcase": "off",
    +        "comma-dangle": "error",
    +        "comma-spacing": "off",
    +        "comma-style": "off",
    +        "complexity": ["off", 11],
    +        "computed-property-spacing": "off",
    +        "consistent-return": "off",
    +        "consistent-this": "off",
    +        "constructor-super": "error",
    +        "curly": "off",
    +        "default-case": "off",
    +        "dot-location": "off",
    +        "dot-notation": "off",
    +        "eol-last": "off",
    +        "eqeqeq": "off",
    +        "func-names": "off",
    +        "func-style": "off",
    +        "generator-star-spacing": "off",
    +        "global-require": "off",
    +        "guard-for-in": "off",
    +        "handle-callback-err": "off",
    +        "id-length": "off",
    +        "indent": "off",
    +        "init-declarations": "off",
    +        "jsx-quotes": "off",
    +        "key-spacing": "off",
    +        "keyword-spacing": "off",
    +        "lines-around-comment": "off",
    +        "max-depth": "off",
    +        "max-len": "off",
    +        "max-nested-callbacks": "off",
    +        "max-params": "off",
    +        "max-statements": "off",
    +        "max-statements-per-line": "off",
    +        "new-cap": "off",
    +        "new-parens": "off",
    +        "newline-after-var": "off",
    +        "newline-before-return": "off",
    +        "newline-per-chained-call": "off",
    +        "object-curly-spacing": ["off", "never"],
    +        "object-shorthand": "off",
    +        "one-var": "off",
    +        "one-var-declaration-per-line": "off",
    +        "operator-assignment": "off",
    +        "operator-linebreak": "off",
    +        "padded-blocks": "off",
    +        "prefer-arrow-callback": "off",
    +        "prefer-const": "off",
    +        "prefer-reflect": "off",
    +        "prefer-rest-params": "off",
    +        "prefer-spread": "off",
    +        "prefer-template": "off",
    +        "quote-props": "off",
    +        "quotes": "off",
    +        "radix": "off",
    +        "id-match": "off",
    +        "id-blacklist": "off",
    +        "require-jsdoc": "off",
    +        "require-yield": "off",
    +        "semi": "off",
    +        "semi-spacing": "off",
    +        "sort-vars": "off",
    +        "sort-imports": "off",
    +        "space-before-blocks": "off",
    +        "space-before-function-paren": "off",
    +        "space-in-parens": "off",
    +        "space-infix-ops": "off",
    +        "space-unary-ops": "off",
    +        "spaced-comment": "off",
    +        "strict": "off",
    +        "template-curly-spacing": "off",
    +        "use-isnan": "error",
    +        "valid-jsdoc": "off",
    +        "valid-typeof": "error",
    +        "vars-on-top": "off",
    +        "wrap-iife": "off",
    +        "wrap-regex": "off",
    +        "yield-star-spacing": "off",
    +        "yoda": "off"
         }
     }
    diff --git a/tools/eslint/lib/ast-utils.js b/tools/eslint/lib/ast-utils.js
    index f9c04ceab37006..e008beeb2aea44 100644
    --- a/tools/eslint/lib/ast-utils.js
    +++ b/tools/eslint/lib/ast-utils.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -33,14 +31,21 @@ var thisTagPattern = /^[\s\*]*@this/m;
      * @private
      */
     function isModifyingReference(reference, index, references) {
    -    var identifier = reference.identifier;
    +    var identifier = reference.identifier,
    +        modifyingDifferentIdentifier;
    +
    +    /*
    +     * Destructuring assignments can have multiple default value, so
    +     * possibly there are multiple writeable references for the same
    +     * identifier.
    +     */
    +    modifyingDifferentIdentifier = index === 0 ||
    +        references[index - 1].identifier !== identifier;
     
         return (identifier &&
             reference.init === false &&
             reference.isWrite() &&
    -            // 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)
    +        modifyingDifferentIdentifier
         );
     }
     
    @@ -155,6 +160,7 @@ function isMethodWhichHasThisArg(node) {
      */
     function hasJSDocThisTag(node, sourceCode) {
         var jsdocComment = sourceCode.getJSDocComment(node);
    +
         if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
             return true;
         }
    @@ -168,6 +174,22 @@ function hasJSDocThisTag(node, sourceCode) {
         });
     }
     
    +/**
    + * Determines if a node is surrounded by parentheses.
    + * @param {RuleContext} context The context object passed to the rule
    + * @param {ASTNode} node The node to be checked.
    + * @returns {boolean} True if the node is parenthesised.
    + * @private
    + */
    +function isParenthesised(context, node) {
    +    var previousToken = context.getTokenBefore(node),
    +        nextToken = context.getTokenAfter(node);
    +
    +    return Boolean(previousToken && nextToken) &&
    +        previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +        nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +}
    +
     //------------------------------------------------------------------------------
     // Public Interface
     //------------------------------------------------------------------------------
    @@ -187,8 +209,10 @@ module.exports = {
     
         isNullOrUndefined: isNullOrUndefined,
         isCallee: isCallee,
    +    isES5Constructor: isES5Constructor,
         getUpperFunction: getUpperFunction,
         isArrayFromMethod: isArrayFromMethod,
    +    isParenthesised: isParenthesised,
     
         /**
          * Checks whether or not a given node is a string literal.
    @@ -261,6 +285,7 @@ module.exports = {
          */
         isDirectiveComment: function(node) {
             var comment = node.value.trim();
    +
             return (
                 node.type === "Line" && comment.indexOf("eslint-") === 0 ||
                 node.type === "Block" && (
    @@ -293,8 +318,10 @@ module.exports = {
          */
         getVariableByName: function(initScope, name) {
             var scope = initScope;
    +
             while (scope) {
                 var variable = scope.set.get(name);
    +
                 if (variable) {
                     return variable;
                 }
    @@ -333,10 +360,13 @@ module.exports = {
     
             while (node) {
                 var parent = node.parent;
    +
                 switch (parent.type) {
    -                // Looks up the destination.
    -                // e.g.
    -                //   obj.foo = nativeFoo || function foo() { ... };
    +
    +                /*
    +                 * Looks up the destination.
    +                 * e.g., obj.foo = nativeFoo || function foo() { ... };
    +                 */
                     case "LogicalExpression":
                     case "ConditionalExpression":
                         node = parent;
    @@ -350,6 +380,7 @@ module.exports = {
                     //   })();
                     case "ReturnStatement":
                         var func = getUpperFunction(parent);
    +
                         if (func === null || !isCallee(func)) {
                             return true;
                         }
    diff --git a/tools/eslint/lib/cli-engine.js b/tools/eslint/lib/cli-engine.js
    index e3d72c6bb5e5b5..7fa1a794ea01ba 100644
    --- a/tools/eslint/lib/cli-engine.js
    +++ b/tools/eslint/lib/cli-engine.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -22,8 +20,7 @@ var fs = require("fs"),
     
         lodash = require("lodash"),
         debug = require("debug"),
    -    glob = require("glob"),
    -    shell = require("shelljs"),
    +    isAbsolute = require("path-is-absolute"),
     
         rules = require("./rules"),
         eslint = require("./eslint"),
    @@ -36,8 +33,8 @@ var fs = require("fs"),
         SourceCodeFixer = require("./util/source-code-fixer"),
         validator = require("./config/config-validator"),
         stringify = require("json-stable-stringify"),
    +    hash = require("./util/hash"),
     
    -    crypto = require( "crypto" ),
         pkg = require("../package.json");
     
     
    @@ -73,12 +70,6 @@ var fs = require("fs"),
      * @property {LintMessage[]} messages All of the messages for the result.
      */
     
    -//------------------------------------------------------------------------------
    -// Private
    -//------------------------------------------------------------------------------
    -
    -defaultOptions = lodash.assign({}, defaultOptions, {cwd: process.cwd()});
    -
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
    @@ -122,6 +113,79 @@ function calculateStatsPerRun(results) {
         });
     }
     
    +/**
    + * Performs multiple autofix passes over the text until as many fixes as possible
    + * have been applied.
    + * @param {string} text The source text to apply fixes to.
    + * @param {Object} config The ESLint config object to use.
    + * @param {Object} options The ESLint options object to use.
    + * @param {string} options.filename The filename from which the text was read.
    + * @param {boolean} options.allowInlineConfig Flag indicating if inline comments
    + *      should be allowed.
    + * @returns {Object} The result of the fix operation as returned from the
    + *      SourceCodeFixer.
    + * @private
    + */
    +function multipassFix(text, config, options) {
    +
    +    var messages = [],
    +        fixedResult,
    +        fixed = false,
    +        passNumber = 0,
    +        lastMessageCount,
    +        MAX_PASSES = 10;
    +
    +    /**
    +     * This loop continues until one of the following is true:
    +     *
    +     * 1. No more fixes have been applied.
    +     * 2. There are no more linting errors reported.
    +     * 3. The number of linting errors is no different between two passes.
    +     * 4. Ten passes have been made.
    +     *
    +     * That means anytime a fix is successfully applied, there will be another pass.
    +     * Essentially, guaranteeing a minimum of two passes.
    +     */
    +    do {
    +        passNumber++;
    +        lastMessageCount = messages.length;
    +
    +        debug("Linting code for " + options.filename + " (pass " + passNumber + ")");
    +        messages = eslint.verify(text, config, options);
    +
    +        debug("Generating fixed text for " + options.filename + " (pass " + passNumber + ")");
    +        fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
    +
    +        // keep track if any fixes were ever applied - important for return value
    +        fixed = fixed || fixedResult.fixed;
    +
    +        // update to use the fixed output instead of the original text
    +        text = fixedResult.output;
    +
    +    } while (
    +        fixedResult.fixed && fixedResult.messages.length > 0 &&
    +        fixedResult.messages.length !== lastMessageCount &&
    +        passNumber < MAX_PASSES
    +    );
    +
    +
    +    /*
    +     * If the last result had fixes, we need to lint again to me sure we have
    +     * the most up-to-date information.
    +     */
    +    if (fixedResult.fixed) {
    +        fixedResult.messages = eslint.verify(text, config, options);
    +    }
    +
    +
    +    // ensure the last result properly reflects if fixes were done
    +    fixedResult.fixed = fixed;
    +    fixedResult.output = text;
    +
    +    return fixedResult;
    +
    +}
    +
     /**
      * Processes an source code using ESLint.
      * @param {string} text The source code to check.
    @@ -141,13 +205,14 @@ function processText(text, configHelper, filename, fix, allowInlineConfig) {
             config,
             messages,
             stats,
    -        fileExtension = path.extname(filename),
    +        fileExtension,
             processor,
             loadedPlugins,
             fixedResult;
     
         if (filename) {
             filePath = path.resolve(filename);
    +        fileExtension = path.extname(filename);
         }
     
         filename = filename || "";
    @@ -171,6 +236,7 @@ function processText(text, configHelper, filename, fix, allowInlineConfig) {
             debug("Using processor");
             var parsedBlocks = processor.preprocess(text, filename);
             var unprocessedMessages = [];
    +
             parsedBlocks.forEach(function(block) {
                 unprocessedMessages.push(eslint.verify(block, config, {
                     filename: filename,
    @@ -184,15 +250,17 @@ function processText(text, configHelper, filename, fix, allowInlineConfig) {
     
         } else {
     
    -        messages = eslint.verify(text, config, {
    -            filename: filename,
    -            allowInlineConfig: allowInlineConfig
    -        });
    -
             if (fix) {
    -            debug("Generating fixed text for " + filename);
    -            fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
    +            fixedResult = multipassFix(text, config, {
    +                filename: filename,
    +                allowInlineConfig: allowInlineConfig
    +            });
                 messages = fixedResult.messages;
    +        } else {
    +            messages = eslint.verify(text, config, {
    +                filename: filename,
    +                allowInlineConfig: allowInlineConfig
    +            });
             }
         }
     
    @@ -262,17 +330,6 @@ 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
    @@ -286,8 +343,11 @@ function md5Hash(str) {
      * @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
    +
    +    /*
    +     * 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);
    @@ -298,7 +358,7 @@ function getCacheFile(cacheFile, cwd) {
          * @returns {string} the resolved path to the cacheFile
          */
         function getCacheFileForDirectory() {
    -        return path.join(resolvedCacheFile, ".cache_" + md5Hash(cwd));
    +        return path.join(resolvedCacheFile, ".cache_" + hash(cwd));
         }
     
         var fileStats;
    @@ -310,23 +370,31 @@ function getCacheFile(cacheFile, cwd) {
         }
     
     
    -    // 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
    +    /*
    +     * 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
    +
    +        /*
    +         * 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.
    +    /*
    +     * 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) {
    @@ -347,7 +415,12 @@ function getCacheFile(cacheFile, cwd) {
      */
     function CLIEngine(options) {
     
    -    options = lodash.assign(Object.create(null), defaultOptions, options);
    +    options = lodash.assign(
    +        Object.create(null),
    +        defaultOptions,
    +        {cwd: process.cwd()},
    +        options
    +    );
     
         /**
          * Stored options for this instance
    @@ -358,8 +431,9 @@ function CLIEngine(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
    +     * Cache used to avoid operating on files that haven't changed since the
    +     * last successful execution (e.g., file passed linting with no errors and
    +     * no warnings).
          * @type {Object}
          */
         this._fileCache = fileEntryCache.create(cacheFile);
    @@ -371,6 +445,7 @@ function CLIEngine(options) {
         // 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, cwd);
    @@ -404,7 +479,9 @@ CLIEngine.getFormatter = function(format) {
     
             // if there's a slash, then it's a file
             if (format.indexOf("/") > -1) {
    -            formatterPath = path.resolve(this.options.cwd, format);
    +            var cwd = this.options ? this.options.cwd : process.cwd();
    +
    +            formatterPath = path.resolve(cwd, format);
             } else {
                 formatterPath = "./formatters/" + format;
             }
    @@ -476,7 +553,7 @@ CLIEngine.prototype = {
          * @returns {string[]} The equivalent glob patterns.
          */
         resolveFileGlobPatterns: function(patterns) {
    -        return globUtil.resolveFileGlobPatterns(patterns, this.options.extensions);
    +        return globUtil.resolveFileGlobPatterns(patterns, this.options);
         },
     
         /**
    @@ -490,26 +567,11 @@ CLIEngine.prototype = {
                 options = this.options,
                 fileCache = this._fileCache,
                 configHelper = new Config(options),
    -            ignoredPaths = new IgnoredPaths(options),
    -            globOptions,
    +            fileList,
                 stats,
                 startTime,
                 prevConfig; // the previous configuration used
     
    -        startTime = Date.now();
    -
    -        globOptions = {
    -            nodir: true
    -        };
    -
    -        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
    @@ -524,13 +586,16 @@ CLIEngine.prototype = {
     
                 // 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
    +
    +                /*
    +                 * config changed so we need to calculate the hash of the config
    +                 * and the hash of the plugins being used
    +                 */
                     prevConfig.config = config;
     
                     var eslintVersion = pkg.version;
     
    -                prevConfig.hash = md5Hash(eslintVersion + "_" + stringify(config));
    +                prevConfig.hash = hash(eslintVersion + "_" + stringify(config));
                 }
     
                 return prevConfig.hash;
    @@ -546,48 +611,41 @@ CLIEngine.prototype = {
             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]) {
    +            if (warnIgnored) {
    +                results.push(createIgnoreResult(filename));
                     return;
                 }
     
                 if (options.cache) {
    -                // get the descriptor for this file
    -                // with the metadata and the flag that determines if
    -                // the file has changed
    +
    +                /*
    +                 * 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)
    -
    +                    /*
    +                     * 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
    +                    /*
    +                     * Add the the cached results (always will be 0 error and
    +                     * 0 warnings). We should not cache results for files that
    +                     * failed, in order to guarantee that next execution will
    +                     * process those files as well.
    +                     */
                         results.push(descriptor.meta.results);
     
                         // move to the next file
    @@ -602,17 +660,25 @@ CLIEngine.prototype = {
                 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 ) {
    +
    +                /*
    +                 * 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 );
    +                    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
    +
    +                    /*
    +                     * since the file passed we store the result here
    +                     * TODO: check this as we might not need to store the
    +                     * successful runs as it will always should be 0 errors and
    +                     * 0 warnings.
    +                     */
                         descriptor.meta.hashOfConfig = hashOfConfig;
                         descriptor.meta.results = res;
                     }
    @@ -621,23 +687,20 @@ CLIEngine.prototype = {
                 results.push(res);
             }
     
    -        patterns.forEach(function(pattern) {
    +        startTime = Date.now();
     
    -            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);
    -                });
    -            }
     
    +        patterns = this.resolveFileGlobPatterns(patterns);
    +        fileList = globUtil.listFilesToProcess(patterns, options);
    +        fileList.forEach(function(fileInfo) {
    +            executeOnFile(fileInfo.filename, fileInfo.ignored);
             });
     
             stats = calculateStatsPerRun(results);
     
             if (options.cache) {
    +
                 // persist the cache to disk
                 fileCache.reconcile();
             }
    @@ -665,7 +728,12 @@ CLIEngine.prototype = {
                 configHelper = new Config(options),
                 ignoredPaths = new IgnoredPaths(options);
     
    +        // resolve filename based on options.cwd (for reporting, ignoredPaths also resolves)
    +        if (filename && !isAbsolute(filename)) {
    +            filename = path.resolve(options.cwd, filename);
    +        }
             if (filename && (options.ignore !== false) && ignoredPaths.contains(filename)) {
    +
                 results.push(createIgnoreResult(filename));
             } else {
                 results.push(processText(text, configHelper, filename, options.fix, options.allowInlineConfig));
    @@ -689,6 +757,7 @@ CLIEngine.prototype = {
          */
         getConfigForFile: function(filePath) {
             var configHelper = new Config(this.options);
    +
             return configHelper.getConfig(filePath);
         },
     
    @@ -699,10 +768,11 @@ CLIEngine.prototype = {
          */
         isPathIgnored: function(filePath) {
             var ignoredPaths;
    +        var resolvedPath = path.resolve(this.options.cwd, filePath);
     
             if (this.options.ignore) {
                 ignoredPaths = new IgnoredPaths(this.options);
    -            return ignoredPaths.contains(filePath);
    +            return ignoredPaths.contains(resolvedPath);
             }
     
             return false;
    diff --git a/tools/eslint/lib/cli.js b/tools/eslint/lib/cli.js
    index 979060d3f99760..adb70d8ce18390 100644
    --- a/tools/eslint/lib/cli.js
    +++ b/tools/eslint/lib/cli.js
    @@ -51,6 +51,7 @@ function translateOptions(cliOptions) {
             rulePaths: cliOptions.rulesdir,
             useEslintrc: cliOptions.eslintrc,
             parser: cliOptions.parser,
    +        parserOptions: cliOptions.parserOptions,
             cache: cliOptions.cache,
             cacheFile: cliOptions.cacheFile,
             cacheLocation: cliOptions.cacheLocation,
    @@ -171,6 +172,7 @@ var cli = {
                     }
     
                     var fileConfig = engine.getConfigForFile(files[0]);
    +
                     log.info(JSON.stringify(fileConfig, null, "  "));
                     return 0;
                 }
    diff --git a/tools/eslint/lib/code-path-analysis/code-path-analyzer.js b/tools/eslint/lib/code-path-analysis/code-path-analyzer.js
    index aa2a6ff4acb1f1..4e55cccee64869 100644
    --- a/tools/eslint/lib/code-path-analysis/code-path-analyzer.js
    +++ b/tools/eslint/lib/code-path-analysis/code-path-analyzer.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -41,6 +39,7 @@ function isCaseNode(node) {
      */
     function isForkingByTrueOrFalse(node) {
         var parent = node.parent;
    +
         switch (parent.type) {
             case "ConditionalExpression":
             case "IfStatement":
    @@ -128,8 +127,8 @@ function isIdentifierReference(node) {
      *
      * 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.
    + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd"
    + * events are fired.
      *
      * @param {CodePathAnalyzer} analyzer - The instance.
      * @param {ASTNode} node - The current AST node.
    @@ -206,6 +205,7 @@ function leaveFromCurrentSegment(analyzer, node) {
                     node);
             }
         }
    +
         state.currentSegments = [];
     }
     
    @@ -234,9 +234,12 @@ function preprocess(analyzer, node) {
     
             case "ConditionalExpression":
             case "IfStatement":
    -            // Fork if this node is at `consequent`/`alternate`.
    -            // `popForkContext()` exists at `IfStatement:exit` and
    -            // `ConditionalExpression:exit`.
    +
    +            /*
    +             * 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) {
    @@ -299,9 +302,12 @@ function preprocess(analyzer, node) {
                 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`.
    +
    +            /*
    +             * 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();
    @@ -332,6 +338,7 @@ function processCodePathToEnter(analyzer, node) {
             case "FunctionExpression":
             case "ArrowFunctionExpression":
                 if (codePath) {
    +
                     // Emits onCodePathSegmentStart events if updated.
                     forwardCurrentToHead(analyzer, node);
                     debug.dumpState(node, state, false);
    @@ -370,9 +377,12 @@ function processCodePathToEnter(analyzer, node) {
                 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.
    +
    +            /*
    +             * 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();
                 }
    @@ -425,9 +435,12 @@ function processCodePathToExit(analyzer, node) {
                 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.
    +
    +            /*
    +             * 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);
                 }
    @@ -499,9 +512,12 @@ function processCodePathToExit(analyzer, node) {
                 break;
         }
     
    -    // Skip updating the current segment to avoid creating useless segments if
    -    // the node type is the same as the parent node type.
    +    /*
    +     * 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);
         }
    diff --git a/tools/eslint/lib/code-path-analysis/code-path-segment.js b/tools/eslint/lib/code-path-analysis/code-path-segment.js
    index 94deafbfbb1d0c..d5361ccd07413b 100644
    --- a/tools/eslint/lib/code-path-analysis/code-path-segment.js
    +++ b/tools/eslint/lib/code-path-analysis/code-path-segment.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,8 +9,7 @@
     // Requirements
     //------------------------------------------------------------------------------
     
    -var assert = require("assert"),
    -    debug = require("./debug-helpers");
    +var debug = require("./debug-helpers");
     
     //------------------------------------------------------------------------------
     // Helpers
    @@ -79,6 +76,7 @@ function isReachable(segment) {
      * @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.
    @@ -120,7 +118,8 @@ function CodePathSegment(id, allPrevSegments, reachable) {
     
         // Internal data.
         Object.defineProperty(this, "internal", {value: {
    -        used: false
    +        used: false,
    +        loopedPrevSegments: []
         }});
     
         /* istanbul ignore if */
    @@ -130,6 +129,20 @@ function CodePathSegment(id, allPrevSegments, reachable) {
         }
     }
     
    +CodePathSegment.prototype = {
    +    constructor: CodePathSegment,
    +
    +    /**
    +     * Checks a given previous segment is coming from the end of a loop.
    +     *
    +     * @param {CodePathSegment} segment - A previous segment to check.
    +     * @returns {boolean} `true` if the segment is coming from the end of a loop.
    +     */
    +    isLoopedPrevSegment: function(segment) {
    +        return this.internal.loopedPrevSegments.indexOf(segment) !== -1;
    +    }
    +};
    +
     /**
      * Creates the root segment.
      *
    @@ -162,7 +175,13 @@ CodePathSegment.newNext = function(id, allPrevSegments) {
      * @returns {CodePathSegment} The created segment.
      */
     CodePathSegment.newUnreachable = function(id, allPrevSegments) {
    -    return new CodePathSegment(id, flattenUnusedSegments(allPrevSegments), false);
    +    var segment = new CodePathSegment(id, flattenUnusedSegments(allPrevSegments), false);
    +
    +    // In `if (a) return a; foo();` case, the unreachable segment preceded by
    +    // the return statement is not used but must not be remove.
    +    CodePathSegment.markUsed(segment);
    +
    +    return segment;
     };
     
     /**
    @@ -187,10 +206,13 @@ CodePathSegment.newDisconnected = function(id, allPrevSegments) {
      * @returns {void}
      */
     CodePathSegment.markUsed = function(segment) {
    -    assert(!segment.internal.used, segment.id + " is marked twice.");
    +    if (segment.internal.used) {
    +        return;
    +    }
         segment.internal.used = true;
     
         var i;
    +
         if (segment.reachable) {
             for (i = 0; i < segment.allPrevSegments.length; ++i) {
                 var prevSegment = segment.allPrevSegments[i];
    @@ -205,4 +227,15 @@ CodePathSegment.markUsed = function(segment) {
         }
     };
     
    +/**
    + * Marks a previous segment as looped.
    + *
    + * @param {CodePathSegment} segment - A segment.
    + * @param {CodePathSegment} prevSegment - A previous segment to mark.
    + * @returns {void}
    + */
    +CodePathSegment.markPrevSegmentAsLooped = function(segment, prevSegment) {
    +    segment.internal.loopedPrevSegments.push(prevSegment);
    +};
    +
     module.exports = CodePathSegment;
    diff --git a/tools/eslint/lib/code-path-analysis/code-path-state.js b/tools/eslint/lib/code-path-analysis/code-path-state.js
    index 121df319fa642f..0492d832c2c40f 100644
    --- a/tools/eslint/lib/code-path-analysis/code-path-state.js
    +++ b/tools/eslint/lib/code-path-analysis/code-path-state.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -55,6 +53,7 @@ function getContinueContext(state, label) {
         }
     
         var context = state.loopContext;
    +
         while (context) {
             if (context.label === label) {
                 return context;
    @@ -75,6 +74,7 @@ function getContinueContext(state, label) {
      */
     function getBreakContext(state, label) {
         var context = state.breakContext;
    +
         while (context) {
             if (label ? context.label === label : context.breakable) {
                 return context;
    @@ -94,6 +94,7 @@ function getBreakContext(state, label) {
      */
     function getReturnContext(state) {
         var context = state.tryContext;
    +
         while (context) {
             if (context.hasFinalizer && context.position !== "finally") {
                 return context;
    @@ -112,6 +113,7 @@ function getReturnContext(state) {
      */
     function getThrowContext(state) {
         var context = state.tryContext;
    +
         while (context) {
             if (context.position === "try" ||
                 (context.hasFinalizer && context.position === "catch")
    @@ -168,6 +170,7 @@ function removeConnection(prevSegments, nextSegments) {
      */
     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];
    @@ -181,6 +184,10 @@ function makeLooped(state, fromSegments, toSegments) {
             fromSegment.allNextSegments.push(toSegment);
             toSegment.allPrevSegments.push(fromSegment);
     
    +        if (toSegment.allPrevSegments.length >= 2) {
    +            CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
    +        }
    +
             state.notifyLooped(fromSegment, toSegment);
         }
     }
    @@ -237,6 +244,7 @@ function CodePathState(idGenerator, onLooped) {
         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);
     }
    @@ -259,6 +267,7 @@ CodePathState.prototype = {
          */
         get parentForkContext() {
             var current = this.forkContext;
    +
             return current && current.upper;
         },
     
    @@ -362,6 +371,7 @@ CodePathState.prototype = {
          */
         popChoiceContext: function() {
             var context = this.choiceContext;
    +
             this.choiceContext = context.upper;
     
             var forkContext = this.forkContext;
    @@ -370,43 +380,61 @@ CodePathState.prototype = {
             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 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.
    +                /*
    +                 * 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.
    +
    +                    /*
    +                     * 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.
    +
    +                    /*
    +                     * 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().
    +
    +                /*
    +                 * Loops are addressed in popLoopContext().
    +                 * This is called from popLoopContext().
    +                 */
                     return context;
     
                 /* istanbul ignore next */
    @@ -416,6 +444,7 @@ CodePathState.prototype = {
     
             // Merges all paths.
             var prevForkContext = context.trueForkContext;
    +
             prevForkContext.addAll(context.falseForkContext);
             forkContext.replaceHead(prevForkContext.makeNext(0, -1));
     
    @@ -433,8 +462,11 @@ CodePathState.prototype = {
             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.
    +
    +            /*
    +             * 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;
    @@ -444,13 +476,18 @@ CodePathState.prototype = {
     
                 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.
    +
    +            /*
    +             * 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);
                 }
    @@ -468,13 +505,16 @@ CodePathState.prototype = {
             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 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.
    @@ -492,8 +532,10 @@ CodePathState.prototype = {
             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.
    +        /*
    +         * 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;
    @@ -526,6 +568,7 @@ CodePathState.prototype = {
                 lastIsDefault: false,
                 countForks: 0
             };
    +
             this.pushBreakContext(true, label);
         },
     
    @@ -541,41 +584,57 @@ CodePathState.prototype = {
          */
         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.
    +
    +            /*
    +             * 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` 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.
    +        /*
    +         * 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.
    +
    +                /*
    +                 * 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.
    +
    +                /*
    +                 * It handles the last case body as broken if `default` chunk
    +                 * does not exist.
    +                 */
                     brokenForkContext.add(lastCaseSegments);
                 }
             }
    @@ -584,8 +643,11 @@ CodePathState.prototype = {
             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.
    +
    +        /*
    +         * Creates a path from all brokenForkContext paths.
    +         * This is a path after switch statement.
    +         */
             this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
         },
     
    @@ -598,20 +660,26 @@ CodePathState.prototype = {
          */
         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.
    +        /*
    +         * 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.
    +        /*
    +         * 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) {
    @@ -625,6 +693,7 @@ CodePathState.prototype = {
                     context.defaultBodySegments = forkContext.head;
                 }
             }
    +
             context.lastIsDefault = isDefault;
             context.countForks += 1;
         },
    @@ -645,9 +714,11 @@ CodePathState.prototype = {
                 upper: this.tryContext,
                 position: "try",
                 hasFinalizer: hasFinalizer,
    +
                 returnedForkContext: hasFinalizer
                     ? ForkContext.newEmpty(this.forkContext)
                     : null,
    +
                 thrownForkContext: ForkContext.newEmpty(this.forkContext),
                 lastOfTryIsReachable: false,
                 lastOfCatchIsReachable: false
    @@ -661,24 +732,31 @@ CodePathState.prototype = {
          */
         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.
    +
    +        /*
    +         * 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);
    @@ -744,6 +822,7 @@ CodePathState.prototype = {
     
             // Update state.
             if (context.position === "catch") {
    +
                 // Merges two paths from the `try` block and `catch` block.
                 this.popForkContext();
                 forkContext = this.forkContext;
    @@ -755,14 +834,18 @@ CodePathState.prototype = {
             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.
    +        /*
    +         * 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]];
     
    @@ -790,11 +873,13 @@ CodePathState.prototype = {
          */
         makeFirstThrowablePathInTryBlock: function() {
             var forkContext = this.forkContext;
    +
             if (!forkContext.reachable) {
                 return;
             }
     
             var context = getThrowContext(this);
    +
             if (context === this ||
                 context.position !== "try" ||
                 !context.thrownForkContext.empty
    @@ -893,6 +978,7 @@ CodePathState.prototype = {
          */
         popLoopContext: function() {
             var context = this.loopContext;
    +
             this.loopContext = context.upper;
     
             var forkContext = this.forkContext;
    @@ -923,6 +1009,7 @@ CodePathState.prototype = {
     
                     // `true` paths go to looping.
                     var segmentsList = choiceContext.trueForkContext.segmentsList;
    +
                     for (var i = 0; i < segmentsList.length; ++i) {
                         makeLooped(
                             this,
    @@ -1069,6 +1156,7 @@ CodePathState.prototype = {
     
             // Update state.
             var updateSegments = forkContext.makeDisconnected(-1, -1);
    +
             context.continueDestSegments = context.updateSegments = updateSegments;
             forkContext.replaceHead(updateSegments);
         },
    @@ -1104,10 +1192,15 @@ CodePathState.prototype = {
             }
     
             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.
    +
    +            /*
    +             * 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);
    @@ -1146,6 +1239,7 @@ CodePathState.prototype = {
             var context = this.loopContext;
             var forkContext = this.forkContext;
             var temp = ForkContext.newEmpty(forkContext);
    +
             temp.add(context.prevSegments);
             var rightSegments = temp.makeNext(-1, -1);
     
    @@ -1164,6 +1258,7 @@ CodePathState.prototype = {
             var context = this.loopContext;
             var forkContext = this.forkContext;
             var temp = ForkContext.newEmpty(forkContext);
    +
             temp.add(context.endOfLeftSegments);
             var bodySegments = temp.makeNext(-1, -1);
     
    @@ -1205,11 +1300,13 @@ CodePathState.prototype = {
         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));
    @@ -1230,15 +1327,18 @@ CodePathState.prototype = {
          */
         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));
         },
     
    @@ -1253,11 +1353,13 @@ CodePathState.prototype = {
          */
         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) {
    @@ -1286,6 +1388,7 @@ CodePathState.prototype = {
          */
         makeReturn: function() {
             var forkContext = this.forkContext;
    +
             if (forkContext.reachable) {
                 getReturnContext(this).returnedForkContext.add(forkContext.head);
                 forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
    @@ -1302,6 +1405,7 @@ CodePathState.prototype = {
          */
         makeThrow: function() {
             var forkContext = this.forkContext;
    +
             if (forkContext.reachable) {
                 getThrowContext(this).thrownForkContext.add(forkContext.head);
                 forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
    @@ -1314,6 +1418,7 @@ CodePathState.prototype = {
          */
         makeFinal: function() {
             var segments = this.currentSegments;
    +
             if (segments.length > 0 && segments[0].reachable) {
                 this.returnedForkContext.add(segments);
             }
    diff --git a/tools/eslint/lib/code-path-analysis/code-path.js b/tools/eslint/lib/code-path-analysis/code-path.js
    index 200ff434b8d417..035e34e712e002 100644
    --- a/tools/eslint/lib/code-path-analysis/code-path.js
    +++ b/tools/eslint/lib/code-path-analysis/code-path.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -27,6 +25,7 @@ var IdGenerator = require("./id-generator");
      * @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.
    @@ -102,6 +101,123 @@ CodePath.prototype = {
          */
         get currentSegments() {
             return this.internal.currentSegments;
    +    },
    +
    +    /**
    +     * Traverses all segments in this code path.
    +     *
    +     *     codePath.traverseSegments(function(segment, controller) {
    +     *         // do something.
    +     *     });
    +     *
    +     * This method enumerates segments in order from the head.
    +     *
    +     * The `controller` object has two methods.
    +     *
    +     * - `controller.skip()` - Skip the following segments in this branch.
    +     * - `controller.break()` - Skip all following segments.
    +     *
    +     * @param {object} [options] - Omittable.
    +     * @param {CodePathSegment} [options.first] - The first segment to traverse.
    +     * @param {CodePathSegment} [options.last] - The last segment to traverse.
    +     * @param {function} callback - A callback function.
    +     * @returns {void}
    +     */
    +    traverseSegments: function(options, callback) {
    +        if (typeof options === "function") {
    +            callback = options;
    +            options = null;
    +        }
    +
    +        options = options || {};
    +        var startSegment = options.first || this.internal.initialSegment;
    +        var lastSegment = options.last;
    +
    +        var item = null;
    +        var index = 0;
    +        var end = 0;
    +        var segment = null;
    +        var visited = Object.create(null);
    +        var stack = [[startSegment, 0]];
    +        var skippedSegment = null;
    +        var broken = false;
    +        var controller = {
    +            skip: function() {
    +                if (stack.length <= 1) {
    +                    broken = true;
    +                } else {
    +                    skippedSegment = stack[stack.length - 2][0];
    +                }
    +            },
    +            break: function() {
    +                broken = true;
    +            }
    +        };
    +
    +        /**
    +         * Checks a given previous segment has been visited.
    +         * @param {CodePathSegment} prevSegment - A previous segment to check.
    +         * @returns {boolean} `true` if the segment has been visited.
    +         */
    +        function isVisited(prevSegment) {
    +            return (
    +                visited[prevSegment.id] ||
    +                segment.isLoopedPrevSegment(prevSegment)
    +            );
    +        }
    +
    +        while (stack.length > 0) {
    +            item = stack[stack.length - 1];
    +            segment = item[0];
    +            index = item[1];
    +
    +            if (index === 0) {
    +
    +                // Skip if this segment has been visited already.
    +                if (visited[segment.id]) {
    +                    stack.pop();
    +                    continue;
    +                }
    +
    +                // Skip if all previous segments have not been visited.
    +                if (segment !== startSegment &&
    +                    segment.prevSegments.length > 0 &&
    +                    !segment.prevSegments.every(isVisited)
    +                ) {
    +                    stack.pop();
    +                    continue;
    +                }
    +
    +                // Reset the flag of skipping if all branches have been skipped.
    +                if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) {
    +                    skippedSegment = null;
    +                }
    +                visited[segment.id] = true;
    +
    +                // Call the callback when the first time.
    +                if (!skippedSegment) {
    +                    callback.call(this, segment, controller); // eslint-disable-line callback-return
    +                    if (segment === lastSegment) {
    +                        controller.skip();
    +                    }
    +                    if (broken) {
    +                        break;
    +                    }
    +                }
    +            }
    +
    +            // Update the stack.
    +            end = segment.nextSegments.length - 1;
    +            if (index < end) {
    +                item[1] += 1;
    +                stack.push([segment.nextSegments[index], 0]);
    +            } else if (index === end) {
    +                item[0] = segment.nextSegments[index];
    +                item[1] = 0;
    +            } else {
    +                stack.pop();
    +            }
    +        }
         }
     };
     
    diff --git a/tools/eslint/lib/code-path-analysis/debug-helpers.js b/tools/eslint/lib/code-path-analysis/debug-helpers.js
    index d8c26ad1b85e67..e68c94bc496a0d 100644
    --- a/tools/eslint/lib/code-path-analysis/debug-helpers.js
    +++ b/tools/eslint/lib/code-path-analysis/debug-helpers.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -32,6 +30,7 @@ function getId(segment) { // eslint-disable-line require-jsdoc
     //------------------------------------------------------------------------------
     
     module.exports = {
    +
         /**
          * A flag that debug dumping is enabled or not.
          * @type {boolean}
    @@ -57,6 +56,7 @@ module.exports = {
         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 {
    @@ -153,12 +153,14 @@ module.exports = {
                 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;
                 }
    diff --git a/tools/eslint/lib/code-path-analysis/fork-context.js b/tools/eslint/lib/code-path-analysis/fork-context.js
    index 8716ddd6ffa7d1..00e0f97c40300f 100644
    --- a/tools/eslint/lib/code-path-analysis/fork-context.js
    +++ b/tools/eslint/lib/code-path-analysis/fork-context.js
    @@ -5,8 +5,6 @@
      * 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";
    @@ -47,6 +45,7 @@ function isReachable(segment) {
      */
     function makeSegments(context, begin, end, create) {
         var list = context.segmentsList;
    +
         if (begin < 0) {
             begin = list.length + begin;
         }
    @@ -55,6 +54,7 @@ function makeSegments(context, begin, end, create) {
         }
     
         var segments = [];
    +
         for (var i = 0; i < context.count; ++i) {
             var allPrevSegments = [];
     
    @@ -81,6 +81,7 @@ function makeSegments(context, begin, end, create) {
     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(),
    @@ -120,6 +121,7 @@ ForkContext.prototype = {
          */
         get head() {
             var list = this.segmentsList;
    +
             return list.length === 0 ? [] : list[list.length - 1];
         },
     
    @@ -137,6 +139,7 @@ ForkContext.prototype = {
          */
         get reachable() {
             var segments = this.head;
    +
             return segments.length > 0 && segments.some(isReachable);
         },
     
    @@ -212,6 +215,7 @@ ForkContext.prototype = {
             assert(context.count === this.count);
     
             var source = context.segmentsList;
    +
             for (var i = 0; i < source.length; ++i) {
                 this.segmentsList.push(source[i]);
             }
    diff --git a/tools/eslint/lib/code-path-analysis/id-generator.js b/tools/eslint/lib/code-path-analysis/id-generator.js
    index c37e7d7e5b92ac..f33858cacd4071 100644
    --- a/tools/eslint/lib/code-path-analysis/id-generator.js
    +++ b/tools/eslint/lib/code-path-analysis/id-generator.js
    @@ -5,8 +5,6 @@
      * 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";
    @@ -33,10 +31,12 @@ function IdGenerator(prefix) {
      */
     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;
     };
     
    diff --git a/tools/eslint/lib/config.js b/tools/eslint/lib/config.js
    index 6f445a44a50aa8..b9c70619532c72 100644
    --- a/tools/eslint/lib/config.js
    +++ b/tools/eslint/lib/config.js
    @@ -1,11 +1,8 @@
     /**
      * @fileoverview Responsible for loading config files
      * @author Seth McLaughlin
    - * @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";
     
     //------------------------------------------------------------------------------
    @@ -78,7 +75,7 @@ function loadConfig(configToLoad) {
      * @private
      */
     function getPersonalConfig() {
    -    var config = {},
    +    var config,
             filename;
     
         if (PERSONAL_CONFIG_DIR) {
    @@ -90,7 +87,7 @@ function getPersonalConfig() {
             }
         }
     
    -    return config;
    +    return config || {};
     }
     
     /**
    @@ -166,6 +163,7 @@ function Config(options) {
         this.ignorePath = options.ignorePath;
         this.cache = {};
         this.parser = options.parser;
    +    this.parserOptions = options.parserOptions || {};
     
         this.baseConfig = options.baseConfig ? loadConfig(options.baseConfig) : { rules: {} };
     
    @@ -176,10 +174,17 @@ function Config(options) {
             return envs;
         }, {});
     
    +    /*
    +     * Handle declared globals.
    +     * For global variable foo, handle "foo:false" and "foo:true" to set
    +     * whether global is writable.
    +     * If user declares "foo", convert to "foo:false".
    +     */
         this.globals = (options.globals || []).reduce(function(globals, def) {
    -        // Default "foo" to false and handle "foo:false" and "foo:true"
             var parts = def.split(":");
    +
             globals[parts[0]] = (parts.length > 1 && parts[1] === "true");
    +
             return globals;
         }, {});
     
    @@ -226,7 +231,7 @@ Config.prototype.getConfig = function(filePath) {
         }
     
         // Step 2: Create a copy of the baseConfig
    -    config = ConfigOps.merge({parser: this.parser}, this.baseConfig);
    +    config = ConfigOps.merge({parser: this.parser, parserOptions: this.parserOptions}, this.baseConfig);
     
         // Step 3: Merge in the user-specified configuration from .eslintrc and package.json
         config = ConfigOps.merge(config, userConfig);
    @@ -237,6 +242,7 @@ Config.prototype.getConfig = function(filePath) {
     
             config = ConfigOps.merge(config, this.useSpecificConfig);
         }
    +
         // Step 5: Merge in command line environments
         debug("Merging command line environment settings");
         config = ConfigOps.merge(config, { env: this.env });
    diff --git a/tools/eslint/lib/config/autoconfig.js b/tools/eslint/lib/config/autoconfig.js
    index 1b7493bf07abe0..be3d0970741935 100644
    --- a/tools/eslint/lib/config/autoconfig.js
    +++ b/tools/eslint/lib/config/autoconfig.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -15,6 +13,7 @@ var lodash = require("lodash"),
         debug = require("debug"),
         eslint = require("../eslint"),
         configRule = require("./config-rule"),
    +    ConfigOps = require("./config-ops"),
         recConfig = require("../../conf/eslint.json");
     
     //------------------------------------------------------------------------------
    @@ -91,6 +90,7 @@ Registry.prototype = {
          */
         populateFromCoreRules: function() {
             var rulesConfig = configRule.createCoreRuleConfigs();
    +
             this.rules = makeRegistryItems(rulesConfig);
         },
     
    @@ -123,18 +123,32 @@ Registry.prototype = {
              * @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.
    +
    +            /*
    +             * This check ensures that there is a rule configuration and that
    +             * it has fewer than the max combinations allowed.
    +             * If it has too many configs, we will only use the most basic of
    +             * the possible configurations.
    +             */
                 var hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS);
    +
                 if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) {
    -                // If the rule has too many possible combinations, only take simple ones, avoiding objects.
    +
    +                /*
    +                 * If 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
    +
    +                /*
    +                 * Initialize errorCount to zero, since this is a config which
    +                 * will be linted.
    +                 */
                     this.rules[rule][idx].errorCount = 0;
                 }
             }.bind(this);
    @@ -164,6 +178,7 @@ Registry.prototype = {
                 var errorFreeItems = newRegistry.rules[ruleId].filter(function(registryItem) {
                     return (registryItem.errorCount === 0);
                 });
    +
                 if (errorFreeItems.length > 0) {
                     newRegistry.rules[ruleId] = errorFreeItems;
                 } else {
    @@ -208,6 +223,7 @@ Registry.prototype = {
                 var failingConfigs = this.rules[ruleId].filter(function(registryItem) {
                     return (registryItem.errorCount > 0);
                 });
    +
                 if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) {
                     failingRegistry.rules[ruleId] = failingConfigs;
                 }
    @@ -273,26 +289,43 @@ Registry.prototype = {
     
             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;
    +
    +                    // It is possible that the error is from a configuration comment
    +                    // in a linted file, in which case there may not be a config
    +                    // set in this ruleSetIdx. (https://github.com/eslint/eslint/issues/5992)
    +                    if (lintedRegistry.rules[result.ruleId][ruleSetIdx]) {
    +                        lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1;
    +                    }
                     });
    +
                     ruleSetIdx += 1;
    +
                     if (cb) {
                         cb(totalFilesLinting);  // eslint-disable-line callback-return
                     }
                 });
    +
                 // Deallocate for GC
                 sourceCodes[filename] = null;
             });
    @@ -312,8 +345,11 @@ Registry.prototype = {
      */
     function extendFromRecommended(config) {
         var newConfig = lodash.assign({}, config);
    +
    +    ConfigOps.normalizeToStrings(newConfig);
    +
         var recRules = Object.keys(recConfig.rules).filter(function(ruleId) {
    -        return (recConfig.rules[ruleId] === 2 || recConfig.rules[ruleId][0] === 2);
    +        return ConfigOps.isErrorSeverity(recConfig.rules[ruleId]);
         });
     
         recRules.forEach(function(ruleId) {
    diff --git a/tools/eslint/lib/config/config-file.js b/tools/eslint/lib/config/config-file.js
    index beb97c72a48adf..51a81c733163ca 100644
    --- a/tools/eslint/lib/config/config-file.js
    +++ b/tools/eslint/lib/config/config-file.js
    @@ -1,10 +1,10 @@
     /**
      * @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";
     
     //------------------------------------------------------------------------------
    @@ -17,11 +17,14 @@ var debug = require("debug"),
         ConfigOps = require("./config-ops"),
         validator = require("./config-validator"),
         Plugins = require("./plugins"),
    -    resolveModule = require("resolve"),
    +    pathUtil = require("../util/path-util"),
    +    ModuleResolver = require("../util/module-resolver"),
         pathIsInside = require("path-is-inside"),
         stripComments = require("strip-json-comments"),
         stringify = require("json-stable-stringify"),
    -    isAbsolutePath = require("path-is-absolute");
    +    isAbsolutePath = require("path-is-absolute"),
    +    defaultOptions = require("../../conf/eslint.json"),
    +    requireUncached = require("require-uncached");
     
     
     //------------------------------------------------------------------------------
    @@ -54,6 +57,8 @@ var CONFIG_FILES = [
         "package.json"
     ];
     
    +var resolver = new ModuleResolver();
    +
     debug = debug("eslint:config-file");
     
     /**
    @@ -92,6 +97,7 @@ function loadYAMLConfigFile(filePath) {
         var yaml = require("js-yaml");
     
         try {
    +
             // empty YAML file can be null, so always use
             return yaml.safeLoad(readFile(filePath)) || {};
         } catch (e) {
    @@ -152,7 +158,7 @@ function loadLegacyConfigFile(filePath) {
     function loadJSConfigFile(filePath) {
         debug("Loading JS config file: " + filePath);
         try {
    -        return require(filePath);
    +        return requireUncached(filePath);
         } catch (e) {
             debug("Error reading JavaScript file: " + filePath);
             e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
    @@ -186,9 +192,8 @@ function loadPackageJSONConfigFile(filePath) {
      * @private
      */
     function loadConfigFile(file) {
    -    var config;
    -
    -    var filePath = file.filePath;
    +    var config,
    +        filePath = file.filePath;
     
         switch (path.extname(filePath)) {
             case ".js":
    @@ -232,6 +237,7 @@ function writeJSONConfigFile(config, filePath) {
         debug("Writing JSON config file: " + filePath);
     
         var content = stringify(config, {cmp: sortByKey, space: 4});
    +
         fs.writeFileSync(filePath, content, "utf8");
     }
     
    @@ -249,6 +255,7 @@ function writeYAMLConfigFile(config, filePath) {
         var yaml = require("js-yaml");
     
         var content = yaml.safeDump(config, {sortKeys: true});
    +
         fs.writeFileSync(filePath, content, "utf8");
     }
     
    @@ -263,6 +270,7 @@ 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");
     }
     
    @@ -295,24 +303,42 @@ function write(config, filePath) {
     }
     
     /**
    - * Determines the lookup path for node packages referenced in a config file.
    - * If the config
    + * Determines the base directory for node packages referenced in a config file.
    + * This does not include node_modules in the path so it can be used for all
    + * references relative to a config file.
      * @param {string} configFilePath The config file referencing the file.
    - * @returns {string} The lookup path for the file path.
    + * @returns {string} The base directory for the file path.
      * @private
      */
    -function getLookupPath(configFilePath) {
    +function getBaseDir(configFilePath) {
     
         // calculates the path of the project including ESLint as dependency
         var projectPath = path.resolve(__dirname, "../../../");
    +
         if (configFilePath && pathIsInside(configFilePath, projectPath)) {
    +
             // be careful of https://github.com/substack/node-resolve/issues/78
    -        return path.resolve(configFilePath);
    +        return path.join(path.resolve(configFilePath));
         }
     
    -    // default to ESLint project path since it's unlikely that plugins will be
    -    // in this directory
    -    return projectPath;
    +    /*
    +     * default to ESLint project path since it's unlikely that plugins will be
    +     * in this directory
    +     */
    +    return path.join(projectPath);
    +}
    +
    +/**
    + * Determines the lookup path, including node_modules, for package
    + * references relative to a config file.
    + * @param {string} configFilePath The config file referencing the file.
    + * @returns {string} The lookup path for the file path.
    + * @private
    + */
    +function getLookupPath(configFilePath) {
    +    var basedir = getBaseDir(configFilePath);
    +
    +    return path.join(basedir, "node_modules");
     }
     
     /**
    @@ -320,11 +346,12 @@ function getLookupPath(configFilePath) {
      * @param {Object} config The configuration information.
      * @param {string} filePath The file path from which the configuration information
      *      was loaded.
    + * @param {string} [relativeTo] The path to resolve relative to.
      * @returns {Object} A new configuration object with all of the "extends" fields
      *      loaded and merged.
      * @private
      */
    -function applyExtends(config, filePath) {
    +function applyExtends(config, filePath, relativeTo) {
         var configExtends = config.extends;
     
         // normalize into an array for easier handling
    @@ -336,12 +363,18 @@ function applyExtends(config, filePath) {
         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
    +
    +            /*
    +             * 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.
    +
    +            /*
    +             * 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
    @@ -350,11 +383,15 @@ function applyExtends(config, filePath) {
     
             try {
                 debug("Loading " + parentPath);
    -            return ConfigOps.merge(load(parentPath), previousValue);
    +            return ConfigOps.merge(load(parentPath, false, relativeTo), previousValue);
             } catch (e) {
    -            // If the file referenced by `extends` failed to load, add the path to the
    -            // configuration file that referenced it to the error message so the user is
    -            // able to see where it was referenced from, then re-throw
    +
    +            /*
    +             * 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;
             }
    @@ -372,16 +409,33 @@ function applyExtends(config, filePath) {
      * @private
      */
     function normalizePackageName(name, prefix) {
    +
    +    /*
    +     * On Windows, name can come in with Windows slashes instead of Unix slashes.
    +     * Normalize to Unix first to avoid errors later on.
    +     * https://github.com/eslint/eslint/issues/5644
    +     */
    +    if (name.indexOf("\\") > -1) {
    +        name = pathUtil.convertPathToPosix(name);
    +    }
    +
         if (name.charAt(0) === "@") {
    -        // it's a scoped package
    -        // package name is "eslint-config", or just a username
    +
    +        /*
    +         * 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
    +
    +            /*
    +             * 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) {
    @@ -400,21 +454,23 @@ function normalizePackageName(name, prefix) {
      * @private
      */
     function resolve(filePath, relativeTo) {
    -
         if (isFilePath(filePath)) {
             return { filePath: path.resolve(relativeTo || "", filePath) };
         } else {
    +        var normalizedPackageName;
    +
             if (filePath.indexOf("plugin:") === 0) {
                 var packagePath = filePath.substr(7, filePath.lastIndexOf("/") - 7);
                 var configName = filePath.substr(filePath.lastIndexOf("/") + 1, filePath.length - filePath.lastIndexOf("/") - 1);
    -            filePath = resolveModule.sync(normalizePackageName(packagePath, "eslint-plugin"), {
    -                basedir: getLookupPath(relativeTo)
    -            });
    +
    +            normalizedPackageName = normalizePackageName(packagePath, "eslint-plugin");
    +            debug("Attempting to resolve " + normalizedPackageName);
    +            filePath = resolver.resolve(normalizedPackageName, getLookupPath(relativeTo));
                 return { filePath: filePath, configName: configName };
             } else {
    -            filePath = resolveModule.sync(normalizePackageName(filePath, "eslint-config"), {
    -                basedir: getLookupPath(relativeTo)
    -            });
    +            normalizedPackageName = normalizePackageName(filePath, "eslint-config");
    +            debug("Attempting to resolve " + normalizedPackageName);
    +            filePath = resolver.resolve(normalizedPackageName, getLookupPath(relativeTo));
                 return { filePath: filePath };
             }
         }
    @@ -426,12 +482,15 @@ function resolve(filePath, relativeTo) {
      * @param {string} filePath The filename or package name to load the configuration
      *      information from.
      * @param {boolean} [applyEnvironments=false] Set to true to merge in environment settings.
    + * @param {string} [relativeTo] The path to resolve relative to.
      * @returns {Object} The configuration information.
      * @private
      */
    -function load(filePath, applyEnvironments) {
    -
    -    var resolvedPath = resolve(filePath),
    +function load(filePath, applyEnvironments, relativeTo) {
    +    var resolvedPath = resolve(filePath, relativeTo),
    +        dirname = path.dirname(resolvedPath.filePath),
    +        basedir = getBaseDir(dirname),
    +        lookupPath = getLookupPath(dirname),
             config = loadConfigFile(resolvedPath);
     
         if (config) {
    @@ -441,23 +500,33 @@ function load(filePath, applyEnvironments) {
                 Plugins.loadAll(config.plugins);
             }
     
    +        // remove parser from config if it is the default parser
    +        if (config.parser === defaultOptions.parser) {
    +            config.parser = null;
    +        }
    +
             // include full path of parser if present
             if (config.parser) {
    -            config.parser = resolveModule.sync(config.parser, {
    -                basedir: getLookupPath(path.dirname(path.resolve(filePath)))
    -            });
    +            if (isFilePath(config.parser)) {
    +                config.parser = path.resolve(basedir || "", config.parser);
    +            } else {
    +                config.parser = resolver.resolve(config.parser, lookupPath);
    +            }
             }
     
             // validate the configuration before continuing
             validator.validate(config, filePath);
     
    -        // If an `extends` property is defined, it represents a configuration file to use as
    -        // a "parent". Load the referenced file and merge the configuration recursively.
    +        /*
    +         * If 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);
    +            config = applyExtends(config, filePath, basedir);
             }
     
             if (config.env && applyEnvironments) {
    +
                 // Merge in environment-specific globals and parserOptions.
                 config = ConfigOps.applyEnvironments(config);
             }
    @@ -473,11 +542,13 @@ function load(filePath, applyEnvironments) {
     
     module.exports = {
     
    +    getBaseDir: getBaseDir,
         getLookupPath: getLookupPath,
         load: load,
         resolve: resolve,
         write: write,
         applyExtends: applyExtends,
    +    normalizePackageName: normalizePackageName,
         CONFIG_FILES: CONFIG_FILES,
     
         /**
    diff --git a/tools/eslint/lib/config/config-initializer.js b/tools/eslint/lib/config/config-initializer.js
    index ffa0a406dc6a68..3d0e78fefe1140 100644
    --- a/tools/eslint/lib/config/config-initializer.js
    +++ b/tools/eslint/lib/config/config-initializer.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Config initialization wizard.
      * @author Ilya Volodin
    - * @copyright 2015 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -17,6 +16,7 @@ var util = require("util"),
         ProgressBar = require("progress"),
         autoconfig = require("./autoconfig.js"),
         ConfigFile = require("./config-file"),
    +    ConfigOps = require("./config-ops"),
         getSourceCodeOfFiles = require("../util/source-code-util").getSourceCodeOfFiles,
         npmUtil = require("../util/npm-util"),
         recConfig = require("../../conf/eslint.json"),
    @@ -39,6 +39,7 @@ function writeFile(config, format) {
     
         // default is .js
         var extname = ".js";
    +
         if (format === "YAML") {
             extname = ".yml";
         } else if (format === "JSON") {
    @@ -48,6 +49,10 @@ function writeFile(config, format) {
     
         ConfigFile.write(config, "./.eslintrc" + extname);
         log.info("Successfully created .eslintrc" + extname + " file in " + process.cwd());
    +
    +    if (config.installedESLint) {
    +        log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.");
    +    }
     }
     
     /**
    @@ -74,12 +79,24 @@ function installModules(config) {
         if (modules.length === 0) {
             return;
         }
    +
    +    // Add eslint to list in case user does not have it installed locally
    +    modules.unshift("eslint");
    +
         installStatus = npmUtil.checkDevDeps(modules);
     
         // Install packages which aren't already installed
         modulesToInstall = Object.keys(installStatus).filter(function(module) {
    -        return installStatus[module] === false;
    +        var notInstalled = installStatus[module] === false;
    +
    +        if (module === "eslint" && notInstalled) {
    +            log.info("Local ESLint installation not found.");
    +            config.installedESLint = true;
    +        }
    +
    +        return notInstalled;
         });
    +
         if (modulesToInstall.length > 0) {
             log.info("Installing " + modulesToInstall.join(", "));
             npmUtil.installSyncSaveDev(modulesToInstall);
    @@ -148,12 +165,14 @@ function configureRules(answers, config) {
     
         // 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);
    +        return ConfigOps.isErrorSeverity(recConfig.rules[ruleId]);
         });
     
         // Find and disable rules which had no error-free configuration
         failingRegistry = registry.getFailingRulesRegistry();
    +
         Object.keys(failingRegistry.rules).forEach(function(ruleId) {
    +
             // If the rule is recommended, set it to error, otherwise disable it
             disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0;
         });
    @@ -184,8 +203,9 @@ function configureRules(answers, config) {
         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) {
    +    var finalRuleIds = Object.keys(newConfig.rules),
    +        totalRules = finalRuleIds.length;
    +    var enabledRules = finalRuleIds.filter(function(ruleId) {
             return (newConfig.rules[ruleId] !== 0);
         }).length;
         var resultMessage = [
    @@ -193,7 +213,10 @@ function configureRules(answers, config) {
             "rules based on " + fileQty,
             "file" + ((fileQty === 1) ? "." : "s.")
         ].join(" ");
    +
         log.info(resultMessage);
    +
    +    ConfigOps.normalizeToStrings(newConfig);
         return newConfig;
     }
     
    @@ -230,10 +253,10 @@ function processAnswers(answers) {
     
         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"];
    +        config.rules.indent = ["error", answers.indent];
    +        config.rules.quotes = ["error", answers.quotes];
    +        config.rules["linebreak-style"] = ["error", answers.linebreak];
    +        config.rules.semi = ["error", answers.semi ? "always" : "never"];
         }
     
         installModules(config);
    @@ -242,6 +265,8 @@ function processAnswers(answers) {
             config = configureRules(answers, config);
             config = autoconfig.extendFromRecommended(config);
         }
    +
    +    ConfigOps.normalizeToStrings(config);
         return config;
     }
     
    @@ -256,6 +281,7 @@ function getConfigForStyleGuide(guide) {
             airbnb: {extends: "airbnb", plugins: ["react"]},
             standard: {extends: "standard", plugins: ["standard"]}
         };
    +
         if (!guides[guide]) {
             throw new Error("You referenced an unsupported guide.");
         }
    @@ -273,6 +299,7 @@ function getConfigForStyleGuide(guide) {
      */
     function promptUser(callback) {
         var config;
    +
         inquirer.prompt([
             {
                 type: "list",
    @@ -354,7 +381,7 @@ function promptUser(callback) {
                     name: "env",
                     message: "Where will your code run?",
                     default: ["browser"],
    -                choices: [{name: "Node", value: "node"}, {name: "Browser", value: "browser"}]
    +                choices: [{name: "Browser", value: "browser"}, {name: "Node", value: "node"}]
                 },
                 {
                     type: "confirm",
    @@ -387,11 +414,8 @@ function promptUser(callback) {
                 // 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);
    @@ -408,7 +432,7 @@ function promptUser(callback) {
                         type: "list",
                         name: "indent",
                         message: "What style of indentation do you use?",
    -                    default: "tabs",
    +                    default: "tab",
                         choices: [{name: "Tabs", value: "tab"}, {name: "Spaces", value: 4}]
                     },
                     {
    @@ -441,6 +465,7 @@ function promptUser(callback) {
                 ], function(answers) {
                     try {
                         var totalAnswers = lodash.assign({}, earlyAnswers, secondAnswers, answers);
    +
                         config = processAnswers(totalAnswers);
                         installModules(config);
                         writeFile(config, answers.format);
    diff --git a/tools/eslint/lib/config/config-ops.js b/tools/eslint/lib/config/config-ops.js
    index 4e36563c1db1f1..727d3afa049b5d 100644
    --- a/tools/eslint/lib/config/config-ops.js
    +++ b/tools/eslint/lib/config/config-ops.js
    @@ -2,8 +2,6 @@
      * @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";
     
    @@ -21,6 +19,12 @@ var lodash = require("lodash"),
     
     debug = debug("eslint:config-ops");
     
    +var RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
    +    RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce(function(map, value, index) {
    +        map[value] = index;
    +        return map;
    +    }, {});
    +
     //------------------------------------------------------------------------------
     // Public Interface
     //------------------------------------------------------------------------------
    @@ -99,6 +103,7 @@ module.exports = {
          * @returns {Object} merged config object.
          */
         merge: function deepmerge(target, src, combine, isRule) {
    +
             /*
              The MIT License (MIT)
     
    @@ -122,7 +127,12 @@ module.exports = {
              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.
    +
    +        /*
    +         * 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 && [] || {};
     
    @@ -130,7 +140,9 @@ module.exports = {
             isRule = !!isRule;
             if (array) {
                 target = target || [];
    -            if (isRule && src.length > 1) {
    +
    +            // src could be a string, so check for array
    +            if (isRule && Array.isArray(src) && src.length > 1) {
                     dst = dst.concat(src);
                 } else {
                     dst = dst.concat(target);
    @@ -176,7 +188,66 @@ module.exports = {
             }
     
             return dst;
    -    }
    +    },
    +
    +    /**
    +     * Converts new-style severity settings (off, warn, error) into old-style
    +     * severity settings (0, 1, 2) for all rules. Assumption is that severity
    +     * values have already been validated as correct.
    +     * @param {Object} config The config object to normalize.
    +     * @returns {void}
    +     */
    +    normalize: function(config) {
    +
    +        if (config.rules) {
    +            Object.keys(config.rules).forEach(function(ruleId) {
    +                var ruleConfig = config.rules[ruleId];
    +
    +                if (typeof ruleConfig === "string") {
    +                    config.rules[ruleId] = RULE_SEVERITY[ruleConfig.toLowerCase()] || 0;
    +                } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "string") {
    +                    ruleConfig[0] = RULE_SEVERITY[ruleConfig[0].toLowerCase()] || 0;
    +                }
    +            });
    +        }
    +    },
     
    +    /**
    +     * Converts old-style severity settings (0, 1, 2) into new-style
    +     * severity settings (off, warn, error) for all rules. Assumption is that severity
    +     * values have already been validated as correct.
    +     * @param {Object} config The config object to normalize.
    +     * @returns {void}
    +     */
    +    normalizeToStrings: function(config) {
    +
    +        if (config.rules) {
    +            Object.keys(config.rules).forEach(function(ruleId) {
    +                var ruleConfig = config.rules[ruleId];
    +
    +                if (typeof ruleConfig === "number") {
    +                    config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
    +                } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
    +                    ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
    +                }
    +            });
    +        }
    +    },
    +
    +    /**
    +     * Determines if the severity for the given rule configuration represents an error.
    +     * @param {int|string|Array} ruleConfig The configuration for an individual rule.
    +     * @returns {boolean} True if the rule represents an error, false if not.
    +     */
    +    isErrorSeverity: function(ruleConfig) {
    +
    +        var severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
    +
    +        if (typeof severity === "string") {
    +            severity = RULE_SEVERITY[severity.toLowerCase()] || 0;
    +        }
    +
    +        return (typeof severity === "number" && severity === 2);
    +    }
     
     };
    diff --git a/tools/eslint/lib/config/config-rule.js b/tools/eslint/lib/config/config-rule.js
    index 72ad88a73e1c44..c0a394efee10fd 100644
    --- a/tools/eslint/lib/config/config-rule.js
    +++ b/tools/eslint/lib/config/config-rule.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -44,6 +42,7 @@ function explodeArray(xs) {
      */
     function combineArrays(arr1, arr2) {
         var res = [];
    +
         if (arr1.length === 0) {
             return explodeArray(arr2);
         }
    @@ -81,9 +80,11 @@ function combineArrays(arr1, arr2) {
     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];
         });
    @@ -144,6 +145,7 @@ function groupByProperty(objects) {
      */
     function combinePropertyObjects(objArr1, objArr2) {
         var res = [];
    +
         if (objArr1.length === 0) {
             return objArr2;
         }
    @@ -155,6 +157,7 @@ function combinePropertyObjects(objArr1, objArr2) {
                 var combinedObj = {};
                 var obj1Props = Object.keys(obj1);
                 var obj2Props = Object.keys(obj2);
    +
                 obj1Props.forEach(function(prop1) {
                     combinedObj[prop1] = obj1[prop1];
                 });
    @@ -201,10 +204,12 @@ RuleConfigSet.prototype = {
         */
         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);
         },
    @@ -228,6 +233,7 @@ RuleConfigSet.prototype = {
                 objectConfigs: [],
                 add: function(property, values) {
                     var optionObj;
    +
                     for (var idx = 0; idx < values.length; idx++) {
                         optionObj = {};
                         optionObj[property] = values[idx];
    @@ -241,8 +247,11 @@ RuleConfigSet.prototype = {
                     }, []);
                 }
             };
    -        // The object schema could have multiple independent properties.
    -        // If any contain enums or booleans, they can be added and then combined
    +
    +        /*
    +         * 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);
    @@ -266,15 +275,19 @@ RuleConfigSet.prototype = {
     */
     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
                 }
             });
    @@ -289,9 +302,11 @@ function generateConfigsFromSchema(schema) {
     */
     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;
         }, {});
    diff --git a/tools/eslint/lib/config/config-validator.js b/tools/eslint/lib/config/config-validator.js
    index 852a5dce0ecabf..ebc70516c195d5 100644
    --- a/tools/eslint/lib/config/config-validator.js
    +++ b/tools/eslint/lib/config/config-validator.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Validates configs.
      * @author Brandon Mills
    - * @copyright 2015 Brandon Mills
    - * See LICENSE file in root directory for full license.
      */
     
     "use strict";
    @@ -13,7 +11,8 @@
     
     var rules = require("../rules"),
         Environments = require("./environments"),
    -    schemaValidator = require("is-my-json-valid");
    +    schemaValidator = require("is-my-json-valid"),
    +    util = require("util");
     
     var validators = {
         rules: Object.create(null)
    @@ -36,16 +35,16 @@ function getRuleOptionsSchema(id) {
         if (Array.isArray(schema)) {
             if (schema.length) {
                 return {
    -                "type": "array",
    -                "items": schema,
    -                "minItems": 0,
    -                "maxItems": schema.length
    +                type: "array",
    +                items: schema,
    +                minItems: 0,
    +                maxItems: schema.length
                 };
             } else {
                 return {
    -                "type": "array",
    -                "minItems": 0,
    -                "maxItems": 0
    +                type: "array",
    +                minItems: 0,
    +                maxItems: 0
                 };
             }
         }
    @@ -83,7 +82,10 @@ function validateRuleOptions(id, options, source) {
             localOptions = [];
         }
     
    -    validSeverity = (severity === 0 || severity === 1 || severity === 2);
    +    validSeverity = (
    +        severity === 0 || severity === 1 || severity === 2 ||
    +        (typeof severity === "string" && /^(?:off|warn|error)$/i.test(severity))
    +    );
     
         if (validateRule) {
             validateRule(localOptions);
    @@ -97,7 +99,10 @@ function validateRuleOptions(id, options, source) {
     
             if (!validSeverity) {
                 message.push(
    -                "\tSeverity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed \"", severity, "\").\n");
    +                "\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '",
    +                util.inspect(severity).replace(/'/g, "\"").replace(/\n/g, ""),
    +                "').\n"
    +            );
             }
     
             if (validateRule && validateRule.errors) {
    @@ -136,6 +141,7 @@ function validateEnvironment(environment, source) {
                         source, ":\n",
                         "\tEnvironment key \"", env, "\" is unknown\n"
                     ];
    +
                     throw new Error(message.join(""));
                 }
             });
    diff --git a/tools/eslint/lib/config/environments.js b/tools/eslint/lib/config/environments.js
    index 6470eec1b38bc8..e7711836e51419 100644
    --- a/tools/eslint/lib/config/environments.js
    +++ b/tools/eslint/lib/config/environments.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    diff --git a/tools/eslint/lib/config/plugins.js b/tools/eslint/lib/config/plugins.js
    index 7281e48eabfc39..e157eb123c9df5 100644
    --- a/tools/eslint/lib/config/plugins.js
    +++ b/tools/eslint/lib/config/plugins.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -117,6 +115,10 @@ module.exports = {
                 } catch (err) {
                     debug("Failed to load plugin eslint-plugin-" + pluginNameWithoutPrefix + ". Proceeding without it.");
                     err.message = "Failed to load plugin " + pluginName + ": " + err.message;
    +                err.messageTemplate = "plugin-missing";
    +                err.messageData = {
    +                    pluginName: pluginNameWithoutPrefix
    +                };
                     throw err;
                 }
     
    diff --git a/tools/eslint/lib/eslint.js b/tools/eslint/lib/eslint.js
    index 36e0970f74c648..3a52bb3af1825d 100644
    --- a/tools/eslint/lib/eslint.js
    +++ b/tools/eslint/lib/eslint.js
    @@ -1,9 +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";
     
     //------------------------------------------------------------------------------
    @@ -11,7 +10,7 @@
     //------------------------------------------------------------------------------
     
     var lodash = require("lodash"),
    -    estraverse = require("./util/estraverse"),
    +    Traverser = require("./util/traverser"),
         escope = require("escope"),
         Environments = require("./config/environments"),
         blankScriptAST = require("../conf/blank-script.json"),
    @@ -43,16 +42,20 @@ var DEFAULT_PARSER = require("../conf/eslint.json").parser;
      */
     function parseBooleanConfig(string, comment) {
         var items = {};
    +
         // Collapse whitespace around : to make parsing easier
         string = string.replace(/\s*:\s*/g, ":");
    +
         // Collapse whitespace around ,
         string = string.replace(/\s*,\s*/g, ",");
    +
         string.split(/\s|,+/).forEach(function(name) {
             if (!name) {
                 return;
             }
             var pos = name.indexOf(":"),
                 value;
    +
             if (pos !== -1) {
                 value = name.substring(pos + 1, name.length);
                 name = name.substring(0, pos);
    @@ -76,6 +79,7 @@ function parseBooleanConfig(string, comment) {
      */
     function parseJsonConfig(string, location, messages) {
         var items = {};
    +
         string = string.replace(/([a-zA-Z0-9\-\/]+):/g, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/, "$1,");
         try {
             items = JSON.parse("{" + string + "}");
    @@ -103,8 +107,10 @@ function parseJsonConfig(string, location, messages) {
      */
     function parseListConfig(string) {
         var items = {};
    +
         // Collapse whitespace around ,
         string = string.replace(/\s*,\s*/g, ",");
    +
         string.split(/,+/).forEach(function(name) {
             name = name.trim();
             if (!name) {
    @@ -136,6 +142,7 @@ function addDeclaredGlobals(program, globalScope, config) {
             if (config.env[name]) {
                 var env = Environments.get(name),
                     environmentGlobals = env && env.globals;
    +
                 if (environmentGlobals) {
                     lodash.assign(declaredGlobals, environmentGlobals);
                 }
    @@ -148,6 +155,7 @@ function addDeclaredGlobals(program, globalScope, config) {
     
         Object.keys(declaredGlobals).forEach(function(name) {
             var variable = globalScope.set.get(name);
    +
             if (!variable) {
                 variable = new escope.Variable(name, globalScope);
                 variable.eslintExplicitGlobal = false;
    @@ -159,6 +167,7 @@ function addDeclaredGlobals(program, globalScope, config) {
     
         Object.keys(explicitGlobals).forEach(function(name) {
             var variable = globalScope.set.get(name);
    +
             if (!variable) {
                 variable = new escope.Variable(name, globalScope);
                 variable.eslintExplicitGlobal = true;
    @@ -172,23 +181,33 @@ function addDeclaredGlobals(program, globalScope, config) {
         // 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.
    +    /*
    +     * "through" contains all references which definitions cannot be found.
    +     * Since we augment the global scope using configuration, we need to update
    +     * references and remove the ones that were added by configuration.
    +     */
         globalScope.through = globalScope.through.filter(function(reference) {
             var name = reference.identifier.name;
             var variable = globalScope.set.get(name);
    +
             if (variable) {
    -            // Links the variable and the reference.
    -            // And this reference is removed from `Scope#through`.
    +
    +            /*
    +             * 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;
         });
     }
    @@ -234,15 +253,17 @@ function enableReporting(reportingConfig, start, rulesToEnable) {
         if (rulesToEnable.length) {
             rulesToEnable.forEach(function(rule) {
                 for (i = reportingConfig.length - 1; i >= 0; i--) {
    -                if (!reportingConfig[i].end && reportingConfig[i].rule === rule ) {
    +                if (!reportingConfig[i].end && reportingConfig[i].rule === rule) {
                         reportingConfig[i].end = start;
                         break;
                     }
                 }
             });
         } else {
    +
             // find all previous disabled locations if they was started as list of rules
             var prevStart;
    +
             for (i = reportingConfig.length - 1; i >= 0; i--) {
                 if (prevStart && prevStart !== reportingConfig[i].start) {
                     break;
    @@ -280,7 +301,7 @@ 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|exported|globals?)(\s|$)/.exec(value);
    +        var match = /^(eslint(-\w+){0,3}|exported|globals?)(\s|$)/.exec(value);
     
             if (match) {
                 value = value.substring(match.index + match[1].length);
    @@ -310,8 +331,10 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
     
                         case "eslint":
                             var items = parseJsonConfig(value, comment.loc, messages);
    +
                             Object.keys(items).forEach(function(name) {
                                 var ruleValue = items[name];
    +
                                 validator.validateRuleOptions(name, ruleValue, filename + " line " + comment.loc.start.line);
                                 commentRules[name] = ruleValue;
                             });
    @@ -319,11 +342,13 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
     
                         // no default
                     }
    -            } else {
    -                // comment.type === "Line"
    +            } else {        // comment.type === "Line"
                     if (match[1] === "eslint-disable-line") {
    -                    disableReporting(reportingConfig, { "line": comment.loc.start.line, "column": 0 }, Object.keys(parseListConfig(value)));
    +                    disableReporting(reportingConfig, { line: comment.loc.start.line, column: 0 }, Object.keys(parseListConfig(value)));
                         enableReporting(reportingConfig, comment.loc.end, Object.keys(parseListConfig(value)));
    +                } else if (match[1] === "eslint-disable-next-line") {
    +                    disableReporting(reportingConfig, comment.loc.start, Object.keys(parseListConfig(value)));
    +                    enableReporting(reportingConfig, { line: comment.loc.start.line + 2 }, Object.keys(parseListConfig(value)));
                     }
                 }
             }
    @@ -332,6 +357,7 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
         // apply environment configs
         Object.keys(commentConfig.env).forEach(function(name) {
             var env = Environments.get(name);
    +
             if (env) {
                 commentConfig = ConfigOps.merge(commentConfig, env);
             }
    @@ -353,6 +379,7 @@ function isDisabledByReportingConfig(reportingConfig, ruleId, location) {
         for (var i = 0, c = reportingConfig.length; i < c; i++) {
     
             var ignore = reportingConfig[i];
    +
             if ((!ignore.rule || ignore.rule === ruleId) &&
                 (location.line > ignore.start.line || (location.line === ignore.start.line && location.column >= ignore.start.column)) &&
                 (!ignore.end || (location.line < ignore.end.line || (location.line === ignore.end.line && location.column <= ignore.end.column)))) {
    @@ -380,6 +407,7 @@ function prepareConfig(config) {
         if (typeof config.rules === "object") {
             Object.keys(config.rules).forEach(function(k) {
                 var rule = config.rules[k];
    +
                 if (rule === null) {
                     throw new Error("Invalid config for rule '" + k + "'\.");
                 }
    @@ -395,6 +423,7 @@ function prepareConfig(config) {
         if (typeof config.env === "object") {
             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);
                 }
    @@ -418,7 +447,7 @@ function prepareConfig(config) {
             // can't have global return inside of modules
             preparedConfig.parserOptions.ecmaFeatures.globalReturn = false;
     
    -        // also need at least ES6 six for modules
    +        // also need at least ES6 for modules
             if (!preparedConfig.parserOptions.ecmaVersion || preparedConfig.parserOptions.ecmaVersion < 6) {
                 preparedConfig.parserOptions.ecmaVersion = 6;
             }
    @@ -462,8 +491,10 @@ function createStubRule(message) {
     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;
     }
     
    @@ -478,6 +509,7 @@ function findEslintEnv(text) {
         var match, retv;
     
         eslintEnvPattern.lastIndex = 0;
    +
         while ((match = eslintEnvPattern.exec(text))) {
             retv = lodash.assign(retv || {}, parseListConfig(match[1]));
         }
    @@ -492,9 +524,12 @@ function findEslintEnv(text) {
      * @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
    +
    +    /*
    +     * 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);
         }
    @@ -518,7 +553,7 @@ module.exports = (function() {
             scopeMap = null,
             scopeManager = null,
             currentFilename = null,
    -        controller = null,
    +        traverser = null,
             reportingConfig = [],
             sourceCode = null;
     
    @@ -636,7 +671,7 @@ module.exports = (function() {
             currentScopes = null;
             scopeMap = null;
             scopeManager = null;
    -        controller = null;
    +        traverser = null;
             reportingConfig = [];
             sourceCode = null;
         };
    @@ -689,6 +724,7 @@ module.exports = (function() {
     
             // search and apply "eslint-env *".
             var envInFile = findEslintEnv(text || textOrSourceCode.text);
    +
             if (envInFile) {
                 if (!config || !config.env) {
                     config = lodash.assign({}, config || {}, {env: envInFile});
    @@ -703,6 +739,7 @@ module.exports = (function() {
     
             // 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);
    @@ -734,6 +771,9 @@ module.exports = (function() {
                     config = modifyConfigsFromComments(currentFilename, ast, config, reportingConfig, messages);
                 }
     
    +            // ensure that severities are normalized in the config
    +            ConfigOps.normalize(config);
    +
                 // enable appropriate rules
                 Object.keys(config.rules).filter(function(key) {
                     return getRuleSeverity(config.rules[key]) > 0;
    @@ -744,8 +784,10 @@ module.exports = (function() {
                         rule;
     
                     ruleCreator = rules.get(key);
    +
                     if (!ruleCreator) {
                         var replacementMsg = getRuleReplacementMessage(key);
    +
                         if (replacementMsg) {
                             ruleCreator = createStubRule(replacementMsg);
                         } else {
    @@ -761,6 +803,7 @@ module.exports = (function() {
                         var ruleContext = new RuleContext(
                             key, api, severity, options,
                             config.settings, config.parserOptions, config.parser, ruleCreator.meta);
    +
                         rule = ruleCreator.create ? ruleCreator.create(ruleContext) :
                             ruleCreator(ruleContext);
     
    @@ -779,19 +822,21 @@ module.exports = (function() {
     
                 // save config so rules can access as necessary
                 currentConfig = config;
    -            controller = new estraverse.Controller();
    +            traverser = new Traverser();
     
                 ecmaFeatures = currentConfig.parserOptions.ecmaFeatures || {};
                 ecmaVersion = currentConfig.parserOptions.ecmaVersion || 5;
     
    -            // gather data that may be needed by the rules
    +            // gather scope data that may be needed by the rules
                 scopeManager = escope.analyze(ast, {
                     ignoreEval: true,
                     nodejsScope: ecmaFeatures.globalReturn,
                     impliedStrict: ecmaFeatures.impliedStrict,
                     ecmaVersion: ecmaVersion,
    -                sourceType: currentConfig.parserOptions.sourceType || "script"
    +                sourceType: currentConfig.parserOptions.sourceType || "script",
    +                fallback: Traverser.getKeys
                 });
    +
                 currentScopes = scopeManager.scopes;
     
                 /*
    @@ -799,11 +844,14 @@ module.exports = (function() {
                  * lookup in getScope.
                  */
                 scopeMap = [];
    +
                 currentScopes.forEach(function(scope, index) {
                     var range = scope.block.range[0];
     
    -                // Sometimes two scopes are returned for a given node. This is
    -                // handled later in a known way, so just don't overwrite here.
    +                /*
    +                 * Sometimes two scopes are returned for a given node. This is
    +                 * handled later in a known way, so just don't overwrite here.
    +                 */
                     if (!scopeMap[range]) {
                         scopeMap[range] = index;
                     }
    @@ -822,15 +870,17 @@ module.exports = (function() {
                 }
     
                 var eventGenerator = new NodeEventGenerator(api);
    +
                 eventGenerator = new CodePathAnalyzer(eventGenerator);
                 eventGenerator = new CommentEventGenerator(eventGenerator, sourceCode);
     
                 /*
    -             * Each node has a type property. Whenever a particular type of node is found,
    -             * an event is fired. This allows any listeners to automatically be informed
    -             * that this type of node has been found and react accordingly.
    +             * Each node has a type property. Whenever a particular type of
    +             * node is found, an event is fired. This allows any listeners to
    +             * automatically be informed that this type of node has been found
    +             * and react accordingly.
                  */
    -            controller.traverse(ast, {
    +            traverser.traverse(ast, {
                     enter: function(node, parent) {
                         node.parent = parent;
                         eventGenerator.enterNode(node);
    @@ -884,6 +934,7 @@ module.exports = (function() {
                 message = location;
                 location = node.loc.start;
             }
    +
             // else, assume location was provided, so node may be omitted
     
             if (isDisabledByReportingConfig(reportingConfig, ruleId, location)) {
    @@ -912,7 +963,7 @@ module.exports = (function() {
             };
     
             // 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)) {
    +        if (fix && Array.isArray(fix.range) && (typeof fix.text === "string") && (!meta || meta.fixable)) {
                 problem.fix = fix;
             }
     
    @@ -966,7 +1017,7 @@ module.exports = (function() {
          * @returns {ASTNode[]} Array of objects representing ancestors.
          */
         api.getAncestors = function() {
    -        return controller.parents();
    +        return traverser.parents();
         };
     
         /**
    @@ -974,14 +1025,15 @@ module.exports = (function() {
          * @returns {Object} An object representing the current node's scope.
          */
         api.getScope = function() {
    -        var parents = controller.parents(),
    +        var parents = traverser.parents(),
                 scope = currentScopes[0];
     
             // Don't do this for Program nodes - they have no parents
             if (parents.length) {
     
                 // if current node introduces a scope, add it to the list
    -            var current = controller.current();
    +            var current = traverser.current();
    +
                 if (currentConfig.parserOptions.ecmaVersion >= 6) {
                     if (["BlockStatement", "SwitchStatement", "CatchClause", "FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"].indexOf(current.type) >= 0) {
                         parents.push(current);
    @@ -1039,7 +1091,7 @@ module.exports = (function() {
                         return true;
                     }
                 }
    -        } while ( (scope = scope.upper) );
    +        } while ((scope = scope.upper));
     
             return false;
         };
    diff --git a/tools/eslint/lib/file-finder.js b/tools/eslint/lib/file-finder.js
    index f0ae19a7875cb2..4dbb7544a37077 100644
    --- a/tools/eslint/lib/file-finder.js
    +++ b/tools/eslint/lib/file-finder.js
    @@ -1,10 +1,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";
     
     //------------------------------------------------------------------------------
    @@ -58,9 +56,11 @@ function FileFinder(files, cwd) {
      */
     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;
                 }
    @@ -103,6 +103,7 @@ FileFinder.prototype.findInDirectoryOrParents = function(directory) {
             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]]) {
    diff --git a/tools/eslint/lib/formatters/compact.js b/tools/eslint/lib/formatters/compact.js
    index f1eb83aec35f39..0c31b073e3fefd 100644
    --- a/tools/eslint/lib/formatters/compact.js
    +++ b/tools/eslint/lib/formatters/compact.js
    @@ -35,6 +35,7 @@ module.exports = function(results) {
         results.forEach(function(result) {
     
             var messages = result.messages;
    +
             total += messages.length;
     
             messages.forEach(function(message) {
    diff --git a/tools/eslint/lib/formatters/html.js b/tools/eslint/lib/formatters/html.js
    index ba6f3e513efa45..da3f7596fd04b6 100644
    --- a/tools/eslint/lib/formatters/html.js
    +++ b/tools/eslint/lib/formatters/html.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview HTML reporter
      * @author Julian Laval
    - * @copyright 2015 Julian Laval. All rights reserved.
      */
     "use strict";
     
    @@ -36,6 +35,7 @@ function pluralize(word, count) {
     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) + ")";
         }
    @@ -64,6 +64,7 @@ function renderColor(totalErrors, totalWarnings) {
      * @returns {string} HTML (table rows) describing the messages.
      */
     function renderMessages(messages, parentIndex) {
    +
         /**
          * Get HTML (table row) describing a message.
          * @param {Object} message Message.
    diff --git a/tools/eslint/lib/formatters/json.js b/tools/eslint/lib/formatters/json.js
    index c1101970efa468..82138af1874855 100644
    --- a/tools/eslint/lib/formatters/json.js
    +++ b/tools/eslint/lib/formatters/json.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview JSON reporter
      * @author Burak Yigit Kaya aka BYK
    - * @copyright 2015 Burak Yigit Kaya. All rights reserved.
      */
     "use strict";
     
    diff --git a/tools/eslint/lib/formatters/junit.js b/tools/eslint/lib/formatters/junit.js
    index 64357263313322..c53fd8141baf5a 100644
    --- a/tools/eslint/lib/formatters/junit.js
    +++ b/tools/eslint/lib/formatters/junit.js
    @@ -45,6 +45,7 @@ module.exports = function(results) {
     
             messages.forEach(function(message) {
                 var type = message.fatal ? "error" : "failure";
    +
                 output += "";
                 output += "<" + type + " message=\"" + lodash.escape(message.message || "") + "\">";
                 output += "
    - * @copyright 2016 Gajus Kuizinas . All rights reserved.
      */
     "use strict";
     
    diff --git a/tools/eslint/lib/formatters/tap.js b/tools/eslint/lib/formatters/tap.js
    index cd9ec0e33a227e..d898e30393ec5e 100644
    --- a/tools/eslint/lib/formatters/tap.js
    +++ b/tools/eslint/lib/formatters/tap.js
    @@ -31,6 +31,7 @@ function getMessageType(message) {
     function outputDiagnostics(diagnostic) {
         var prefix = "  ";
         var output = prefix + "---\n";
    +
         output += prefix + yaml.safeDump(diagnostic).split("\n").join("\n" + prefix);
         output += "...\n";
         return output;
    diff --git a/tools/eslint/lib/formatters/unix.js b/tools/eslint/lib/formatters/unix.js
    index 2782b0cd0e3568..ce429fee25b9ce 100644
    --- a/tools/eslint/lib/formatters/unix.js
    +++ b/tools/eslint/lib/formatters/unix.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview unix-style formatter.
      * @author oshi-shinobu
    - * @copyright 2015 oshi-shinobu. All rights reserved.
      */
     "use strict";
     
    @@ -35,6 +34,7 @@ module.exports = function(results) {
         results.forEach(function(result) {
     
             var messages = result.messages;
    +
             total += messages.length;
     
             messages.forEach(function(message) {
    diff --git a/tools/eslint/lib/formatters/visualstudio.js b/tools/eslint/lib/formatters/visualstudio.js
    index 2d04aaef55d5f9..5d53dde289ed04 100644
    --- a/tools/eslint/lib/formatters/visualstudio.js
    +++ b/tools/eslint/lib/formatters/visualstudio.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -38,6 +36,7 @@ module.exports = function(results) {
         results.forEach(function(result) {
     
             var messages = result.messages;
    +
             total += messages.length;
     
             messages.forEach(function(message) {
    diff --git a/tools/eslint/lib/ignored-paths.js b/tools/eslint/lib/ignored-paths.js
    index 01e56bdc7c26c2..c6a710a9b56757 100644
    --- a/tools/eslint/lib/ignored-paths.js
    +++ b/tools/eslint/lib/ignored-paths.js
    @@ -2,6 +2,7 @@
      * @fileoverview Responsible for loading ignore config files and managing ignore patterns
      * @author Jonathan Rajavuori
      */
    +
     "use strict";
     
     //------------------------------------------------------------------------------
    @@ -12,7 +13,8 @@ var lodash = require("lodash"),
         fs = require("fs"),
         path = require("path"),
         debug = require("debug"),
    -    ignore = require("ignore");
    +    ignore = require("ignore"),
    +    pathUtil = require("./util/path-util");
     
     debug = debug("eslint:ignored-paths");
     
    @@ -23,8 +25,8 @@ debug = debug("eslint:ignored-paths");
     
     var ESLINT_IGNORE_FILENAME = ".eslintignore";
     var DEFAULT_IGNORE_PATTERNS = [
    -    "/node_modules/",
    -    "/bower_components/"
    +    "/node_modules/*",
    +    "/bower_components/*"
     ];
     var DEFAULT_OPTIONS = {
         dotfiles: false,
    @@ -46,59 +48,8 @@ function findIgnoreFile(cwd) {
         cwd = cwd || DEFAULT_OPTIONS.cwd;
     
         var ignoreFilePath = path.resolve(cwd, ESLINT_IGNORE_FILENAME);
    -    return fs.existsSync(ignoreFilePath) ? ignoreFilePath : "";
    -}
    -
    -/**
    - * 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;
    -}
     
    -/**
    - * 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;
    -}
    -
    -/**
    - * Resolves a filepath
    - * @param {string} filepath Path resolve
    - * @param {string} baseDir Base directory to resolve the filepath from
    - * @returns {string} Resolved filepath
    - */
    -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;
    -}
    -
    -/**
    - * 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);
    +    return fs.existsSync(ignoreFilePath) ? ignoreFilePath : "";
     }
     
     /**
    @@ -142,35 +93,40 @@ function IgnoredPaths(options) {
          * @returns {array} raw ignore rules
          */
         function addIgnoreFile(ig, filepath) {
    -        return ig.addIgnoreFile(filepath);
    +        ig.ignoreFiles.push(filepath);
    +        return ig.add(fs.readFileSync(filepath, "utf8"));
         }
     
         this.defaultPatterns = DEFAULT_IGNORE_PATTERNS.concat(options.patterns || []);
    -    this.baseDir = ".";
    +    this.baseDir = options.cwd;
     
         this.ig = {
    -        custom: new ignore.Ignore({
    -            twoGlobstars: true,
    -            ignore: []
    -        }),
    -        default: new ignore.Ignore({
    -            twoGlobstars: true,
    -            ignore: []
    -        })
    +        custom: ignore(),
    +        default: ignore()
         };
     
    +    // Add a way to keep track of ignored files.  This was present in node-ignore
    +    // 2.x, but dropped for now as of 3.0.10.
    +    this.ig.custom.ignoreFiles = [];
    +    this.ig.default.ignoreFiles = [];
    +
         if (options.dotfiles !== true) {
    -        addPattern(this.ig.default, ".*");
    -    }
     
    -    if (options.ignore !== false) {
    +        /*
    +         * ignore files beginning with a dot, but not files in a parent or
    +         * ancestor directory (which in relative format will begin with `../`).
    +         */
    +        addPattern(this.ig.default, [".*", "!../"]);
    +    }
     
    -        addPattern(this.ig.default, this.defaultPatterns);
    +    addPattern(this.ig.default, this.defaultPatterns);
     
    +    if (options.ignore !== false) {
             var ignorePath;
     
             if (options.ignorePattern) {
                 addPattern(this.ig.custom, options.ignorePattern);
    +            addPattern(this.ig.default, options.ignorePattern);
             }
     
             if (options.ignorePath) {
    @@ -198,8 +154,9 @@ function IgnoredPaths(options) {
     
             if (ignorePath) {
                 debug("Adding " + ignorePath);
    -            this.baseDir = path.dirname(ignorePath);
    +            this.baseDir = path.dirname(path.resolve(options.cwd, ignorePath));
                 addIgnoreFile(this.ig.custom, ignorePath);
    +            addIgnoreFile(this.ig.default, ignorePath);
             }
     
         }
    @@ -217,14 +174,15 @@ function IgnoredPaths(options) {
     IgnoredPaths.prototype.contains = function(filepath, category) {
     
         var result = false;
    -    filepath = normalizeAndResolveFilepath(filepath, this.baseDir);
    +    var absolutePath = path.resolve(this.options.cwd, filepath);
    +    var relativePath = pathUtil.getRelativePath(absolutePath, this.options.cwd);
     
         if ((typeof category === "undefined") || (category === "default")) {
    -        result = result || (this.ig.default.filter([filepath]).length === 0);
    +        result = result || (this.ig.default.filter([relativePath]).length === 0);
         }
     
         if ((typeof category === "undefined") || (category === "custom")) {
    -        result = result || (this.ig.custom.filter([filepath]).length === 0);
    +        result = result || (this.ig.custom.filter([relativePath]).length === 0);
         }
     
         return result;
    diff --git a/tools/eslint/lib/load-rules.js b/tools/eslint/lib/load-rules.js
    index 8c0fdd75ce0e93..6691dbba4b350a 100644
    --- a/tools/eslint/lib/load-rules.js
    +++ b/tools/eslint/lib/load-rules.js
    @@ -30,6 +30,7 @@ module.exports = function(rulesDir, cwd) {
         }
     
         var rules = Object.create(null);
    +
         fs.readdirSync(rulesDir).forEach(function(file) {
             if (path.extname(file) !== ".js") {
                 return;
    diff --git a/tools/eslint/lib/logging.js b/tools/eslint/lib/logging.js
    index b5e7260519dc72..3a60879c617923 100644
    --- a/tools/eslint/lib/logging.js
    +++ b/tools/eslint/lib/logging.js
    @@ -1,12 +1,15 @@
     /**
    - * @fileoverview Handle logging for Eslint
    + * @fileoverview Handle logging for ESLint
      * @author Gyandeep Singh
    - * @copyright 2015 Gyandeep Singh. All rights reserved.
      */
    +
     "use strict";
     
    +/* eslint no-console: "off" */
    +
     /* istanbul ignore next */
     module.exports = {
    +
         /**
          * Cover for console.log
          * @returns {void}
    diff --git a/tools/eslint/lib/options.js b/tools/eslint/lib/options.js
    index ba3b7fa2037cac..7d614585810cb9 100644
    --- a/tools/eslint/lib/options.js
    +++ b/tools/eslint/lib/options.js
    @@ -1,8 +1,8 @@
     /**
      * @fileoverview Options configuration for optionator.
      * @author George Zahariev
    - * See LICENSE in root directory for full license.
      */
    +
     "use strict";
     
     //------------------------------------------------------------------------------
    @@ -60,6 +60,11 @@ module.exports = optionator({
                 default: "espree",
                 description: "Specify the parser to be used"
             },
    +        {
    +            option: "parser-options",
    +            type: "Object",
    +            description: "Specify parser options"
    +        },
             {
                 heading: "Caching"
             },
    @@ -168,8 +173,8 @@ module.exports = optionator({
             {
                 option: "color",
                 type: "Boolean",
    -            default: "true",
    -            description: "Disable color in piped output"
    +            alias: "no-color",
    +            description: "Force enabling/disabling of color"
             },
             {
                 heading: "Miscellaneous"
    @@ -202,13 +207,13 @@ module.exports = optionator({
                 option: "version",
                 alias: "v",
                 type: "Boolean",
    -            description: "Outputs the version number"
    +            description: "Output the version number"
             },
             {
                 option: "inline-config",
                 type: "Boolean",
                 default: "true",
    -            description: "Allow comments to change eslint config/rules"
    +            description: "Prevent comments from changing config or rules"
             },
             {
                 option: "print-config",
    diff --git a/tools/eslint/lib/rule-context.js b/tools/eslint/lib/rule-context.js
    index e70ba6686ace5c..88e68abd73e932 100644
    --- a/tools/eslint/lib/rule-context.js
    +++ b/tools/eslint/lib/rule-context.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -73,6 +71,7 @@ var PASSTHROUGHS = [
      * @param {Object} meta The metadata of the rule
      */
     function RuleContext(ruleId, eslint, severity, options, settings, parserOptions, parserPath, meta) {
    +
         // public.
         this.id = ruleId;
         this.options = options;
    @@ -149,9 +148,8 @@ RuleContext.prototype = {
         }
     };
     
    -// copy over passthrough methods
    +// Copy over passthrough methods. All functions will have 5 or fewer parameters.
     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);
         };
    diff --git a/tools/eslint/lib/rules.js b/tools/eslint/lib/rules.js
    index 77fb7749e43145..24a8fd8a497bb9 100644
    --- a/tools/eslint/lib/rules.js
    +++ b/tools/eslint/lib/rules.js
    @@ -39,6 +39,7 @@ function define(ruleId, ruleModule) {
      */
     function load(rulesDir, cwd) {
         var newRules = loadRules(rulesDir, cwd);
    +
         Object.keys(newRules).forEach(function(ruleId) {
             define(ruleId, newRules[ruleId]);
         });
    diff --git a/tools/eslint/lib/rules/accessor-pairs.js b/tools/eslint/lib/rules/accessor-pairs.js
    index 4c8032b8e4dd13..1b91ef2715ae3b 100644
    --- a/tools/eslint/lib/rules/accessor-pairs.js
    +++ b/tools/eslint/lib/rules/accessor-pairs.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag wrapping non-iife in parens
      * @author Gyandeep Singh
    - * @copyright 2015 Gyandeep Singh. All rights reserved.
      */
     
     "use strict";
    @@ -30,6 +29,7 @@ function isIdentifier(node, name) {
      */
     function isArgumentOfMethodCall(node, index, object, property) {
         var parent = node.parent;
    +
         return (
             parent.type === "CallExpression" &&
             parent.callee.type === "MemberExpression" &&
    @@ -46,6 +46,7 @@ function isArgumentOfMethodCall(node, index, object, property) {
      * @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")
    @@ -53,9 +54,12 @@ function isPropertyDescriptor(node) {
             return true;
         }
     
    -    // Object.defineProperties(obj, {foo: {set: ...}})
    -    // Object.create(proto, {foo: {set: ...}})
    +    /*
    +     * 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")
    @@ -74,16 +78,16 @@ module.exports = {
                 recommended: false
             },
             schema: [{
    -            "type": "object",
    -            "properties": {
    -                "getWithoutSet": {
    -                    "type": "boolean"
    +            type: "object",
    +            properties: {
    +                getWithoutSet: {
    +                    type: "boolean"
                     },
    -                "setWithoutGet": {
    -                    "type": "boolean"
    +                setWithoutGet: {
    +                    type: "boolean"
                     }
                 },
    -            "additionalProperties": false
    +            additionalProperties: false
             }]
         },
         create: function(context) {
    @@ -106,6 +110,7 @@ module.exports = {
                     var property = node.properties[i];
     
                     var propToCheck = "";
    +
                     if (property.kind === "init") {
                         if (isDescriptor && !property.computed) {
                             propToCheck = property.key.name;
    @@ -124,6 +129,7 @@ module.exports = {
                             break;
     
                         default:
    +
                             // Do nothing
                     }
     
    @@ -140,7 +146,7 @@ module.exports = {
             }
     
             return {
    -            "ObjectExpression": function(node) {
    +            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 5716a1215228b6..379ed0fa59f74e 100644
    --- a/tools/eslint/lib/rules/array-bracket-spacing.js
    +++ b/tools/eslint/lib/rules/array-bracket-spacing.js
    @@ -1,10 +1,6 @@
     /**
      * @fileoverview Disallows or enforces spaces inside of array brackets.
      * @author Jamund Ferguson
    - * @copyright 2015 Jamund Ferguson. All rights reserved.
    - * @copyright 2014 Brandyn Bennett. All rights reserved.
    - * @copyright 2014 Michael Ficarra. No rights reserved.
    - * @copyright 2014 Vignesh Anand. All rights reserved.
      */
     "use strict";
     
    @@ -19,27 +15,27 @@ module.exports = {
             docs: {
                 description: "Enforce spacing inside array brackets",
                 category: "Stylistic Issues",
    -            recommended: false,
    -            fixable: "whitespace"
    +            recommended: false
             },
    +        fixable: "whitespace",
             schema: [
                 {
    -                "enum": ["always", "never"]
    +                enum: ["always", "never"]
                 },
                 {
    -                "type": "object",
    -                "properties": {
    -                    "singleValue": {
    -                        "type": "boolean"
    +                type: "object",
    +                properties: {
    +                    singleValue: {
    +                        type: "boolean"
                         },
    -                    "objectsInArrays": {
    -                        "type": "boolean"
    +                    objectsInArrays: {
    +                        type: "boolean"
                         },
    -                    "arraysInArrays": {
    -                        "type": "boolean"
    +                    arraysInArrays: {
    +                        type: "boolean"
                         }
                     },
    -                "additionalProperties": false
    +                additionalProperties: false
                 }
             ]
         },
    @@ -82,6 +78,7 @@ module.exports = {
                     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]]);
                     }
                 });
    @@ -100,6 +97,7 @@ module.exports = {
                     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]]);
                     }
                 });
    diff --git a/tools/eslint/lib/rules/array-callback-return.js b/tools/eslint/lib/rules/array-callback-return.js
    index 9489b810f77e38..714c189c6b5495 100644
    --- a/tools/eslint/lib/rules/array-callback-return.js
    +++ b/tools/eslint/lib/rules/array-callback-return.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -107,10 +105,13 @@ function isTargetMethod(node) {
     function isCallbackOfArrayMethod(node) {
         while (node) {
             var parent = node.parent;
    +
             switch (parent.type) {
    -            // Looks up the destination.
    -            // e.g.
    -            //   foo.every(nativeFoo || function foo() { ... });
    +
    +            /*
    +             * Looks up the destination. e.g.,
    +             * foo.every(nativeFoo || function foo() { ... });
    +             */
                 case "LogicalExpression":
                 case "ConditionalExpression":
                     node = parent;
    @@ -124,6 +125,7 @@ function isCallbackOfArrayMethod(node) {
                 //   })());
                 case "ReturnStatement":
                     var func = astUtils.getUpperFunction(parent);
    +
                     if (func === null || !astUtils.isCallee(func)) {
                         return false;
                     }
    @@ -162,75 +164,86 @@ function isCallbackOfArrayMethod(node) {
     // 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)
    -            };
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce `return` statements in callbacks of array methods",
    +            category: "Best Practices",
    +            recommended: false
             },
     
    -        // 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;
    +        schema: []
    +    },
    +
    +    create: 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."
    +                });
    +            }
    +        }
     
    -                if (!node.argument) {
    -                    context.report({
    -                        node: node,
    -                        message: "Expected a return value."
    -                    });
    +        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
    -    };
    +            // 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
    index e7e6b6bdb47330..79fde90f805d15 100644
    --- a/tools/eslint/lib/rules/arrow-body-style.js
    +++ b/tools/eslint/lib/rules/arrow-body-style.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,49 +8,60 @@
     // 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;
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require braces around arrow function bodies",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -            if (asNeeded && blockBody[0].type === "ReturnStatement") {
    -                context.report({
    -                    node: node,
    -                    loc: arrowBody.loc.start,
    -                    message: "Unexpected block statement surrounding arrow body."
    -                });
    +        schema: [
    +            {
    +                enum: ["always", "as-needed"]
                 }
    -        } else {
    -            if (always) {
    -                context.report({
    -                    node: node,
    -                    loc: arrowBody.loc.start,
    -                    message: "Expected block statement surrounding arrow body."
    -                });
    +        ]
    +    },
    +
    +    create: 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"]
    +        return {
    +            ArrowFunctionExpression: validate
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/arrow-parens.js b/tools/eslint/lib/rules/arrow-parens.js
    index 2332dda12134c2..78ce045017106f 100644
    --- a/tools/eslint/lib/rules/arrow-parens.js
    +++ b/tools/eslint/lib/rules/arrow-parens.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to require parens in arrow function arguments.
      * @author Jxck
    - * @copyright 2015 Jxck. All rights reserved.
      */
     "use strict";
     
    @@ -9,44 +8,54 @@
     // 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);
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require parentheses around arrow function arguments",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                enum: ["always", "as-needed"]
    +            }
    +        ]
    +    },
    +
    +    create: 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;
                 }
    -            return;
    -        }
     
    -        if (token.type === "Identifier") {
    -            var after = context.getTokenAfter(token);
    +            if (token.type === "Identifier") {
    +                var after = context.getTokenAfter(token);
     
    -            // (x) => x
    -            if (after.value !== ")") {
    -                context.report(node, message);
    +                // (x) => x
    +                if (after.value !== ")") {
    +                    context.report(node, message);
    +                }
                 }
             }
    -    }
     
    -    return {
    -        "ArrowFunctionExpression": parens
    -    };
    -};
    -
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "as-needed"]
    +        return {
    +            ArrowFunctionExpression: parens
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/arrow-spacing.js b/tools/eslint/lib/rules/arrow-spacing.js
    index cb71dd400c716d..82cec87ed2798b 100644
    --- a/tools/eslint/lib/rules/arrow-spacing.js
    +++ b/tools/eslint/lib/rules/arrow-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to define spacing before/after arrow function's arrow.
      * @author Jxck
    - * @copyright 2015 Jxck. All rights reserved.
      */
     "use strict";
     
    @@ -9,116 +8,137 @@
     // 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 };
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before and after the arrow in arrow functions",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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 };
    -    }
    +        fixable: "whitespace",
     
    -    /**
    -     * 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, " ");
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    before: {
    +                        type: "boolean"
    +                    },
    +                    after: {
    +                        type: "boolean"
                         }
    -                });
    +                },
    +                additionalProperties: false
                 }
    -        } 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]]);
    -                    }
    -                });
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        // merge rules with default
    +        var rule = { before: true, after: true },
    +            option = context.options[0] || {};
    +
    +        rule.before = option.before !== false;
    +        rule.after = option.after !== false;
    +
    +        /**
    +         * Get tokens of arrow(`=>`) and before/after arrow.
    +         * @param {ASTNode} node The arrow function node.
    +         * @returns {Object} Tokens of arrow and before/after arrow.
    +         */
    +        function getTokens(node) {
    +            var t = context.getFirstToken(node);
    +            var before;
    +
    +            while (t.type !== "Punctuator" || t.value !== "=>") {
    +                before = t;
    +                t = context.getTokenAfter(t);
                 }
    +            var after = context.getTokenAfter(t);
    +
    +            return { before: before, arrow: t, after: after };
             }
     
    -        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]]);
    -                    }
    -                });
    -            }
    +        /**
    +         * 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 };
             }
    -    }
     
    -    return {
    -        "ArrowFunctionExpression": spaces
    -    };
    -};
    +        /**
    +         * 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);
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "before": {
    -                "type": "boolean"
    -            },
    -            "after": {
    -                "type": "boolean"
    +            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]]);
    +                        }
    +                    });
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +
    +            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
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/block-scoped-var.js b/tools/eslint/lib/rules/block-scoped-var.js
    index 28755558f184f8..3da07adcba1a1f 100644
    --- a/tools/eslint/lib/rules/block-scoped-var.js
    +++ b/tools/eslint/lib/rules/block-scoped-var.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,97 +8,111 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var stack = [];
    -
    -    /**
    -     * Makes a block scope.
    -     * @param {ASTNode} node - A node of a scope.
    -     * @returns {void}
    -     */
    -    function enterScope(node) {
    -        stack.push(node.range);
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce the use of variables within the scope they are defined",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Pops the last block scope.
    -     * @returns {void}
    -     */
    -    function exitScope() {
    -        stack.pop();
    -    }
    +        schema: []
    +    },
     
    -    /**
    -     * Reports a given reference.
    -     * @param {escope.Reference} reference - A reference to report.
    -     * @returns {void}
    -     */
    -    function report(reference) {
    -        var identifier = reference.identifier;
    -        context.report(
    -            identifier,
    -            "'{{name}}' used outside of binding context.",
    -            {name: identifier.name});
    -    }
    +    create: function(context) {
    +        var stack = [];
     
    -    /**
    -     * Finds and reports references which are outside of valid scopes.
    -     * @param {ASTNode} node - A node to get variables.
    -     * @returns {void}
    -     */
    -    function checkForVariables(node) {
    -        if (node.kind !== "var") {
    -            return;
    +        /**
    +         * Makes a block scope.
    +         * @param {ASTNode} node - A node of a scope.
    +         * @returns {void}
    +         */
    +        function enterScope(node) {
    +            stack.push(node.range);
             }
     
    -        // Defines a predicate to check whether or not a given reference is outside of valid scope.
    -        var scopeRange = stack[stack.length - 1];
    +        /**
    +         * Pops the last block scope.
    +         * @returns {void}
    +         */
    +        function exitScope() {
    +            stack.pop();
    +        }
     
             /**
    -         * Check if a reference is out of scope
    -         * @param {ASTNode} reference node to examine
    -         * @returns {boolean} True is its outside the scope
    -         * @private
    +         * Reports a given reference.
    +         * @param {escope.Reference} reference - A reference to report.
    +         * @returns {void}
              */
    -        function isOutsideOfScope(reference) {
    -            var idRange = reference.identifier.range;
    -            return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1];
    +        function report(reference) {
    +            var identifier = reference.identifier;
    +
    +            context.report(
    +                identifier,
    +                "'{{name}}' used outside of binding context.",
    +                {name: identifier.name});
             }
     
    -        // 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);
    +        /**
    +         * Finds and reports references which are outside of valid scopes.
    +         * @param {ASTNode} node - A node to get variables.
    +         * @returns {void}
    +         */
    +        function checkForVariables(node) {
    +            if (node.kind !== "var") {
    +                return;
    +            }
    +
    +            // 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];
    +            }
    +
    +            // 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);
    +            }
             }
    -    }
     
    -    return {
    -        "Program": function(node) {
    -            stack = [node.range];
    -        },
    +        return {
    +            Program: function(node) {
    +                stack = [node.range];
    +            },
     
    -        // 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
    -    };
    +            // 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
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/block-spacing.js b/tools/eslint/lib/rules/block-spacing.js
    index 4df8d59763c287..b6dc6e701d25a8 100644
    --- a/tools/eslint/lib/rules/block-spacing.js
    +++ b/tools/eslint/lib/rules/block-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @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";
    @@ -12,108 +11,121 @@ 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);
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing inside single-line blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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
    -        );
    -    }
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {enum: ["always", "never"]}
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var always = (context.options[0] !== "never"),
    +            message = always ? "Requires a space" : "Unexpected space(s)",
    +            sourceCode = context.getSourceCode();
     
    -    /**
    -     * 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;
    +        /**
    +         * 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);
             }
     
    -        // Skip line comments for option never
    -        if (!always && firstToken.type === "Line") {
    -            return;
    +        /**
    +         * 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
    +            );
             }
     
    -        // 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, " ");
    -                    }
    +        /**
    +         * Reports invalid spacing style inside braces.
    +         * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get.
    +         * @returns {void}
    +         */
    +        function checkSpacingInsideBraces(node) {
     
    -                    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, " ");
    +            // 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 fixer.removeRange([lastToken.range[1], closeBrace.range[0]]);
    +                    }
    +                });
    +            }
             }
    -    }
     
    -    return {
    -        BlockStatement: checkSpacingInsideBraces,
    -        SwitchStatement: checkSpacingInsideBraces
    -    };
    +        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 04ef0188dda5e4..785a71e4e7b0aa 100644
    --- a/tools/eslint/lib/rules/brace-style.js
    +++ b/tools/eslint/lib/rules/brace-style.js
    @@ -9,215 +9,236 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    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_ALLMAN = "Closing curly brace appears on the same line as the subsequent block.";
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Determines if a given node is a block statement.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {boolean} True if the node is a block statement, false if not.
    -     * @private
    -     */
    -    function isBlock(node) {
    -        return node && node.type === "BlockStatement";
    -    }
    -
    -    /**
    -     * Check if the token is an punctuator with a value of curly brace
    -     * @param {object} token - Token to check
    -     * @returns {boolean} true if its a curly punctuator
    -     * @private
    -     */
    -    function isCurlyPunctuator(token) {
    -        return token.value === "{" || token.value === "}";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent brace style for blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Binds a list of properties to a function that verifies that the opening
    -     * curly brace is on the same line as its controlling statement of a given
    -     * node.
    -     * @param {...string} The properties to check on the node.
    -     * @returns {Function} A function that will perform the check on a node
    -     * @private
    -     */
    -    function checkBlock() {
    -        var blockProperties = arguments;
    -
    -        return function(node) {
    -            [].forEach.call(blockProperties, function(blockProp) {
    -                var block = node[blockProp], previousToken, curlyToken, curlyTokenEnd, curlyTokensOnSameLine;
    -
    -                if (!isBlock(block)) {
    -                    return;
    -                }
    +        schema: [
    +            {
    +                enum: ["1tbs", "stroustrup", "allman"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    allowSingleLine: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -                previousToken = sourceCode.getTokenBefore(block);
    -                curlyToken = sourceCode.getFirstToken(block);
    -                curlyTokenEnd = sourceCode.getLastToken(block);
    -                curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line;
    +    create: function(context) {
    +        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_ALLMAN = "Closing curly brace appears on the same line as the subsequent block.";
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Determines if a given node is a block statement.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {boolean} True if the node is a block statement, false if not.
    +         * @private
    +         */
    +        function isBlock(node) {
    +            return node && node.type === "BlockStatement";
    +        }
     
    -                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);
    -                }
    +        /**
    +         * Check if the token is an punctuator with a value of curly brace
    +         * @param {object} token - Token to check
    +         * @returns {boolean} true if its a curly punctuator
    +         * @private
    +         */
    +        function isCurlyPunctuator(token) {
    +            return token.value === "{" || token.value === "}";
    +        }
     
    -                if (!block.body.length || curlyTokensOnSameLine && params.allowSingleLine) {
    -                    return;
    -                }
    +        /**
    +         * Binds a list of properties to a function that verifies that the opening
    +         * curly brace is on the same line as its controlling statement of a given
    +         * node.
    +         * @param {...string} The properties to check on the node.
    +         * @returns {Function} A function that will perform the check on a node
    +         * @private
    +         */
    +        function checkBlock() {
    +            var blockProperties = arguments;
    +
    +            return function(node) {
    +                Array.prototype.forEach.call(blockProperties, function(blockProp) {
    +                    var block = node[blockProp],
    +                        previousToken,
    +                        curlyToken,
    +                        curlyTokenEnd,
    +                        allOnSameLine;
    +
    +                    if (!isBlock(block)) {
    +                        return;
    +                    }
    +
    +                    previousToken = sourceCode.getTokenBefore(block);
    +                    curlyToken = sourceCode.getFirstToken(block);
    +                    curlyTokenEnd = sourceCode.getLastToken(block);
    +                    allOnSameLine = previousToken.loc.start.line === curlyTokenEnd.loc.start.line;
    +
    +                    if (allOnSameLine && params.allowSingleLine) {
    +                        return;
    +                    }
    +
    +                    if (style !== "allman" && previousToken.loc.start.line !== curlyToken.loc.start.line) {
    +                        context.report(node, OPEN_MESSAGE);
    +                    } else if (style === "allman" && previousToken.loc.start.line === curlyToken.loc.start.line) {
    +                        context.report(node, OPEN_MESSAGE_ALLMAN);
    +                    }
    +
    +                    if (!block.body.length) {
    +                        return;
    +                    }
    +
    +                    if (curlyToken.loc.start.line === block.body[0].loc.start.line) {
    +                        context.report(block.body[0], BODY_MESSAGE);
    +                    }
    +
    +                    if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line) {
    +                        context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE);
    +                    }
    +                });
    +            };
    +        }
     
    -                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);
    +        /**
    +         * Enforces the configured brace style on IfStatements
    +         * @param {ASTNode} node An IfStatement node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkIfStatement(node) {
    +            var tokens;
    +
    +            checkBlock("consequent", "alternate")(node);
    +
    +            if (node.alternate) {
    +
    +                tokens = sourceCode.getTokensBefore(node.alternate, 2);
    +
    +                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);
                     }
    -            });
    -        };
    -    }
    -
    -    /**
    -     * Enforces the configured brace style on IfStatements
    -     * @param {ASTNode} node An IfStatement node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkIfStatement(node) {
    -        var tokens;
     
    -        checkBlock("consequent", "alternate")(node);
    -
    -        if (node.alternate) {
    -
    -            tokens = sourceCode.getTokensBefore(node.alternate, 2);
    -
    -            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);
                 }
    -
             }
    -    }
     
    -    /**
    -     * Enforces the configured brace style on TryStatements
    -     * @param {ASTNode} node A TryStatement node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkTryStatement(node) {
    -        var tokens;
    -
    -        checkBlock("block", "finalizer")(node);
    -
    -        if (isBlock(node.finalizer)) {
    -            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);
    +        /**
    +         * Enforces the configured brace style on TryStatements
    +         * @param {ASTNode} node A TryStatement node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkTryStatement(node) {
    +            var tokens;
    +
    +            checkBlock("block", "finalizer")(node);
    +
    +            if (isBlock(node.finalizer)) {
    +                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 (tokens[0].loc.start.line === tokens[1].loc.start.line) {
    +                    context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
                     }
    -            } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) {
    -                context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
                 }
             }
    -    }
     
    -    /**
    -     * Enforces the configured brace style on CatchClauses
    -     * @param {ASTNode} node A CatchClause node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkCatchClause(node) {
    -        var previousToken = sourceCode.getTokenBefore(node),
    -            firstToken = sourceCode.getFirstToken(node);
    -
    -        checkBlock("body")(node);
    -
    -        if (isBlock(node.body)) {
    -            if (style === "1tbs") {
    -                if (previousToken.loc.start.line !== firstToken.loc.start.line) {
    -                    context.report(node, CLOSE_MESSAGE);
    -                }
    -            } else {
    -                if (previousToken.loc.start.line === firstToken.loc.start.line) {
    -                    context.report(node, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
    +        /**
    +         * Enforces the configured brace style on CatchClauses
    +         * @param {ASTNode} node A CatchClause node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkCatchClause(node) {
    +            var previousToken = sourceCode.getTokenBefore(node),
    +                firstToken = sourceCode.getFirstToken(node);
    +
    +            checkBlock("body")(node);
    +
    +            if (isBlock(node.body)) {
    +                if (style === "1tbs") {
    +                    if (previousToken.loc.start.line !== firstToken.loc.start.line) {
    +                        context.report(node, CLOSE_MESSAGE);
    +                    }
    +                } else {
    +                    if (previousToken.loc.start.line === firstToken.loc.start.line) {
    +                        context.report(node, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
    +                    }
                     }
                 }
             }
    -    }
     
    -    /**
    -     * Enforces the configured brace style on SwitchStatements
    -     * @param {ASTNode} node A SwitchStatement node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkSwitchStatement(node) {
    -        var tokens;
    -        if (node.cases && node.cases.length) {
    -            tokens = sourceCode.getTokensBefore(node.cases[0], 2);
    -        } else {
    -            tokens = sourceCode.getLastTokens(node, 3);
    -        }
    +        /**
    +         * Enforces the configured brace style on SwitchStatements
    +         * @param {ASTNode} node A SwitchStatement node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkSwitchStatement(node) {
    +            var tokens;
    +
    +            if (node.cases && node.cases.length) {
    +                tokens = sourceCode.getTokensBefore(node.cases[0], 2);
    +            } else {
    +                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);
    +            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);
    +            }
             }
    -    }
    -
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "FunctionDeclaration": checkBlock("body"),
    -        "FunctionExpression": checkBlock("body"),
    -        "ArrowFunctionExpression": checkBlock("body"),
    -        "IfStatement": checkIfStatement,
    -        "TryStatement": checkTryStatement,
    -        "CatchClause": checkCatchClause,
    -        "DoWhileStatement": checkBlock("body"),
    -        "WhileStatement": checkBlock("body"),
    -        "WithStatement": checkBlock("body"),
    -        "ForStatement": checkBlock("body"),
    -        "ForInStatement": checkBlock("body"),
    -        "ForOfStatement": checkBlock("body"),
    -        "SwitchStatement": checkSwitchStatement
    -    };
     
    -};
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            FunctionDeclaration: checkBlock("body"),
    +            FunctionExpression: checkBlock("body"),
    +            ArrowFunctionExpression: checkBlock("body"),
    +            IfStatement: checkIfStatement,
    +            TryStatement: checkTryStatement,
    +            CatchClause: checkCatchClause,
    +            DoWhileStatement: checkBlock("body"),
    +            WhileStatement: checkBlock("body"),
    +            WithStatement: checkBlock("body"),
    +            ForStatement: checkBlock("body"),
    +            ForInStatement: checkBlock("body"),
    +            ForOfStatement: checkBlock("body"),
    +            SwitchStatement: checkSwitchStatement
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["1tbs", "stroustrup", "allman"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "allowSingleLine": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/callback-return.js b/tools/eslint/lib/rules/callback-return.js
    index 49e5da6239aad4..a995da3a98f354 100644
    --- a/tools/eslint/lib/rules/callback-return.js
    +++ b/tools/eslint/lib/rules/callback-return.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Enforce return after a callback.
      * @author Jamund Ferguson
    - * @copyright 2015 Jamund Ferguson. All rights reserved.
      */
     "use strict";
     
    @@ -9,135 +8,146 @@
     // 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);
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `return` statements after callbacks",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
    +
    +        schema: [{
    +            type: "array",
    +            items: { type: "string" }
    +        }]
    +    },
    +
    +    create: 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;
             }
    -        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;
    +        /**
    +         * 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;
             }
     
    -        // cb()
    -        if (parentNode.expression === node) {
    -            return true;
    -        }
    +        /**
    +         * 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;
    +            }
     
    -        // special case for cb && cb() and similar
    -        if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") {
    -            if (parentNode.expression.right === node) {
    +            // 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;
             }
     
    -        return false;
    -    }
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        return {
    +            CallExpression: function(node) {
     
    -    return {
    -        "CallExpression": function(node) {
    +                // if we"re not a callback we can return
    +                if (!isCallback(node)) {
    +                    return;
    +                }
     
    -            // 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;
     
    -            // 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;
    +                }
     
    -            // 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;
    +                }
     
    -            // 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") {
     
    -            // 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];
     
    -                // 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)) {
     
    -                // if the callback is the last thing in a block that might be ok
    -                if (isCallbackExpression(node, lastItem)) {
    +                        parentType = closestBlock.parent.type;
     
    -                    parentType = closestBlock.parent.type;
    +                        // but only if the block is part of a function
    +                        if (parentType === "FunctionExpression" ||
    +                            parentType === "FunctionDeclaration" ||
    +                            parentType === "ArrowFunctionExpression"
    +                        ) {
    +                            return;
    +                        }
     
    -                    // 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") {
    +                    // 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;
    +                        // 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.");
    +                }
     
    -            // 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 1294a548d77f4d..28f9e8296b1926 100644
    --- a/tools/eslint/lib/rules/camelcase.js
    +++ b/tools/eslint/lib/rules/camelcase.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag non-camelcased identifiers
      * @author Nicholas C. Zakas
    - * @copyright 2015 Dieter Oberkofler. All rights reserved.
      */
     
     "use strict";
    @@ -10,111 +9,126 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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.
    -     * @returns {boolean} if the string is underscored
    -     * @private
    -     */
    -    function isUnderscored(name) {
    -
    -        // if there's an underscore, it might be A_CONSTANT, which is okay
    -        return name.indexOf("_") > -1 && name !== name.toUpperCase();
    -    }
    -
    -    /**
    -     * Reports an AST node as a rule violation.
    -     * @param {ASTNode} node The node to report.
    -     * @returns {void}
    -     * @private
    -     */
    -    function report(node) {
    -        if (reported.indexOf(node) < 0) {
    -            reported.push(node);
    -            context.report(node, "Identifier '{{name}}' is not in camel case.", { name: node.name });
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce camelcase naming convention",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var options = context.options[0] || {},
    -        properties = options.properties || "";
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    properties: {
    +                        enum: ["always", "never"]
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    if (properties !== "always" && properties !== "never") {
    -        properties = "always";
    -    }
    +    create: function(context) {
     
    -    return {
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -        "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;
    +        // contains reported nodes to avoid reporting twice on destructuring with shorthand notation
    +        var reported = [];
     
    -            // MemberExpressions get special rules
    -            if (node.parent.type === "MemberExpression") {
    +        /**
    +         * Checks if a string contains an underscore and isn't all upper-case
    +         * @param {String} name The string to check.
    +         * @returns {boolean} if the string is underscored
    +         * @private
    +         */
    +        function isUnderscored(name) {
     
    -                // "never" check properties
    -                if (properties === "never") {
    -                    return;
    -                }
    -
    -                // Always report underscored object names
    -                if (node.parent.object.type === "Identifier" &&
    -                        node.parent.object.name === node.name &&
    -                        isUnderscored(name)) {
    -                    report(node);
    +            // if there's an underscore, it might be A_CONSTANT, which is okay
    +            return name.indexOf("_") > -1 && name !== name.toUpperCase();
    +        }
     
    -                // Report AssignmentExpressions only if they are the left side of the assignment
    -                } else if (effectiveParent.type === "AssignmentExpression" &&
    -                        isUnderscored(name) &&
    -                        (effectiveParent.right.type !== "MemberExpression" ||
    -                        effectiveParent.left.type === "MemberExpression" &&
    -                        effectiveParent.left.property.name === node.name)) {
    -                    report(node);
    -                }
    +        /**
    +         * Reports an AST node as a rule violation.
    +         * @param {ASTNode} node The node to report.
    +         * @returns {void}
    +         * @private
    +         */
    +        function report(node) {
    +            if (reported.indexOf(node) < 0) {
    +                reported.push(node);
    +                context.report(node, "Identifier '{{name}}' is not in camel case.", { name: node.name });
    +            }
    +        }
     
    -            // Properties have their own rules
    -            } else if (node.parent.type === "Property") {
    -                // "never" check properties
    -                if (properties === "never") {
    -                    return;
    -                }
    +        var options = context.options[0] || {},
    +            properties = options.properties || "";
     
    -                if (node.parent.parent && node.parent.parent.type === "ObjectPattern" &&
    -                        node.parent.key === node && node.parent.value !== node) {
    -                    return;
    -                }
    +        if (properties !== "always" && properties !== "never") {
    +            properties = "always";
    +        }
     
    -                if (isUnderscored(name) && effectiveParent.type !== "CallExpression") {
    +        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;
    +
    +                // MemberExpressions get special rules
    +                if (node.parent.type === "MemberExpression") {
    +
    +                    // "never" check properties
    +                    if (properties === "never") {
    +                        return;
    +                    }
    +
    +                    // Always report underscored object names
    +                    if (node.parent.object.type === "Identifier" &&
    +                            node.parent.object.name === node.name &&
    +                            isUnderscored(name)) {
    +                        report(node);
    +
    +                    // Report AssignmentExpressions only if they are the left side of the assignment
    +                    } else if (effectiveParent.type === "AssignmentExpression" &&
    +                            isUnderscored(name) &&
    +                            (effectiveParent.right.type !== "MemberExpression" ||
    +                            effectiveParent.left.type === "MemberExpression" &&
    +                            effectiveParent.left.property.name === node.name)) {
    +                        report(node);
    +                    }
    +
    +                // 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);
    +                    }
    +
    +                // Report anything that is underscored that isn't a CallExpression
    +                } else if (isUnderscored(name) && effectiveParent.type !== "CallExpression") {
                         report(node);
                     }
    -
    -            // Report anything that is underscored that isn't a CallExpression
    -            } else if (isUnderscored(name) && effectiveParent.type !== "CallExpression") {
    -                report(node);
                 }
    -        }
     
    -    };
    -
    -};
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "properties": {
    -                "enum": ["always", "never"]
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/comma-dangle.js b/tools/eslint/lib/rules/comma-dangle.js
    index c197b783dc35f9..7c2451b60876e8 100644
    --- a/tools/eslint/lib/rules/comma-dangle.js
    +++ b/tools/eslint/lib/rules/comma-dangle.js
    @@ -1,30 +1,15 @@
     /**
      * @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
    +// Requirements
     //------------------------------------------------------------------------------
     
    -/**
    - * 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];
    -}
    +var lodash = require("lodash");
     
     /**
      * Checks whether or not a trailing comma is allowed in a given node.
    @@ -35,198 +20,204 @@ function getLast(xs) {
      * @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;
    -    }
    +    return node.type !== "ArrayPattern" || lastItem.type !== "RestElement";
     }
     
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var mode = context.options[0];
    -    var UNEXPECTED_MESSAGE = "Unexpected trailing comma.";
    -    var MISSING_MESSAGE = "Missing trailing comma.";
    -
    -    /**
    -     * 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 forbidTrailingComma(node) {
    -        var lastItem = getLast(node.properties || node.elements || node.specifiers);
    -        if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
    -            return;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow trailing commas",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        fixable: "code",
    +
    +        schema: [
    +            {
    +                enum: ["always", "always-multiline", "only-multiline", "never"]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var mode = context.options[0];
    +        var UNEXPECTED_MESSAGE = "Unexpected trailing comma.";
    +        var MISSING_MESSAGE = "Missing trailing comma.";
    +
    +        /**
    +         * Checks whether or not a given node is multiline.
    +         * This rule handles a given node as multiline when the closing parenthesis
    +         * and the last element are not on the same line.
    +         *
    +         * @param {ASTNode} node - A node to check.
    +         * @returns {boolean} `true` if the node is multiline.
    +         */
    +        function isMultiline(node) {
    +            var lastItem = lodash.last(node.properties || node.elements || node.specifiers);
    +
    +            if (!lastItem) {
    +                return false;
    +            }
    +
    +            var sourceCode = context.getSourceCode(),
    +                penultimateToken = sourceCode.getLastToken(lastItem),
    +                lastToken = sourceCode.getTokenAfter(penultimateToken);
    +
    +            // parentheses are a pain
    +            while (lastToken.value === ")") {
    +                penultimateToken = lastToken;
    +                lastToken = sourceCode.getTokenAfter(lastToken);
    +            }
    +
    +            if (lastToken.value === ",") {
    +                penultimateToken = lastToken;
    +                lastToken = sourceCode.getTokenAfter(lastToken);
    +            }
    +
    +            return lastToken.loc.end.line !== penultimateToken.loc.end.line;
             }
     
    -        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);
    +        /**
    +         * 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 forbidTrailingComma(node) {
    +            var lastItem = lodash.last(node.properties || node.elements || node.specifiers);
    +
    +            if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
    +                return;
    +            }
    +
    +            var sourceCode = context.getSourceCode(),
    +                trailingToken;
    +
    +            // last item can be surrounded by parentheses for object and array literals
    +            if (node.type === "ObjectExpression" || node.type === "ArrayExpression") {
    +                trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node));
    +            } else {
    +                trailingToken = sourceCode.getTokenAfter(lastItem);
    +            }
    +
    +            if (trailingToken.value === ",") {
    +                context.report({
    +                    node: lastItem,
    +                    loc: trailingToken.loc.start,
    +                    message: UNEXPECTED_MESSAGE,
    +                    fix: function(fixer) {
    +                        return fixer.remove(trailingToken);
    +                    }
    +                });
    +            }
             }
     
    -        if (trailingToken.value === ",") {
    -            context.report(
    -                lastItem,
    -                trailingToken.loc.start,
    -                UNEXPECTED_MESSAGE);
    +        /**
    +         * Reports the last element of a given node if it does not have a trailing
    +         * comma.
    +         *
    +         * If a given node is `ArrayPattern` which has `RestElement`, the trailing
    +         * comma is disallowed, so report if it exists.
    +         *
    +         * @param {ASTNode} node - A node to check. Its type is one of
    +         *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
    +         *   ImportDeclaration, and ExportNamedDeclaration.
    +         * @returns {void}
    +         */
    +        function forceTrailingComma(node) {
    +            var lastItem = lodash.last(node.properties || node.elements || node.specifiers);
    +
    +            if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
    +                return;
    +            }
    +            if (!isTrailingCommaAllowed(node, lastItem)) {
    +                forbidTrailingComma(node);
    +                return;
    +            }
    +
    +            var sourceCode = context.getSourceCode(),
    +                trailingToken;
    +
    +            // last item can be surrounded by parentheses for object and array literals
    +            if (node.type === "ObjectExpression" || node.type === "ArrayExpression") {
    +                trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node));
    +            } else {
    +                trailingToken = sourceCode.getTokenAfter(lastItem);
    +            }
    +
    +            if (trailingToken.value !== ",") {
    +                context.report({
    +                    node: lastItem,
    +                    loc: lastItem.loc.end,
    +                    message: MISSING_MESSAGE,
    +                    fix: function(fixer) {
    +                        return fixer.insertTextAfter(lastItem, ",");
    +                    }
    +                });
    +            }
             }
    -    }
     
    -    /**
    -     * 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;
    +        /**
    +         * 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);
    +            }
             }
     
    -        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);
    +        /**
    +         * 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);
    +            }
             }
     
    -        if (trailingToken.value !== ",") {
    -            context.report(
    -                lastItem,
    -                lastItem.loc.end,
    -                MISSING_MESSAGE);
    -        }
    -    }
    +        // Chooses a checking function.
    +        var checkForTrailingComma;
     
    -    /**
    -     * 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);
    +        if (mode === "always") {
    +            checkForTrailingComma = forceTrailingComma;
    +        } else if (mode === "always-multiline") {
    +            checkForTrailingComma = forceTrailingCommaIfMultiline;
    +        } else if (mode === "only-multiline") {
    +            checkForTrailingComma = allowTrailingCommaIfMultiline;
             } else {
    -            forbidTrailingComma(node);
    +            checkForTrailingComma = forbidTrailingComma;
             }
    -    }
    -
    -    /**
    -     * 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,
    +            ObjectPattern: checkForTrailingComma,
    +            ArrayExpression: checkForTrailingComma,
    +            ArrayPattern: checkForTrailingComma,
    +            ImportDeclaration: checkForTrailingComma,
    +            ExportNamedDeclaration: checkForTrailingComma
    +        };
         }
    -
    -    return {
    -        "ObjectExpression": checkForTrailingComma,
    -        "ObjectPattern": checkForTrailingComma,
    -        "ArrayExpression": checkForTrailingComma,
    -        "ArrayPattern": checkForTrailingComma,
    -        "ImportDeclaration": checkForTrailingComma,
    -        "ExportNamedDeclaration": checkForTrailingComma
    -    };
     };
    -
    -module.exports.schema = [
    -    {
    -        "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 7d2b2d794933ab..2a4ec1f4173b4c 100644
    --- a/tools/eslint/lib/rules/comma-spacing.js
    +++ b/tools/eslint/lib/rules/comma-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Comma spacing - validates spacing before and after comma
      * @author Vignesh Anand aka vegetableman.
    - * @copyright 2014 Vignesh Anand. All rights reserved.
      */
     "use strict";
     
    @@ -11,173 +10,185 @@ 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
    -    };
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    // list of comma tokens to ignore for the check of leading whitespace
    -    var commaTokensToIgnore = [];
    -
    -    /**
    -     * Determines if a given token is a comma operator.
    -     * @param {ASTNode} token The token to check.
    -     * @returns {boolean} True if the token is a comma, false if not.
    -     * @private
    -     */
    -    function isComma(token) {
    -        return !!token && (token.type === "Punctuator") && (token.value === ",");
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before and after commas",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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, otherNode) {
    -        context.report({
    -            node: node,
    -            fix: function(fixer) {
    -                if (options[dir]) {
    -                    if (dir === "before") {
    -                        return fixer.insertTextBefore(node, " ");
    -                    } else {
    -                        return fixer.insertTextAfter(node, " ");
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    before: {
    +                        type: "boolean"
    +                    },
    +                    after: {
    +                        type: "boolean"
                         }
    -                } else {
    -                    var start, end;
    -                    var newText = "";
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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
    +        };
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        // list of comma tokens to ignore for the check of leading whitespace
    +        var commaTokensToIgnore = [];
    +
    +        /**
    +         * Determines if a given token is a comma operator.
    +         * @param {ASTNode} token The token to check.
    +         * @returns {boolean} True if the token is a comma, false if not.
    +         * @private
    +         */
    +        function isComma(token) {
    +            return !!token && (token.type === "Punctuator") && (token.value === ",");
    +        }
     
    -                    if (dir === "before") {
    -                        start = otherNode.range[1];
    -                        end = node.range[0];
    +        /**
    +         * 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, otherNode) {
    +            context.report({
    +                node: node,
    +                fix: function(fixer) {
    +                    if (options[dir]) {
    +                        if (dir === "before") {
    +                            return fixer.insertTextBefore(node, " ");
    +                        } else {
    +                            return fixer.insertTextAfter(node, " ");
    +                        }
                         } else {
    -                        start = node.range[1];
    -                        end = otherNode.range[0];
    +                        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);
                         }
    -
    -                    return fixer.replaceTextRange([start, end], newText);
    -                }
    -            },
    -            message: options[dir] ?
    -              "A space is required " + dir + " ','." :
    -              "There should be no space " + dir + " ','."
    -        });
    -    }
    -
    -    /**
    -     * Validates the spacing around a comma token.
    -     * @param {Object} tokens - The tokens to be validated.
    -     * @param {Token} tokens.comma The token representing the comma.
    -     * @param {Token} [tokens.left] The last token before the comma.
    -     * @param {Token} [tokens.right] The first token after the comma.
    -     * @param {Token|ASTNode} reportItem The item to use when reporting an error.
    -     * @returns {void}
    -     * @private
    -     */
    -    function validateCommaItemSpacing(tokens, reportItem) {
    -        if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) &&
    -                (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma))
    -        ) {
    -            report(reportItem, "before", tokens.left);
    +                },
    +                message: options[dir] ?
    +                  "A space is required " + dir + " ','." :
    +                  "There should be no space " + dir + " ','."
    +            });
             }
     
    -        if (tokens.right && !options.after && tokens.right.type === "Line") {
    -            return;
    -        }
    +        /**
    +         * Validates the spacing around a comma token.
    +         * @param {Object} tokens - The tokens to be validated.
    +         * @param {Token} tokens.comma The token representing the comma.
    +         * @param {Token} [tokens.left] The last token before the comma.
    +         * @param {Token} [tokens.right] The first token after the comma.
    +         * @param {Token|ASTNode} reportItem The item to use when reporting an error.
    +         * @returns {void}
    +         * @private
    +         */
    +        function validateCommaItemSpacing(tokens, reportItem) {
    +            if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) &&
    +                    (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma))
    +            ) {
    +                report(reportItem, "before", tokens.left);
    +            }
    +
    +            if (tokens.right && !options.after && tokens.right.type === "Line") {
    +                return;
    +            }
     
    -        if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) &&
    -                (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right))
    -        ) {
    -            report(reportItem, "after", tokens.right);
    +            if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) &&
    +                    (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right))
    +            ) {
    +                report(reportItem, "after", tokens.right);
    +            }
             }
    -    }
     
    -    /**
    -     * 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 addNullElementsToIgnoreList(node) {
    -        var previousToken = context.getFirstToken(node);
    +        /**
    +         * 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 addNullElementsToIgnoreList(node) {
    +            var previousToken = context.getFirstToken(node);
     
    -        node.elements.forEach(function(element) {
    -            var token;
    +            node.elements.forEach(function(element) {
    +                var token;
     
    -            if (element === null) {
    -                token = context.getTokenAfter(previousToken);
    +                if (element === null) {
    +                    token = context.getTokenAfter(previousToken);
     
    -                if (isComma(token)) {
    -                    commaTokensToIgnore.push(token);
    +                    if (isComma(token)) {
    +                        commaTokensToIgnore.push(token);
    +                    }
    +                } else {
    +                    token = context.getTokenAfter(element);
                     }
    -            } else {
    -                token = context.getTokenAfter(element);
    -            }
     
    -            previousToken = token;
    -        });
    -    }
    +                previousToken = token;
    +            });
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    return {
    -        "Program:exit": function() {
    +        return {
    +            "Program:exit": function() {
     
    -            var previousToken,
    -                nextToken;
    +                var previousToken,
    +                    nextToken;
     
    -            tokensAndComments.forEach(function(token, i) {
    +                tokensAndComments.forEach(function(token, i) {
     
    -                if (!isComma(token)) {
    -                    return;
    -                }
    -
    -                if (token && token.type === "JSXText") {
    -                    return;
    -                }
    +                    if (!isComma(token)) {
    +                        return;
    +                    }
     
    -                previousToken = tokensAndComments[i - 1];
    -                nextToken = tokensAndComments[i + 1];
    +                    if (token && token.type === "JSXText") {
    +                        return;
    +                    }
     
    -                validateCommaItemSpacing({
    -                    comma: token,
    -                    left: isComma(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken,
    -                    right: isComma(nextToken) ? null : nextToken
    -                }, token);
    -            });
    -        },
    -        "ArrayExpression": addNullElementsToIgnoreList,
    -        "ArrayPattern": addNullElementsToIgnoreList
    +                    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
     
    -};
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "before": {
    -                "type": "boolean"
    -            },
    -            "after": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/comma-style.js b/tools/eslint/lib/rules/comma-style.js
    index af001372c55249..9c7d266d3dd270 100644
    --- a/tools/eslint/lib/rules/comma-style.js
    +++ b/tools/eslint/lib/rules/comma-style.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Comma style - enforces comma styles of two types: last and first
      * @author Vignesh Anand aka vegetableman
    - * @copyright 2014 Vignesh Anand. All rights reserved.
    - * @copyright 2015 Evan Simmons. All rights reserved.
      */
     
     "use strict";
    @@ -13,174 +11,184 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var style = context.options[0] || "last",
    -        exceptions = {};
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent comma style",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    if (context.options.length === 2 && context.options[1].hasOwnProperty("exceptions")) {
    -        exceptions = context.options[1].exceptions;
    -    }
    +        schema: [
    +            {
    +                enum: ["first", "last"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "object",
    +                        additionalProperties: {
    +                            type: "boolean"
    +                        }
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Determines if a given token is a comma operator.
    -     * @param {ASTNode} token The token to check.
    -     * @returns {boolean} True if the token is a comma, false if not.
    -     * @private
    -     */
    -    function isComma(token) {
    -        return !!token && (token.type === "Punctuator") && (token.value === ",");
    -    }
    +    create: function(context) {
     
    -    /**
    -     * Validates the spacing around single items in lists.
    -     * @param {Token} previousItemToken The last token from the previous item.
    -     * @param {Token} commaToken The token representing the comma.
    -     * @param {Token} currentItemToken The first token of the current item.
    -     * @param {Token} reportItem The item to use when reporting an error.
    -     * @returns {void}
    -     * @private
    -     */
    -    function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) {
    +        var style = context.options[0] || "last",
    +            exceptions = {};
     
    -        // if single line
    -        if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
    -                astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
    +        if (context.options.length === 2 && context.options[1].hasOwnProperty("exceptions")) {
    +            exceptions = context.options[1].exceptions;
    +        }
     
    -            return;
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Determines if a given token is a comma operator.
    +         * @param {ASTNode} token The token to check.
    +         * @returns {boolean} True if the token is a comma, false if not.
    +         * @private
    +         */
    +        function isComma(token) {
    +            return !!token && (token.type === "Punctuator") && (token.value === ",");
    +        }
     
    -        } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
    -                !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
    +        /**
    +         * Validates the spacing around single items in lists.
    +         * @param {Token} previousItemToken The last token from the previous item.
    +         * @param {Token} commaToken The token representing the comma.
    +         * @param {Token} currentItemToken The first token of the current item.
    +         * @param {Token} reportItem The item to use when reporting an error.
    +         * @returns {void}
    +         * @private
    +         */
    +        function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) {
     
    -            // lone comma
    -            context.report(reportItem, {
    -                line: commaToken.loc.end.line,
    -                column: commaToken.loc.start.column
    -            }, "Bad line breaking before and after ','.");
    +            // if single line
    +            if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
    +                    astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
     
    -        } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
    +                return;
     
    -            context.report(reportItem, "',' should be placed first.");
    +            } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
    +                    !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
     
    -        } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
    +                // lone comma
    +                context.report(reportItem, {
    +                    line: commaToken.loc.end.line,
    +                    column: commaToken.loc.start.column
    +                }, "Bad line breaking before and after ','.");
     
    -            context.report(reportItem, {
    -                line: commaToken.loc.end.line,
    -                column: commaToken.loc.end.column
    -            }, "',' should be placed last.");
    -        }
    -    }
    +            } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
     
    -    /**
    -     * Checks the comma placement with regards to a declaration/property/element
    -     * @param {ASTNode} node The binary expression node to check
    -     * @param {string} property The property of the node containing child nodes.
    -     * @private
    -     * @returns {void}
    -     */
    -    function validateComma(node, property) {
    -        var items = node[property],
    -            arrayLiteral = (node.type === "ArrayExpression"),
    -            previousItemToken;
    +                context.report(reportItem, "',' should be placed first.");
     
    -        if (items.length > 1 || arrayLiteral) {
    +            } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
     
    -            // seed as opening [
    -            previousItemToken = context.getFirstToken(node);
    +                context.report(reportItem, {
    +                    line: commaToken.loc.end.line,
    +                    column: commaToken.loc.end.column
    +                }, "',' should be placed last.");
    +            }
    +        }
     
    -            items.forEach(function(item) {
    -                var commaToken = item ? context.getTokenBefore(item) : previousItemToken,
    -                    currentItemToken = item ? context.getFirstToken(item) : context.getTokenAfter(commaToken),
    -                    reportItem = item || currentItemToken;
    +        /**
    +         * Checks the comma placement with regards to a declaration/property/element
    +         * @param {ASTNode} node The binary expression node to check
    +         * @param {string} property The property of the node containing child nodes.
    +         * @private
    +         * @returns {void}
    +         */
    +        function validateComma(node, property) {
    +            var items = node[property],
    +                arrayLiteral = (node.type === "ArrayExpression"),
    +                previousItemToken;
    +
    +            if (items.length > 1 || arrayLiteral) {
    +
    +                // seed as opening [
    +                previousItemToken = context.getFirstToken(node);
    +
    +                items.forEach(function(item) {
    +                    var commaToken = item ? context.getTokenBefore(item) : previousItemToken,
    +                        currentItemToken = item ? context.getFirstToken(item) : context.getTokenAfter(commaToken),
    +                        reportItem = item || currentItemToken;
    +
    +                    /*
    +                     * This works by comparing three token locations:
    +                     * - previousItemToken is the last token of the previous item
    +                     * - commaToken is the location of the comma before the current item
    +                     * - currentItemToken is the first token of the current item
    +                     *
    +                     * These values get switched around if item is undefined.
    +                     * previousItemToken will refer to the last token not belonging
    +                     * to the current item, which could be a comma or an opening
    +                     * square bracket. currentItemToken could be a comma.
    +                     *
    +                     * All comparisons are done based on these tokens directly, so
    +                     * they are always valid regardless of an undefined item.
    +                     */
    +                    if (isComma(commaToken)) {
    +                        validateCommaItemSpacing(previousItemToken, commaToken,
    +                                currentItemToken, reportItem);
    +                    }
    +
    +                    previousItemToken = item ? context.getLastToken(item) : previousItemToken;
    +                });
     
                     /*
    -                 * This works by comparing three token locations:
    -                 * - previousItemToken is the last token of the previous item
    -                 * - commaToken is the location of the comma before the current item
    -                 * - currentItemToken is the first token of the current item
    -                 *
    -                 * These values get switched around if item is undefined.
    -                 * previousItemToken will refer to the last token not belonging
    -                 * to the current item, which could be a comma or an opening
    -                 * square bracket. currentItemToken could be a comma.
    -                 *
    -                 * All comparisons are done based on these tokens directly, so
    -                 * they are always valid regardless of an undefined item.
    +                 * Special case for array literals that have empty last items, such
    +                 * as [ 1, 2, ]. These arrays only have two items show up in the
    +                 * AST, so we need to look at the token to verify that there's no
    +                 * dangling comma.
                      */
    -                if (isComma(commaToken)) {
    -                    validateCommaItemSpacing(previousItemToken, commaToken,
    -                            currentItemToken, reportItem);
    -                }
    -
    -                previousItemToken = item ? context.getLastToken(item) : previousItemToken;
    -            });
    -
    -            /*
    -             * Special case for array literals that have empty last items, such
    -             * as [ 1, 2, ]. These arrays only have two items show up in the
    -             * AST, so we need to look at the token to verify that there's no
    -             * dangling comma.
    -             */
    -            if (arrayLiteral) {
    -
    -                var lastToken = context.getLastToken(node),
    -                    nextToLastToken = context.getTokenBefore(lastToken);
    -
    -                if (isComma(nextToLastToken)) {
    -                    validateCommaItemSpacing(
    -                        context.getTokenBefore(nextToLastToken),
    -                        nextToLastToken,
    -                        lastToken,
    -                        lastToken
    -                    );
    +                if (arrayLiteral) {
    +
    +                    var lastToken = context.getLastToken(node),
    +                        nextToLastToken = context.getTokenBefore(lastToken);
    +
    +                    if (isComma(nextToLastToken)) {
    +                        validateCommaItemSpacing(
    +                            context.getTokenBefore(nextToLastToken),
    +                            nextToLastToken,
    +                            lastToken,
    +                            lastToken
    +                        );
    +                    }
                     }
                 }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    var nodes = {};
    +        var nodes = {};
     
    -    if (!exceptions.VariableDeclaration) {
    -        nodes.VariableDeclaration = function(node) {
    -            validateComma(node, "declarations");
    -        };
    -    }
    -    if (!exceptions.ObjectExpression) {
    -        nodes.ObjectExpression = function(node) {
    -            validateComma(node, "properties");
    -        };
    -    }
    -    if (!exceptions.ArrayExpression) {
    -        nodes.ArrayExpression = function(node) {
    -            validateComma(node, "elements");
    -        };
    -    }
    -
    -    return nodes;
    -};
    +        if (!exceptions.VariableDeclaration) {
    +            nodes.VariableDeclaration = function(node) {
    +                validateComma(node, "declarations");
    +            };
    +        }
    +        if (!exceptions.ObjectExpression) {
    +            nodes.ObjectExpression = function(node) {
    +                validateComma(node, "properties");
    +            };
    +        }
    +        if (!exceptions.ArrayExpression) {
    +            nodes.ArrayExpression = function(node) {
    +                validateComma(node, "elements");
    +            };
    +        }
     
    -module.exports.schema = [
    -    {
    -        "enum": ["first", "last"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "object",
    -                "additionalProperties": {
    -                    "type": "boolean"
    -                }
    -            }
    -        },
    -        "additionalProperties": false
    +        return nodes;
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/complexity.js b/tools/eslint/lib/rules/complexity.js
    index aa89c1414f6163..029b739808d6d7 100644
    --- a/tools/eslint/lib/rules/complexity.js
    +++ b/tools/eslint/lib/rules/complexity.js
    @@ -10,113 +10,153 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var THRESHOLD = (typeof context.options[0] !== "undefined") ? context.options[0] : 20;
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum cyclomatic complexity allowed in a program",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            maximum: {
    +                                type: "integer",
    +                                minimum: 0
    +                            },
    +                            max: {
    +                                type: "integer",
    +                                minimum: 0
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var option = context.options[0],
    +            THRESHOLD = 20;
    +
    +        if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") {
    +            THRESHOLD = option.maximum;
    +        }
    +        if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") {
    +            THRESHOLD = option.max;
    +        }
    +        if (typeof option === "number") {
    +            THRESHOLD = option;
    +        }
     
    -    // Using a stack to store complexity (handling nested functions)
    -    var fns = [];
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * When parsing a new function, store it in our function stack
    -     * @returns {void}
    -     * @private
    -     */
    -    function startFunction() {
    -        fns.push(1);
    -    }
    +        // Using a stack to store complexity (handling nested functions)
    +        var fns = [];
     
    -    /**
    -     * 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" || node.parent.type === "Property") {
    -            name = node.parent.key.name;
    +        /**
    +         * When parsing a new function, store it in our function stack
    +         * @returns {void}
    +         * @private
    +         */
    +        function startFunction() {
    +            fns.push(1);
             }
     
    -        if (complexity > THRESHOLD) {
    -            context.report(node, "Function '{{name}}' has a complexity of {{complexity}}.", { name: name, complexity: complexity });
    +        /**
    +         * 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" || node.parent.type === "Property") {
    +                name = node.parent.key.name;
    +            }
    +
    +            if (complexity > THRESHOLD) {
    +                context.report(node, "Function '{{name}}' has a complexity of {{complexity}}.", { name: name, complexity: complexity });
    +            }
             }
    -    }
     
    -    /**
    -     * Increase the complexity of the function in context
    -     * @returns {void}
    -     * @private
    -     */
    -    function increaseComplexity() {
    -        if (fns.length) {
    -            fns[fns.length - 1] ++;
    +        /**
    +         * 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) {
    -            increaseComplexity(node);
    +        /**
    +         * Increase the switch complexity in context
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function increaseSwitchComplexity(node) {
    +
    +            // Avoiding `default`
    +            if (node.test) {
    +                increaseComplexity(node);
    +            }
             }
    -    }
     
    -    /**
    -     * Increase the logical path complexity in context
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {void}
    -     * @private
    -     */
    -    function increaseLogicalComplexity(node) {
    -        // Avoiding &&
    -        if (node.operator === "||") {
    -            increaseComplexity(node);
    +        /**
    +         * Increase the logical path complexity in context
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function increaseLogicalComplexity(node) {
    +
    +            // Avoiding &&
    +            if (node.operator === "||") {
    +                increaseComplexity(node);
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "FunctionDeclaration": startFunction,
    -        "FunctionExpression": startFunction,
    -        "ArrowFunctionExpression": startFunction,
    -        "FunctionDeclaration:exit": endFunction,
    -        "FunctionExpression:exit": endFunction,
    -        "ArrowFunctionExpression:exit": endFunction,
    -
    -        "CatchClause": increaseComplexity,
    -        "ConditionalExpression": increaseComplexity,
    -        "LogicalExpression": increaseLogicalComplexity,
    -        "ForStatement": increaseComplexity,
    -        "ForInStatement": increaseComplexity,
    -        "ForOfStatement": increaseComplexity,
    -        "IfStatement": increaseComplexity,
    -        "SwitchCase": increaseSwitchComplexity,
    -        "WhileStatement": increaseComplexity,
    -        "DoWhileStatement": increaseComplexity
    -    };
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            FunctionDeclaration: startFunction,
    +            FunctionExpression: startFunction,
    +            ArrowFunctionExpression: startFunction,
    +            "FunctionDeclaration:exit": endFunction,
    +            "FunctionExpression:exit": endFunction,
    +            "ArrowFunctionExpression:exit": endFunction,
    +
    +            CatchClause: increaseComplexity,
    +            ConditionalExpression: increaseComplexity,
    +            LogicalExpression: increaseLogicalComplexity,
    +            ForStatement: increaseComplexity,
    +            ForInStatement: increaseComplexity,
    +            ForOfStatement: increaseComplexity,
    +            IfStatement: increaseComplexity,
    +            SwitchCase: increaseSwitchComplexity,
    +            WhileStatement: increaseComplexity,
    +            DoWhileStatement: increaseComplexity
    +        };
     
    -};
    -
    -module.exports.schema = [
    -    {
    -        "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 6462dfb90ee8f3..1ae674e90dbd2a 100644
    --- a/tools/eslint/lib/rules/computed-property-spacing.js
    +++ b/tools/eslint/lib/rules/computed-property-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Disallows or enforces spaces inside computed properties.
      * @author Jamund Ferguson
    - * @copyright 2015 Jamund Ferguson. All rights reserved.
      */
     "use strict";
     
    @@ -11,143 +10,155 @@ 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
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -    * 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, 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, 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]]);
    -            }
    -        });
    -    }
    -
    -    /**
    -    * 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, " ");
    -            }
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing inside computed property brackets",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -    * 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, " ");
    -            }
    -        });
    -    }
    +        fixable: "whitespace",
     
    -    /**
    -     * Returns a function that checks the spacing of a node on the property name
    -     * that was passed in.
    -     * @param {String} propertyName The property on the node to check for spacing
    -     * @returns {Function} A function that will check spacing on a node
    -     */
    -    function checkSpacing(propertyName) {
    -        return function(node) {
    -            if (!node.computed) {
    -                return;
    +        schema: [
    +            {
    +                enum: ["always", "never"]
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var sourceCode = context.getSourceCode();
    +        var propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
    +
    +        //--------------------------------------------------------------------------
    +        // 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.
    +        * @param {Token} tokenAfter - The token after `token`.
    +        * @returns {void}
    +        */
    +        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, 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]]);
    +                }
    +            });
    +        }
    +
    +        /**
    +        * 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 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, " ");
    +                }
    +            });
    +        }
    +
    +        /**
    +         * Returns a function that checks the spacing of a node on the property name
    +         * that was passed in.
    +         * @param {String} propertyName The property on the node to check for spacing
    +         * @returns {Function} A function that will check spacing on a node
    +         */
    +        function checkSpacing(propertyName) {
    +            return function(node) {
    +                if (!node.computed) {
    +                    return;
    +                }
     
    -            var property = node[propertyName];
    -
    -            var before = context.getTokenBefore(property),
    -                first = context.getFirstToken(property),
    -                last = context.getLastToken(property),
    -                after = context.getTokenAfter(property);
    -
    -            if (astUtils.isTokenOnSameLine(before, first)) {
    -                if (propertyNameMustBeSpaced) {
    -                    if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) {
    -                        reportRequiredBeginningSpace(node, before);
    -                    }
    -                } else {
    -                    if (sourceCode.isSpaceBetweenTokens(before, first)) {
    -                        reportNoBeginningSpace(node, before, first);
    +                var property = node[propertyName];
    +
    +                var before = context.getTokenBefore(property),
    +                    first = context.getFirstToken(property),
    +                    last = context.getLastToken(property),
    +                    after = context.getTokenAfter(property);
    +
    +                if (astUtils.isTokenOnSameLine(before, first)) {
    +                    if (propertyNameMustBeSpaced) {
    +                        if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) {
    +                            reportRequiredBeginningSpace(node, before);
    +                        }
    +                    } else {
    +                        if (sourceCode.isSpaceBetweenTokens(before, first)) {
    +                            reportNoBeginningSpace(node, before, first);
    +                        }
                         }
                     }
    -            }
     
    -            if (astUtils.isTokenOnSameLine(last, after)) {
    -                if (propertyNameMustBeSpaced) {
    -                    if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) {
    -                        reportRequiredEndingSpace(node, after);
    -                    }
    -                } else {
    -                    if (sourceCode.isSpaceBetweenTokens(last, after)) {
    -                        reportNoEndingSpace(node, after, last);
    +                if (astUtils.isTokenOnSameLine(last, after)) {
    +                    if (propertyNameMustBeSpaced) {
    +                        if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) {
    +                            reportRequiredEndingSpace(node, after);
    +                        }
    +                    } else {
    +                        if (sourceCode.isSpaceBetweenTokens(last, after)) {
    +                            reportNoEndingSpace(node, after, last);
    +                        }
                         }
                     }
    -            }
    -        };
    -    }
    -
    +            };
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
     
    -    return {
    -        Property: checkSpacing("key"),
    -        MemberExpression: checkSpacing("property")
    -    };
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -};
    +        return {
    +            Property: checkSpacing("key"),
    +            MemberExpression: checkSpacing("property")
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/consistent-return.js b/tools/eslint/lib/rules/consistent-return.js
    index 2c988bb4221d25..0e9a8c8b0f41cf 100644
    --- a/tools/eslint/lib/rules/consistent-return.js
    +++ b/tools/eslint/lib/rules/consistent-return.js
    @@ -4,6 +4,12 @@
      */
     "use strict";
     
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var astUtils = require("../ast-utils");
    +
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
    @@ -21,92 +27,110 @@ function isUnreachable(segment) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var funcInfo = null;
    -
    -    /**
    -     * 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}
    -     */
    -    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;
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `return` statements to either always or never specify values",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -        // 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";
    -        }
    +        schema: []
    +    },
     
    -        // Reports.
    -        context.report({
    -            node: node,
    -            loc: loc,
    -            message: "Expected to return a value at the end of this {{type}}.",
    -            data: {type: type}
    -        });
    -    }
    +    create: function(context) {
    +        var funcInfo = null;
     
    -    return {
    -        // 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;
    -        },
    +        /**
    +         * 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}
    +         */
    +        function checkLastSegment(node) {
    +            var loc, type;
    +
    +            /*
    +             * Skip if it expected no return value or unreachable.
    +             * When unreachable, all paths are returned or thrown.
    +             */
    +            if (!funcInfo.hasReturnValue ||
    +                funcInfo.codePath.currentSegments.every(isUnreachable) ||
    +                astUtils.isES5Constructor(node)
    +            ) {
    +                return;
    +            }
     
    -        // Reports a given return statement if it's inconsistent.
    -        "ReturnStatement": function(node) {
    -            var hasReturnValue = Boolean(node.argument);
    +            // Adjust a location and a message.
    +            if (node.type === "Program") {
     
    -            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});
    +                // 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";
                 }
    -        },
     
    -        // Reports a given program/function if the implicit returning is not consistent.
    -        "Program:exit": checkLastSegment,
    -        "FunctionDeclaration:exit": checkLastSegment,
    -        "FunctionExpression:exit": checkLastSegment,
    -        "ArrowFunctionExpression:exit": checkLastSegment
    -    };
    -};
    +            // Reports.
    +            context.report({
    +                node: node,
    +                loc: loc,
    +                message: "Expected to return a value at the end of this {{type}}.",
    +                data: {type: type}
    +            });
    +        }
     
    -module.exports.schema = [];
    +        return {
    +
    +            // 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 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
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/consistent-this.js b/tools/eslint/lib/rules/consistent-this.js
    index 364be712d1561d..042e1a0aaeddd5 100644
    --- a/tools/eslint/lib/rules/consistent-this.js
    +++ b/tools/eslint/lib/rules/consistent-this.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to enforce consistent naming of "this" context variables
      * @author Raphael Pigulla
    - * @copyright 2015 Timothy Jones. All rights reserved.
    - * @copyright 2015 David Aurelio. All rights reserved.
      */
     "use strict";
     
    @@ -10,130 +8,141 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    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, alias) {
    -        context.report(node,
    -            "Designated alias '{{alias}}' is not assigned to 'this'.",
    -            { alias: alias });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent naming when capturing the current execution context",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Checks that an assignment to an identifier only assigns 'this' to the
    -     * appropriate alias, and the alias is only assigned to 'this'.
    -     * @param {ASTNode} node - The assigning node.
    -     * @param {Identifier} name - The name of the variable assigned to.
    -     * @param {Expression} value - The value of the assignment.
    -     * @returns {void}
    -     */
    -    function checkAssignment(node, name, value) {
    -        var isThis = value.type === "ThisExpression";
    -
    -        if (aliases.indexOf(name) !== -1) {
    -            if (!isThis || node.operator && node.operator !== "=") {
    -                reportBadAssignment(node, name);
    -            }
    -        } else if (isThis) {
    -            context.report(node,
    -                "Unexpected alias '{{name}}' for 'this'.", { name: name });
    +        schema: {
    +            type: "array",
    +            items: {
    +                type: "string",
    +                minLength: 1
    +            },
    +            uniqueItems: true
             }
    -    }
    +    },
     
    -    /**
    -     * 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;
    -        }
    +    create: function(context) {
    +        var aliases = [];
     
    -        if (variable.defs.some(function(def) {
    -            return def.node.type === "VariableDeclarator" &&
    -            def.node.init !== null;
    -        })) {
    -            return;
    +        if (context.options.length === 0) {
    +            aliases.push("that");
    +        } else {
    +            aliases = context.options;
             }
     
    -        // 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);
    -            });
    +        /**
    +         * 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, alias) {
    +            context.report(node,
    +                "Designated alias '{{alias}}' is not assigned to 'this'.",
    +                { alias: alias });
             }
    -    }
    -
    -    /**
    -     * Check each alias to ensure that is was assinged to the correct value.
    -     * @returns {void}
    -     */
    -    function ensureWasAssigned() {
    -        var scope = context.getScope();
     
    -        aliases.forEach(function(alias) {
    -            checkWasAssigned(alias, scope);
    -        });
    -    }
    -
    -    return {
    -        "Program:exit": ensureWasAssigned,
    -        "FunctionExpression:exit": ensureWasAssigned,
    -        "FunctionDeclaration:exit": ensureWasAssigned,
    +        /**
    +         * Checks that an assignment to an identifier only assigns 'this' to the
    +         * appropriate alias, and the alias is only assigned to 'this'.
    +         * @param {ASTNode} node - The assigning node.
    +         * @param {Identifier} name - The name of the variable assigned to.
    +         * @param {Expression} value - The value of the assignment.
    +         * @returns {void}
    +         */
    +        function checkAssignment(node, name, value) {
    +            var isThis = value.type === "ThisExpression";
    +
    +            if (aliases.indexOf(name) !== -1) {
    +                if (!isThis || node.operator && node.operator !== "=") {
    +                    reportBadAssignment(node, name);
    +                }
    +            } else if (isThis) {
    +                context.report(node,
    +                    "Unexpected alias '{{name}}' for 'this'.", { name: name });
    +            }
    +        }
     
    -        "VariableDeclarator": function(node) {
    -            var id = node.id;
    -            var isDestructuring =
    -                id.type === "ArrayPattern" || id.type === "ObjectPattern";
    +        /**
    +         * 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 (node.init !== null && !isDestructuring) {
    -                checkAssignment(node, id.name, node.init);
    +            if (variable.defs.some(function(def) {
    +                return def.node.type === "VariableDeclarator" &&
    +                def.node.init !== null;
    +            })) {
    +                return;
                 }
    -        },
     
    -        "AssignmentExpression": function(node) {
    -            if (node.left.type === "Identifier") {
    -                checkAssignment(node, node.left.name, node.right);
    +            // 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();
     
    -module.exports.schema = {
    -    "type": "array",
    -    "items": {
    -        "type": "string",
    -        "minLength": 1
    -    },
    -    "uniqueItems": true
    +            aliases.forEach(function(alias) {
    +                checkWasAssigned(alias, scope);
    +            });
    +        }
    +
    +        return {
    +            "Program:exit": ensureWasAssigned,
    +            "FunctionExpression:exit": ensureWasAssigned,
    +            "FunctionDeclaration:exit": ensureWasAssigned,
    +
    +            VariableDeclarator: function(node) {
    +                var id = node.id;
    +                var isDestructuring =
    +                    id.type === "ArrayPattern" || id.type === "ObjectPattern";
    +
    +                if (node.init !== null && !isDestructuring) {
    +                    checkAssignment(node, id.name, node.init);
    +                }
    +            },
    +
    +            AssignmentExpression: function(node) {
    +                if (node.left.type === "Identifier") {
    +                    checkAssignment(node, node.left.name, node.right);
    +                }
    +            }
    +        };
    +
    +    }
     };
    diff --git a/tools/eslint/lib/rules/constructor-super.js b/tools/eslint/lib/rules/constructor-super.js
    index f66540ee0ad634..4b2aacf5755281 100644
    --- a/tools/eslint/lib/rules/constructor-super.js
    +++ b/tools/eslint/lib/rules/constructor-super.js
    @@ -1,21 +1,24 @@
     /**
      * @fileoverview A rule to verify `super()` callings in constructor.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
     
    -//------------------------------------------------------------------------------
    -// Requirements
    -//------------------------------------------------------------------------------
    -
    -var astUtils = require("../ast-utils");
    -
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
     
    +/**
    + * Checks whether a given code path segment is reachable or not.
    + *
    + * @param {CodePathSegment} segment - A code path segment to check.
    + * @returns {boolean} `true` if the segment is reachable.
    + */
    +function isReachable(segment) {
    +    return segment.reachable;
    +}
    +
     /**
      * Checks whether or not a given node is a constructor.
      * @param {ASTNode} node - A node to check. This node type is one of
    @@ -31,185 +34,352 @@ function isConstructorFunction(node) {
         );
     }
     
    +/**
    + * Checks whether a given node can be a constructor or not.
    + *
    + * @param {ASTNode} node - A node to check.
    + * @returns {boolean} `true` if the node can be a constructor.
    + */
    +function isPossibleConstructor(node) {
    +    if (!node) {
    +        return false;
    +    }
    +
    +    switch (node.type) {
    +        case "ClassExpression":
    +        case "FunctionExpression":
    +        case "ThisExpression":
    +        case "MemberExpression":
    +        case "CallExpression":
    +        case "NewExpression":
    +        case "YieldExpression":
    +        case "TaggedTemplateExpression":
    +        case "MetaProperty":
    +            return true;
    +
    +        case "Identifier":
    +            return node.name !== "undefined";
    +
    +        case "AssignmentExpression":
    +            return isPossibleConstructor(node.right);
    +
    +        case "LogicalExpression":
    +            return (
    +                isPossibleConstructor(node.left) ||
    +                isPossibleConstructor(node.right)
    +            );
    +
    +        case "ConditionalExpression":
    +            return (
    +                isPossibleConstructor(node.alternate) ||
    +                isPossibleConstructor(node.consequent)
    +            );
    +
    +        case "SequenceExpression":
    +            var lastExpression = node.expressions[node.expressions.length - 1];
    +
    +            return isPossibleConstructor(lastExpression);
    +
    +        default:
    +            return false;
    +    }
    +}
    +
     //------------------------------------------------------------------------------
     // 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;
    -
    -    // {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);
    -
    -    /**
    -     * 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 isCalledInSomePath(segment) {
    -        return segInfoMap[segment.id].calledInSomePaths;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `super()` calls in constructors",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
     
    -    /**
    -     * 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 isCalledInEveryPath(segment) {
    -        return segInfoMap[segment.id].calledInEveryPaths;
    -    }
    +        schema: []
    +    },
     
    -    return {
    -        /**
    -         * Stacks a constructor information.
    -         * @param {CodePath} codePath - A code path which was started.
    -         * @param {ASTNode} node - The current node.
    -         * @returns {void}
    +    create: 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.
              */
    -        "onCodePathStart": function(codePath, node) {
    -            if (!isConstructorFunction(node)) {
    -                return;
    -            }
    +        var funcInfo = null;
     
    -            // 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
    -            };
    -        },
    +        /*
    +         * {Map}
    +         * Information for each code path segment.
    +         * - calledInSomePaths:  A flag of be called `super()` in some code paths.
    +         * - calledInEveryPaths: A flag of be called `super()` in all code paths.
    +         * - validNodes:
    +         */
    +        var segInfoMap = Object.create(null);
     
             /**
    -         * 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}
    +         * 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
              */
    -        "onCodePathEnd": function(codePath, node) {
    -            if (!isConstructorFunction(node)) {
    -                return;
    -            }
    -
    -            // Skip if own class which has a valid `extends` part.
    -            var hasExtends = funcInfo.hasExtends;
    -            funcInfo = funcInfo.upper;
    -            if (!hasExtends) {
    -                return;
    -            }
    -
    -            // 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
    -                });
    -            }
    -        },
    +        function isCalledInSomePath(segment) {
    +            return segment.reachable && segInfoMap[segment.id].calledInSomePaths;
    +        }
     
             /**
    -         * Initialize information of a given code path segment.
    -         * @param {CodePathSegment} segment - A code path segment to initialize.
    -         * @returns {void}
    +         * 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.
              */
    -        "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;
    -            }
    +        function isCalledInEveryPath(segment) {
     
    -            // 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);
    +            /*
    +             * If specific segment is the looped segment of the current segment,
    +             * skip the segment.
    +             * If not skipped, this never becomes true after a loop.
    +             */
    +            if (segment.nextSegments.length === 1 &&
    +                segment.nextSegments[0].isLoopedPrevSegment(segment)
    +            ) {
    +                return true;
                 }
    -        },
    +            return segment.reachable && segInfoMap[segment.id].calledInEveryPaths;
    +        }
     
    -        /**
    -         * 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;
    -            }
    +        return {
     
    -            // Skip if this is not in a constructor.
    -            if (!(funcInfo && funcInfo.scope === context.getScope().variableScope)) {
    -                return;
    -            }
    +            /**
    +             * Stacks a constructor information.
    +             * @param {CodePath} codePath - A code path which was started.
    +             * @param {ASTNode} node - The current node.
    +             * @returns {void}
    +             */
    +            onCodePathStart: function(codePath, node) {
    +                if (isConstructorFunction(node)) {
     
    -            // 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];
    +                    // Class > ClassBody > MethodDefinition > FunctionExpression
    +                    var classNode = node.parent.parent.parent;
    +                    var superClass = classNode.superClass;
     
    -                    duplicate = duplicate || info.calledInSomePaths;
    -                    info.calledInSomePaths = info.calledInEveryPaths = true;
    +                    funcInfo = {
    +                        upper: funcInfo,
    +                        isConstructor: true,
    +                        hasExtends: Boolean(superClass),
    +                        superIsConstructor: isPossibleConstructor(superClass),
    +                        codePath: codePath
    +                    };
    +                } else {
    +                    funcInfo = {
    +                        upper: funcInfo,
    +                        isConstructor: false,
    +                        hasExtends: false,
    +                        superIsConstructor: false,
    +                        codePath: codePath
    +                    };
                     }
    +            },
     
    -                if (duplicate) {
    +            /**
    +             * 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}
    +             */
    +            onCodePathEnd: function(codePath, node) {
    +                var hasExtends = funcInfo.hasExtends;
    +
    +                // Pop.
    +                funcInfo = funcInfo.upper;
    +
    +                if (!hasExtends) {
    +                    return;
    +                }
    +
    +                // 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
    +                    });
    +                }
    +            },
    +
    +            /**
    +             * Initialize information of a given code path segment.
    +             * @param {CodePathSegment} segment - A code path segment to initialize.
    +             * @returns {void}
    +             */
    +            onCodePathSegmentStart: function(segment) {
    +                if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) {
    +                    return;
    +                }
    +
    +                // Initialize info.
    +                var info = segInfoMap[segment.id] = {
    +                    calledInSomePaths: false,
    +                    calledInEveryPaths: false,
    +                    validNodes: []
    +                };
    +
    +                // When there are previous segments, aggregates these.
    +                var prevSegments = segment.prevSegments;
    +
    +                if (prevSegments.length > 0) {
    +                    info.calledInSomePaths = prevSegments.some(isCalledInSomePath);
    +                    info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath);
    +                }
    +            },
    +
    +            /**
    +             * Update information of the code path segment when a code path was
    +             * looped.
    +             * @param {CodePathSegment} fromSegment - The code path segment of the
    +             *      end of a loop.
    +             * @param {CodePathSegment} toSegment - A code path segment of the head
    +             *      of a loop.
    +             * @returns {void}
    +             */
    +            onCodePathSegmentLoop: function(fromSegment, toSegment) {
    +                if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) {
    +                    return;
    +                }
    +
    +                // Update information inside of the loop.
    +                var isRealLoop = toSegment.prevSegments.length >= 2;
    +
    +                funcInfo.codePath.traverseSegments(
    +                    {first: toSegment, last: fromSegment},
    +                    function(segment) {
    +                        var info = segInfoMap[segment.id];
    +                        var prevSegments = segment.prevSegments;
    +
    +                        // Updates flags.
    +                        info.calledInSomePaths = prevSegments.some(isCalledInSomePath);
    +                        info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath);
    +
    +                        // If flags become true anew, reports the valid nodes.
    +                        if (info.calledInSomePaths || isRealLoop) {
    +                            var nodes = info.validNodes;
    +
    +                            info.validNodes = [];
    +
    +                            for (var i = 0; i < nodes.length; ++i) {
    +                                var node = nodes[i];
    +
    +                                context.report({
    +                                    message: "Unexpected duplicate 'super()'.",
    +                                    node: node
    +                                });
    +                            }
    +                        }
    +                    }
    +                );
    +            },
    +
    +            /**
    +             * Checks for a call of `super()`.
    +             * @param {ASTNode} node - A CallExpression node to check.
    +             * @returns {void}
    +             */
    +            "CallExpression:exit": function(node) {
    +                if (!(funcInfo && funcInfo.isConstructor)) {
    +                    return;
    +                }
    +
    +                // Skips except `super()`.
    +                if (node.callee.type !== "Super") {
    +                    return;
    +                }
    +
    +                // Reports if needed.
    +                if (funcInfo.hasExtends) {
    +                    var segments = funcInfo.codePath.currentSegments;
    +                    var reachable = false;
    +                    var duplicate = false;
    +
    +                    for (var i = 0; i < segments.length; ++i) {
    +                        var segment = segments[i];
    +
    +                        if (segment.reachable) {
    +                            var info = segInfoMap[segment.id];
    +
    +                            reachable = true;
    +                            duplicate = duplicate || info.calledInSomePaths;
    +                            info.calledInSomePaths = info.calledInEveryPaths = true;
    +                        }
    +                    }
    +
    +                    if (reachable) {
    +                        if (duplicate) {
    +                            context.report({
    +                                message: "Unexpected duplicate 'super()'.",
    +                                node: node
    +                            });
    +                        } else if (!funcInfo.superIsConstructor) {
    +                            context.report({
    +                                message: "Unexpected 'super()' because 'super' is not a constructor.",
    +                                node: node
    +                            });
    +                        } else {
    +                            info.validNodes.push(node);
    +                        }
    +                    }
    +                } else if (funcInfo.codePath.currentSegments.some(isReachable)) {
                         context.report({
    -                        message: "Unexpected duplicate 'super()'.",
    +                        message: "Unexpected '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);
    -        }
    -    };
    -};
    +            /**
    +             * Set the mark to the returned path as `super()` was called.
    +             * @param {ASTNode} node - A ReturnStatement node to check.
    +             * @returns {void}
    +             */
    +            ReturnStatement: function(node) {
    +                if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) {
    +                    return;
    +                }
     
    -module.exports.schema = [];
    +                // Skips if no argument.
    +                if (!node.argument) {
    +                    return;
    +                }
    +
    +                // Returning argument is a substitute of 'super()'.
    +                var segments = funcInfo.codePath.currentSegments;
    +
    +                for (var i = 0; i < segments.length; ++i) {
    +                    var segment = segments[i];
    +
    +                    if (segment.reachable) {
    +                        var info = segInfoMap[segment.id];
    +
    +                        info.calledInSomePaths = info.calledInEveryPaths = true;
    +                    }
    +                }
    +            },
    +
    +            /**
    +             * 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 cad5a831746b3f..0bc5fdb3de4261 100644
    --- a/tools/eslint/lib/rules/curly.js
    +++ b/tools/eslint/lib/rules/curly.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag statements without curly braces
      * @author Nicholas C. Zakas
    - * @copyright 2015 Ivan Nikulin. All rights reserved.
      */
     "use strict";
     
    @@ -15,274 +14,290 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Determines if a given node is a one-liner that's on the same line as it's preceding code.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code.
    -     * @private
    -     */
    -    function isCollapsedOneLiner(node) {
    -        var before = context.getTokenBefore(node),
    -            last = context.getLastToken(node);
    -        return before.loc.start.line === last.loc.end.line;
    -    }
    -
    -    /**
    -     * 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;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent brace style for all control statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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);
    +        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
    +                }
    +            ]
    +        }
    +    },
    +
    +    create: 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
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Determines if a given node is a one-liner that's on the same line as it's preceding code.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code.
    +         * @private
    +         */
    +        function isCollapsedOneLiner(node) {
    +            var before = context.getTokenBefore(node),
    +                last = context.getLastToken(node);
    +
    +            return before.loc.start.line === last.loc.end.line;
             }
     
    -        return token;
    -    }
    +        /**
    +         * 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;
    +        }
     
    -    /**
    -     * 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;
    +        /**
    +         * 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);
                 }
     
    -            node = node.consequent.body[0];
    -            while (node) {
    -                if (node.type === "IfStatement" && !node.alternate) {
    +            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 = astUtils.getTrailingStatement(node);
    +
    +                node = node.consequent.body[0];
    +                while (node) {
    +                    if (node.type === "IfStatement" && !node.alternate) {
    +                        return true;
    +                    }
    +                    node = astUtils.getTrailingStatement(node);
    +                }
                 }
    -        }
     
    -        return false;
    -    }
    +            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 "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 : "")
    -            }
    -        });
    -    }
    +        /**
    +         * 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 {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 prepareCheck(node, body, name, suffix) {
    -        var hasBlock = (body.type === "BlockStatement");
    -        var expected = null;
    -
    -        if (node.type === "IfStatement" && node.consequent === body && requiresBraceOfConsequent(node)) {
    -            expected = true;
    -        } else if (multiOnly) {
    -            if (hasBlock && body.body.length === 1) {
    -                expected = false;
    -            }
    -        } else if (multiLine) {
    -            if (!isCollapsedOneLiner(body)) {
    +        /**
    +         * 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 {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 prepareCheck(node, body, name, suffix) {
    +            var hasBlock = (body.type === "BlockStatement");
    +            var expected = null;
    +
    +            if (node.type === "IfStatement" && node.consequent === body && requiresBraceOfConsequent(node)) {
                     expected = true;
    -            }
    -        } else if (multiOrNest) {
    -            if (hasBlock && body.body.length === 1 && isOneLiner(body.body[0])) {
    -                expected = false;
    -            } else if (!isOneLiner(body)) {
    +            } else if (multiOnly) {
    +                if (hasBlock && body.body.length === 1) {
    +                    expected = false;
    +                }
    +            } else if (multiLine) {
    +                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 {
                     expected = true;
                 }
    -        } else {
    -            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);
    +            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;
    -    }
    -
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * 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;
    +                });
     
    -    return {
    -        "IfStatement": function(node) {
    -            if (node.parent.type !== "IfStatement") {
    -                prepareIfChecks(node).forEach(function(preparedCheck) {
    -                    preparedCheck.check();
    +                preparedChecks.forEach(function(preparedCheck) {
    +                    preparedCheck.expected = expected;
                     });
                 }
    -        },
     
    -        "WhileStatement": function(node) {
    -            prepareCheck(node, node.body, "while", "condition").check();
    -        },
    +            return preparedChecks;
    +        }
     
    -        "DoWhileStatement": function(node) {
    -            prepareCheck(node, node.body, "do").check();
    -        },
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -        "ForStatement": function(node) {
    -            prepareCheck(node, node.body, "for", "condition").check();
    -        },
    +        return {
    +            IfStatement: function(node) {
    +                if (node.parent.type !== "IfStatement") {
    +                    prepareIfChecks(node).forEach(function(preparedCheck) {
    +                        preparedCheck.check();
    +                    });
    +                }
    +            },
     
    -        "ForInStatement": function(node) {
    -            prepareCheck(node, node.body, "for-in").check();
    -        },
    +            WhileStatement: function(node) {
    +                prepareCheck(node, node.body, "while", "condition").check();
    +            },
     
    -        "ForOfStatement": function(node) {
    -            prepareCheck(node, node.body, "for-of").check();
    -        }
    -    };
    -};
    +            DoWhileStatement: function(node) {
    +                prepareCheck(node, node.body, "do").check();
    +            },
     
    -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
    -        }
    -    ]
    +            ForStatement: function(node) {
    +                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();
    +            }
    +        };
    +    }
     };
    diff --git a/tools/eslint/lib/rules/default-case.js b/tools/eslint/lib/rules/default-case.js
    index e8a748401e570d..a4f3eef3cc0768 100644
    --- a/tools/eslint/lib/rules/default-case.js
    +++ b/tools/eslint/lib/rules/default-case.js
    @@ -4,63 +4,89 @@
      */
     "use strict";
     
    -var COMMENT_VALUE = "no default";
    +var DEFAULT_COMMENT_PATTERN = /^no default$/;
     
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `default` cases in switch statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                commentPattern: {
    +                    type: "string"
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
    +
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var commentPattern = options.commentPattern ?
    +            new RegExp(options.commentPattern) :
    +            DEFAULT_COMMENT_PATTERN;
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Shortcut to get last element of array
    +         * @param  {*[]} collection Array
    +         * @returns {*} Last element
    +         */
    +        function last(collection) {
    +            return collection[collection.length - 1];
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * Shortcut to get last element of array
    -     * @param  {*[]} collection Array
    -     * @returns {*} Last element
    -     */
    -    function last(collection) {
    -        return collection[collection.length - 1];
    -    }
    +        return {
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +            SwitchStatement: function(node) {
     
    -    return {
    +                if (!node.cases.length) {
     
    -        "SwitchStatement": function(node) {
    +                    /*
    +                     * skip check of empty switch because there is no easy way
    +                     * to extract comments inside it now
    +                     */
    +                    return;
    +                }
     
    -            if (!node.cases.length) {
    -                // skip check of empty switch because there is no easy way
    -                // to extract comments inside it now
    -                return;
    -            }
    +                var hasDefault = node.cases.some(function(v) {
    +                    return v.test === null;
    +                });
     
    -            var hasDefault = node.cases.some(function(v) {
    -                return v.test === null;
    -            });
    +                if (!hasDefault) {
     
    -            if (!hasDefault) {
    +                    var comment;
    +                    var comments;
     
    -                var comment;
    -                var comments;
    +                    var lastCase = last(node.cases);
     
    -                var lastCase = last(node.cases);
    -                comments = context.getComments(lastCase).trailing;
    +                    comments = context.getComments(lastCase).trailing;
     
    -                if (comments.length) {
    -                    comment = last(comments);
    -                }
    +                    if (comments.length) {
    +                        comment = last(comments);
    +                    }
     
    -                if (!comment || comment.value.trim() !== COMMENT_VALUE) {
    -                    context.report(node, "Expected a default case.");
    +                    if (!comment || !commentPattern.test(comment.value.trim())) {
    +                        context.report(node, "Expected a default case.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/dot-location.js b/tools/eslint/lib/rules/dot-location.js
    index 403ffe2d5e7767..0e1c257d392a2a 100644
    --- a/tools/eslint/lib/rules/dot-location.js
    +++ b/tools/eslint/lib/rules/dot-location.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Validates newlines before and after dots
      * @author Greg Cochard
    - * @copyright 2015 Greg Cochard
      */
     
     "use strict";
    @@ -12,49 +11,61 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent newlines before and after dots",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                enum: ["object", "property"]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var config = context.options[0],
    +            onObject;
     
    -    var config = context.options[0],
             // default to onObject if no preference is passed
             onObject = config === "object" || !config;
     
    -    /**
    -     * Reports if the dot between object and property is on the correct loccation.
    -     * @param {ASTNode} obj The object owning the property.
    -     * @param {ASTNode} prop The property of the object.
    -     * @param {ASTNode} node The corresponding node of the token.
    -     * @returns {void}
    -     */
    -    function checkDotLocation(obj, prop, node) {
    -        var dot = context.getTokenBefore(prop);
    -
    -        if (dot.type === "Punctuator" && dot.value === ".") {
    -            if (onObject) {
    -                if (!astUtils.isTokenOnSameLine(obj, dot)) {
    -                    context.report(node, dot.loc.start, "Expected dot to be on same line as object.");
    +        /**
    +         * Reports if the dot between object and property is on the correct loccation.
    +         * @param {ASTNode} obj The object owning the property.
    +         * @param {ASTNode} prop The property of the object.
    +         * @param {ASTNode} node The corresponding node of the token.
    +         * @returns {void}
    +         */
    +        function checkDotLocation(obj, prop, node) {
    +            var dot = context.getTokenBefore(prop);
    +
    +            if (dot.type === "Punctuator" && dot.value === ".") {
    +                if (onObject) {
    +                    if (!astUtils.isTokenOnSameLine(obj, dot)) {
    +                        context.report(node, dot.loc.start, "Expected dot to be on same line as object.");
    +                    }
    +                } else if (!astUtils.isTokenOnSameLine(dot, prop)) {
    +                    context.report(node, dot.loc.start, "Expected dot to be on same line as property.");
                     }
    -            } else if (!astUtils.isTokenOnSameLine(dot, prop)) {
    -                context.report(node, dot.loc.start, "Expected dot to be on same line as property.");
                 }
             }
    -    }
     
    -    /**
    -     * Checks the spacing of the dot within a member expression.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     */
    -    function checkNode(node) {
    -        checkDotLocation(node.object, node.property, node);
    -    }
    -
    -    return {
    -        "MemberExpression": checkNode
    -    };
    -};
    +        /**
    +         * Checks the spacing of the dot within a member expression.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         */
    +        function checkNode(node) {
    +            checkDotLocation(node.object, node.property, node);
    +        }
     
    -module.exports.schema = [
    -    {
    -        "enum": ["object", "property"]
    +        return {
    +            MemberExpression: checkNode
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/dot-notation.js b/tools/eslint/lib/rules/dot-notation.js
    index 255d08ada67394..07e0b0a8db82a7 100644
    --- a/tools/eslint/lib/rules/dot-notation.js
    +++ b/tools/eslint/lib/rules/dot-notation.js
    @@ -11,49 +11,60 @@
     var validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
     var keywords = require("../util/keywords");
     
    -module.exports = function(context) {
    -    var options = context.options[0] || {};
    -    var allowKeywords = options.allowKeywords === void 0 || !!options.allowKeywords;
    -
    -    var allowPattern;
    -    if (options.allowPattern) {
    -        allowPattern = new RegExp(options.allowPattern);
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce dot notation whenever possible",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    -        "MemberExpression": function(node) {
    -            if (
    -                node.computed &&
    -                node.property.type === "Literal" &&
    -                validIdentifier.test(node.property.value) &&
    -                (allowKeywords || keywords.indexOf("" + node.property.value) === -1)
    -            ) {
    -                if (!(allowPattern && allowPattern.test(node.property.value))) {
    -                    context.report(node, "[" + JSON.stringify(node.property.value) + "] is better written in dot notation.");
    -                }
    -            }
    -            if (
    -                !allowKeywords &&
    -                !node.computed &&
    -                keywords.indexOf("" + node.property.name) !== -1
    -            ) {
    -                context.report(node, "." + node.property.name + " is a syntax error.");
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowKeywords: {
    +                        type: "boolean"
    +                    },
    +                    allowPattern: {
    +                        type: "string"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var allowKeywords = options.allowKeywords === void 0 || !!options.allowKeywords;
    +
    +        var allowPattern;
    +
    +        if (options.allowPattern) {
    +            allowPattern = new RegExp(options.allowPattern);
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "allowKeywords": {
    -                "type": "boolean"
    -            },
    -            "allowPattern": {
    -                "type": "string"
    +        return {
    +            MemberExpression: function(node) {
    +                if (
    +                    node.computed &&
    +                    node.property.type === "Literal" &&
    +                    validIdentifier.test(node.property.value) &&
    +                    (allowKeywords || keywords.indexOf("" + node.property.value) === -1)
    +                ) {
    +                    if (!(allowPattern && allowPattern.test(node.property.value))) {
    +                        context.report(node.property, "[" + JSON.stringify(node.property.value) + "] is better written in dot notation.");
    +                    }
    +                }
    +                if (
    +                    !allowKeywords &&
    +                    !node.computed &&
    +                    keywords.indexOf("" + node.property.name) !== -1
    +                ) {
    +                    context.report(node.property, "." + node.property.name + " is a syntax error.");
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/eol-last.js b/tools/eslint/lib/rules/eol-last.js
    index 33a09b0573f643..1bd7c2897a6e71 100644
    --- a/tools/eslint/lib/rules/eol-last.js
    +++ b/tools/eslint/lib/rules/eol-last.js
    @@ -8,41 +8,55 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -
    -        "Program": function checkBadEOF(node) {
    -            // Get the whole source code, not for node only.
    -            var src = context.getSource(),
    -                location = {column: 1},
    -                linebreakStyle = context.options[0] || "unix",
    -                linebreak = linebreakStyle === "unix" ? "\n" : "\r\n";
    -
    -            if (src[src.length - 1] !== "\n") {
    -                // file is not newline-terminated
    -                location.line = src.split(/\n/g).length;
    -                context.report({
    -                    node: node,
    -                    loc: location,
    -                    message: "Newline required at end of file but not found.",
    -                    fix: function(fixer) {
    -                        return fixer.insertTextAfterRange([0, src.length], linebreak);
    -                    }
    -                });
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce at least one newline at the end of files",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                enum: ["unix", "windows"]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +
    +            Program: function checkBadEOF(node) {
    +
    +                // Get the whole source code, not for node only.
    +                var src = context.getSource(),
    +                    location = {column: 1},
    +                    linebreakStyle = context.options[0] || "unix",
    +                    linebreak = linebreakStyle === "unix" ? "\n" : "\r\n";
    +
    +                if (src[src.length - 1] !== "\n") {
    +
    +                    // file is not newline-terminated
    +                    location.line = src.split(/\n/g).length;
    +                    context.report({
    +                        node: node,
    +                        loc: location,
    +                        message: "Newline required at end of file but not found.",
    +                        fix: function(fixer) {
    +                            return fixer.insertTextAfterRange([0, src.length], linebreak);
    +                        }
    +                    });
    +                }
                 }
    -        }
    -
    -    };
     
    -};
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["unix", "windows"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/eqeqeq.js b/tools/eslint/lib/rules/eqeqeq.js
    index 6650740f909157..f1d1d1542928f6 100644
    --- a/tools/eslint/lib/rules/eqeqeq.js
    +++ b/tools/eslint/lib/rules/eqeqeq.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,90 +9,101 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require the use of `===` and `!==`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Checks if an expression is a typeof expression
    -     * @param  {ASTNode} node The node to check
    -     * @returns {boolean} if the node is a typeof expression
    -     */
    -    function isTypeOf(node) {
    -        return node.type === "UnaryExpression" && node.operator === "typeof";
    -    }
    +        schema: [
    +            {
    +                enum: ["smart", "allow-null"]
    +            }
    +        ]
    +    },
     
    -    /**
    -     * Checks if either operand of a binary expression is a typeof operation
    -     * @param {ASTNode} node The node to check
    -     * @returns {boolean} if one of the operands is typeof
    -     * @private
    -     */
    -    function isTypeOfBinary(node) {
    -        return isTypeOf(node.left) || isTypeOf(node.right);
    -    }
    +    create: function(context) {
     
    -    /**
    -     * Checks if operands are literals of the same type (via typeof)
    -     * @param {ASTNode} node The node to check
    -     * @returns {boolean} if operands are of same type
    -     * @private
    -     */
    -    function areLiteralsAndSameType(node) {
    -        return node.left.type === "Literal" && node.right.type === "Literal" &&
    -                typeof node.left.value === typeof node.right.value;
    -    }
    +        /**
    +         * Checks if an expression is a typeof expression
    +         * @param  {ASTNode} node The node to check
    +         * @returns {boolean} if the node is a typeof expression
    +         */
    +        function isTypeOf(node) {
    +            return node.type === "UnaryExpression" && node.operator === "typeof";
    +        }
     
    -    /**
    -     * Checks if one of the operands is a literal null
    -     * @param {ASTNode} node The node to check
    -     * @returns {boolean} if operands are null
    -     * @private
    -     */
    -    function isNullCheck(node) {
    -        return (node.right.type === "Literal" && node.right.value === null) ||
    -                (node.left.type === "Literal" && node.left.value === null);
    -    }
    +        /**
    +         * Checks if either operand of a binary expression is a typeof operation
    +         * @param {ASTNode} node The node to check
    +         * @returns {boolean} if one of the operands is typeof
    +         * @private
    +         */
    +        function isTypeOfBinary(node) {
    +            return isTypeOf(node.left) || isTypeOf(node.right);
    +        }
     
    -    /**
    -     * Gets the location (line and column) of the binary expression's operator
    -     * @param {ASTNode} node The binary expression node to check
    -     * @param {String} operator The operator to find
    -     * @returns {Object} { line, column } location of operator
    -     * @private
    -     */
    -    function getOperatorLocation(node) {
    -        var opToken = context.getTokenAfter(node.left);
    -        return {line: opToken.loc.start.line, column: opToken.loc.start.column};
    -    }
    +        /**
    +         * Checks if operands are literals of the same type (via typeof)
    +         * @param {ASTNode} node The node to check
    +         * @returns {boolean} if operands are of same type
    +         * @private
    +         */
    +        function areLiteralsAndSameType(node) {
    +            return node.left.type === "Literal" && node.right.type === "Literal" &&
    +                    typeof node.left.value === typeof node.right.value;
    +        }
     
    -    return {
    -        "BinaryExpression": function(node) {
    -            if (node.operator !== "==" && node.operator !== "!=") {
    -                return;
    -            }
    +        /**
    +         * Checks if one of the operands is a literal null
    +         * @param {ASTNode} node The node to check
    +         * @returns {boolean} if operands are null
    +         * @private
    +         */
    +        function isNullCheck(node) {
    +            return (node.right.type === "Literal" && node.right.value === null) ||
    +                    (node.left.type === "Literal" && node.left.value === null);
    +        }
     
    -            if (context.options[0] === "smart" && (isTypeOfBinary(node) ||
    -                    areLiteralsAndSameType(node) || isNullCheck(node))) {
    -                return;
    -            }
    +        /**
    +         * Gets the location (line and column) of the binary expression's operator
    +         * @param {ASTNode} node The binary expression node to check
    +         * @param {String} operator The operator to find
    +         * @returns {Object} { line, column } location of operator
    +         * @private
    +         */
    +        function getOperatorLocation(node) {
    +            var opToken = context.getTokenAfter(node.left);
     
    -            if (context.options[0] === "allow-null" && isNullCheck(node)) {
    -                return;
    -            }
    +            return {line: opToken.loc.start.line, column: opToken.loc.start.column};
    +        }
     
    -            context.report({
    -                node: node,
    -                loc: getOperatorLocation(node),
    -                message: "Expected '{{op}}=' and instead saw '{{op}}'.",
    -                data: { op: node.operator }
    -            });
    +        return {
    +            BinaryExpression: function(node) {
    +                if (node.operator !== "==" && node.operator !== "!=") {
    +                    return;
    +                }
     
    -        }
    -    };
    +                if (context.options[0] === "smart" && (isTypeOfBinary(node) ||
    +                        areLiteralsAndSameType(node) || isNullCheck(node))) {
    +                    return;
    +                }
     
    -};
    +                if (context.options[0] === "allow-null" && isNullCheck(node)) {
    +                    return;
    +                }
    +
    +                context.report({
    +                    node: node,
    +                    loc: getOperatorLocation(node),
    +                    message: "Expected '{{op}}=' and instead saw '{{op}}'.",
    +                    data: { op: node.operator }
    +                });
    +
    +            }
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["smart", "allow-null"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/func-names.js b/tools/eslint/lib/rules/func-names.js
    index a4fb59edd6333d..51a1ffe0468704 100644
    --- a/tools/eslint/lib/rules/func-names.js
    +++ b/tools/eslint/lib/rules/func-names.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to warn when a function expression does not have a name.
      * @author Kyle T. Nunery
    - * @copyright 2015 Brandon Mills. All rights reserved.
    - * @copyright 2014 Kyle T. Nunery. All rights reserved.
      */
     
     "use strict";
    @@ -11,35 +9,45 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    /**
    -     * Determines whether the current FunctionExpression node is a get, set, or
    -     * shorthand method in an object literal or a class.
    -     * @returns {boolean} True if the node is a get, set, or shorthand method.
    -     */
    -    function isObjectOrClassMethod() {
    -        var parent = context.getAncestors().pop();
    -
    -        return (parent.type === "MethodDefinition" || (
    -            parent.type === "Property" && (
    -                parent.method ||
    -                parent.kind === "get" ||
    -                parent.kind === "set"
    -            )
    -        ));
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce named `function` expressions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * Determines whether the current FunctionExpression node is a get, set, or
    +         * shorthand method in an object literal or a class.
    +         * @returns {boolean} True if the node is a get, set, or shorthand method.
    +         */
    +        function isObjectOrClassMethod() {
    +            var parent = context.getAncestors().pop();
    +
    +            return (parent.type === "MethodDefinition" || (
    +                parent.type === "Property" && (
    +                    parent.method ||
    +                    parent.kind === "get" ||
    +                    parent.kind === "set"
    +                )
    +            ));
    +        }
     
    -    return {
    -        "FunctionExpression": function(node) {
    +        return {
    +            FunctionExpression: function(node) {
     
    -            var name = node.id && node.id.name;
    +                var name = node.id && node.id.name;
     
    -            if (!name && !isObjectOrClassMethod()) {
    -                context.report(node, "Missing function expression name.");
    +                if (!name && !isObjectOrClassMethod()) {
    +                    context.report(node, "Missing function expression name.");
    +                }
                 }
    -        }
    -    };
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/func-style.js b/tools/eslint/lib/rules/func-style.js
    index 661c0157388b1f..9dad6c0755656d 100644
    --- a/tools/eslint/lib/rules/func-style.js
    +++ b/tools/eslint/lib/rules/func-style.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to enforce a particular function style
      * @author Nicholas C. Zakas
    - * @copyright 2013 Nicholas C. Zakas. All rights reserved.
      */
     "use strict";
     
    @@ -9,76 +8,86 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce the consistent use of either `function` declarations or expressions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                enum: ["declaration", "expression"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    allowArrowFunctions: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    var style = context.options[0],
    -        allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true,
    -        enforceDeclarations = (style === "declaration"),
    -        stack = [];
    +    create: function(context) {
     
    -    var nodesToCheck = {
    -        "Program": function() {
    +        var style = context.options[0],
    +            allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true,
    +            enforceDeclarations = (style === "declaration"),
                 stack = [];
    -        },
     
    -        "FunctionDeclaration": function(node) {
    -            stack.push(false);
    +        var nodesToCheck = {
    +            Program: function() {
    +                stack = [];
    +            },
     
    -            if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") {
    -                context.report(node, "Expected a function expression.");
    -            }
    -        },
    -        "FunctionDeclaration:exit": function() {
    -            stack.pop();
    -        },
    +            FunctionDeclaration: function(node) {
    +                stack.push(false);
     
    -        "FunctionExpression": function(node) {
    -            stack.push(false);
    +                if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") {
    +                    context.report(node, "Expected a function expression.");
    +                }
    +            },
    +            "FunctionDeclaration:exit": function() {
    +                stack.pop();
    +            },
     
    -            if (enforceDeclarations && node.parent.type === "VariableDeclarator") {
    -                context.report(node.parent, "Expected a function declaration.");
    -            }
    -        },
    -        "FunctionExpression:exit": function() {
    -            stack.pop();
    -        },
    +            FunctionExpression: function(node) {
    +                stack.push(false);
     
    -        "ThisExpression": function() {
    -            if (stack.length > 0) {
    -                stack[stack.length - 1] = true;
    -            }
    -        }
    -    };
    +                if (enforceDeclarations && node.parent.type === "VariableDeclarator") {
    +                    context.report(node.parent, "Expected a function declaration.");
    +                }
    +            },
    +            "FunctionExpression:exit": function() {
    +                stack.pop();
    +            },
     
    -    if (!allowArrowFunctions) {
    -        nodesToCheck.ArrowFunctionExpression = function() {
    -            stack.push(false);
    +            ThisExpression: function() {
    +                if (stack.length > 0) {
    +                    stack[stack.length - 1] = true;
    +                }
    +            }
             };
     
    -        nodesToCheck["ArrowFunctionExpression:exit"] = function(node) {
    -            var hasThisExpr = stack.pop();
    +        if (!allowArrowFunctions) {
    +            nodesToCheck.ArrowFunctionExpression = function() {
    +                stack.push(false);
    +            };
     
    -            if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") {
    -                context.report(node.parent, "Expected a function declaration.");
    -            }
    -        };
    -    }
    +            nodesToCheck["ArrowFunctionExpression:exit"] = function(node) {
    +                var hasThisExpr = stack.pop();
     
    -    return nodesToCheck;
    +                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 210638a4ec1adb..f05f9f4201b1eb 100644
    --- a/tools/eslint/lib/rules/generator-star-spacing.js
    +++ b/tools/eslint/lib/rules/generator-star-spacing.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to check the spacing around the * in generator functions.
      * @author Jamund Ferguson
    - * @copyright 2015 Brandon Mills. All rights reserved.
    - * @copyright 2014 Jamund Ferguson. All rights reserved.
      */
     
     "use strict";
    @@ -11,104 +9,114 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing around `*` operators in generator functions",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    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 || "before"];
    -        }
    -        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 (!!(rightToken.range[0] - leftToken.range[1]) !== 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, " ");
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["before", "after", "both", "neither"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            before: {type: "boolean"},
    +                            after: {type: "boolean"}
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        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 || "before"];
    +            }
    +            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 (!!(rightToken.range[0] - leftToken.range[1]) !== 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.insertTextBefore(node, " ");
    +                        return fixer.removeRange([leftToken.range[1], rightToken.range[0]]);
                         }
    -                    return fixer.removeRange([leftToken.range[1], rightToken.range[0]]);
    -                }
    -            });
    +                });
    +            }
             }
    -    }
     
    -    /**
    -     * Enforces the spacing around the star if node is a generator function.
    -     * @param {ASTNode} node A function expression or declaration node.
    -     * @returns {void}
    -     */
    -    function checkFunction(node) {
    -        var prevToken, starToken, nextToken;
    +        /**
    +         * Enforces the spacing around the star if node is a generator function.
    +         * @param {ASTNode} node A function expression or declaration node.
    +         * @returns {void}
    +         */
    +        function checkFunction(node) {
    +            var prevToken, starToken, nextToken;
     
    -        if (!node.generator) {
    -            return;
    -        }
    +            if (!node.generator) {
    +                return;
    +            }
     
    -        if (node.parent.method || node.parent.type === "MethodDefinition") {
    -            starToken = context.getTokenBefore(node, 1);
    -        } else {
    -            starToken = context.getFirstToken(node, 1);
    -        }
    +            if (node.parent.method || node.parent.type === "MethodDefinition") {
    +                starToken = context.getTokenBefore(node, 1);
    +            } else {
    +                starToken = context.getFirstToken(node, 1);
    +            }
     
    -        // Only check before when preceded by `function` keyword
    -        prevToken = context.getTokenBefore(starToken);
    -        if (prevToken.value === "function" || prevToken.value === "static") {
    -            checkSpacing("before", prevToken, starToken);
    -        }
    +            // Only check before when preceded by `function` keyword
    +            prevToken = context.getTokenBefore(starToken);
    +            if (prevToken.value === "function" || prevToken.value === "static") {
    +                checkSpacing("before", prevToken, starToken);
    +            }
     
    -        // Only check after when followed by an identifier
    -        nextToken = context.getTokenAfter(starToken);
    -        if (nextToken.type === "Identifier") {
    +            nextToken = context.getTokenAfter(starToken);
                 checkSpacing("after", starToken, nextToken);
             }
    -    }
     
    -    return {
    -        "FunctionDeclaration": checkFunction,
    -        "FunctionExpression": checkFunction
    -    };
    +        return {
    +            FunctionDeclaration: checkFunction,
    +            FunctionExpression: checkFunction
    +        };
     
    -};
    -
    -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/global-require.js b/tools/eslint/lib/rules/global-require.js
    index 70125cf63b3672..d1298719a9a80d 100644
    --- a/tools/eslint/lib/rules/global-require.js
    +++ b/tools/eslint/lib/rules/global-require.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule for disallowing require() outside of the top-level module context
      * @author Jamund Ferguson
    - * @copyright 2015 Jamund Ferguson. All rights reserved.
      */
     
     "use strict";
    @@ -45,25 +44,36 @@ function findReference(scope, node) {
      */
     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;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `require()` calls to be placed at top-level module scope",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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().");
    +                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/guard-for-in.js b/tools/eslint/lib/rules/guard-for-in.js
    index 925e11817b0d15..b43dda39e46968 100644
    --- a/tools/eslint/lib/rules/guard-for-in.js
    +++ b/tools/eslint/lib/rules/guard-for-in.js
    @@ -9,24 +9,34 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `for-in` loops to include an `if` statement",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "ForInStatement": function(node) {
    +    create: function(context) {
     
    -            /*
    -             * If the for-in statement has {}, then the real body is the body
    -             * of the BlockStatement. Otherwise, just use body as provided.
    -             */
    -            var body = node.body.type === "BlockStatement" ? node.body.body[0] : node.body;
    +        return {
     
    -            if (body && body.type !== "IfStatement") {
    -                context.report(node, "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.");
    +            ForInStatement: function(node) {
    +
    +                /*
    +                 * If the for-in statement has {}, then the real body is the body
    +                 * of the BlockStatement. Otherwise, just use body as provided.
    +                 */
    +                var body = node.body.type === "BlockStatement" ? node.body.body[0] : node.body;
    +
    +                if (body && body.type !== "IfStatement") {
    +                    context.report(node, "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/handle-callback-err.js b/tools/eslint/lib/rules/handle-callback-err.js
    index 600a04fcfa8ef9..09bf0da9771428 100644
    --- a/tools/eslint/lib/rules/handle-callback-err.js
    +++ b/tools/eslint/lib/rules/handle-callback-err.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Ensure handling of errors when we know they exist.
      * @author Jamund Ferguson
    - * @copyright 2015 Mathias Schreck.
    - * @copyright 2014 Jamund Ferguson. All rights reserved.
      */
     
     "use strict";
    @@ -11,71 +9,83 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require error handling in callbacks",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    var errorArgument = context.options[0] || "err";
    +        schema: [
    +            {
    +                type: "string"
    +            }
    +        ]
    +    },
     
    -    /**
    -     * Checks if the given argument should be interpreted as a regexp pattern.
    -     * @param {string} stringToCheck The string which should be checked.
    -     * @returns {boolean} Whether or not the string should be interpreted as a pattern.
    -     */
    -    function isPattern(stringToCheck) {
    -        var firstChar = stringToCheck[0];
    -        return firstChar === "^";
    -    }
    +    create: function(context) {
     
    -    /**
    -     * Checks if the given name matches the configured error argument.
    -     * @param {string} name The name which should be compared.
    -     * @returns {boolean} Whether or not the given name matches the configured error variable name.
    -     */
    -    function matchesConfiguredErrorName(name) {
    -        if (isPattern(errorArgument)) {
    -            var regexp = new RegExp(errorArgument);
    -            return regexp.test(name);
    -        }
    -        return name === errorArgument;
    -    }
    +        var errorArgument = context.options[0] || "err";
     
    -    /**
    -     * Get the parameters of a given function scope.
    -     * @param {object} scope The function scope.
    -     * @returns {array} All parameters of the given scope.
    -     */
    -    function getParameters(scope) {
    -        return scope.variables.filter(function(variable) {
    -            return variable.defs[0] && variable.defs[0].type === "Parameter";
    -        });
    -    }
    +        /**
    +         * Checks if the given argument should be interpreted as a regexp pattern.
    +         * @param {string} stringToCheck The string which should be checked.
    +         * @returns {boolean} Whether or not the string should be interpreted as a pattern.
    +         */
    +        function isPattern(stringToCheck) {
    +            var firstChar = stringToCheck[0];
    +
    +            return firstChar === "^";
    +        }
     
    -    /**
    -     * Check to see if we're handling the error object properly.
    -     * @param {ASTNode} node The AST node to check.
    -     * @returns {void}
    -     */
    -    function checkForError(node) {
    -        var scope = context.getScope(),
    -            parameters = getParameters(scope),
    -            firstParameter = parameters[0];
    +        /**
    +         * Checks if the given name matches the configured error argument.
    +         * @param {string} name The name which should be compared.
    +         * @returns {boolean} Whether or not the given name matches the configured error variable name.
    +         */
    +        function matchesConfiguredErrorName(name) {
    +            if (isPattern(errorArgument)) {
    +                var regexp = new RegExp(errorArgument);
     
    -        if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) {
    -            if (firstParameter.references.length === 0) {
    -                context.report(node, "Expected error to be handled.");
    +                return regexp.test(name);
                 }
    +            return name === errorArgument;
             }
    -    }
     
    -    return {
    -        "FunctionDeclaration": checkForError,
    -        "FunctionExpression": checkForError,
    -        "ArrowFunctionExpression": checkForError
    -    };
    +        /**
    +         * Get the parameters of a given function scope.
    +         * @param {object} scope The function scope.
    +         * @returns {array} All parameters of the given scope.
    +         */
    +        function getParameters(scope) {
    +            return scope.variables.filter(function(variable) {
    +                return variable.defs[0] && variable.defs[0].type === "Parameter";
    +            });
    +        }
     
    -};
    +        /**
    +         * Check to see if we're handling the error object properly.
    +         * @param {ASTNode} node The AST node to check.
    +         * @returns {void}
    +         */
    +        function checkForError(node) {
    +            var scope = context.getScope(),
    +                parameters = getParameters(scope),
    +                firstParameter = parameters[0];
    +
    +            if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) {
    +                if (firstParameter.references.length === 0) {
    +                    context.report(node, "Expected error to be handled.");
    +                }
    +            }
    +        }
    +
    +        return {
    +            FunctionDeclaration: checkForError,
    +            FunctionExpression: checkForError,
    +            ArrowFunctionExpression: checkForError
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "string"
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/id-blacklist.js b/tools/eslint/lib/rules/id-blacklist.js
    index 42eaf53786ff7d..142d8d21f4bc63 100644
    --- a/tools/eslint/lib/rules/id-blacklist.js
    +++ b/tools/eslint/lib/rules/id-blacklist.js
    @@ -1,11 +1,7 @@
     /**
      * @fileoverview Rule that warns when identifier names that are
    -                 blacklisted in the configuration are used.
    + * 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";
    @@ -14,97 +10,108 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified identifiers",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: {
    +            type: "array",
    +            items: {
    +                type: "string"
    +            },
    +            uniqueItems: true
    +        }
    +    },
     
    -    var blacklist = context.options;
    +    create: function(context) {
     
     
    -    /**
    -     * 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;
    -    }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * 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);
    -    }
    +        var blacklist = context.options;
     
    -    /**
    -     * 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 {
    +        /**
    +         * 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;
    +        }
     
    -        "Identifier": function(node) {
    -            var name = node.name,
    -                effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent;
    +        /**
    +         * 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);
    +        }
     
    -            // MemberExpressions get special rules
    -            if (node.parent.type === "MemberExpression") {
    +        /**
    +         * 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
    +            });
    +        }
     
    -                // Always check object names
    -                if (node.parent.object.type === "Identifier" &&
    -                    node.parent.object.name === node.name) {
    -                    if (isInvalid(name)) {
    -                        report(node);
    +        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);
    +                        }
                         }
     
    -                    // 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)) {
    +                // Properties have their own rules
    +                } else if (node.parent.type === "Property") {
    +
    +                    if (shouldReport(effectiveParent, name)) {
                             report(node);
                         }
    -                }
     
    -            // Properties have their own rules
    -            } else if (node.parent.type === "Property") {
    -
    -                if (shouldReport(effectiveParent, name)) {
    +                // Report anything that is a match and not a CallExpression
    +                } else 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
    index 0ea42e14ef4bda..43437513acb480 100644
    --- a/tools/eslint/lib/rules/id-length.js
    +++ b/tools/eslint/lib/rules/id-length.js
    @@ -1,9 +1,7 @@
     /**
      * @fileoverview Rule that warns when identifier names are shorter or longer
    - *               than the values provided in configuration.
    + * 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";
    @@ -12,95 +10,105 @@
     // 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;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce minimum and maximum identifier lengths",
    +            category: "Stylistic Issues",
    +            recommended: false
             },
    -        "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
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    min: {
    +                        type: "number"
    +                    },
    +                    max: {
    +                        type: "number"
    +                    },
    +                    exceptions: {
    +                        type: "array",
    +                        uniqueItems: true,
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    properties: {
    +                        enum: ["always", "never"]
    +                    }
    +                },
    +                additionalProperties: false
                 }
    +        ]
    +    },
     
    -            var isValidExpression = SUPPORTED_EXPRESSIONS[parent.type];
    +    create: 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;
     
    -            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 }
    -                );
    -            }
    -        }
    -    };
    -};
    +                return obj;
    +            }, {});
    +
    +        var SUPPORTED_EXPRESSIONS = {
    +            MemberExpression: properties && function(parent) {
    +                return !parent.computed && (
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "min": {
    -                "type": "number"
    +                    // 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)
    +                );
                 },
    -            "max": {
    -                "type": "number"
    +            AssignmentPattern: function(parent, node) {
    +                return parent.left === node;
                 },
    -            "exceptions": {
    -                "type": "array",
    -                "uniqueItems": true,
    -                "items": {
    -                    "type": "string"
    -                }
    +            VariableDeclarator: function(parent, node) {
    +                return parent.id === node;
    +            },
    +            Property: properties && function(parent, node) {
    +                return parent.key === node;
                 },
    -            "properties": {
    -                "enum": ["always", "never"]
    +            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 }
    +                    );
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/id-match.js b/tools/eslint/lib/rules/id-match.js
    index 416689c56835b0..4c9f4351088c57 100644
    --- a/tools/eslint/lib/rules/id-match.js
    +++ b/tools/eslint/lib/rules/id-match.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,119 +9,132 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require identifiers to match a specified regular expression",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                type: "string"
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    properties: {
    +                        type: "boolean"
    +                    }
    +                }
    +            }
    +        ]
    +    },
     
    -    var pattern = context.options[0] || "^.+$",
    -        regexp = new RegExp(pattern);
    +    create: function(context) {
     
    -    var options = context.options[1] || {},
    -        properties = options.properties;
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    // cast to boolean and default to false
    -    properties = !!properties;
    +        var pattern = context.options[0] || "^.+$",
    +            regexp = new RegExp(pattern);
     
    +        var options = context.options[1] || {},
    +            properties = !!options.properties,
    +            onlyDeclarations = !!options.onlyDeclarations;
     
    -    /**
    -     * 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);
    -    }
    +        /**
    +         * 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);
    -    }
    +        /**
    +         * 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
    -        });
    -    }
    +        /**
    +         * 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 {
    +        return {
     
    -        "Identifier": function(node) {
    -            var name = node.name,
    -                effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent;
    +            Identifier: function(node) {
    +                var name = node.name,
    +                    parent = node.parent,
    +                    effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent;
     
    -            // MemberExpressions get special rules
    -            if (node.parent.type === "MemberExpression") {
    -                // return early if properties is false
    -                if (!properties) {
    -                    return;
    -                }
    +                if (parent.type === "MemberExpression") {
     
    -                // Always check object names
    -                if (node.parent.object.type === "Identifier" &&
    -                    node.parent.object.name === node.name) {
    -                    if (isInvalid(name)) {
    -                        report(node);
    +                    if (!properties) {
    +                        return;
                         }
     
    +                    // Always check object names
    +                    if (parent.object.type === "Identifier" &&
    +                        parent.object.name === 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);
    +                    } else if (effectiveParent.type === "AssignmentExpression" &&
    +                        (effectiveParent.right.type !== "MemberExpression" ||
    +                        effectiveParent.left.type === "MemberExpression" &&
    +                        effectiveParent.left.property.name === 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;
    -                }
    +                } else if (parent.type === "Property") {
     
    -                if (shouldReport(effectiveParent, name)) {
    -                    report(node);
    -                }
    +                    if (!properties || parent.key.name !== name) {
    +                        return;
    +                    }
     
    -            // Report anything that is a match and not a CallExpression
    -            } else if (shouldReport(effectiveParent, name)) {
    -                report(node);
    -            }
    -        }
    +                    if (shouldReport(effectiveParent, name)) {
    +                        report(node);
    +                    }
     
    -    };
    +                } else {
    +                    var isDeclaration = effectiveParent.type === "FunctionDeclaration" || effectiveParent.type === "VariableDeclarator";
     
    -};
    +                    if (onlyDeclarations && !isDeclaration) {
    +                        return;
    +                    }
     
    -module.exports.schema = [
    -    {
    -        "type": "string"
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "properties": {
    -                "type": "boolean"
    +                    if (shouldReport(effectiveParent, name)) {
    +                        report(node);
    +                    }
    +                }
                 }
    -        }
    +
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/indent.js b/tools/eslint/lib/rules/indent.js
    index e18fd534c83db0..3e8f4b92e1849b 100644
    --- a/tools/eslint/lib/rules/indent.js
    +++ b/tools/eslint/lib/rules/indent.js
    @@ -1,31 +1,11 @@
     /**
      * @fileoverview This option sets a specific tab width for your code
    -
    + *
      * 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";
     
     //------------------------------------------------------------------------------
    @@ -34,698 +14,754 @@
     var util = require("util");
     var lodash = require("lodash");
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent indentation",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.";
    -    var DEFAULT_VARIABLE_INDENT = 1;
    +        fixable: "whitespace",
     
    -    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") {
    -            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";
    -        }
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["tab"]
    +                    },
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    }
    +                ]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    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
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
     
    -        if (context.options[1]) {
    -            var opts = context.options[1];
    -            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 MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.";
    +        var DEFAULT_VARIABLE_INDENT = 1;
    +
    +        var indentType = "space";
    +        var indentSize = 4;
    +        var options = {
    +            SwitchCase: 0,
    +            VariableDeclarator: {
    +                var: DEFAULT_VARIABLE_INDENT,
    +                let: DEFAULT_VARIABLE_INDENT,
    +                const: DEFAULT_VARIABLE_INDENT
    +            }
    +        };
    +
    +        if (context.options.length) {
    +            if (context.options[0] === "tab") {
    +                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.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 indentPattern = {
    -        normal: indentType === "space" ? /^ +/ : /^\t+/,
    -        excludeCommas: indentType === "space" ? /^[ ,]+/ : /^[\t,]+/
    -    };
    -
    -    var caseIndentStore = {};
    -
    -    /**
    -     * 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 report(node, needed, gotten, loc, isLastNodeCheck) {
    -        var msgContext = {
    -            needed: needed,
    -            type: indentType,
    -            characters: needed === 1 ? "character" : "characters",
    -            gotten: gotten
    +        var indentPattern = {
    +            normal: indentType === "space" ? /^ +/ : /^\t+/,
    +            excludeCommas: indentType === "space" ? /^[ ,]+/ : /^[\t,]+/
             };
    -        var indentChar = indentType === "space" ? " " : "\t";
    +
    +        var caseIndentStore = {};
     
             /**
    -         * Responsible for fixing the indentation issue fix
    -         * @returns {Function} function to be executed by the fixer
    -         * @private
    +         * 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 getFixerFunction() {
    -            var rangeToFix = [];
    -
    -            if (needed > gotten) {
    -                var spaces = "" + new Array(needed - gotten + 1).join(indentChar);  // replace with repeat in future
    +        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]
    +                        ];
    +                    }
     
    -                if (isLastNodeCheck === true) {
    -                    rangeToFix = [
    -                        node.range[1] - 1,
    -                        node.range[1] - 1
    -                    ];
    +                    return function(fixer) {
    +                        return fixer.insertTextBeforeRange(rangeToFix, spaces);
    +                    };
                     } else {
    -                    rangeToFix = [
    -                        node.range[0],
    -                        node.range[0]
    -                    ];
    -                }
    +                    if (isLastNodeCheck === true) {
    +                        rangeToFix = [
    +                            node.range[1] - (gotten - needed) - 1,
    +                            node.range[1] - 1
    +                        ];
    +                    } else {
    +                        rangeToFix = [
    +                            node.range[0] - (gotten - needed),
    +                            node.range[0]
    +                        ];
    +                    }
     
    -                return function(fixer) {
    -                    return fixer.insertTextBeforeRange(rangeToFix, spaces);
    -                };
    -            } else {
    -                if (isLastNodeCheck === true) {
    -                    rangeToFix = [
    -                        node.range[1] - (gotten - needed) - 1,
    -                        node.range[1] - 1
    -                    ];
    -                } else {
    -                    rangeToFix = [
    -                        node.range[0] - (gotten - needed),
    -                        node.range[0]
    -                    ];
    +                    return function(fixer) {
    +                        return fixer.removeRange(rangeToFix);
    +                    };
                     }
    +            }
     
    -                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()
    +                });
                 }
             }
     
    -        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()
    -            });
    +        /**
    +         * 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 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;
             }
    -    }
     
    -    /**
    -     * 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 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;
    -    }
    +        /**
    +         * 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 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;
     
    -    /**
    -     * 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 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;
    -    }
    +            return startLine !== endLine;
    +        }
     
    -    /**
    -     * 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 checkNodesIndent(nodes, indent, excludeCommas) {
    -        nodes.forEach(function(node) {
    +        /**
    +         * Check indent for node
    +         * @param {ASTNode} node Node to check
    +         * @param {int} indent needed indent
    +         * @param {boolean} [excludeCommas=false] skip comma on start of line
    +         * @returns {void}
    +         */
    +        function checkNodeIndent(node, indent, excludeCommas) {
                 var nodeIndent = getNodeIndent(node, false, excludeCommas);
    +
                 if (
                     node.type !== "ArrayExpression" && node.type !== "ObjectExpression" &&
                     nodeIndent !== indent && isNodeFirstInLine(node)
                 ) {
                     report(node, indent, nodeIndent);
                 }
    -        });
    -    }
    +        }
     
    -    /**
    -     * 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 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
    -            );
    +        /**
    +         * 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 checkNodesIndent(nodes, indent, excludeCommas) {
    +            nodes.forEach(function(node) {
    +                if (node.type === "IfStatement" && node.alternate) {
    +                    var elseToken = context.getTokenBefore(node.alternate);
    +
    +                    checkNodeIndent(elseToken, indent, excludeCommas);
    +                }
    +                checkNodeIndent(node, indent, excludeCommas);
    +            });
             }
    -    }
     
    -    /**
    -     * Check first node line indent is correct
    -     * @param {ASTNode} node Node to examine
    -     * @param {int} firstLineIndent needed indent
    -     * @returns {void}
    -     */
    -    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 }
    -            );
    +        /**
    +         * 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 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
    +                );
    +            }
             }
    -    }
     
    -    /**
    -     * 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 getVariableDeclaratorNode(node) {
    -        var parent = node.parent;
    -
    -        while (parent.type !== "VariableDeclarator" && parent.type !== "Program") {
    -            parent = parent.parent;
    +        /**
    +         * Check first node line indent is correct
    +         * @param {ASTNode} node Node to examine
    +         * @param {int} firstLineIndent needed indent
    +         * @returns {void}
    +         */
    +        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 }
    +                );
    +            }
             }
     
    -        return parent.type === "VariableDeclarator" ? parent : null;
    -    }
    +        /**
    +         * 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 getVariableDeclaratorNode(node) {
    +            var parent = node.parent;
     
    -    /**
    -     * 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 isNodeInVarOnTop(node, varNode) {
    -        return varNode &&
    -            varNode.parent.loc.start.line === node.loc.start.line &&
    -            varNode.parent.declarations.length > 1;
    -    }
    +            while (parent.type !== "VariableDeclarator" && parent.type !== "Program") {
    +                parent = parent.parent;
    +            }
     
    -    /**
    -     * 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 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 parent.type === "VariableDeclarator" ? parent : null;
             }
     
    -        return false;
    -    }
    -
    -    /**
    -     * Check indent for function block content
    -     * @param {ASTNode} node node to examine
    -     * @returns {void}
    -     */
    -    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);
    +        /**
    +         * 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 isNodeInVarOnTop(node, varNode) {
    +            return varNode &&
    +                varNode.parent.loc.start.line === node.loc.start.line &&
    +                varNode.parent.declarations.length > 1;
             }
     
    -        if (calleeNode.parent.type === "CallExpression") {
    -            var calleeParent = calleeNode.parent;
    +        /**
    +         * 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 isArgBeforeCalleeNodeMultiline(node) {
    +            var parent = node.parent;
     
    -            if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") {
    -                if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) {
    -                    indent = getNodeIndent(calleeParent);
    -                }
    +            if (parent.arguments.length >= 2 && parent.arguments[1] === node) {
    +                return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line;
    +            }
    +
    +            return false;
    +        }
    +
    +        /**
    +         * Check indent for function block content
    +         * @param {ASTNode} node node to examine
    +         * @returns {void}
    +         */
    +        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 (isArgBeforeCalleeNodeMultiline(calleeNode) &&
    -                    calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line &&
    -                    !isNodeFirstInLine(calleeNode)) {
    -                    indent = getNodeIndent(calleeParent);
    +
    +                // If function is standalone, simple calculate indent
    +                indent = getNodeIndent(calleeNode);
    +            }
    +
    +            if (calleeNode.parent.type === "CallExpression") {
    +                var calleeParent = calleeNode.parent;
    +
    +                if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") {
    +                    if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) {
    +                        indent = getNodeIndent(calleeParent);
    +                    }
    +                } else {
    +                    if (isArgBeforeCalleeNodeMultiline(calleeNode) &&
    +                        calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line &&
    +                        !isNodeFirstInLine(calleeNode)) {
    +                        indent = getNodeIndent(calleeParent);
    +                    }
                     }
                 }
    -        }
     
    -        // function body indent should be indent + indent size
    -        indent += indentSize;
    +            // 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];
    -        }
    +            // check if the node is inside a variable
    +            var parentVarNode = getVariableDeclaratorNode(node);
     
    -        if (node.body.length > 0) {
    -            checkNodesIndent(node.body, indent);
    -        }
    +            if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) {
    +                indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind];
    +            }
     
    -        checkLastNodeLineIndent(node, indent - indentSize);
    -    }
    +            if (node.body.length > 0) {
    +                checkNodesIndent(node.body, indent);
    +            }
     
    +            checkLastNodeLineIndent(node, indent - indentSize);
    +        }
     
    -    /**
    -     * 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 isSingleLineNode(node) {
    -        var lastToken = context.getLastToken(node),
    -            startLine = node.loc.start.line,
    -            endLine = lastToken.loc.end.line;
     
    -        return startLine === endLine;
    -    }
    +        /**
    +         * 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 isSingleLineNode(node) {
    +            var lastToken = context.getLastToken(node),
    +                startLine = node.loc.start.line,
    +                endLine = lastToken.loc.end.line;
     
    -    /**
    -     * 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 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 startLine === endLine;
             }
    -    }
     
    -    /**
    -     * Check indent for array block content or object block content
    -     * @param {ASTNode} node node to examine
    -     * @returns {void}
    -     */
    -    function checkIndentInArrayOrObjectBlock(node) {
    -        // Skip inline
    -        if (isSingleLineNode(node)) {
    -            return;
    +        /**
    +         * 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 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;
    +            }
             }
     
    -        var elements = (node.type === "ArrayExpression") ? node.elements : node.properties;
    +        /**
    +         * Check indent for array block content or object block content
    +         * @param {ASTNode} node node to examine
    +         * @returns {void}
    +         */
    +        function checkIndentInArrayOrObjectBlock(node) {
     
    -        // 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 inline
    +            if (isSingleLineNode(node)) {
    +                return;
    +            }
     
    -        // 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 elements = (node.type === "ArrayExpression") ? node.elements : node.properties;
     
    -        var nodeIndent;
    -        var elementsIndent;
    -        var parentVarNode = getVariableDeclaratorNode(node);
    +            // 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;
    +            });
     
    -        // TODO - come up with a better strategy in future
    -        if (isNodeFirstInLine(node)) {
    -            var parent = node.parent;
    -            var effectiveParent = parent;
    +            // 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;
    +            }
     
    -            if (parent.type === "MemberExpression") {
    -                if (isNodeFirstInLine(parent)) {
    -                    effectiveParent = parent.parent.parent;
    -                } else {
    -                    effectiveParent = parent.parent;
    +            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;
    +                nodeIndent = getNodeIndent(effectiveParent);
    +                if (parentVarNode && parentVarNode.loc.start.line !== node.loc.start.line) {
    +                    if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) {
    +                        if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === effectiveParent.loc.start.line) {
    +                            nodeIndent = nodeIndent + (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]);
    +                        } else if (
    +                            parent.type === "ObjectExpression" ||
    +                            parent.type === "ArrayExpression" ||
    +                            parent.type === "CallExpression" ||
    +                            parent.type === "ArrowFunctionExpression" ||
    +                            parent.type === "NewExpression"
    +                        ) {
    +                            nodeIndent = nodeIndent + indentSize;
    +                        }
                         }
    +                } else if (!parentVarNode && !isFirstArrayElementOnSameLine(parent) && effectiveParent.type !== "MemberExpression" && effectiveParent.type !== "ExpressionStatement" && effectiveParent.type !== "AssignmentExpression" && effectiveParent.type !== "Property") {
    +                    nodeIndent = nodeIndent + indentSize;
                     }
    -            } else if (!parentVarNode && !isFirstArrayElementOnSameLine(parent) && effectiveParent.type !== "MemberExpression" && effectiveParent.type !== "ExpressionStatement" && effectiveParent.type !== "AssignmentExpression" && effectiveParent.type !== "Property") {
    -                nodeIndent = nodeIndent + indentSize;
    +
    +                elementsIndent = nodeIndent + indentSize;
    +
    +                checkFirstNodeLineIndent(node, nodeIndent);
    +            } else {
    +                nodeIndent = getNodeIndent(node);
    +                elementsIndent = nodeIndent + indentSize;
    +            }
    +
    +            /*
    +             * Check if the node is a multiple variable declaration; if so, then
    +             * make sure indentation takes that into account.
    +             */
    +            if (isNodeInVarOnTop(node, parentVarNode)) {
    +                elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind];
                 }
     
    -            elementsIndent = nodeIndent + indentSize;
    +            // 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;
    +                }
    +            }
     
    -            checkFirstNodeLineIndent(node, nodeIndent);
    -        } else {
    -            nodeIndent = getNodeIndent(node);
    -            elementsIndent = nodeIndent + indentSize;
    +            checkLastNodeLineIndent(node, elementsIndent - 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];
    +        /**
    +         * 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 isNodeBodyBlock(node) {
    +            return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") ||
    +                (node.consequent && node.consequent.type === "BlockStatement");
             }
     
    -        // Comma can be placed before property name
    -        checkNodesIndent(elements, elementsIndent, true);
    +        /**
    +         * Check indentation for blocks
    +         * @param {ASTNode} node node to check
    +         * @returns {void}
    +         */
    +        function blockIndentationCheck(node) {
     
    -        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) {
    +            // Skip inline blocks
    +            if (isSingleLineNode(node)) {
                     return;
                 }
    -        }
     
    -        checkLastNodeLineIndent(node, elementsIndent - indentSize);
    -    }
    +            if (node.parent && (
    +                    node.parent.type === "FunctionExpression" ||
    +                    node.parent.type === "FunctionDeclaration" ||
    +                    node.parent.type === "ArrowFunctionExpression"
    +            )) {
    +                checkIndentInFunctionBlock(node);
    +                return;
    +            }
     
    -    /**
    -     * 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 isNodeBodyBlock(node) {
    -        return node.type === "BlockStatement" || (node.body && node.body.type === "BlockStatement") ||
    -            (node.consequent && node.consequent.type === "BlockStatement");
    -    }
    +            var indent;
    +            var nodesToCheck = [];
     
    -    /**
    -     * Check indentation for blocks
    -     * @param {ASTNode} node node to check
    -     * @returns {void}
    -     */
    -    function blockIndentationCheck(node) {
    -        // Skip inline blocks
    -        if (isSingleLineNode(node)) {
    -            return;
    -        }
    +            /*
    +             * For this statements we should check indent from statement beginning,
    +             * not from the beginning of the block.
    +             */
    +            var statementsWithProperties = [
    +                "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration"
    +            ];
     
    -        if (node.parent && (
    -                node.parent.type === "FunctionExpression" ||
    -                node.parent.type === "FunctionDeclaration" ||
    -                node.parent.type === "ArrowFunctionExpression"
    -        )) {
    -            checkIndentInFunctionBlock(node);
    -            return;
    -        }
    +            if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) {
    +                indent = getNodeIndent(node.parent);
    +            } else {
    +                indent = getNodeIndent(node);
    +            }
     
    -        var indent;
    -        var nodesToCheck = [];
    +            if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") {
    +                nodesToCheck = [node.consequent];
    +            } else if (util.isArray(node.body)) {
    +                nodesToCheck = node.body;
    +            } else {
    +                nodesToCheck = [node.body];
    +            }
     
    -        // For this statements we should check indent from statement begin
    -        // (not from block begin)
    -        var statementsWithProperties = [
    -            "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement"
    -        ];
    +            if (nodesToCheck.length > 0) {
    +                checkNodesIndent(nodesToCheck, indent + indentSize);
    +            }
     
    -        if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) {
    -            indent = getNodeIndent(node.parent);
    -        } else {
    -            indent = getNodeIndent(node);
    +            if (node.type === "BlockStatement") {
    +                checkLastNodeLineIndent(node, indent);
    +            }
             }
     
    -        if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") {
    -            nodesToCheck = [node.consequent];
    -        } else if (util.isArray(node.body)) {
    -            nodesToCheck = node.body;
    -        } else {
    -            nodesToCheck = [node.body];
    -        }
    +        /**
    +         * Filter out the elements which are on the same line of each other or the node.
    +         * basically have only 1 elements from each line except the variable declaration line.
    +         * @param {ASTNode} node Variable declaration node
    +         * @returns {ASTNode[]} Filtered elements
    +         */
    +        function filterOutSameLineVars(node) {
    +            return node.declarations.reduce(function(finalCollection, elem) {
    +                var lastElem = finalCollection[finalCollection.length - 1];
     
    -        if (nodesToCheck.length > 0) {
    -            checkNodesIndent(nodesToCheck, indent + indentSize);
    -        }
    +                if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
    +                    (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
    +                    finalCollection.push(elem);
    +                }
     
    -        if (node.type === "BlockStatement") {
    -            checkLastNodeLineIndent(node, indent);
    +                return finalCollection;
    +            }, []);
             }
    -    }
     
    -    /**
    -     * 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];
    +        /**
    +         * Check indentation for variable declarations
    +         * @param {ASTNode} node node to examine
    +         * @returns {void}
    +         */
    +        function checkIndentInVariableDeclarations(node) {
    +            var elements = filterOutSameLineVars(node);
    +            var nodeIndent = getNodeIndent(node);
    +            var lastElement = elements[elements.length - 1];
     
    -            if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
    -                (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
    -                finalCollection.push(elem);
    -            }
    +            var elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind];
     
    -            return finalCollection;
    -        }, []);
    -    }
    +            // Comma can be placed before declaration
    +            checkNodesIndent(elements, elementsIndent, true);
     
    -    /**
    -     * Check indentation for variable declarations
    -     * @param {ASTNode} node node to examine
    -     * @returns {void}
    -     */
    -    function checkIndentInVariableDeclarations(node) {
    -        var elements = filterOutSameLineVars(node);
    -        var nodeIndent = getNodeIndent(node);
    -        var lastElement = elements[elements.length - 1];
    +            // 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;
    +            }
     
    -        var elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind];
    +            var tokenBeforeLastElement = context.getTokenBefore(lastElement);
     
    -        // Comma can be placed before declaration
    -        checkNodesIndent(elements, elementsIndent, true);
    +            if (tokenBeforeLastElement.value === ",") {
     
    -        // 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;
    +                // Special case for comma-first syntax where the semicolon is indented
    +                checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement));
    +            } else {
    +                checkLastNodeLineIndent(node, elementsIndent - indentSize);
    +            }
             }
     
    -        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);
    +            }
             }
    -    }
     
    -    /**
    -     * 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);
    -        }
    -    }
    +        /**
    +         * 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;
     
    -    /**
    -     * Returns the expected indentation for the case statement
    -     * @param {ASTNode} node node to examine
    -     * @param {int} [switchIndent] indent for switch statement
    -     * @returns {int} indent size
    -     */
    -    function expectedCaseIndent(node, switchIndent) {
    -        var switchNode = (node.type === "SwitchStatement") ? node : node.parent;
    -        var caseIndent;
    -
    -        if (caseIndentStore[switchNode.loc.start.line]) {
    -            return caseIndentStore[switchNode.loc.start.line];
    -        } else {
    -            if (typeof switchIndent === "undefined") {
    -                switchIndent = getNodeIndent(switchNode);
    -            }
    -
    -            if (switchNode.cases.length > 0 && options.SwitchCase === 0) {
    -                caseIndent = switchIndent;
    +            if (caseIndentStore[switchNode.loc.start.line]) {
    +                return caseIndentStore[switchNode.loc.start.line];
                 } else {
    -                caseIndent = switchIndent + (indentSize * options.SwitchCase);
    -            }
    +                if (typeof switchIndent === "undefined") {
    +                    switchIndent = getNodeIndent(switchNode);
    +                }
     
    -            caseIndentStore[switchNode.loc.start.line] = caseIndent;
    -            return caseIndent;
    -        }
    -    }
    +                if (switchNode.cases.length > 0 && options.SwitchCase === 0) {
    +                    caseIndent = switchIndent;
    +                } else {
    +                    caseIndent = switchIndent + (indentSize * options.SwitchCase);
    +                }
     
    -    return {
    -        "Program": function(node) {
    -            if (node.body.length > 0) {
    -                // Root nodes should have no indent
    -                checkNodesIndent(node.body, getNodeIndent(node));
    +                caseIndentStore[switchNode.loc.start.line] = caseIndent;
    +                return caseIndent;
                 }
    -        },
    +        }
     
    -        "ClassBody": blockIndentationCheck,
    +        return {
    +            Program: function(node) {
    +                if (node.body.length > 0) {
     
    -        "BlockStatement": blockIndentationCheck,
    +                    // Root nodes should have no indent
    +                    checkNodesIndent(node.body, getNodeIndent(node));
    +                }
    +            },
     
    -        "WhileStatement": blockLessNodes,
    +            ClassBody: blockIndentationCheck,
     
    -        "ForStatement": blockLessNodes,
    +            BlockStatement: blockIndentationCheck,
     
    -        "ForInStatement": blockLessNodes,
    +            WhileStatement: blockLessNodes,
     
    -        "ForOfStatement": blockLessNodes,
    +            ForStatement: blockLessNodes,
     
    -        "DoWhileStatement": blockLessNodes,
    +            ForInStatement: blockLessNodes,
     
    -        "IfStatement": function(node) {
    -            if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) {
    -                blockIndentationCheck(node);
    -            }
    -        },
    +            ForOfStatement: blockLessNodes,
     
    -        "VariableDeclaration": function(node) {
    -            if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) {
    -                checkIndentInVariableDeclarations(node);
    -            }
    -        },
    +            DoWhileStatement: blockLessNodes,
     
    -        "ObjectExpression": function(node) {
    -            checkIndentInArrayOrObjectBlock(node);
    -        },
    +            IfStatement: function(node) {
    +                if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) {
    +                    blockIndentationCheck(node);
    +                }
    +            },
     
    -        "ArrayExpression": function(node) {
    -            checkIndentInArrayOrObjectBlock(node);
    -        },
    +            VariableDeclaration: function(node) {
    +                if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) {
    +                    checkIndentInVariableDeclarations(node);
    +                }
    +            },
     
    -        "SwitchStatement": function(node) {
    -            // Switch is not a 'BlockStatement'
    -            var switchIndent = getNodeIndent(node);
    -            var caseIndent = expectedCaseIndent(node, switchIndent);
    -            checkNodesIndent(node.cases, caseIndent);
    +            ObjectExpression: function(node) {
    +                checkIndentInArrayOrObjectBlock(node);
    +            },
     
    +            ArrayExpression: function(node) {
    +                checkIndentInArrayOrObjectBlock(node);
    +            },
     
    -            checkLastNodeLineIndent(node, switchIndent);
    -        },
    +            SwitchStatement: function(node) {
     
    -        "SwitchCase": function(node) {
    -            // Skip inline cases
    -            if (isSingleLineNode(node)) {
    -                return;
    -            }
    -            var caseIndent = expectedCaseIndent(node);
    -            checkNodesIndent(node.consequent, caseIndent + indentSize);
    -        }
    -    };
    +                // Switch is not a 'BlockStatement'
    +                var switchIndent = getNodeIndent(node);
    +                var caseIndent = expectedCaseIndent(node, switchIndent);
     
    -};
    +                checkNodesIndent(node.cases, caseIndent);
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "enum": ["tab"]
    -            },
    -            {
    -                "type": "integer",
    -                "minimum": 0
    -            }
    -        ]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "SwitchCase": {
    -                "type": "integer",
    -                "minimum": 0
    +
    +                checkLastNodeLineIndent(node, switchIndent);
                 },
    -            "VariableDeclarator": {
    -                "oneOf": [
    -                    {
    -                        "type": "integer",
    -                        "minimum": 0
    -                    },
    -                    {
    -                        "type": "object",
    -                        "properties": {
    -                            "var": {
    -                                "type": "integer",
    -                                "minimum": 0
    -                            },
    -                            "let": {
    -                                "type": "integer",
    -                                "minimum": 0
    -                            },
    -                            "const": {
    -                                "type": "integer",
    -                                "minimum": 0
    -                            }
    -                        }
    -                    }
    -                ]
    +
    +            SwitchCase: function(node) {
    +
    +                // Skip inline cases
    +                if (isSingleLineNode(node)) {
    +                    return;
    +                }
    +                var caseIndent = expectedCaseIndent(node);
    +
    +                checkNodesIndent(node.consequent, caseIndent + indentSize);
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/init-declarations.js b/tools/eslint/lib/rules/init-declarations.js
    index 79b188728cfbbf..66b0a0aea43c1a 100644
    --- a/tools/eslint/lib/rules/init-declarations.js
    +++ b/tools/eslint/lib/rules/init-declarations.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to control the style of variable initializations.
      * @author Colin Ihrig
    - * @copyright 2015 Colin Ihrig. All rights reserved.
      */
     
     "use strict";
    @@ -43,72 +42,84 @@ function isInitialized(node) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow initialization in `var` declarations",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    var MODE_ALWAYS = "always",
    -        MODE_NEVER = "never";
    +        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
    +                }
    +            ]
    +        }
    +    },
     
    -    var mode = context.options[0] || MODE_ALWAYS;
    -    var params = context.options[1] || {};
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +    create: function(context) {
     
    -    return {
    -        "VariableDeclaration:exit": function(node) {
    +        var MODE_ALWAYS = "always",
    +            MODE_NEVER = "never";
     
    -            var kind = node.kind,
    -                declarations = node.declarations;
    +        var mode = context.options[0] || MODE_ALWAYS;
    +        var params = context.options[1] || {};
     
    -            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;
    -                }
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -                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.");
    -                }
    -            }
    -        }
    -    };
    -};
    +        return {
    +            "VariableDeclaration:exit": function(node) {
     
    -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
    +                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.");
    +                    }
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 2
    -        }
    -    ]
    +            }
    +        };
    +    }
     };
    diff --git a/tools/eslint/lib/rules/jsx-quotes.js b/tools/eslint/lib/rules/jsx-quotes.js
    index 486aa818622901..6b3a2efef7143c 100644
    --- a/tools/eslint/lib/rules/jsx-quotes.js
    +++ b/tools/eslint/lib/rules/jsx-quotes.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to ensure consistent quotes used in jsx syntax.
      * @author Mathias Schreck 
    - * @copyright 2015 Mathias Schreck
      */
     
     "use strict";
    @@ -37,39 +36,51 @@ var QUOTE_SETTINGS = {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var quoteOption = context.options[0] || "prefer-double",
    -        setting = QUOTE_SETTINGS[quoteOption];
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce the consistent use of either double or single quotes in JSX attributes",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    +        fixable: "whitespace",
     
    -            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));
    -                    }
    -                });
    +        schema: [
    +            {
    +                enum: [ "prefer-single", "prefer-double" ]
                 }
    +        ]
    +    },
    +
    +    create: 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);
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "enum": [ "prefer-single", "prefer-double" ]
    +        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));
    +                        }
    +                    });
    +                }
    +            }
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/key-spacing.js b/tools/eslint/lib/rules/key-spacing.js
    index cfdbf11f326023..1bc14aefec05ab 100644
    --- a/tools/eslint/lib/rules/key-spacing.js
    +++ b/tools/eslint/lib/rules/key-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to specify spacing of object literal keys and values
      * @author Brandon Mills
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     "use strict";
     
    @@ -111,331 +110,341 @@ var messages = {
         value: "{{error}} space before value for {{computed}}key '{{key}}'."
     };
     
    -module.exports = function(context) {
    -
    -    /**
    -     * OPTIONS
    -     * "key-spacing": [2, {
    -     *     beforeColon: false,
    -     *     afterColon: true,
    -     *     align: "colon" // Optional, or "value"
    -     * }
    -     */
    -
    -    var options = context.options[0] || {},
    -        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"
    -        );
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing between keys and values in object literal properties",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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);
    +        schema: [{
    +            anyOf: [
    +                {
    +                    type: "object",
    +                    properties: {
    +                        align: {
    +                            enum: ["colon", "value"]
    +                        },
    +                        mode: {
    +                            enum: ["strict", "minimum"]
    +                        },
    +                        beforeColon: {
    +                            type: "boolean"
    +                        },
    +                        afterColon: {
    +                            type: "boolean"
    +                        }
    +                    },
    +                    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
    +                }
    +            ]
    +        }]
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * OPTIONS
    +         * "key-spacing": [2, {
    +         *     beforeColon: false,
    +         *     afterColon: true,
    +         *     align: "colon" // Optional, or "value"
    +         * }
    +         */
    +
    +        var options = context.options[0] || {},
    +            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"
    +            );
             }
     
    -        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) {
    +        /**
    +         * 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);
    +            }
     
    -        while (node && (node.type !== "Punctuator" || node.value !== ":")) {
    -            node = context.getTokenAfter(node);
    +            return prevNode;
             }
     
    -        return node;
    -    }
    +        /**
    +         * 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) {
     
    -    /**
    -     * Gets an object literal property's key as the identifier name or string value.
    -     * @param {ASTNode} property Property node whose key to retrieve.
    -     * @returns {string} The property's key.
    -     */
    -    function getKey(property) {
    -        var key = property.key;
    +            while (node && (node.type !== "Punctuator" || node.value !== ":")) {
    +                node = context.getTokenAfter(node);
    +            }
     
    -        if (property.computed) {
    -            return context.getSource().slice(key.range[0], key.range[1]);
    +            return node;
             }
     
    -        return property.key.name || property.key.value;
    -    }
    +        /**
    +         * Gets an object literal property's key as the identifier name or string value.
    +         * @param {ASTNode} property Property node whose key to retrieve.
    +         * @returns {string} The property's key.
    +         */
    +        function getKey(property) {
    +            var key = property.key;
     
    -    /**
    -     * Reports an appropriately-formatted error if spacing is incorrect on one
    -     * side of the colon.
    -     * @param {ASTNode} property Key-value pair in an object literal.
    -     * @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, mode) {
    -        var diff = whitespace.length - expected,
    -            key = property.key,
    -            firstTokenAfterColon = context.getTokenAfter(getNextColon(key)),
    -            location = side === "key" ? key.loc.start : firstTokenAfterColon.loc.start;
    -
    -        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 " : "",
    -                key: getKey(property)
    -            });
    +            if (property.computed) {
    +                return context.getSource().slice(key.range[0], key.range[1]);
    +            }
    +
    +            return property.key.name || property.key.value;
             }
    -    }
     
    -    /**
    -     * Gets the number of characters in a key, including quotes around string
    -     * keys and braces around computed property keys.
    -     * @param {ASTNode} property Property of on object literal.
    -     * @returns {int} Width of the key.
    -     */
    -    function getKeyWidth(property) {
    -        var startToken, endToken;
    +        /**
    +         * Reports an appropriately-formatted error if spacing is incorrect on one
    +         * side of the colon.
    +         * @param {ASTNode} property Key-value pair in an object literal.
    +         * @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, mode) {
    +            var diff = whitespace.length - expected,
    +                key = property.key,
    +                firstTokenAfterColon = context.getTokenAfter(getNextColon(key)),
    +                location = side === "key" ? key.loc.start : firstTokenAfterColon.loc.start;
    +
    +            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 " : "",
    +                    key: getKey(property)
    +                });
    +            }
    +        }
     
    -        startToken = context.getFirstToken(property);
    -        endToken = getLastTokenBeforeColon(property.key);
    +        /**
    +         * Gets the number of characters in a key, including quotes around string
    +         * keys and braces around computed property keys.
    +         * @param {ASTNode} property Property of on object literal.
    +         * @returns {int} Width of the key.
    +         */
    +        function getKeyWidth(property) {
    +            var startToken, endToken;
     
    -        return endToken.range[1] - startToken.range[0];
    -    }
    +            startToken = context.getFirstToken(property);
    +            endToken = getLastTokenBeforeColon(property.key);
     
    -    /**
    -     * Gets the whitespace around the colon in an object literal property.
    -     * @param {ASTNode} property Property node from an object literal.
    -     * @returns {Object} Whitespace before and after the property's colon.
    -     */
    -    function getPropertyWhitespace(property) {
    -        var whitespace = /(\s*):(\s*)/.exec(context.getSource().slice(
    -            property.key.range[1], property.value.range[0]
    -        ));
    -
    -        if (whitespace) {
    -            return {
    -                beforeColon: whitespace[1],
    -                afterColon: whitespace[2]
    -            };
    +            return endToken.range[1] - startToken.range[0];
             }
    -        return null;
    -    }
     
    -    /**
    -     * Creates groups of properties.
    -     * @param  {ASTNode} node ObjectExpression node being evaluated.
    -     * @returns {Array.} Groups of property AST node lists.
    -     */
    -    function createGroups(node) {
    -        if (node.properties.length === 1) {
    -            return [node.properties];
    +        /**
    +         * Gets the whitespace around the colon in an object literal property.
    +         * @param {ASTNode} property Property node from an object literal.
    +         * @returns {Object} Whitespace before and after the property's colon.
    +         */
    +        function getPropertyWhitespace(property) {
    +            var whitespace = /(\s*):(\s*)/.exec(context.getSource().slice(
    +                property.key.range[1], property.value.range[0]
    +            ));
    +
    +            if (whitespace) {
    +                return {
    +                    beforeColon: whitespace[1],
    +                    afterColon: whitespace[2]
    +                };
    +            }
    +            return null;
             }
     
    -        return node.properties.reduce(function(groups, property) {
    -            var currentGroup = last(groups),
    -                prev = last(currentGroup);
    -
    -            if (!prev || continuesPropertyGroup(prev, property)) {
    -                currentGroup.push(property);
    -            } else {
    -                groups.push([property]);
    +        /**
    +         * Creates groups of properties.
    +         * @param  {ASTNode} node ObjectExpression node being evaluated.
    +         * @returns {Array.} Groups of property AST node lists.
    +         */
    +        function createGroups(node) {
    +            if (node.properties.length === 1) {
    +                return [node.properties];
                 }
     
    -            return groups;
    -        }, [
    -            []
    -        ]);
    -    }
    +            return node.properties.reduce(function(groups, property) {
    +                var currentGroup = last(groups),
    +                    prev = last(currentGroup);
     
    -    /**
    -     * Verifies correct vertical alignment of a group of properties.
    -     * @param {ASTNode[]} properties List of Property AST nodes.
    -     * @returns {void}
    -     */
    -    function verifyGroupAlignment(properties) {
    -        var length = properties.length,
    -            widths = properties.map(getKeyWidth), // Width of keys, including quotes
    -            targetWidth = Math.max.apply(null, widths),
    -            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);
    -
    -        for (i = 0; i < length; i++) {
    -            property = properties[i];
    -            whitespace = getPropertyWhitespace(property);
    -            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);
    +                if (!prev || continuesPropertyGroup(prev, property)) {
    +                    currentGroup.push(property);
    +                } else {
    +                    groups.push([property]);
    +                }
    +
    +                return groups;
    +            }, [
    +                []
    +            ]);
    +        }
    +
    +        /**
    +         * Verifies correct vertical alignment of a group of properties.
    +         * @param {ASTNode[]} properties List of Property AST nodes.
    +         * @returns {void}
    +         */
    +        function verifyGroupAlignment(properties) {
    +            var length = properties.length,
    +                widths = properties.map(getKeyWidth), // Width of keys, including quotes
    +                targetWidth = Math.max.apply(null, widths),
    +                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);
    +
    +            for (i = 0; i < length; i++) {
    +                property = properties[i];
    +                whitespace = getPropertyWhitespace(property);
    +                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);
    +                    }
                     }
                 }
             }
    -    }
     
    -    /**
    -     * Verifies vertical alignment, taking into account groups of properties.
    -     * @param  {ASTNode} node ObjectExpression node being evaluated.
    -     * @returns {void}
    -     */
    -    function verifyAlignment(node) {
    -        createGroups(node).forEach(function(group) {
    -            verifyGroupAlignment(group.filter(isKeyValueProperty));
    -        });
    -    }
    +        /**
    +         * Verifies vertical alignment, taking into account groups of properties.
    +         * @param  {ASTNode} node ObjectExpression node being evaluated.
    +         * @returns {void}
    +         */
    +        function verifyAlignment(node) {
    +            createGroups(node).forEach(function(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, 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);
    +        /**
    +         * 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, 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);
    +            }
             }
    -    }
     
    -    /**
    -     * Verifies spacing of each property in a list.
    -     * @param  {ASTNode[]} properties List of Property AST nodes.
    -     * @returns {void}
    -     */
    -    function verifyListSpacing(properties) {
    -        var length = properties.length;
    +        /**
    +         * Verifies spacing of each property in a list.
    +         * @param  {ASTNode[]} properties List of Property AST nodes.
    +         * @returns {void}
    +         */
    +        function verifyListSpacing(properties) {
    +            var length = properties.length;
     
    -        for (var i = 0; i < length; i++) {
    -            verifySpacing(properties[i], singleLineOptions);
    +            for (var i = 0; i < length; i++) {
    +                verifySpacing(properties[i], singleLineOptions);
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -    if (multiLineOptions.align) { // Verify vertical alignment
    +        if (multiLineOptions.align) { // Verify vertical alignment
     
    -        return {
    -            "ObjectExpression": function(node) {
    -                if (isSingleLine(node)) {
    -                    verifyListSpacing(node.properties);
    -                } else {
    -                    verifyAlignment(node);
    +            return {
    +                ObjectExpression: function(node) {
    +                    if (isSingleLine(node)) {
    +                        verifyListSpacing(node.properties.filter(isKeyValueProperty));
    +                    } else {
    +                        verifyAlignment(node);
    +                    }
                     }
    -            }
    -        };
    +            };
     
    -    } else { // Obey beforeColon and afterColon in each property as configured
    +        } else { // Obey beforeColon and afterColon in each property as configured
     
    -        return {
    -            "Property": function(node) {
    -                verifySpacing(node, isSingleLine(node) ? singleLineOptions : multiLineOptions);
    -            }
    -        };
    +            return {
    +                Property: function(node) {
    +                    verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions);
    +                }
    +            };
     
    -    }
    +        }
     
    +    }
     };
    -
    -module.exports.schema = [{
    -    "anyOf": [
    -        {
    -            "type": "object",
    -            "properties": {
    -                "align": {
    -                    "enum": ["colon", "value"]
    -                },
    -                "mode": {
    -                    "enum": ["strict", "minimum"]
    -                },
    -                "beforeColon": {
    -                    "type": "boolean"
    -                },
    -                "afterColon": {
    -                    "type": "boolean"
    -                }
    -            },
    -            "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
    index d532a4ce24ff28..f771029a581d44 100644
    --- a/tools/eslint/lib/rules/keyword-spacing.js
    +++ b/tools/eslint/lib/rules/keyword-spacing.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -65,456 +63,482 @@ function isCloseParenOfTemplate(token) {
     // 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, " ");
    -                }
    -            });
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before and after keywords",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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]]);
    -                }
    -            });
    +        fixable: "whitespace",
    +
    +        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
    +            }
    +        ]
    +    },
    +
    +    create: 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 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) 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 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]]);
    -                }
    -            });
    +        /**
    +         * 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, " ");
    +                    }
    +                });
    +            }
             }
    -    }
     
    -    /**
    -     * 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;
    +        /**
    +         * 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]]);
    +                    }
    +                });
                 }
             }
     
    -        return retv;
    -    }
    +        /**
    +         * 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;
     
    -    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);
    -    }
    +                    retv[key] = {
    +                        before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore,
    +                        after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter
    +                    };
    +                } else {
    +                    retv[key] = defaultValue;
    +                }
    +            }
     
    -    /**
    -     * 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);
    -    }
    +            return retv;
    +        }
     
    -    /**
    -     * 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);
    -    }
    +        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 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 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 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 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 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);
    +        /**
    +         * 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);
                 }
    -
    -            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 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 `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 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);
    +                }
     
    -    /**
    -     * 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);
    -    }
    +                checkSpacingAround(token);
    +            }
    +        }
     
    -    /**
    -     * 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 `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 `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);
    +        /**
    +         * 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);
             }
    -        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 `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 `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 `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 `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) {
    +        /**
    +         * 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);
             }
    -        if (node.kind === "get" || node.kind === "set") {
    -            var token = sourceCode.getFirstToken(
    -                node,
    -                node.static ? 1 : 0
    -            );
    +
    +        /**
    +         * 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);
             }
    -    }
     
    -    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
    -    };
    -};
    +        /**
    +         * 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);
    +            }
    +        }
     
    -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
    +        /**
    +         * 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);
                 }
    -        },
    -        "additionalProperties": false
    +            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
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/linebreak-style.js b/tools/eslint/lib/rules/linebreak-style.js
    index 29a9dfb7f0555a..d99d7e58579c74 100644
    --- a/tools/eslint/lib/rules/linebreak-style.js
    +++ b/tools/eslint/lib/rules/linebreak-style.js
    @@ -1,9 +1,6 @@
     /**
    - * @fileoverview Rule to forbid mixing LF and LFCR line breaks.
    + * @fileoverview Rule to enforce a single linebreak style.
      * @author Erik Mueller
    - * @copyright 2015 Varun Verma. All rights reserverd.
    - * @copyright 2015 James Whitney. All rights reserved.
    - * @copyright 2015 Erik Mueller. All rights reserved.
      */
     
     "use strict";
    @@ -12,68 +9,81 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent linebreak style",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.",
    -        EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'.";
    +        fixable: "whitespace",
     
    -    //--------------------------------------------------------------------------
    -    // 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);
    -        };
    -    }
    +        schema: [
    +            {
    +                enum: ["unix", "windows"]
    +            }
    +        ]
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +    create: function(context) {
     
    -    return {
    -        "Program": function checkForlinebreakStyle(node) {
    -            var linebreakStyle = context.options[0] || "unix",
    -                expectedLF = linebreakStyle === "unix",
    -                expectedLFChars = expectedLF ? "\n" : "\r\n",
    -                source = context.getSource(),
    -                pattern = /\r\n|\r|\n|\u2028|\u2029/g,
    -                match,
    -                index,
    -                range;
    +        var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.",
    +            EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'.";
     
    -            var i = 0;
    -            while ((match = pattern.exec(source)) !== null) {
    -                i++;
    -                if (match[0] === expectedLFChars) {
    -                    continue;
    -                }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -                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)
    -                });
    -            }
    +        /**
    +         * 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);
    +            };
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "enum": ["unix", "windows"]
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            Program: function checkForlinebreakStyle(node) {
    +                var linebreakStyle = context.options[0] || "unix",
    +                    expectedLF = linebreakStyle === "unix",
    +                    expectedLFChars = expectedLF ? "\n" : "\r\n",
    +                    source = context.getSource(),
    +                    pattern = /\r\n|\r|\n|\u2028|\u2029/g,
    +                    match,
    +                    index,
    +                    range;
    +
    +                var i = 0;
    +
    +                while ((match = pattern.exec(source)) !== null) {
    +                    i++;
    +                    if (match[0] === expectedLFChars) {
    +                        continue;
    +                    }
    +
    +                    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 6f0e510007a45b..92fc3252ae9ff6 100644
    --- a/tools/eslint/lib/rules/lines-around-comment.js
    +++ b/tools/eslint/lib/rules/lines-around-comment.js
    @@ -1,9 +1,6 @@
     /**
      * @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";
     
    @@ -33,6 +30,7 @@ function getEmptyLineNums(lines) {
         }).map(function(line) {
             return line.num;
         });
    +
         return emptyLines;
     }
     
    @@ -43,9 +41,11 @@ function getEmptyLineNums(lines) {
      */
     function getCommentLineNums(comments) {
         var lines = [];
    +
         comments.forEach(function(token) {
             var start = token.loc.start.line;
             var end = token.loc.end.line;
    +
             lines.push(start, end);
         });
         return lines;
    @@ -65,270 +65,282 @@ function contains(val, array) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    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;
    -    options.afterBlockComment = options.afterBlockComment || false;
    -    options.allowBlockStart = options.allowBlockStart || false;
    -    options.allowBlockEnd = options.allowBlockEnd || false;
    -
    -    var sourceCode = context.getSourceCode();
    -    /**
    -     * 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;
    -
    -        token = node;
    -        do {
    -            token = sourceCode.getTokenOrCommentBefore(token);
    -        } while (token && (token.type === "Block" || token.type === "Line"));
    -
    -        if (token && token.loc.end.line === node.loc.start.line) {
    -            return true;
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require empty lines around comments",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -        token = node;
    -        do {
    -            token = sourceCode.getTokenOrCommentAfter(token);
    -        } while (token && (token.type === "Block" || token.type === "Line"));
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    beforeBlockComment: {
    +                        type: "boolean"
    +                    },
    +                    afterBlockComment: {
    +                        type: "boolean"
    +                    },
    +                    beforeLineComment: {
    +                        type: "boolean"
    +                    },
    +                    afterLineComment: {
    +                        type: "boolean"
    +                    },
    +                    allowBlockStart: {
    +                        type: "boolean"
    +                    },
    +                    allowBlockEnd: {
    +                        type: "boolean"
    +                    },
    +                    allowObjectStart: {
    +                        type: "boolean"
    +                    },
    +                    allowObjectEnd: {
    +                        type: "boolean"
    +                    },
    +                    allowArrayStart: {
    +                        type: "boolean"
    +                    },
    +                    allowArrayEnd: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -        if (token && token.loc.start.line === node.loc.end.line) {
    -            return true;
    -        }
    +    create: function(context) {
     
    -        return false;
    -    }
    +        var options = context.options[0] ? lodash.assign({}, context.options[0]) : {};
     
    -    /**
    -     * Returns whether or not comments are inside a node type or not.
    -     * @param {ASTNode} node The Comment node.
    -     * @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 isCommentInsideNodeType(node, parent, nodeType) {
    -        return parent.type === nodeType ||
    -            (parent.body && parent.body.type === nodeType) ||
    -            (parent.consequent && parent.consequent.type === nodeType);
    -    }
    +        options.beforeLineComment = options.beforeLineComment || false;
    +        options.afterLineComment = options.afterLineComment || false;
    +        options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true;
    +        options.afterBlockComment = options.afterBlockComment || false;
    +        options.allowBlockStart = options.allowBlockStart || false;
    +        options.allowBlockEnd = options.allowBlockEnd || false;
     
    -    /**
    -     * 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();
    -        }
    +        var sourceCode = context.getSourceCode();
     
    -        return parent && isCommentInsideNodeType(node, parent, nodeType) &&
    -                node.loc.start.line - parent.loc.start.line === 1;
    -    }
    +        /**
    +         * 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;
     
    -    /**
    -     * Returns whether or not comments are at the parent end 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 end.
    -     */
    -    function isCommentAtParentEnd(node, nodeType) {
    -        var ancestors = context.getAncestors();
    -        var parent;
    -
    -        if (ancestors.length) {
    -            parent = ancestors.pop();
    -        }
    +            token = node;
    +            do {
    +                token = sourceCode.getTokenOrCommentBefore(token);
    +            } while (token && (token.type === "Block" || token.type === "Line"));
     
    -        return parent && isCommentInsideNodeType(node, parent, nodeType) &&
    -                parent.loc.end.line - node.loc.end.line === 1;
    -    }
    +            if (token && token.loc.end.line === node.loc.start.line) {
    +                return true;
    +            }
     
    -    /**
    -     * 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");
    -    }
    +            token = node;
    +            do {
    +                token = sourceCode.getTokenOrCommentAfter(token);
    +            } while (token && (token.type === "Block" || token.type === "Line"));
     
    -    /**
    -     * 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");
    -    }
    +            if (token && token.loc.start.line === node.loc.end.line) {
    +                return true;
    +            }
     
    -    /**
    -     * 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");
    -    }
    +            return false;
    +        }
     
    -    /**
    -     * 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 inside a node type or not.
    +         * @param {ASTNode} node The Comment node.
    +         * @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 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 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 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();
    +            }
     
    -    /**
    -     * 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");
    -    }
    +            return parent && isCommentInsideNodeType(node, parent, nodeType) &&
    +                    node.loc.start.line - parent.loc.start.line === 1;
    +        }
    +
    +        /**
    +         * Returns whether or not comments are at the parent end 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 end.
    +         */
    +        function isCommentAtParentEnd(node, nodeType) {
    +            var ancestors = context.getAncestors();
    +            var parent;
    +
    +            if (ancestors.length) {
    +                parent = ancestors.pop();
    +            }
     
    -    /**
    -     * Checks if a comment node has lines around it (ignores inline comments)
    -     * @param {ASTNode} node The Comment node.
    -     * @param {Object} opts Options to determine the newline.
    -     * @param {Boolean} opts.after Should have a newline after this line.
    -     * @param {Boolean} opts.before Should have a newline before this line.
    -     * @returns {void}
    -     */
    -    function checkForEmptyLine(node, opts) {
    -
    -        var lines = context.getSourceLines(),
    -            numLines = lines.length + 1,
    -            comments = context.getAllComments(),
    -            commentLines = getCommentLineNums(comments),
    -            emptyLines = getEmptyLineNums(lines),
    -            commentAndEmptyLines = commentLines.concat(emptyLines);
    -
    -        var after = opts.after,
    -            before = opts.before;
    -
    -        var prevLineNum = node.loc.start.line - 1,
    -            nextLineNum = node.loc.end.line + 1,
    -            commentIsNotAlone = codeAroundComment(node);
    -
    -        var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(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) {
    -            before = false;
    +            return parent && isCommentInsideNodeType(node, parent, nodeType) &&
    +                    parent.loc.end.line - node.loc.end.line === 1;
             }
    -        if (nextLineNum >= numLines) {
    -            after = false;
    +
    +        /**
    +         * Returns whether or not comments are at the block start or not.
    +         * @param {ASTNode} node The Comment node.
    +         * @returns {boolean} True if the comment is at block start.
    +         */
    +        function isCommentAtBlockStart(node) {
    +            return isCommentAtParentStart(node, "ClassBody") || isCommentAtParentStart(node, "BlockStatement") || isCommentAtParentStart(node, "SwitchCase");
             }
     
    -        // we ignore all inline comments
    -        if (commentIsNotAlone) {
    -            return;
    +        /**
    +         * Returns whether or not comments are at the block end or not.
    +         * @param {ASTNode} node The Comment node.
    +         * @returns {boolean} True if the comment is at block end.
    +         */
    +        function isCommentAtBlockEnd(node) {
    +            return isCommentAtParentEnd(node, "ClassBody") || isCommentAtParentEnd(node, "BlockStatement") || isCommentAtParentEnd(node, "SwitchCase") || isCommentAtParentEnd(node, "SwitchStatement");
             }
     
    -        // check for newline before
    -        if (!exceptionStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) {
    -            context.report(node, "Expected line before comment.");
    +        /**
    +         * 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");
             }
     
    -        // check for newline after
    -        if (!exceptionEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) {
    -            context.report(node, "Expected line after comment.");
    +        /**
    +         * 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");
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * 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");
    +        }
     
    -    return {
    +        /**
    +         * Checks if a comment node has lines around it (ignores inline comments)
    +         * @param {ASTNode} node The Comment node.
    +         * @param {Object} opts Options to determine the newline.
    +         * @param {Boolean} opts.after Should have a newline after this line.
    +         * @param {Boolean} opts.before Should have a newline before this line.
    +         * @returns {void}
    +         */
    +        function checkForEmptyLine(node, opts) {
    +
    +            var lines = context.getSourceLines(),
    +                numLines = lines.length + 1,
    +                comments = context.getAllComments(),
    +                commentLines = getCommentLineNums(comments),
    +                emptyLines = getEmptyLineNums(lines),
    +                commentAndEmptyLines = commentLines.concat(emptyLines);
    +
    +            var after = opts.after,
    +                before = opts.before;
    +
    +            var prevLineNum = node.loc.start.line - 1,
    +                nextLineNum = node.loc.end.line + 1,
    +                commentIsNotAlone = codeAroundComment(node);
    +
    +            var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(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) {
    +                before = false;
    +            }
    +            if (nextLineNum >= numLines) {
    +                after = false;
    +            }
     
    -        "LineComment": function(node) {
    -            if (options.beforeLineComment || options.afterLineComment) {
    -                checkForEmptyLine(node, {
    -                    after: options.afterLineComment,
    -                    before: options.beforeLineComment
    -                });
    +            // we ignore all inline comments
    +            if (commentIsNotAlone) {
    +                return;
                 }
    -        },
     
    -        "BlockComment": function(node) {
    -            if (options.beforeBlockComment || options.afterBlockComment) {
    -                checkForEmptyLine(node, {
    -                    after: options.afterBlockComment,
    -                    before: options.beforeBlockComment
    -                });
    +            // check for newline before
    +            if (!exceptionStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) {
    +                context.report(node, "Expected line before comment.");
                 }
    +
    +            // check for newline after
    +            if (!exceptionEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) {
    +                context.report(node, "Expected line after comment.");
    +            }
    +
             }
     
    -    };
    -};
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "beforeBlockComment": {
    -                "type": "boolean"
    -            },
    -            "afterBlockComment": {
    -                "type": "boolean"
    -            },
    -            "beforeLineComment": {
    -                "type": "boolean"
    -            },
    -            "afterLineComment": {
    -                "type": "boolean"
    -            },
    -            "allowBlockStart": {
    -                "type": "boolean"
    -            },
    -            "allowBlockEnd": {
    -                "type": "boolean"
    -            },
    -            "allowObjectStart": {
    -                "type": "boolean"
    -            },
    -            "allowObjectEnd": {
    -                "type": "boolean"
    -            },
    -            "allowArrayStart": {
    -                "type": "boolean"
    +        return {
    +
    +            LineComment: function(node) {
    +                if (options.beforeLineComment || options.afterLineComment) {
    +                    checkForEmptyLine(node, {
    +                        after: options.afterLineComment,
    +                        before: options.beforeLineComment
    +                    });
    +                }
                 },
    -            "allowArrayEnd": {
    -                "type": "boolean"
    +
    +            BlockComment: function(node) {
    +                if (options.beforeBlockComment || options.afterBlockComment) {
    +                    checkForEmptyLine(node, {
    +                        after: options.afterBlockComment,
    +                        before: options.beforeBlockComment
    +                    });
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/max-depth.js b/tools/eslint/lib/rules/max-depth.js
    index 89cf75f00bb8ff..317f06c68f397a 100644
    --- a/tools/eslint/lib/rules/max-depth.js
    +++ b/tools/eslint/lib/rules/max-depth.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to set the maximum depth block can be nested in a function.
      * @author Ian Christian Myers
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -10,102 +9,141 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum depth that blocks can be nested",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            maximum: {
    +                                type: "integer",
    +                                minimum: 0
    +                            },
    +                            max: {
    +                                type: "integer",
    +                                minimum: 0
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
     
    -    var functionStack = [],
    -        maxDepth = context.options[0] || 4;
    +    create: function(context) {
     
    -    /**
    -     * When parsing a new function, store it in our function stack
    -     * @returns {void}
    -     * @private
    -     */
    -    function startFunction() {
    -        functionStack.push(0);
    -    }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * When parsing is done then pop out the reference
    -     * @returns {void}
    -     * @private
    -     */
    -    function endFunction() {
    -        functionStack.pop();
    -    }
    +        var functionStack = [],
    +            option = context.options[0],
    +            maxDepth = 4;
     
    -    /**
    -     * 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];
    -
    -        if (len > maxDepth) {
    -            context.report(node, "Blocks are nested too deeply ({{depth}}).",
    -                    { depth: len });
    +        if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") {
    +            maxDepth = option.maximum;
    +        }
    +        if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") {
    +            maxDepth = option.max;
    +        }
    +        if (typeof option === "number") {
    +            maxDepth = option;
             }
    -    }
    -
    -    /**
    -     * Pop the saved block
    -     * @returns {void}
    -     * @private
    -     */
    -    function popBlock() {
    -        functionStack[functionStack.length - 1]--;
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        /**
    +         * When parsing a new function, store it in our function stack
    +         * @returns {void}
    +         * @private
    +         */
    +        function startFunction() {
    +            functionStack.push(0);
    +        }
     
    -    return {
    -        "Program": startFunction,
    -        "FunctionDeclaration": startFunction,
    -        "FunctionExpression": startFunction,
    -        "ArrowFunctionExpression": startFunction,
    +        /**
    +         * When parsing is done then pop out the reference
    +         * @returns {void}
    +         * @private
    +         */
    +        function endFunction() {
    +            functionStack.pop();
    +        }
     
    -        "IfStatement": function(node) {
    -            if (node.parent.type !== "IfStatement") {
    -                pushBlock(node);
    +        /**
    +         * 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];
    +
    +            if (len > maxDepth) {
    +                context.report(node, "Blocks are nested too deeply ({{depth}}).",
    +                        { depth: len });
                 }
    -        },
    -        "SwitchStatement": pushBlock,
    -        "TryStatement": pushBlock,
    -        "DoWhileStatement": pushBlock,
    -        "WhileStatement": pushBlock,
    -        "WithStatement": pushBlock,
    -        "ForStatement": pushBlock,
    -        "ForInStatement": pushBlock,
    -        "ForOfStatement": pushBlock,
    -
    -        "IfStatement:exit": popBlock,
    -        "SwitchStatement:exit": popBlock,
    -        "TryStatement:exit": popBlock,
    -        "DoWhileStatement:exit": popBlock,
    -        "WhileStatement:exit": popBlock,
    -        "WithStatement:exit": popBlock,
    -        "ForStatement:exit": popBlock,
    -        "ForInStatement:exit": popBlock,
    -        "ForOfStatement:exit": popBlock,
    -
    -        "FunctionDeclaration:exit": endFunction,
    -        "FunctionExpression:exit": endFunction,
    -        "ArrowFunctionExpression:exit": endFunction,
    -        "Program:exit": endFunction
    -    };
    +        }
     
    -};
    +        /**
    +         * Pop the saved block
    +         * @returns {void}
    +         * @private
    +         */
    +        function popBlock() {
    +            functionStack[functionStack.length - 1]--;
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            Program: startFunction,
    +            FunctionDeclaration: startFunction,
    +            FunctionExpression: startFunction,
    +            ArrowFunctionExpression: startFunction,
    +
    +            IfStatement: function(node) {
    +                if (node.parent.type !== "IfStatement") {
    +                    pushBlock(node);
    +                }
    +            },
    +            SwitchStatement: pushBlock,
    +            TryStatement: pushBlock,
    +            DoWhileStatement: pushBlock,
    +            WhileStatement: pushBlock,
    +            WithStatement: pushBlock,
    +            ForStatement: pushBlock,
    +            ForInStatement: pushBlock,
    +            ForOfStatement: pushBlock,
    +
    +            "IfStatement:exit": popBlock,
    +            "SwitchStatement:exit": popBlock,
    +            "TryStatement:exit": popBlock,
    +            "DoWhileStatement:exit": popBlock,
    +            "WhileStatement:exit": popBlock,
    +            "WithStatement:exit": popBlock,
    +            "ForStatement:exit": popBlock,
    +            "ForInStatement:exit": popBlock,
    +            "ForOfStatement:exit": popBlock,
    +
    +            "FunctionDeclaration:exit": endFunction,
    +            "FunctionExpression:exit": endFunction,
    +            "ArrowFunctionExpression:exit": endFunction,
    +            "Program:exit": endFunction
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "integer",
    -        "minimum": 0
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/max-len.js b/tools/eslint/lib/rules/max-len.js
    index 3c389588d958f0..1ba539a1192e43 100644
    --- a/tools/eslint/lib/rules/max-len.js
    +++ b/tools/eslint/lib/rules/max-len.js
    @@ -1,223 +1,258 @@
     /**
      * @fileoverview Rule to check for max length on a line.
      * @author Matt DuVall 
    - * @copyright 2013 Matt DuVall. All rights reserved.
      */
     
     "use strict";
     
     //------------------------------------------------------------------------------
    -// Rule Definition
    +// Constants
     //------------------------------------------------------------------------------
     
    -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 = /[^:/?#]:\/\/[^?#]/;
    -
    -    /**
    -     * 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 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;
    -    }
    -
    -    // 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 = 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) {
    -        // 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;
    -
    -        lines.forEach(function(line, i) {
    -            // 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 + ".");
    -            }
    -        });
    -    }
    -
    -
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "Program": checkProgramForMaxLength
    -    };
    -
    -};
    -
     var OPTIONS_SCHEMA = {
    -    "type": "object",
    -    "properties": {
    -        "code": {
    -            "type": "integer",
    -            "minimum": 0
    +    type: "object",
    +    properties: {
    +        code: {
    +            type: "integer",
    +            minimum: 0
             },
    -        "comments": {
    -            "type": "integer",
    -            "minimum": 0
    +        comments: {
    +            type: "integer",
    +            minimum: 0
             },
    -        "tabWidth": {
    -            "type": "integer",
    -            "minimum": 0
    +        tabWidth: {
    +            type: "integer",
    +            minimum: 0
             },
    -        "ignorePattern": {
    -            "type": "string"
    +        ignorePattern: {
    +            type: "string"
             },
    -        "ignoreComments": {
    -            "type": "boolean"
    +        ignoreComments: {
    +            type: "boolean"
             },
    -        "ignoreUrls": {
    -            "type": "boolean"
    +        ignoreUrls: {
    +            type: "boolean"
             },
    -        "ignoreTrailingComments": {
    -            "type": "boolean"
    +        ignoreTrailingComments: {
    +            type: "boolean"
             }
         },
    -    "additionalProperties": false
    +    additionalProperties: false
     };
     
     var OPTIONS_OR_INTEGER_SCHEMA = {
    -    "anyOf": [
    +    anyOf: [
             OPTIONS_SCHEMA,
             {
    -            "type": "integer",
    -            "minimum": 0
    +            type: "integer",
    +            minimum: 0
             }
         ]
     };
     
    -module.exports.schema = [
    -    OPTIONS_OR_INTEGER_SCHEMA,
    -    OPTIONS_OR_INTEGER_SCHEMA,
    -    OPTIONS_SCHEMA
    -];
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum line length",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            OPTIONS_OR_INTEGER_SCHEMA,
    +            OPTIONS_OR_INTEGER_SCHEMA,
    +            OPTIONS_SCHEMA
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        /*
    +         * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however:
    +         * - They're matching an entire string that we know is a URI
    +         * - We're matching part of a string where we think there *might* be a URL
    +         * - We're only concerned about URLs, as picking out any URI would cause
    +         *   too many false positives
    +         * - We don't care about matching the entire URL, any small segment is fine
    +         */
    +        var URL_REGEXP = /[^:/?#]:\/\/[^?#]/;
    +
    +        /**
    +         * 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 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;
    +        }
    +
    +        // 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 = 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) {
    +
    +            // split (honors line-ending)
    +            var lines = context.getSourceLines(),
    +
    +                // list of comments to ignore
    +                comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? context.getAllComments() : [],
    +
    +                // we iterate over comments in parallel with the lines
    +                commentsIndex = 0;
    +
    +            lines.forEach(function(line, i) {
    +
    +                // 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 + ".");
    +                }
    +            });
    +        }
    +
    +
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            Program: checkProgramForMaxLength
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/max-nested-callbacks.js b/tools/eslint/lib/rules/max-nested-callbacks.js
    index cac15d1e85144d..06554127c63242 100644
    --- a/tools/eslint/lib/rules/max-nested-callbacks.js
    +++ b/tools/eslint/lib/rules/max-nested-callbacks.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to enforce a maximum number of nested callbacks.
      * @author Ian Christian Myers
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -10,65 +9,104 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum depth that callbacks can be nested",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            maximum: {
    +                                type: "integer",
    +                                minimum: 0
    +                            },
    +                            max: {
    +                                type: "integer",
    +                                minimum: 0
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Constants
    +        //--------------------------------------------------------------------------
    +        var option = context.options[0],
    +            THRESHOLD = 10;
    +
    +        if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") {
    +            THRESHOLD = option.maximum;
    +        }
    +        if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") {
    +            THRESHOLD = option.max;
    +        }
    +        if (typeof option === "number") {
    +            THRESHOLD = option;
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Constants
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    var THRESHOLD = context.options[0] || 10;
    +        var callbackStack = [];
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        /**
    +         * Checks a given function node for too many callbacks.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkFunction(node) {
    +            var parent = node.parent;
     
    -    var callbackStack = [];
    +            if (parent.type === "CallExpression") {
    +                callbackStack.push(node);
    +            }
     
    -    /**
    -     * Checks a given function node for too many callbacks.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkFunction(node) {
    -        var parent = node.parent;
    +            if (callbackStack.length > THRESHOLD) {
    +                var opts = {num: callbackStack.length, max: THRESHOLD};
     
    -        if (parent.type === "CallExpression") {
    -            callbackStack.push(node);
    +                context.report(node, "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.", opts);
    +            }
             }
     
    -        if (callbackStack.length > THRESHOLD) {
    -            var opts = {num: callbackStack.length, max: THRESHOLD};
    -            context.report(node, "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.", opts);
    +        /**
    +         * Pops the call stack.
    +         * @returns {void}
    +         * @private
    +         */
    +        function popStack() {
    +            callbackStack.pop();
             }
    -    }
     
    -    /**
    -     * Pops the call stack.
    -     * @returns {void}
    -     * @private
    -     */
    -    function popStack() {
    -        callbackStack.pop();
    -    }
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        return {
    +            ArrowFunctionExpression: checkFunction,
    +            "ArrowFunctionExpression:exit": popStack,
     
    -    return {
    -        "ArrowFunctionExpression": checkFunction,
    -        "ArrowFunctionExpression:exit": popStack,
    +            FunctionExpression: checkFunction,
    +            "FunctionExpression:exit": popStack
    +        };
     
    -        "FunctionExpression": checkFunction,
    -        "FunctionExpression:exit": popStack
    -    };
    -
    -};
    -
    -module.exports.schema = [
    -    {
    -        "type": "integer",
    -        "minimum": 0
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/max-params.js b/tools/eslint/lib/rules/max-params.js
    index d248bdf2260c84..5d9d64fac10af9 100644
    --- a/tools/eslint/lib/rules/max-params.js
    +++ b/tools/eslint/lib/rules/max-params.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag when a function has too many parameters
      * @author Ilya Volodin
    - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -11,36 +9,75 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var numParams = context.options[0] || 3;
    -
    -    /**
    -     * Checks a function to see if it has too many parameters.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkFunction(node) {
    -        if (node.params.length > numParams) {
    -            context.report(node, "This function has too many parameters ({{count}}). Maximum allowed is {{max}}.", {
    -                count: node.params.length,
    -                max: numParams
    -            });
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum number of parameters in `function` definitions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            maximum: {
    +                                type: "integer",
    +                                minimum: 0
    +                            },
    +                            max: {
    +                                type: "integer",
    +                                minimum: 0
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var option = context.options[0],
    +            numParams = 3;
    +
    +        if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") {
    +            numParams = option.maximum;
    +        }
    +        if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") {
    +            numParams = option.max;
    +        }
    +        if (typeof option === "number") {
    +            numParams = option;
             }
    -    }
     
    -    return {
    -        "FunctionDeclaration": checkFunction,
    -        "ArrowFunctionExpression": checkFunction,
    -        "FunctionExpression": checkFunction
    -    };
    +        /**
    +         * Checks a function to see if it has too many parameters.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkFunction(node) {
    +            if (node.params.length > numParams) {
    +                context.report(node, "This function has too many parameters ({{count}}). Maximum allowed is {{max}}.", {
    +                    count: node.params.length,
    +                    max: numParams
    +                });
    +            }
    +        }
     
    -};
    +        return {
    +            FunctionDeclaration: checkFunction,
    +            ArrowFunctionExpression: checkFunction,
    +            FunctionExpression: checkFunction
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "integer",
    -        "minimum": 0
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/max-statements-per-line.js b/tools/eslint/lib/rules/max-statements-per-line.js
    new file mode 100644
    index 00000000000000..64058f0d30bf2b
    --- /dev/null
    +++ b/tools/eslint/lib/rules/max-statements-per-line.js
    @@ -0,0 +1,113 @@
    +/**
    + * @fileoverview Specify the maximum number of statements allowed per line.
    + * @author Kenneth Williams
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum number of statements allowed per line",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    max: {
    +                        type: "integer"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var options = context.options[0] || {},
    +            lastStatementLine = 0,
    +            numberOfStatementsOnThisLine = 0,
    +            maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1;
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Reports a node
    +         * @param {ASTNode} node The node to report
    +         * @returns {void}
    +         * @private
    +         */
    +        function report(node) {
    +            context.report(
    +                node,
    +                "This line has too many statements. Maximum allowed is {{max}}.",
    +                { max: maxStatementsPerLine });
    +        }
    +
    +        /**
    +         * Enforce a maximum number of statements per line
    +         * @param {ASTNode} nodes Array of nodes to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function enforceMaxStatementsPerLine(nodes) {
    +            if (nodes.length < 1) {
    +                return;
    +            }
    +
    +            for (var i = 0, l = nodes.length; i < l; ++i) {
    +                var currentStatement = nodes[i];
    +
    +                if (currentStatement.loc.start.line === lastStatementLine) {
    +                    ++numberOfStatementsOnThisLine;
    +                } else {
    +                    numberOfStatementsOnThisLine = 1;
    +                    lastStatementLine = currentStatement.loc.end.line;
    +                }
    +                if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) {
    +                    report(currentStatement);
    +                }
    +            }
    +        }
    +
    +        /**
    +         * Check each line in the body of a node
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkLinesInBody(node) {
    +            enforceMaxStatementsPerLine(node.body);
    +        }
    +
    +        /**
    +         * Check each line in the consequent of a switch case
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkLinesInConsequent(node) {
    +            enforceMaxStatementsPerLine(node.consequent);
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            Program: checkLinesInBody,
    +            BlockStatement: checkLinesInBody,
    +            SwitchCase: checkLinesInConsequent
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/max-statements.js b/tools/eslint/lib/rules/max-statements.js
    index 78de52ebeb197c..72904c64bad0c4 100644
    --- a/tools/eslint/lib/rules/max-statements.js
    +++ b/tools/eslint/lib/rules/max-statements.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to set the maximum number of statements in a function.
      * @author Ian Christian Myers
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -10,110 +9,151 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    var functionStack = [],
    -        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 });
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce a maximum number of statements allowed in `function` blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * When parsing a new function, store it in our function stack
    -     * @returns {void}
    -     * @private
    -     */
    -    function startFunction() {
    -        functionStack.push(0);
    -    }
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            maximum: {
    +                                type: "integer",
    +                                minimum: 0
    +                            },
    +                            max: {
    +                                type: "integer",
    +                                minimum: 0
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    ignoreTopLevelFunctions: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    /**
    -     * 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 (ignoreTopLevelFunctions && functionStack.length === 0) {
    -            topLevelFunctions.push({ node: node, count: count});
    -        } else {
    -            reportIfTooManyStatements(node, count, maxStatements);
    -        }
    -    }
    +    create: function(context) {
     
    -    /**
    -     * 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;
    -    }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        var functionStack = [],
    +            option = context.options[0],
    +            maxStatements = 10,
    +            ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false,
    +            topLevelFunctions = [];
     
    -    return {
    -        "FunctionDeclaration": startFunction,
    -        "FunctionExpression": startFunction,
    -        "ArrowFunctionExpression": startFunction,
    +        if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") {
    +            maxStatements = option.maximum;
    +        }
    +        if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") {
    +            maxStatements = option.max;
    +        }
    +        if (typeof option === "number") {
    +            maxStatements = option;
    +        }
     
    -        "BlockStatement": countStatements,
    +        /**
    +         * 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 });
    +            }
    +        }
     
    -        "FunctionDeclaration:exit": endFunction,
    -        "FunctionExpression:exit": endFunction,
    -        "ArrowFunctionExpression:exit": endFunction,
    +        /**
    +         * When parsing a new function, store it in our function stack
    +         * @returns {void}
    +         * @private
    +         */
    +        function startFunction() {
    +            functionStack.push(0);
    +        }
     
    -        "Program:exit": function() {
    -            if (topLevelFunctions.length === 1) {
    -                return;
    +        /**
    +         * 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 (ignoreTopLevelFunctions && functionStack.length === 0) {
    +                topLevelFunctions.push({ node: node, count: count});
    +            } else {
    +                reportIfTooManyStatements(node, count, maxStatements);
                 }
    +        }
     
    -            topLevelFunctions.forEach(function(element) {
    -                var count = element.count;
    -                var node = element.node;
    -                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;
             }
    -    };
     
    -};
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -module.exports.schema = [
    -    {
    -        "type": "integer",
    -        "minimum": 0
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "ignoreTopLevelFunctions": {
    -                "type": "boolean"
    +        return {
    +            FunctionDeclaration: startFunction,
    +            FunctionExpression: startFunction,
    +            ArrowFunctionExpression: startFunction,
    +
    +            BlockStatement: countStatements,
    +
    +            "FunctionDeclaration:exit": endFunction,
    +            "FunctionExpression: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);
    +                });
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/new-cap.js b/tools/eslint/lib/rules/new-cap.js
    index 35f5cafa8b339f..697b60d0f10c87 100644
    --- a/tools/eslint/lib/rules/new-cap.js
    +++ b/tools/eslint/lib/rules/new-cap.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag use of constructors without capital letters
      * @author Nicholas C. Zakas
    - * @copyright 2014 Jordan Harband. All rights reserved.
    - * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved.
      */
     
     "use strict";
    @@ -38,6 +36,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");
    @@ -75,167 +74,184 @@ function calculateCapIsNewExceptions(config) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require constructor `function` names to begin with a capital letter",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    newIsCap: {
    +                        type: "boolean"
    +                    },
    +                    capIsNew: {
    +                        type: "boolean"
    +                    },
    +                    newIsCapExceptions: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    capIsNewExceptions: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    properties: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
     
    -    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 config = context.options[0] ? lodash.assign({}, context.options[0]) : {};
     
    -    var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {});
    +        config.newIsCap = config.newIsCap !== false;
    +        config.capIsNew = config.capIsNew !== false;
    +        var skipProperties = config.properties === false;
     
    -    var capIsNewExceptions = calculateCapIsNewExceptions(config);
    +        var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {});
     
    -    var listeners = {};
    +        var capIsNewExceptions = calculateCapIsNewExceptions(config);
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        var listeners = {};
     
    -    /**
    -     * Get exact callee name from expression
    -     * @param {ASTNode} node CallExpression or NewExpression node
    -     * @returns {string} name
    -     */
    -    function extractNameFromExpression(node) {
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -        var name = "",
    -            property;
    +        /**
    +         * Get exact callee name from expression
    +         * @param {ASTNode} node CallExpression or NewExpression node
    +         * @returns {string} name
    +         */
    +        function extractNameFromExpression(node) {
     
    -        if (node.callee.type === "MemberExpression") {
    -            property = node.callee.property;
    +            var name = "",
    +                property;
     
    -            if (property.type === "Literal" && (typeof property.value === "string")) {
    -                name = property.value;
    -            } else if (property.type === "Identifier" && !node.callee.computed) {
    -                name = property.name;
    +            if (node.callee.type === "MemberExpression") {
    +                property = node.callee.property;
    +
    +                if (property.type === "Literal" && (typeof property.value === "string")) {
    +                    name = property.value;
    +                } else if (property.type === "Identifier" && !node.callee.computed) {
    +                    name = property.name;
    +                }
    +            } else {
    +                name = node.callee.name;
                 }
    -        } else {
    -            name = node.callee.name;
    +            return name;
             }
    -        return name;
    -    }
     
    -    /**
    -     * Returns the capitalization state of the string -
    -     * Whether the first character is uppercase, lowercase, or non-alphabetic
    -     * @param {string} str String
    -     * @returns {string} capitalization state: "non-alpha", "lower", or "upper"
    -     */
    -    function getCap(str) {
    -        var firstChar = str.charAt(0);
    -
    -        var firstCharLower = firstChar.toLowerCase();
    -        var firstCharUpper = firstChar.toUpperCase();
    -
    -        if (firstCharLower === firstCharUpper) {
    -            // char has no uppercase variant, so it's non-alphabetic
    -            return "non-alpha";
    -        } else if (firstChar === firstCharLower) {
    -            return "lower";
    -        } else {
    -            return "upper";
    +        /**
    +         * Returns the capitalization state of the string -
    +         * Whether the first character is uppercase, lowercase, or non-alphabetic
    +         * @param {string} str String
    +         * @returns {string} capitalization state: "non-alpha", "lower", or "upper"
    +         */
    +        function getCap(str) {
    +            var firstChar = str.charAt(0);
    +
    +            var firstCharLower = firstChar.toLowerCase();
    +            var firstCharUpper = firstChar.toUpperCase();
    +
    +            if (firstCharLower === firstCharUpper) {
    +
    +                // char has no uppercase variant, so it's non-alphabetic
    +                return "non-alpha";
    +            } else if (firstChar === firstCharLower) {
    +                return "lower";
    +            } else {
    +                return "upper";
    +            }
             }
    -    }
     
    -    /**
    -     * Check if capitalization is allowed for a CallExpression
    -     * @param {Object} allowedMap Object mapping calleeName to a Boolean
    -     * @param {ASTNode} node CallExpression node
    -     * @param {string} calleeName Capitalized callee name from a CallExpression
    -     * @returns {Boolean} Returns true if the callee may be capitalized
    -     */
    -    function isCapAllowed(allowedMap, node, calleeName) {
    -        if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) {
    -            return true;
    -        }
    +        /**
    +         * Check if capitalization is allowed for a CallExpression
    +         * @param {Object} allowedMap Object mapping calleeName to a Boolean
    +         * @param {ASTNode} node CallExpression node
    +         * @param {string} calleeName Capitalized callee name from a CallExpression
    +         * @returns {Boolean} Returns true if the callee may be capitalized
    +         */
    +        function isCapAllowed(allowedMap, node, calleeName) {
    +            if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) {
    +                return true;
    +            }
    +
    +            if (calleeName === "UTC" && node.callee.type === "MemberExpression") {
     
    -        if (calleeName === "UTC" && node.callee.type === "MemberExpression") {
    -            // allow if callee is Date.UTC
    -            return node.callee.object.type === "Identifier" &&
    -                node.callee.object.name === "Date";
    +                // allow if callee is Date.UTC
    +                return node.callee.object.type === "Identifier" &&
    +                    node.callee.object.name === "Date";
    +            }
    +
    +            return skipProperties && node.callee.type === "MemberExpression";
             }
     
    -        return skipProperties && node.callee.type === "MemberExpression";
    -    }
    +        /**
    +         * Reports the given message for the given node. The location will be the start of the property or the callee.
    +         * @param {ASTNode} node CallExpression or NewExpression node.
    +         * @param {string} message The message to report.
    +         * @returns {void}
    +         */
    +        function report(node, message) {
    +            var callee = node.callee;
    +
    +            if (callee.type === "MemberExpression") {
    +                callee = callee.property;
    +            }
     
    -    /**
    -     * Reports the given message for the given node. The location will be the start of the property or the callee.
    -     * @param {ASTNode} node CallExpression or NewExpression node.
    -     * @param {string} message The message to report.
    -     * @returns {void}
    -     */
    -    function report(node, message) {
    -        var callee = node.callee;
    -
    -        if (callee.type === "MemberExpression") {
    -            callee = callee.property;
    +            context.report(node, callee.loc.start, message);
             }
     
    -        context.report(node, callee.loc.start, message);
    -    }
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        if (config.newIsCap) {
    +            listeners.NewExpression = function(node) {
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +                var constructorName = extractNameFromExpression(node);
     
    -    if (config.newIsCap) {
    -        listeners.NewExpression = function(node) {
    +                if (constructorName) {
    +                    var capitalization = getCap(constructorName);
    +                    var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName);
     
    -            var constructorName = extractNameFromExpression(node);
    -            if (constructorName) {
    -                var capitalization = getCap(constructorName);
    -                var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName);
    -                if (!isAllowed) {
    -                    report(node, "A constructor name should not start with a lowercase letter.");
    +                    if (!isAllowed) {
    +                        report(node, "A constructor name should not start with a lowercase letter.");
    +                    }
                     }
    -            }
    -        };
    -    }
    +            };
    +        }
     
    -    if (config.capIsNew) {
    -        listeners.CallExpression = function(node) {
    +        if (config.capIsNew) {
    +            listeners.CallExpression = function(node) {
     
    -            var calleeName = extractNameFromExpression(node);
    -            if (calleeName) {
    -                var capitalization = getCap(calleeName);
    -                var isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName);
    -                if (!isAllowed) {
    -                    report(node, "A function with a name starting with an uppercase letter should only be used as a constructor.");
    -                }
    -            }
    -        };
    -    }
    +                var calleeName = extractNameFromExpression(node);
     
    -    return listeners;
    -};
    +                if (calleeName) {
    +                    var capitalization = getCap(calleeName);
    +                    var isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName);
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "newIsCap": {
    -                "type": "boolean"
    -            },
    -            "capIsNew": {
    -                "type": "boolean"
    -            },
    -            "newIsCapExceptions": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    -                }
    -            },
    -            "capIsNewExceptions": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    +                    if (!isAllowed) {
    +                        report(node, "A function with a name starting with an uppercase letter should only be used as a constructor.");
    +                    }
                     }
    -            },
    -            "properties": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
    +            };
    +        }
    +
    +        return listeners;
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/new-parens.js b/tools/eslint/lib/rules/new-parens.js
    index 903564b5d77078..0d7a84e3cc4b07 100644
    --- a/tools/eslint/lib/rules/new-parens.js
    +++ b/tools/eslint/lib/rules/new-parens.js
    @@ -9,21 +9,32 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require parentheses when invoking a constructor with no arguments",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "NewExpression": function(node) {
    -            var tokens = context.getTokens(node);
    -            var prenticesTokens = tokens.filter(function(token) {
    -                return token.value === "(" || token.value === ")";
    -            });
    -            if (prenticesTokens.length < 2) {
    -                context.report(node, "Missing '()' invoking a constructor");
    +    create: function(context) {
    +
    +        return {
    +
    +            NewExpression: function(node) {
    +                var tokens = context.getTokens(node);
    +                var prenticesTokens = tokens.filter(function(token) {
    +                    return token.value === "(" || token.value === ")";
    +                });
    +
    +                if (prenticesTokens.length < 2) {
    +                    context.report(node, "Missing '()' invoking a constructor");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js
    index 1b5698c0302bca..fd80c8c5422d97 100644
    --- a/tools/eslint/lib/rules/newline-after-var.js
    +++ b/tools/eslint/lib/rules/newline-after-var.js
    @@ -1,9 +1,6 @@
     /**
      * @fileoverview Rule to check empty newline after "var" statement
      * @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";
    @@ -12,156 +9,169 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var ALWAYS_MESSAGE = "Expected blank line after variable declarations.",
    -        NEVER_MESSAGE = "Unexpected blank line after variable declarations.";
    -
    -    var sourceCode = context.getSourceCode();
    -
    -    // Default `mode` to "always".
    -    var mode = context.options[0] === "never" ? "never" : "always";
    -
    -    // 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;
    -    }, {});
    -
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Determine if provided keyword is a variable declaration
    -     * @private
    -     * @param {string} keyword - keyword to test
    -     * @returns {boolean} True if `keyword` is a type of var
    -     */
    -    function isVar(keyword) {
    -        return keyword === "var" || keyword === "let" || keyword === "const";
    -    }
    -
    -    /**
    -     * 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";
    -    }
    -
    -    /**
    -     * Determine if provided keyword is an export specifiers
    -     * @private
    -     * @param {string} nodeType - nodeType to test
    -     * @returns {boolean} True if `nodeType` is an export specifier
    -     */
    -    function isExportSpecifier(nodeType) {
    -        return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" ||
    -            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
    -     * to "never"
    -     * @private
    -     * @param {ASTNode} node - `VariableDeclaration` node to test
    -     * @returns {void}
    -     */
    -    function checkForBlankLine(node) {
    -        var lastToken = sourceCode.getLastToken(node),
    -            nextToken = sourceCode.getTokenAfter(node),
    -            nextLineNum = lastToken.loc.end.line + 1,
    -            noNextLineToken,
    -            hasNextLineComment;
    -
    -        // Ignore if there is no following statement
    -        if (!nextToken) {
    -            return;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow an empty line after `var` declarations",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                enum: ["never", "always"]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var ALWAYS_MESSAGE = "Expected blank line after variable declarations.",
    +            NEVER_MESSAGE = "Unexpected blank line after variable declarations.";
    +
    +        var sourceCode = context.getSourceCode();
    +
    +        // Default `mode` to "always".
    +        var mode = context.options[0] === "never" ? "never" : "always";
    +
    +        // 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;
    +        }, {});
    +
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Determine if provided keyword is a variable declaration
    +         * @private
    +         * @param {string} keyword - keyword to test
    +         * @returns {boolean} True if `keyword` is a type of var
    +         */
    +        function isVar(keyword) {
    +            return keyword === "var" || keyword === "let" || keyword === "const";
             }
     
    -        // Ignore if parent of node is a for variant
    -        if (isForTypeSpecifier(node.parent.type)) {
    -            return;
    +        /**
    +         * 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";
             }
     
    -        // Ignore if parent of node is an export specifier
    -        if (isExportSpecifier(node.parent.type)) {
    -            return;
    +        /**
    +         * Determine if provided keyword is an export specifiers
    +         * @private
    +         * @param {string} nodeType - nodeType to test
    +         * @returns {boolean} True if `nodeType` is an export specifier
    +         */
    +        function isExportSpecifier(nodeType) {
    +            return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" ||
    +                nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration";
             }
     
    -        // Some coding styles use multiple `var` statements, so do nothing if
    -        // the next token is a `var` statement.
    -        if (nextToken.type === "Keyword" && isVar(nextToken.value)) {
    -            return;
    -        }
    +        /**
    +         * 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);
     
    -        // Ignore if it is last statement in a block
    -        if (isLastNode(node)) {
    -            return;
    +            return !token || (token.type === "Punctuator" && token.value === "}");
             }
     
    -        // Next statement is not a `var`...
    -        noNextLineToken = nextToken.loc.start.line > nextLineNum;
    -        hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined");
    -
    -        if (mode === "never" && noNextLineToken && !hasNextLineComment) {
    -            context.report(node, NEVER_MESSAGE, { identifier: node.name });
    +        /**
    +         * 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);
             }
     
    -        // 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 });
    +        /**
    +         * 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
    +         * to "never"
    +         * @private
    +         * @param {ASTNode} node - `VariableDeclaration` node to test
    +         * @returns {void}
    +         */
    +        function checkForBlankLine(node) {
    +            var lastToken = sourceCode.getLastToken(node),
    +                nextToken = sourceCode.getTokenAfter(node),
    +                nextLineNum = lastToken.loc.end.line + 1,
    +                noNextLineToken,
    +                hasNextLineComment;
    +
    +            // Ignore if there is no following statement
    +            if (!nextToken) {
    +                return;
    +            }
    +
    +            // Ignore if parent of node is a for variant
    +            if (isForTypeSpecifier(node.parent.type)) {
    +                return;
    +            }
    +
    +            // Ignore if parent of node is an export specifier
    +            if (isExportSpecifier(node.parent.type)) {
    +                return;
    +            }
    +
    +            // Some coding styles use multiple `var` statements, so do nothing if
    +            // the next token is a `var` statement.
    +            if (nextToken.type === "Keyword" && isVar(nextToken.value)) {
    +                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 = (typeof commentEndLine[nextLineNum] !== "undefined");
    +
    +            if (mode === "never" && noNextLineToken && !hasNextLineComment) {
    +                context.report(node, NEVER_MESSAGE, { identifier: node.name });
    +            }
    +
    +            // 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 });
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    return {
    -        "VariableDeclaration": checkForBlankLine
    -    };
    +        return {
    +            VariableDeclaration: checkForBlankLine
    +        };
     
    -};
    -
    -module.exports.schema = [
    -    {
    -        "enum": ["never", "always"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/newline-before-return.js b/tools/eslint/lib/rules/newline-before-return.js
    new file mode 100644
    index 00000000000000..77f3aedaa80868
    --- /dev/null
    +++ b/tools/eslint/lib/rules/newline-before-return.js
    @@ -0,0 +1,166 @@
    +/**
    + * @fileoverview Rule to require newlines before `return` statement
    + * @author Kai Cataldo
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require an empty line before `return` statements",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var sourceCode = context.getSourceCode();
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Tests whether node is preceded by supplied tokens
    +         * @param {ASTNode} node - node to check
    +         * @param {array} testTokens - array of tokens to test against
    +         * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens
    +         * @private
    +         */
    +        function isPrecededByTokens(node, testTokens) {
    +            var tokenBefore = sourceCode.getTokenBefore(node);
    +
    +            return testTokens.some(function(token) {
    +                return tokenBefore.value === token;
    +            });
    +        }
    +
    +        /**
    +         * Checks whether node is the first node after statement or in block
    +         * @param {ASTNode} node - node to check
    +         * @returns {boolean} Whether or not the node is the first node after statement or in block
    +         * @private
    +         */
    +        function isFirstNode(node) {
    +            var parentType = node.parent.type;
    +
    +            if (node.parent.body) {
    +                return Array.isArray(node.parent.body)
    +                  ? node.parent.body[0] === node
    +                  : node.parent.body === node;
    +            }
    +
    +            if (parentType === "IfStatement") {
    +                return isPrecededByTokens(node, ["else", ")"]);
    +            } else if (parentType === "DoWhileStatement") {
    +                return isPrecededByTokens(node, ["do"]);
    +            } else if (parentType === "SwitchCase") {
    +                return isPrecededByTokens(node, [":"]);
    +            } else {
    +                return isPrecededByTokens(node, [")"]);
    +            }
    +        }
    +
    +        /**
    +         * Returns the number of lines of comments that precede the node
    +         * @param {ASTNode} node - node to check for overlapping comments
    +         * @param {number} lineNumTokenBefore - line number of previous token, to check for overlapping comments
    +         * @returns {number} Number of lines of comments that precede the node
    +         * @private
    +         */
    +        function calcCommentLines(node, lineNumTokenBefore) {
    +            var comments = sourceCode.getComments(node).leading,
    +                numLinesComments = 0;
    +
    +            if (!comments.length) {
    +                return numLinesComments;
    +            }
    +
    +            comments.forEach(function(comment) {
    +                numLinesComments++;
    +
    +                if (comment.type === "Block") {
    +                    numLinesComments += comment.loc.end.line - comment.loc.start.line;
    +                }
    +
    +                // avoid counting lines with inline comments twice
    +                if (comment.loc.start.line === lineNumTokenBefore) {
    +                    numLinesComments--;
    +                }
    +
    +                if (comment.loc.end.line === node.loc.start.line) {
    +                    numLinesComments--;
    +                }
    +            });
    +
    +            return numLinesComments;
    +        }
    +
    +        /**
    +         * Checks whether node is preceded by a newline
    +         * @param {ASTNode} node - node to check
    +         * @returns {boolean} Whether or not the node is preceded by a newline
    +         * @private
    +         */
    +        function hasNewlineBefore(node) {
    +            var tokenBefore = sourceCode.getTokenBefore(node),
    +                lineNumNode = node.loc.start.line,
    +                lineNumTokenBefore,
    +                commentLines;
    +
    +            /**
    +             * Global return (at the beginning of a script) is a special case.
    +             * If there is no token before `return`, then we expect no line
    +             * break before the return. Comments are allowed to occupy lines
    +             * before the global return, just no blank lines.
    +             * Setting lineNumTokenBefore to zero in that case results in the
    +             * desired behavior.
    +             */
    +            if (tokenBefore) {
    +                lineNumTokenBefore = tokenBefore.loc.end.line;
    +            } else {
    +                lineNumTokenBefore = 0;     // global return at beginning of script
    +            }
    +
    +            commentLines = calcCommentLines(node, lineNumTokenBefore);
    +
    +            return (lineNumNode - lineNumTokenBefore - commentLines) > 1;
    +        }
    +
    +        /**
    +         * Reports expected/unexpected newline before return statement
    +         * @param {ASTNode} node - the node to report in the event of an error
    +         * @param {boolean} isExpected - whether the newline is expected or not
    +         * @returns {void}
    +         * @private
    +         */
    +        function reportError(node, isExpected) {
    +            var expected = isExpected ? "Expected" : "Unexpected";
    +
    +            context.report({
    +                node: node,
    +                message: expected + " newline before return statement."
    +            });
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            ReturnStatement: function(node) {
    +                if (isFirstNode(node) && hasNewlineBefore(node)) {
    +                    reportError(node, false);
    +                } else if (!isFirstNode(node) && !hasNewlineBefore(node)) {
    +                    reportError(node, true);
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/newline-per-chained-call.js b/tools/eslint/lib/rules/newline-per-chained-call.js
    index 4e17e05ed9cb80..80401415aa8033 100644
    --- a/tools/eslint/lib/rules/newline-per-chained-call.js
    +++ b/tools/eslint/lib/rules/newline-per-chained-call.js
    @@ -1,7 +1,7 @@
     /**
      * @fileoverview Rule to ensure newline per method call when chaining calls
      * @author Rajendra Patil
    - * @copyright 2016 Rajendra Patil. All rights reserved.
    + * @author Burak Yigit Kaya
      */
     
     "use strict";
    @@ -10,104 +10,55 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require a newline after each call in a method chain",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var options = context.options[0] || {},
    -        codeStateMap = {},
    -        ignoreChainWithDepth = options.ignoreChainWithDepth || 2;
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                ignoreChainWithDepth: {
    +                    type: "integer",
    +                    minimum: 1,
    +                    maximum: 10
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
     
    -    /**
    -     * 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;
    -        }
    +    create: function(context) {
     
    -        if (node.object) {
    -            codeState.depth++;
    +        var options = context.options[0] || {},
    +            ignoreChainWithDepth = options.ignoreChainWithDepth || 2;
     
    -            objectLineNumber = node.object.loc.end.line;
    -            propertyLineNumber = node.property.loc.end.line;
    -            valid = node.computed || propertyLineNumber > objectLineNumber;
    +        return {
    +            "CallExpression:exit": function(node) {
    +                if (!node.callee || node.callee.type !== "MemberExpression") {
    +                    return;
    +                }
     
    -            if (!valid) {
    -                codeState.reports.push({
    -                    node: node,
    -                    text: "Expected line break after `{{code}}`.",
    -                    depth: codeState.depth
    -                });
    -            }
    -            // Recurse
    -            checkAndCaptureStateRecursively(node.object, codeState);
    -        }
    +                var callee = node.callee;
    +                var parent = callee.object;
    +                var depth = 1;
     
    -    }
    -    /**
    -     * 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
    -                });
    -            }
    -        }
    -    }
    +                while (parent && parent.callee) {
    +                    depth += 1;
    +                    parent = parent.callee.object;
    +                }
     
    -    /**
    -     * Initialize the node state object with default values.
    -     * @returns {void}
    -     */
    -    function initializeState() {
    -        return {
    -            visited: false,
    -            hasFunctionCall: false,
    -            depth: 1,
    -            reports: []
    +                if (depth > ignoreChainWithDepth && callee.property.loc.start.line === callee.object.loc.end.line) {
    +                    context.report(
    +                        callee.property,
    +                        callee.property.loc.start,
    +                        "Expected line break after `" + context.getSource(callee.object).replace(/\r\n|\r|\n/g, "\\n") + "`."
    +                    );
    +                }
    +            }
             };
         }
    -    /**
    -     * 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 dddefc47733080..e491dfefc5504e 100644
    --- a/tools/eslint/lib/rules/no-alert.js
    +++ b/tools/eslint/lib/rules/no-alert.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag use of alert, confirm, prompt
      * @author Nicholas C. Zakas
    - * @copyright 2015 Mathias Schreck
    - * @copyright 2013 Nicholas C. Zakas
      */
     "use strict";
     
    @@ -73,6 +71,7 @@ function findReference(scope, node) {
      */
     function isShadowed(scope, globalScope, node) {
         var reference = findReference(scope, node);
    +
         return reference && reference.resolved && reference.resolved.defs.length > 0;
     }
     
    @@ -97,39 +96,49 @@ function isGlobalThisReferenceOrGlobalWindow(scope, globalScope, node) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var globalScope;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `alert`, `confirm`, and `prompt`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Program": function() {
    -            globalScope = context.getScope();
    -        },
    +    create: function(context) {
    +        var globalScope;
     
    -        "CallExpression": function(node) {
    -            var callee = node.callee,
    -                identifierName,
    -                currentScope = context.getScope();
    +        return {
     
    -            // without window.
    -            if (callee.type === "Identifier") {
    -                identifierName = callee.name;
    +            Program: function() {
    +                globalScope = context.getScope();
    +            },
     
    -                if (!isShadowed(currentScope, globalScope, callee) && isProhibitedIdentifier(callee.name)) {
    -                    report(context, node, identifierName);
    -                }
    +            CallExpression: function(node) {
    +                var callee = node.callee,
    +                    identifierName,
    +                    currentScope = context.getScope();
    +
    +                // without window.
    +                if (callee.type === "Identifier") {
    +                    identifierName = callee.name;
    +
    +                    if (!isShadowed(currentScope, globalScope, callee) && isProhibitedIdentifier(callee.name)) {
    +                        report(context, node, identifierName);
    +                    }
     
    -            } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, globalScope, callee.object)) {
    -                identifierName = getPropertyName(callee);
    +                } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, globalScope, callee.object)) {
    +                    identifierName = getPropertyName(callee);
     
    -                if (isProhibitedIdentifier(identifierName)) {
    -                    report(context, node, identifierName);
    +                    if (isProhibitedIdentifier(identifierName)) {
    +                        report(context, node, identifierName);
    +                    }
                     }
    -            }
     
    -        }
    -    };
    +            }
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-array-constructor.js b/tools/eslint/lib/rules/no-array-constructor.js
    index ecf5837228b12a..389725c62c7305 100644
    --- a/tools/eslint/lib/rules/no-array-constructor.js
    +++ b/tools/eslint/lib/rules/no-array-constructor.js
    @@ -9,29 +9,39 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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 &&
    -            node.callee.type === "Identifier" &&
    -            node.callee.name === "Array"
    -        ) {
    -            context.report(node, "The array literal notation [] is preferrable.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `Array` constructors",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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 &&
    +                node.callee.type === "Identifier" &&
    +                node.callee.name === "Array"
    +            ) {
    +                context.report(node, "The array literal notation [] is preferrable.");
    +            }
             }
    -    }
     
    -    return {
    -        "CallExpression": check,
    -        "NewExpression": check
    -    };
    +        return {
    +            CallExpression: check,
    +            NewExpression: check
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-bitwise.js b/tools/eslint/lib/rules/no-bitwise.js
    index 9655525396e7e3..0294998ecc1022 100644
    --- a/tools/eslint/lib/rules/no-bitwise.js
    +++ b/tools/eslint/lib/rules/no-bitwise.js
    @@ -18,82 +18,92 @@ var BITWISE_OPERATORS = [
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = context.options[0] || {};
    -    var allowed = options.allow || [];
    -    var int32Hint = options.int32Hint === true;
    -
    -    /**
    -     * Reports an unexpected use of a bitwise operator.
    -     * @param   {ASTNode} node Node which contains the bitwise operator.
    -     * @returns {void}
    -     */
    -    function report(node) {
    -        context.report(node, "Unexpected use of '{{operator}}'.", { operator: node.operator });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow bitwise operators",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Checks if the given node has a bitwise operator.
    -     * @param   {ASTNode} node The node to check.
    -     * @returns {boolean} Whether or not the node has a bitwise operator.
    -     */
    -    function hasBitwiseOperator(node) {
    -        return BITWISE_OPERATORS.indexOf(node.operator) !== -1;
    -    }
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allow: {
    +                        type: "array",
    +                        items: {
    +                            enum: BITWISE_OPERATORS
    +                        },
    +                        uniqueItems: true
    +                    },
    +                    int32Hint: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    /**
    -     * 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;
    -    }
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var allowed = options.allow || [];
    +        var int32Hint = options.int32Hint === true;
     
    -    /**
    -     * 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;
    -    }
    +        /**
    +         * Reports an unexpected use of a bitwise operator.
    +         * @param   {ASTNode} node Node which contains the bitwise operator.
    +         * @returns {void}
    +         */
    +        function report(node) {
    +            context.report(node, "Unexpected use of '{{operator}}'.", { operator: node.operator });
    +        }
     
    -    /**
    -     * Report if the given node contains a bitwise operator.
    -     * @param   {ASTNode} node The node to check.
    -     * @returns {void}
    -     */
    -    function checkNodeForBitwiseOperator(node) {
    -        if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) {
    -            report(node);
    +        /**
    +         * Checks if the given node has a bitwise operator.
    +         * @param   {ASTNode} node The node to check.
    +         * @returns {boolean} Whether or not the node has a bitwise operator.
    +         */
    +        function hasBitwiseOperator(node) {
    +            return BITWISE_OPERATORS.indexOf(node.operator) !== -1;
             }
    -    }
     
    -    return {
    -        "AssignmentExpression": checkNodeForBitwiseOperator,
    -        "BinaryExpression": checkNodeForBitwiseOperator,
    -        "UnaryExpression": checkNodeForBitwiseOperator
    -    };
    +        /**
    +         * 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;
    +        }
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "allow": {
    -                "type": "array",
    -                "items": {
    -                    "enum": BITWISE_OPERATORS
    -                },
    -                "uniqueItems": true
    -            },
    -            "int32Hint": {
    -                "type": "boolean"
    +        /**
    +         * Report if the given node contains a bitwise operator.
    +         * @param   {ASTNode} node The node to check.
    +         * @returns {void}
    +         */
    +        function checkNodeForBitwiseOperator(node) {
    +            if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) {
    +                report(node);
                 }
    -        },
    -        "additionalProperties": false
    +        }
    +
    +        return {
    +            AssignmentExpression: checkNodeForBitwiseOperator,
    +            BinaryExpression: checkNodeForBitwiseOperator,
    +            UnaryExpression: checkNodeForBitwiseOperator
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-caller.js b/tools/eslint/lib/rules/no-caller.js
    index aacb3feffbeb46..0405fdaeb90303 100644
    --- a/tools/eslint/lib/rules/no-caller.js
    +++ b/tools/eslint/lib/rules/no-caller.js
    @@ -9,21 +9,31 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `arguments.caller` or `arguments.callee`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "MemberExpression": function(node) {
    -            var objectName = node.object.name,
    -                propertyName = node.property.name;
    +    create: function(context) {
     
    -            if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/)) {
    -                context.report(node, "Avoid arguments.{{property}}.", { property: propertyName });
    -            }
    +        return {
     
    -        }
    -    };
    +            MemberExpression: function(node) {
    +                var objectName = node.object.name,
    +                    propertyName = node.property.name;
     
    -};
    +                if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/)) {
    +                    context.report(node, "Avoid arguments.{{property}}.", { property: propertyName });
    +                }
     
    -module.exports.schema = [];
    +            }
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-case-declarations.js b/tools/eslint/lib/rules/no-case-declarations.js
    index 443328b89e5b2e..8ef202538ec573 100644
    --- a/tools/eslint/lib/rules/no-case-declarations.js
    +++ b/tools/eslint/lib/rules/no-case-declarations.js
    @@ -1,7 +1,6 @@
     /**
      * @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";
     
    @@ -9,39 +8,50 @@
     // 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;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow lexical declarations in case clauses",
    +            category: "Best Practices",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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."
    -                    });
    +        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 88eeb02fa6182c..4a206833c08928 100644
    --- a/tools/eslint/lib/rules/no-catch-shadow.js
    +++ b/tools/eslint/lib/rules/no-catch-shadow.js
    @@ -15,44 +15,54 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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) {
    -        return astUtils.getVariableByName(scope, name) !== null;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        schema: []
    +    },
     
    -    return {
    +    create: function(context) {
     
    -        "CatchClause": function(node) {
    -            var scope = context.getScope();
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -            // 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;
    -            }
    +        /**
    +         * 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) {
    +            return astUtils.getVariableByName(scope, name) !== null;
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
     
    -            if (paramIsShadowing(scope, node.param.name)) {
    -                context.report(node, "Value of '{{name}}' may be overwritten in IE 8 and earlier.",
    -                        { name: node.param.name });
    +            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 });
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-class-assign.js b/tools/eslint/lib/rules/no-class-assign.js
    index 82f8e31fc34265..1e4d3243d8b918 100644
    --- a/tools/eslint/lib/rules/no-class-assign.js
    +++ b/tools/eslint/lib/rules/no-class-assign.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow modifying variables of class declarations
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -12,37 +11,47 @@ 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});
    -
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning class members",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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
    +        };
     
    -    /**
    -     * 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-cond-assign.js b/tools/eslint/lib/rules/no-cond-assign.js
    index c83afca0afe68c..27b99c6b545916 100644
    --- a/tools/eslint/lib/rules/no-cond-assign.js
    +++ b/tools/eslint/lib/rules/no-cond-assign.js
    @@ -5,129 +5,140 @@
     "use strict";
     
     var NODE_DESCRIPTIONS = {
    -    "DoWhileStatement": "a 'do...while' statement",
    -    "ForStatement": "a 'for' statement",
    -    "IfStatement": "an 'if' statement",
    -    "WhileStatement": "a 'while' statement"
    +    DoWhileStatement: "a 'do...while' statement",
    +    ForStatement: "a 'for' statement",
    +    IfStatement: "an 'if' statement",
    +    WhileStatement: "a 'while' statement"
     };
     
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var prohibitAssign = (context.options[0] || "except-parens");
    -
    -    /**
    -     * Check whether an AST node is the test expression for a conditional statement.
    -     * @param {!Object} node The node to test.
    -     * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`.
    -     */
    -    function isConditionalTestExpression(node) {
    -        return node.parent &&
    -            node.parent.test &&
    -            node === node.parent.test;
    -    }
    -
    -    /**
    -     * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement.
    -     * @param {!Object} node The node to use at the start of the search.
    -     * @returns {?Object} The closest ancestor node that represents a conditional statement.
    -     */
    -    function findConditionalAncestor(node) {
    -        var currentAncestor = node;
    -
    -        do {
    -            if (isConditionalTestExpression(currentAncestor)) {
    -                return currentAncestor.parent;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow assignment operators in conditional expressions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: [
    +            {
    +                enum: ["except-parens", "always"]
                 }
    -        } while ((currentAncestor = currentAncestor.parent));
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var prohibitAssign = (context.options[0] || "except-parens");
    +
    +        /**
    +         * Check whether an AST node is the test expression for a conditional statement.
    +         * @param {!Object} node The node to test.
    +         * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`.
    +         */
    +        function isConditionalTestExpression(node) {
    +            return node.parent &&
    +                node.parent.test &&
    +                node === node.parent.test;
    +        }
     
    -        return null;
    -    }
    +        /**
    +         * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement.
    +         * @param {!Object} node The node to use at the start of the search.
    +         * @returns {?Object} The closest ancestor node that represents a conditional statement.
    +         */
    +        function findConditionalAncestor(node) {
    +            var currentAncestor = node;
    +
    +            do {
    +                if (isConditionalTestExpression(currentAncestor)) {
    +                    return currentAncestor.parent;
    +                }
    +            } while ((currentAncestor = currentAncestor.parent));
    +
    +            return null;
    +        }
     
    -    /**
    -     * Check whether the code represented by an AST node is enclosed in parentheses.
    -     * @param {!Object} node The node to test.
    -     * @returns {boolean} `true` if the code is enclosed in parentheses; otherwise, `false`.
    -     */
    -    function isParenthesised(node) {
    -        var previousToken = context.getTokenBefore(node),
    -            nextToken = context.getTokenAfter(node);
    -
    -        return previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +        /**
    +         * Check whether the code represented by an AST node is enclosed in parentheses.
    +         * @param {!Object} node The node to test.
    +         * @returns {boolean} `true` if the code is enclosed in parentheses; otherwise, `false`.
    +         */
    +        function isParenthesised(node) {
    +            var previousToken = context.getTokenBefore(node),
    +                nextToken = context.getTokenAfter(node);
    +
    +            return previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +                nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +        }
     
    -    /**
    -     * Check whether the code represented by an AST node is enclosed in two sets of parentheses.
    -     * @param {!Object} node The node to test.
    -     * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`.
    -     */
    -    function isParenthesisedTwice(node) {
    -        var previousToken = context.getTokenBefore(node, 1),
    -            nextToken = context.getTokenAfter(node, 1);
    -
    -        return isParenthesised(node) &&
    -            previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +        /**
    +         * Check whether the code represented by an AST node is enclosed in two sets of parentheses.
    +         * @param {!Object} node The node to test.
    +         * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`.
    +         */
    +        function isParenthesisedTwice(node) {
    +            var previousToken = context.getTokenBefore(node, 1),
    +                nextToken = context.getTokenAfter(node, 1);
    +
    +            return isParenthesised(node) &&
    +                previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +                nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +        }
     
    -    /**
    -     * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses.
    -     * @param {!Object} node The node for the conditional statement.
    -     * @returns {void}
    -     */
    -    function testForAssign(node) {
    -        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: node,
    -                loc: node.test.loc.start,
    -                message: "Expected a conditional expression and instead saw an assignment."
    -            });
    +        /**
    +         * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses.
    +         * @param {!Object} node The node for the conditional statement.
    +         * @returns {void}
    +         */
    +        function testForAssign(node) {
    +            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: node,
    +                    loc: node.test.loc.start,
    +                    message: "Expected a conditional expression and instead saw an assignment."
    +                });
    +            }
    +        }
    +
    +        /**
    +         * Check whether an assignment expression is descended from a conditional statement's test expression.
    +         * @param {!Object} node The node for the assignment expression.
    +         * @returns {void}
    +         */
    +        function testForConditionalAncestor(node) {
    +            var ancestor = findConditionalAncestor(node);
    +
    +            if (ancestor) {
    +                context.report(ancestor, "Unexpected assignment within {{type}}.", {
    +                    type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type
    +                });
    +            }
             }
    -    }
     
    -    /**
    -     * Check whether an assignment expression is descended from a conditional statement's test expression.
    -     * @param {!Object} node The node for the assignment expression.
    -     * @returns {void}
    -     */
    -    function testForConditionalAncestor(node) {
    -        var ancestor = findConditionalAncestor(node);
    -
    -        if (ancestor) {
    -            context.report(ancestor, "Unexpected assignment within {{type}}.", {
    -                type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type
    -            });
    +        if (prohibitAssign === "always") {
    +            return {
    +                AssignmentExpression: testForConditionalAncestor
    +            };
             }
    -    }
     
    -    if (prohibitAssign === "always") {
             return {
    -            "AssignmentExpression": testForConditionalAncestor
    +            DoWhileStatement: testForAssign,
    +            ForStatement: testForAssign,
    +            IfStatement: testForAssign,
    +            WhileStatement: testForAssign
             };
    -    }
    -
    -    return {
    -        "DoWhileStatement": testForAssign,
    -        "ForStatement": testForAssign,
    -        "IfStatement": testForAssign,
    -        "WhileStatement": testForAssign
    -    };
     
    -};
    -
    -module.exports.schema = [
    -    {
    -        "enum": ["except-parens", "always"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-confusing-arrow.js b/tools/eslint/lib/rules/no-confusing-arrow.js
    index 9cf2ea7a0c806a..d951a53cf97685 100644
    --- a/tools/eslint/lib/rules/no-confusing-arrow.js
    +++ b/tools/eslint/lib/rules/no-confusing-arrow.js
    @@ -2,32 +2,12 @@
      * @fileoverview A rule to warn against using arrow functions when they could be
      * confused with comparisions
      * @author Jxck 
    - * @copyright 2015 Luke Karrys. All rights reserved.
    - * The MIT License (MIT)
    -
    - * Copyright (c) 2015 Jxck
    -
    - * Permission is hereby granted, free of charge, to any person obtaining a copy
    - * of this software and associated documentation files (the "Software"), to deal
    - * in the Software without restriction, including without limitation the rights
    - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    - * copies of the Software, and to permit persons to whom the Software is
    - * furnished to do so, subject to the following conditions:
    -
    - * The above copyright notice and this permission notice shall be included in all
    - * copies or substantial portions of the Software.
    -
    - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    - * SOFTWARE.
      */
     
     "use strict";
     
    +var astUtils = require("../ast-utils.js");
    +
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
    @@ -38,28 +18,48 @@
      * @returns {boolean} `true` if the node is a conditional expression.
      */
     function isConditional(node) {
    -    return node.body && node.body.type === "ConditionalExpression";
    +    return node && node.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.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow arrow functions where they could be confused with comparisons",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                allowParens: {type: "boolean"}
    +            },
    +            additionalProperties: false
    +        }]
    +    },
    +
    +    create: function(context) {
    +        var config = context.options[0] || {};
    +
    +        /**
    +         * Reports if an arrow function contains an ambiguous conditional.
    +         * @param {ASTNode} node - A node to check and report.
    +         * @returns {void}
    +         */
    +        function checkArrowFunc(node) {
    +            var body = node.body;
    +
    +            if (isConditional(body) && !(config.allowParens && astUtils.isParenthesised(context, body))) {
    +                context.report(node, "Arrow function used ambiguously with a conditional expression.");
    +            }
             }
    -    }
     
    -    return {
    -        "ArrowFunctionExpression": checkArrowFunc
    -    };
    +        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 9493bc752982a6..18a897409f6586 100644
    --- a/tools/eslint/lib/rules/no-console.js
    +++ b/tools/eslint/lib/rules/no-console.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use of console object
      * @author Nicholas C. Zakas
    - * @copyright 2016 Eric Correia. All rights reserved.
      */
     
     "use strict";
    @@ -10,47 +9,57 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `console`",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allow: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        },
    +                        minItems: 1,
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -        "MemberExpression": function(node) {
    +    create: function(context) {
     
    -            if (node.object.name === "console") {
    -                var blockConsole = true;
    +        return {
     
    -                if ( context.options.length > 0 ) {
    -                    var allowedProperties = context.options[0].allow;
    -                    var passedProperty = node.property.name;
    -                    var propertyIsAllowed = (allowedProperties.indexOf(passedProperty) > -1);
    +            MemberExpression: function(node) {
     
    -                    if (propertyIsAllowed) {
    -                        blockConsole = false;
    +                if (node.object.name === "console") {
    +                    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.");
    +                    if (blockConsole) {
    +                        context.report(node, "Unexpected console statement.");
    +                    }
                     }
                 }
    -        }
    -    };
    -
    -};
    +        };
     
    -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
    index d10e1b26d6cd32..344e05a644ee67 100644
    --- a/tools/eslint/lib/rules/no-const-assign.js
    +++ b/tools/eslint/lib/rules/no-const-assign.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow modifying variables that are declared using `const`
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -12,30 +11,40 @@ 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});
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning `const` variables",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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);
    +        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 85e2bd2074d61d..0072491bee5133 100644
    --- a/tools/eslint/lib/rules/no-constant-condition.js
    +++ b/tools/eslint/lib/rules/no-constant-condition.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use constant conditions
      * @author Christian Schulz 
    - * @copyright 2014 Christian Schulz. All rights reserved.
      */
     
     "use strict";
    @@ -10,64 +9,110 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Checks if a node has a constant truthiness value.
    -     * @param {ASTNode} node The AST node to check.
    -     * @returns {Bool} true when node's truthiness is constant
    -     * @private
    -     */
    -    function isConstant(node) {
    -        switch (node.type) {
    -            case "Literal":
    -            case "ArrowFunctionExpression":
    -            case "FunctionExpression":
    -            case "ObjectExpression":
    -            case "ArrayExpression":
    -                return true;
    -            case "UnaryExpression":
    -                return isConstant(node.argument);
    -            case "BinaryExpression":
    -            case "LogicalExpression":
    -                return isConstant(node.left) && isConstant(node.right) && node.operator !== "in";
    -            case "AssignmentExpression":
    -                return (node.operator === "=") && isConstant(node.right);
    -            case "SequenceExpression":
    -                return isConstant(node.expressions[node.expressions.length - 1]);
    -            // no default
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow constant expressions in conditions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +
    +        /**
    +         * Checks if a branch node of LogicalExpression short circuits the whole condition
    +         * @param {ASTNode} node The branch of main condition which needs to be checked
    +         * @param {string} operator The operator of the main LogicalExpression.
    +         * @returns {boolean} true when condition short circuits whole condition
    +         */
    +        function isLogicalIdentity(node, operator) {
    +            switch (node.type) {
    +                case "Literal":
    +                    return (operator === "||" && node.value === true) ||
    +                           (operator === "&&" && node.value === false);
    +                case "LogicalExpression":
    +                    return isLogicalIdentity(node.left, node.operator) ||
    +                             isLogicalIdentity(node.right, node.operator);
    +
    +                     // no default
    +            }
    +            return false;
             }
    -        return false;
    -    }
     
    -    /**
    -     * Reports when the given node contains a constant condition.
    -     * @param {ASTNode} node The AST node to check.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkConstantCondition(node) {
    -        if (node.test && isConstant(node.test)) {
    -            context.report(node, "Unexpected constant condition.");
    +        /**
    +         * Checks if a node has a constant truthiness value.
    +         * @param {ASTNode} node The AST node to check.
    +         * @param {boolean} inBooleanPosition `false` if checking branch of a condition.
    +         *  `true` in all other cases
    +         * @returns {Bool} true when node's truthiness is constant
    +         * @private
    +         */
    +        function isConstant(node, inBooleanPosition) {
    +            switch (node.type) {
    +                case "Literal":
    +                case "ArrowFunctionExpression":
    +                case "FunctionExpression":
    +                case "ObjectExpression":
    +                case "ArrayExpression":
    +                    return true;
    +
    +                case "UnaryExpression":
    +                    return (node.operator === "typeof" && inBooleanPosition) ||
    +                        isConstant(node.argument, true);
    +
    +                case "BinaryExpression":
    +                    return isConstant(node.left, false) &&
    +                            isConstant(node.right, false) &&
    +                            node.operator !== "in";
    +                case "LogicalExpression":
    +                    var isLeftConstant = isConstant(node.left, inBooleanPosition);
    +                    var isRightConstant = isConstant(node.right, inBooleanPosition);
    +                    var isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator));
    +                    var isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator));
    +
    +                    return (isLeftConstant && isRightConstant) || isLeftShortCircuit || isRightShortCircuit;
    +                case "AssignmentExpression":
    +                    return (node.operator === "=") && isConstant(node.right, inBooleanPosition);
    +
    +                case "SequenceExpression":
    +                    return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition);
    +
    +                // no default
    +            }
    +            return false;
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * Reports when the given node contains a constant condition.
    +         * @param {ASTNode} node The AST node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkConstantCondition(node) {
    +            if (node.test && isConstant(node.test, true)) {
    +                context.report(node, "Unexpected constant condition.");
    +            }
    +        }
     
    -    return {
    -        "ConditionalExpression": checkConstantCondition,
    -        "IfStatement": checkConstantCondition,
    -        "WhileStatement": checkConstantCondition,
    -        "DoWhileStatement": checkConstantCondition,
    -        "ForStatement": checkConstantCondition
    -    };
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -};
    +        return {
    +            ConditionalExpression: checkConstantCondition,
    +            IfStatement: checkConstantCondition,
    +            WhileStatement: checkConstantCondition,
    +            DoWhileStatement: checkConstantCondition,
    +            ForStatement: checkConstantCondition
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-continue.js b/tools/eslint/lib/rules/no-continue.js
    index 89fa1848e9572e..246df89ebe4283 100644
    --- a/tools/eslint/lib/rules/no-continue.js
    +++ b/tools/eslint/lib/rules/no-continue.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use of continue statement
      * @author Borislav Zhivkov
    - * @copyright 2015 Borislav Zhivkov. All rights reserved.
      */
     
     "use strict";
    @@ -10,14 +9,24 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `continue` statements",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    -        "ContinueStatement": function(node) {
    -            context.report(node, "Unexpected use of continue statement");
    -        }
    -    };
    +        schema: []
    +    },
     
    -};
    +    create: function(context) {
    +
    +        return {
    +            ContinueStatement: function(node) {
    +                context.report(node, "Unexpected use of continue statement");
    +            }
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-control-regex.js b/tools/eslint/lib/rules/no-control-regex.js
    index c5a219f4470feb..74e03f03c56f40 100644
    --- a/tools/eslint/lib/rules/no-control-regex.js
    +++ b/tools/eslint/lib/rules/no-control-regex.js
    @@ -9,49 +9,87 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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"
    -            ) {
    -                // there could be an invalid regular expression string
    -                try {
    -                    return new RegExp(node.value);
    -                } catch (ex) {
    -                    return null;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow control characters in regular expressions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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"
    +                ) {
    +
    +                    // there could be an invalid regular expression string
    +                    try {
    +                        return new RegExp(node.value);
    +                    } catch (ex) {
    +                        return null;
    +                    }
                     }
                 }
    +
    +            return null;
             }
     
    -        return null;
    -    }
    +        /**
    +         * Check if given regex string has control characters in it
    +         * @param {String} regexStr regex as string to check
    +         * @returns {Boolean} returns true if finds control characters on given string
    +         * @private
    +         */
    +        function hasControlCharacters(regexStr) {
     
    -    return {
    -        "Literal": function(node) {
    -            var computedValue,
    -                regex = getRegExp(node);
    +            // check control characters, if RegExp object used
    +            var hasControlChars = /[\x00-\x1f]/.test(regexStr); // eslint-disable-line no-control-regex
     
    -            if (regex) {
    -                computedValue = regex.toString();
    -                if (/[\x00-\x1f]/.test(computedValue)) {
    -                    context.report(node, "Unexpected control character in regular expression.");
    -                }
    +            // check substr, if regex literal used
    +            var subStrIndex = regexStr.search(/\\x[01][0-9a-f]/i);
    +
    +            if (!hasControlChars && subStrIndex > -1) {
    +
    +                // is it escaped, check backslash count
    +                var possibleEscapeCharacters = regexStr.substr(0, subStrIndex).match(/\\+$/gi);
    +
    +                hasControlChars = possibleEscapeCharacters === null || !(possibleEscapeCharacters[0].length % 2);
                 }
    +
    +            return hasControlChars;
             }
    -    };
     
    -};
    +        return {
    +            Literal: function(node) {
    +                var computedValue,
    +                    regex = getRegExp(node);
    +
    +                if (regex) {
    +                    computedValue = regex.toString();
     
    -module.exports.schema = [];
    +                    if (hasControlCharacters(computedValue)) {
    +                        context.report(node, "Unexpected control character in regular expression.");
    +                    }
    +                }
    +            }
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-debugger.js b/tools/eslint/lib/rules/no-debugger.js
    index 7d86e76d4fdfa1..552294bd674224 100644
    --- a/tools/eslint/lib/rules/no-debugger.js
    +++ b/tools/eslint/lib/rules/no-debugger.js
    @@ -9,14 +9,24 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `debugger`",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    -        "DebuggerStatement": function(node) {
    -            context.report(node, "Unexpected 'debugger' statement.");
    -        }
    -    };
    +        schema: []
    +    },
     
    -};
    +    create: function(context) {
    +
    +        return {
    +            DebuggerStatement: function(node) {
    +                context.report(node, "Unexpected 'debugger' statement.");
    +            }
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-delete-var.js b/tools/eslint/lib/rules/no-delete-var.js
    index d6ffbd107a60cb..c1d717a15ba573 100644
    --- a/tools/eslint/lib/rules/no-delete-var.js
    +++ b/tools/eslint/lib/rules/no-delete-var.js
    @@ -9,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow deleting variables",
    +            category: "Variables",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "UnaryExpression": function(node) {
    -            if (node.operator === "delete" && node.argument.type === "Identifier") {
    -                context.report(node, "Variables should not be deleted.");
    +    create: function(context) {
    +
    +        return {
    +
    +            UnaryExpression: function(node) {
    +                if (node.operator === "delete" && node.argument.type === "Identifier") {
    +                    context.report(node, "Variables should not be deleted.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-div-regex.js b/tools/eslint/lib/rules/no-div-regex.js
    index 61e7a1c4d889ee..58c44662cb98d3 100644
    --- a/tools/eslint/lib/rules/no-div-regex.js
    +++ b/tools/eslint/lib/rules/no-div-regex.js
    @@ -9,19 +9,29 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow division operators explicitly at the beginning of regular expressions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Literal": function(node) {
    -            var token = context.getFirstToken(node);
    +    create: function(context) {
     
    -            if (token.type === "RegularExpression" && token.value[1] === "=") {
    -                context.report(node, "A regular expression literal can be confused with '/='.");
    +        return {
    +
    +            Literal: function(node) {
    +                var token = context.getFirstToken(node);
    +
    +                if (token.type === "RegularExpression" && token.value[1] === "=") {
    +                    context.report(node, "A regular expression literal can be confused with '/='.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-dupe-args.js b/tools/eslint/lib/rules/no-dupe-args.js
    index 80b52ca82ad015..e927ce2b3a8576 100644
    --- a/tools/eslint/lib/rules/no-dupe-args.js
    +++ b/tools/eslint/lib/rules/no-dupe-args.js
    @@ -1,9 +1,6 @@
     /**
      * @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";
    @@ -12,62 +9,65 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow duplicate arguments in `function` definitions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        schema: []
    +    },
     
    -    /**
    -     * 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";
    -    }
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * Determines if a given node has duplicate parameters.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkParams(node) {
    -        var variables = context.getDeclaredVariables(node);
    -        var keyMap = Object.create(null);
    +        /**
    +         * 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";
    +        }
     
    -        for (var i = 0; i < variables.length; ++i) {
    -            var variable = variables[i];
    +        /**
    +         * Determines if a given node has duplicate parameters.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkParams(node) {
    +            var variables = context.getDeclaredVariables(node);
     
    -            // 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;
    -            }
    -            keyMap[key] = true;
    +            for (var i = 0; i < variables.length; ++i) {
    +                var variable = variables[i];
     
    -            // 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}
    -                });
    +                // 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}
    +                    });
    +                }
                 }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -    return {
    -        "FunctionDeclaration": checkParams,
    -        "FunctionExpression": checkParams
    -    };
    +        return {
    +            FunctionDeclaration: checkParams,
    +            FunctionExpression: checkParams
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-dupe-class-members.js b/tools/eslint/lib/rules/no-dupe-class-members.js
    index 12345a7be7019a..883020bdfe5e96 100644
    --- a/tools/eslint/lib/rules/no-dupe-class-members.js
    +++ b/tools/eslint/lib/rules/no-dupe-class-members.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow duplicate name in class members.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -10,89 +9,101 @@
     // 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}
    -            };
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow duplicate class members",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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"];
             }
     
    -        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);
     
    -    /**
    -     * 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 "";
    +                /* istanbul ignore next: syntax error */
    +                default: return "";
    +            }
             }
    -    }
     
    -    return {
    -        // Initializes the stack of state of member declarations.
    -        "Program": function() {
    -            stack = [];
    -        },
    +        return {
     
    -        // Initializes state of member declarations for the class.
    -        "ClassBody": function() {
    -            stack.push(Object.create(null));
    -        },
    +            // Initializes the stack of state of member declarations.
    +            Program: function() {
    +                stack = [];
    +            },
     
    -        // Disposes the state for the class.
    -        "ClassBody:exit": function() {
    -            stack.pop();
    -        },
    +            // Initializes state of member declarations for the class.
    +            ClassBody: function() {
    +                stack.push(Object.create(null));
    +            },
     
    -        // Reports the node if its name has been declared already.
    -        "MethodDefinition": function(node) {
    -            if (node.computed) {
    -                return;
    -            }
    +            // Disposes the state for the class.
    +            "ClassBody:exit": function() {
    +                stack.pop();
    +            },
     
    -            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;
    -            }
    +            // Reports the node if its name has been declared already.
    +            MethodDefinition: function(node) {
    +                if (node.computed) {
    +                    return;
    +                }
     
    -            if (isDuplicate) {
    -                context.report(node, "Duplicate name '{{name}}'.", {name: name});
    +                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 e07f081b4b8570..26f009b3bfe0ca 100644
    --- a/tools/eslint/lib/rules/no-dupe-keys.js
    +++ b/tools/eslint/lib/rules/no-dupe-keys.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag use of duplicate keys in an object.
      * @author Ian Christian Myers
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
    - * @copyright 2013 Nicholas C. Zakas. All rights reserved.
      */
     
     "use strict";
    @@ -11,38 +9,48 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow duplicate keys in object literals",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "ObjectExpression": function(node) {
    +    create: function(context) {
     
    -            // Object that will be a map of properties--safe because we will
    -            // prefix all of the keys.
    -            var nodeProps = Object.create(null);
    +        return {
     
    -            node.properties.forEach(function(property) {
    +            ObjectExpression: function(node) {
     
    -                if (property.type !== "Property") {
    -                    return;
    -                }
    +                // Object that will be a map of properties--safe because we will
    +                // prefix all of the keys.
    +                var nodeProps = Object.create(null);
     
    -                var keyName = property.key.name || property.key.value,
    -                    key = property.kind + "-" + keyName,
    -                    checkProperty = (!property.computed || property.key.type === "Literal");
    +                node.properties.forEach(function(property) {
     
    -                if (checkProperty) {
    -                    if (nodeProps[key]) {
    -                        context.report(node, property.loc.start, "Duplicate key '{{key}}'.", { key: keyName });
    -                    } else {
    -                        nodeProps[key] = true;
    +                    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, property.loc.start, "Duplicate key '{{key}}'.", { key: keyName });
    +                        } else {
    +                            nodeProps[key] = true;
    +                        }
    +                    }
    +                });
     
    -module.exports.schema = [];
    +            }
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-duplicate-case.js b/tools/eslint/lib/rules/no-duplicate-case.js
    index 72677f44d91c24..1308730a6311cd 100644
    --- a/tools/eslint/lib/rules/no-duplicate-case.js
    +++ b/tools/eslint/lib/rules/no-duplicate-case.js
    @@ -1,9 +1,7 @@
     /**
      * @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,22 +10,33 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    return {
    -        "SwitchStatement": function(node) {
    -            var mapping = {};
    -
    -            node.cases.forEach(function(switchCase) {
    -                var key = context.getSource(switchCase.test);
    -                if (mapping[key]) {
    -                    context.report(switchCase, "Duplicate case label.");
    -                } else {
    -                    mapping[key] = switchCase;
    -                }
    -            });
    -        }
    -    };
    -};
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow duplicate case labels",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
     
    -module.exports.schema = [];
    +        return {
    +            SwitchStatement: function(node) {
    +                var mapping = {};
    +
    +                node.cases.forEach(function(switchCase) {
    +                    var key = context.getSource(switchCase.test);
    +
    +                    if (mapping[key]) {
    +                        context.report(switchCase, "Duplicate case label.");
    +                    } else {
    +                        mapping[key] = switchCase;
    +                    }
    +                });
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-duplicate-imports.js b/tools/eslint/lib/rules/no-duplicate-imports.js
    new file mode 100644
    index 00000000000000..44432f48635982
    --- /dev/null
    +++ b/tools/eslint/lib/rules/no-duplicate-imports.js
    @@ -0,0 +1,134 @@
    +/**
    + * @fileoverview Restrict usage of duplicate imports.
    + * @author Simen Bekkhus
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +/**
    + * Returns the name of the module imported or re-exported.
    + *
    + * @param {ASTNode} node - A node to get.
    + * @returns {string} the name of the module, or empty string if no name.
    + */
    +function getValue(node) {
    +    if (node && node.source && node.source.value) {
    +        return node.source.value.trim();
    +    }
    +
    +    return "";
    +}
    +
    +/**
    + * Checks if the name of the import or export exists in the given array, and reports if so.
    + *
    + * @param {RuleContext} context - The ESLint rule context object.
    + * @param {ASTNode} node - A node to get.
    + * @param {string} value - The name of the imported or exported module.
    + * @param {string[]} array - The array containing other imports or exports in the file.
    + * @param {string} message - A message to be reported after the name of the module
    + *
    + * @returns {void} No return value
    + */
    +function checkAndReport(context, node, value, array, message) {
    +    if (array.indexOf(value) !== -1) {
    +        context.report({
    +            node: node,
    +            message: "'{{module}}' " + message,
    +            data: {module: value}
    +        });
    +    }
    +}
    +
    +/**
    + * @callback nodeCallback
    + * @param {ASTNode} node - A node to handle.
    + */
    +
    +/**
    + * Returns a function handling the imports of a given file
    + *
    + * @param {RuleContext} context - The ESLint rule context object.
    + * @param {boolean} includeExports - Whether or not to check for exports in addition to imports.
    + * @param {string[]} importsInFile - The array containing other imports in the file.
    + * @param {string[]} exportsInFile - The array containing other exports in the file.
    + *
    + * @returns {nodeCallback} A function passed to ESLint to handle the statement.
    + */
    +function handleImports(context, includeExports, importsInFile, exportsInFile) {
    +    return function(node) {
    +        var value = getValue(node);
    +
    +        if (value) {
    +            checkAndReport(context, node, value, importsInFile, "import is duplicated.");
    +
    +            if (includeExports) {
    +                checkAndReport(context, node, value, exportsInFile, "import is duplicated as export.");
    +            }
    +
    +            importsInFile.push(value);
    +        }
    +    };
    +}
    +
    +/**
    + * Returns a function handling the exports of a given file
    + *
    + * @param {RuleContext} context - The ESLint rule context object.
    + * @param {string[]} importsInFile - The array containing other imports in the file.
    + * @param {string[]} exportsInFile - The array containing other exports in the file.
    + *
    + * @returns {nodeCallback} A function passed to ESLint to handle the statement.
    + */
    +function handleExports(context, importsInFile, exportsInFile) {
    +    return function(node) {
    +        var value = getValue(node);
    +
    +        if (value) {
    +            checkAndReport(context, node, value, exportsInFile, "export is duplicated.");
    +            checkAndReport(context, node, value, importsInFile, "export is duplicated as import.");
    +
    +            exportsInFile.push(value);
    +        }
    +    };
    +}
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow duplicate module imports",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                includeExports: {
    +                    type: "boolean"
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
    +
    +    create: function(context) {
    +        var includeExports = (context.options[0] || {}).includeExports,
    +            importsInFile = [],
    +            exportsInFile = [];
    +
    +        var handlers = {
    +            ImportDeclaration: handleImports(context, includeExports, importsInFile, exportsInFile)
    +        };
    +
    +        if (includeExports) {
    +            handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile);
    +            handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile);
    +        }
    +
    +        return handlers;
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-else-return.js b/tools/eslint/lib/rules/no-else-return.js
    index 29b53842eb2a48..4678d320af9689 100644
    --- a/tools/eslint/lib/rules/no-else-return.js
    +++ b/tools/eslint/lib/rules/no-else-return.js
    @@ -9,136 +9,150 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Display the context report if rule is violated
    -     *
    -     * @param {Node} node The 'else' node
    -     * @returns {void}
    -     */
    -    function displayReport(node) {
    -        context.report(node, "Unexpected 'else' after 'return'.");
    -    }
    -
    -    /**
    -     * Check to see if the node is a ReturnStatement
    -     *
    -     * @param {Node} node The node being evaluated
    -     * @returns {boolean} True if node is a return
    -     */
    -    function checkForReturn(node) {
    -        return node.type === "ReturnStatement";
    -    }
    -
    -    /**
    -     * Naive return checking, does not iterate through the whole
    -     * BlockStatement because we make the assumption that the ReturnStatement
    -     * will be the last node in the body of the BlockStatement.
    -     *
    -     * @param {Node} node The consequent/alternate node
    -     * @returns {boolean} True if it has a return
    -     */
    -    function naiveHasReturn(node) {
    -        if (node.type === "BlockStatement") {
    -            var body = node.body,
    -                lastChildNode = body[body.length - 1];
    -
    -            return lastChildNode && checkForReturn(lastChildNode);
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `else` blocks after `return` statements in `if` statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Display the context report if rule is violated
    +         *
    +         * @param {Node} node The 'else' node
    +         * @returns {void}
    +         */
    +        function displayReport(node) {
    +            context.report(node, "Unexpected 'else' after 'return'.");
             }
    -        return checkForReturn(node);
    -    }
     
    -    /**
    -     * Check to see if the node is valid for evaluation,
    -     * meaning it has an else and not an else-if
    -     *
    -     * @param {Node} node The node being evaluated
    -     * @returns {boolean} True if the node is valid
    -     */
    -    function hasElse(node) {
    -        return node.alternate && node.consequent && node.alternate.type !== "IfStatement";
    -    }
    +        /**
    +         * Check to see if the node is a ReturnStatement
    +         *
    +         * @param {Node} node The node being evaluated
    +         * @returns {boolean} True if node is a return
    +         */
    +        function checkForReturn(node) {
    +            return node.type === "ReturnStatement";
    +        }
     
    -    /**
    -     * If the consequent is an IfStatement, check to see if it has an else
    -     * and both its consequent and alternate path return, meaning this is
    -     * a nested case of rule violation.  If-Else not considered currently.
    -     *
    -     * @param {Node} node The consequent node
    -     * @returns {boolean} True if this is a nested rule violation
    -     */
    -    function checkForIf(node) {
    -        return node.type === "IfStatement" && hasElse(node) &&
    -            naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent);
    -    }
    +        /**
    +         * Naive return checking, does not iterate through the whole
    +         * BlockStatement because we make the assumption that the ReturnStatement
    +         * will be the last node in the body of the BlockStatement.
    +         *
    +         * @param {Node} node The consequent/alternate node
    +         * @returns {boolean} True if it has a return
    +         */
    +        function naiveHasReturn(node) {
    +            if (node.type === "BlockStatement") {
    +                var body = node.body,
    +                    lastChildNode = body[body.length - 1];
    +
    +                return lastChildNode && checkForReturn(lastChildNode);
    +            }
    +            return checkForReturn(node);
    +        }
     
    -    /**
    -     * Check the consequent/body node to make sure it is not
    -     * a ReturnStatement or an IfStatement that returns on both
    -     * code paths.
    -     *
    -     * @param {Node} node The consequent or body node
    -     * @param {Node} alternate The alternate node
    -     * @returns {boolean} `true` if it is a Return/If node that always returns.
    -     */
    -    function checkForReturnOrIf(node) {
    -        return checkForReturn(node) || checkForIf(node);
    -    }
    +        /**
    +         * Check to see if the node is valid for evaluation,
    +         * meaning it has an else and not an else-if
    +         *
    +         * @param {Node} node The node being evaluated
    +         * @returns {boolean} True if the node is valid
    +         */
    +        function hasElse(node) {
    +            return node.alternate && node.consequent && node.alternate.type !== "IfStatement";
    +        }
     
    +        /**
    +         * If the consequent is an IfStatement, check to see if it has an else
    +         * and both its consequent and alternate path return, meaning this is
    +         * a nested case of rule violation.  If-Else not considered currently.
    +         *
    +         * @param {Node} node The consequent node
    +         * @returns {boolean} True if this is a nested rule violation
    +         */
    +        function checkForIf(node) {
    +            return node.type === "IfStatement" && hasElse(node) &&
    +                naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent);
    +        }
     
    -    /**
    -     * Check whether a node returns in every codepath.
    -     * @param {Node} node The node to be checked
    -     * @returns {boolean} `true` if it returns on every codepath.
    -     */
    -    function alwaysReturns(node) {
    -        // If 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);
    +        /**
    +         * Check the consequent/body node to make sure it is not
    +         * a ReturnStatement or an IfStatement that returns on both
    +         * code paths.
    +         *
    +         * @param {Node} node The consequent or body node
    +         * @param {Node} alternate The alternate node
    +         * @returns {boolean} `true` if it is a Return/If node that always returns.
    +         */
    +        function checkForReturnOrIf(node) {
    +            return checkForReturn(node) || checkForIf(node);
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
     
    -    return {
    +        /**
    +         * Check whether a node returns in every codepath.
    +         * @param {Node} node The node to be checked
    +         * @returns {boolean} `true` if it returns on every codepath.
    +         */
    +        function alwaysReturns(node) {
    +            if (node.type === "BlockStatement") {
     
    -        "IfStatement": function(node) {
    -            var parent = context.getAncestors().pop(),
    -                consequents,
    -                alternate;
    +                // If we have a BlockStatement, check each consequent body node.
    +                return node.body.some(checkForReturnOrIf);
    +            } else {
     
    -            // 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;
    +                /*
    +                 * If not a block statement, make sure the consequent isn't a
    +                 * ReturnStatement or an IfStatement with returns on both paths.
    +                 */
    +                return checkForReturnOrIf(node);
                 }
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -            for (consequents = []; node.type === "IfStatement"; node = node.alternate) {
    -                if (!node.alternate) {
    +        return {
    +
    +            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;
                     }
    -                consequents.push(node.consequent);
    -                alternate = node.alternate;
    -            }
     
    -            if (consequents.every(alwaysReturns)) {
    -                displayReport(alternate);
    +                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);
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-empty-character-class.js b/tools/eslint/lib/rules/no-empty-character-class.js
    index b201da44f45627..e015e0cc067d20 100644
    --- a/tools/eslint/lib/rules/no-empty-character-class.js
    +++ b/tools/eslint/lib/rules/no-empty-character-class.js
    @@ -27,19 +27,30 @@ var regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuy]*$/;
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow empty character classes in regular expressions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Literal": function(node) {
    -            var token = context.getFirstToken(node);
    -            if (token.type === "RegularExpression" && !regex.test(token.value)) {
    -                context.report(node, "Empty class.");
    +    create: 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
    index 6f24ee1de08f67..412614b501099c 100644
    --- a/tools/eslint/lib/rules/no-empty-function.js
    +++ b/tools/eslint/lib/rules/no-empty-function.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -81,6 +79,7 @@ function getKind(node) {
     
         // Detects prefix.
         var prefix = "";
    +
         if (node.generator) {
             prefix = "generator";
         } else if (node.async) {
    @@ -95,55 +94,65 @@ function getKind(node) {
     // 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] + "."
    -            });
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow empty functions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    -        ArrowFunctionExpression: reportIfEmpty,
    -        FunctionDeclaration: reportIfEmpty,
    -        FunctionExpression: reportIfEmpty
    -    };
    -};
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allow: {
    +                        type: "array",
    +                        items: {enum: ALLOW_OPTIONS},
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -module.exports.schema = [
    -    {
    -        type: "object",
    -        properties: {
    -            allow: {
    -                type: "array",
    -                items: {enum: ALLOW_OPTIONS},
    -                uniqueItems: true
    +    create: 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] + "."
    +                });
                 }
    -        },
    -        additionalProperties: false
    +        }
    +
    +        return {
    +            ArrowFunctionExpression: reportIfEmpty,
    +            FunctionDeclaration: reportIfEmpty,
    +            FunctionExpression: reportIfEmpty
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-empty-pattern.js b/tools/eslint/lib/rules/no-empty-pattern.js
    index aa8515ad191317..afd8b1e393e36b 100644
    --- a/tools/eslint/lib/rules/no-empty-pattern.js
    +++ b/tools/eslint/lib/rules/no-empty-pattern.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,19 +8,29 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    return {
    -        "ObjectPattern": function(node) {
    -            if (node.properties.length === 0) {
    -                context.report(node, "Unexpected empty object pattern.");
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow empty destructuring patterns",
    +            category: "Best Practices",
    +            recommended: true
             },
    -        "ArrayPattern": function(node) {
    -            if (node.elements.length === 0) {
    -                context.report(node, "Unexpected empty array pattern.");
    +
    +        schema: []
    +    },
    +
    +    create: 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 a8b0de16869f6c..8f32428304c471 100644
    --- a/tools/eslint/lib/rules/no-empty.js
    +++ b/tools/eslint/lib/rules/no-empty.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag use of an empty block statement
      * @author Nicholas C. Zakas
    - * @copyright Nicholas C. Zakas. All rights reserved.
    - * @copyright 2015 Dieter Oberkofler. All rights reserved.
      */
     "use strict";
     
    @@ -12,35 +10,63 @@
     
     var FUNCTION_TYPE = /^(?:ArrowFunctionExpression|Function(?:Declaration|Expression))$/;
     
    -module.exports = function(context) {
    -    return {
    -        "BlockStatement": function(node) {
    -            // if the body is not empty, we can just return immediately
    -            if (node.body.length !== 0) {
    -                return;
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow empty block statements",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -            // a function is generally allowed to be empty
    -            if (FUNCTION_TYPE.test(node.parent.type)) {
    -                return;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowEmptyCatch: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    +        ]
    +    },
     
    -            // any other block is only allowed to be empty, if it contains a comment
    -            if (context.getComments(node).trailing.length > 0) {
    -                return;
    -            }
    +    create: function(context) {
    +        var options = context.options[0] || {},
    +            allowEmptyCatch = options.allowEmptyCatch || false;
     
    -            context.report(node, "Empty block statement.");
    -        },
    +        return {
    +            BlockStatement: function(node) {
    +
    +                // if the body is not empty, we can just return immediately
    +                if (node.body.length !== 0) {
    +                    return;
    +                }
     
    -        "SwitchStatement": function(node) {
    +                // a function is generally allowed to be empty
    +                if (FUNCTION_TYPE.test(node.parent.type)) {
    +                    return;
    +                }
     
    -            if (typeof node.cases === "undefined" || node.cases.length === 0) {
    -                context.report(node, "Empty switch statement.");
    +                if (allowEmptyCatch && node.parent.type === "CatchClause") {
    +                    return;
    +                }
    +
    +                // any other block is only allowed to be empty, if it contains a comment
    +                if (context.getComments(node).trailing.length > 0) {
    +                    return;
    +                }
    +
    +                context.report(node, "Empty block statement.");
    +            },
    +
    +            SwitchStatement: function(node) {
    +
    +                if (typeof node.cases === "undefined" || node.cases.length === 0) {
    +                    context.report(node, "Empty switch statement.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-eq-null.js b/tools/eslint/lib/rules/no-eq-null.js
    index 92d88920ae6843..da039bb9d7de4c 100644
    --- a/tools/eslint/lib/rules/no-eq-null.js
    +++ b/tools/eslint/lib/rules/no-eq-null.js
    @@ -10,20 +10,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `null` comparisons without type-checking operators",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "BinaryExpression": function(node) {
    -            var badOperator = node.operator === "==" || node.operator === "!=";
    +    create: function(context) {
     
    -            if (node.right.type === "Literal" && node.right.raw === "null" && badOperator ||
    -                    node.left.type === "Literal" && node.left.raw === "null" && badOperator) {
    -                context.report(node, "Use ‘===’ to compare with ‘null’.");
    +        return {
    +
    +            BinaryExpression: function(node) {
    +                var badOperator = node.operator === "==" || node.operator === "!=";
    +
    +                if (node.right.type === "Literal" && node.right.raw === "null" && badOperator ||
    +                        node.left.type === "Literal" && node.left.raw === "null" && badOperator) {
    +                    context.report(node, "Use ‘===’ to compare with ‘null’.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-eval.js b/tools/eslint/lib/rules/no-eval.js
    index bd08bbd117b274..04db4b96b477aa 100644
    --- a/tools/eslint/lib/rules/no-eval.js
    +++ b/tools/eslint/lib/rules/no-eval.js
    @@ -1,9 +1,6 @@
     /**
      * @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";
    @@ -77,214 +74,235 @@ function isMember(node, 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
    -        };
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `eval()`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Pops a variable scope from the stack.
    -     *
    -     * @returns {void}
    -     */
    -    function exitVarScope() {
    -        funcInfo = funcInfo.upper;
    -    }
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowIndirect: {type: "boolean"}
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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;
     
    -    /**
    -     * 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;
    +            funcInfo = {
    +                upper: funcInfo,
    +                node: node,
    +                strict: strict,
    +                defaultThis: false,
    +                initialized: strict
    +            };
             }
    -        if (parent.type === "CallExpression" && parent.callee === node) {
    -            node = parent;
    +
    +        /**
    +         * Pops a variable scope from the stack.
    +         *
    +         * @returns {void}
    +         */
    +        function exitVarScope() {
    +            funcInfo = funcInfo.upper;
             }
     
    -        context.report({
    -            node: node,
    -            loc: locationNode.loc.start,
    -            message: "eval can be harmful."
    -        });
    -    }
    +        /**
    +         * 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");
     
    -    /**
    -     * 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;
    +                return;
                 }
     
                 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;
    -                }
    +            for (var i = 0; i < references.length; ++i) {
    +                var reference = references[i];
    +                var id = reference.identifier;
     
    -                // Reports.
    -                if (isMember(node, "eval")) {
    -                    report(node);
    +                if (id.name === "eval" && !astUtils.isCallee(id)) {
    +
    +                    // Is accessing to eval (excludes direct calls to eval)
    +                    report(id);
                     }
                 }
             }
    -    }
     
    -    /**
    -     * 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;
    -        }
    +        if (allowIndirect) {
     
    -        var references = variable.references;
    -        for (var i = 0; i < references.length; ++i) {
    -            var reference = references[i];
    -            var id = reference.identifier;
    +            // Checks only direct calls to eval. It's simple!
    +            return {
    +                "CallExpression:exit": function(node) {
    +                    var callee = node.callee;
     
    -            if (id.name === "eval" && !astUtils.isCallee(id)) {
    -                // Is accessing to eval (excludes direct calls to eval)
    -                report(id);
    -            }
    +                    if (isIdentifier(callee, "eval")) {
    +                        report(callee);
    +                    }
    +                }
    +            };
             }
    -    }
     
    -    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: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);
    -        },
    +            },
    +
    +            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;
    +                }
     
    -        "FunctionDeclaration": enterVarScope,
    -        "FunctionDeclaration:exit": exitVarScope,
    -        "FunctionExpression": enterVarScope,
    -        "FunctionExpression:exit": exitVarScope,
    -        "ArrowFunctionExpression": enterVarScope,
    -        "ArrowFunctionExpression:exit": exitVarScope,
    +                /*
    +                 * `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
    +                    );
    +                }
     
    -        "ThisExpression": function(node) {
    -            if (!isMember(node.parent, "eval")) {
    -                return;
    -            }
    +                if (!funcInfo.strict && funcInfo.defaultThis) {
     
    -            // `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);
    +                    // `this.eval` is possible built-in `eval`.
    +                    report(node.parent);
    +                }
                 }
    -        }
    -    };
    -
    -};
    +        };
     
    -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 e658e475b46b27..bf3afc6cd3f485 100644
    --- a/tools/eslint/lib/rules/no-ex-assign.js
    +++ b/tools/eslint/lib/rules/no-ex-assign.js
    @@ -11,27 +11,37 @@ 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,
    -                "Do not assign to the exception parameter.");
    -        });
    -    }
    -
    -    return {
    -        "CatchClause": function(node) {
    -            context.getDeclaredVariables(node).forEach(checkVariable);
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning exceptions in `catch` clauses",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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,
    +                    "Do not assign to the exception parameter.");
    +            });
             }
    -    };
     
    -};
    +        return {
    +            CatchClause: function(node) {
    +                context.getDeclaredVariables(node).forEach(checkVariable);
    +            }
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-extend-native.js b/tools/eslint/lib/rules/no-extend-native.js
    index 49e139a29b524c..69d4931ab6e82b 100644
    --- a/tools/eslint/lib/rules/no-extend-native.js
    +++ b/tools/eslint/lib/rules/no-extend-native.js
    @@ -15,86 +15,97 @@ var globals = require("globals");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var config = context.options[0] || {};
    -    var exceptions = config.exceptions || [];
    -    var modifiedBuiltins = Object.keys(globals.builtin).filter(function(builtin) {
    -        return builtin[0].toUpperCase() === builtin[0];
    -    });
    -
    -    if (exceptions.length) {
    -        modifiedBuiltins = modifiedBuiltins.filter(function(builtIn) {
    -            return exceptions.indexOf(builtIn) === -1;
    -        });
    -    }
    -
    -    return {
    -
    -        // handle the Array.prototype.extra style case
    -        "AssignmentExpression": function(node) {
    -            var lhs = node.left, affectsProto;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow extending native types",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -            if (lhs.type !== "MemberExpression" || lhs.object.type !== "MemberExpression") {
    -                return;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        },
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
                 }
    +        ]
    +    },
     
    -            affectsProto = lhs.object.computed ?
    -                lhs.object.property.type === "Literal" && lhs.object.property.value === "prototype" :
    -                lhs.object.property.name === "prototype";
    +    create: function(context) {
     
    -            if (!affectsProto) {
    -                return;
    -            }
    +        var config = context.options[0] || {};
    +        var exceptions = config.exceptions || [];
    +        var modifiedBuiltins = Object.keys(globals.builtin).filter(function(builtin) {
    +            return builtin[0].toUpperCase() === builtin[0];
    +        });
     
    -            modifiedBuiltins.forEach(function(builtin) {
    -                if (lhs.object.object.name === builtin) {
    -                    context.report(node, builtin + " prototype is read only, properties should not be added.");
    -                }
    +        if (exceptions.length) {
    +            modifiedBuiltins = modifiedBuiltins.filter(function(builtIn) {
    +                return exceptions.indexOf(builtIn) === -1;
                 });
    -        },
    +        }
     
    -        // handle the Object.definePropert[y|ies](Array.prototype) case
    -        "CallExpression": function(node) {
    +        return {
     
    -            var callee = node.callee,
    -                subject,
    -                object;
    +            // handle the Array.prototype.extra style case
    +            AssignmentExpression: function(node) {
    +                var lhs = node.left,
    +                    affectsProto;
     
    -            // only worry about Object.definePropert[y|ies]
    -            if (callee.type === "MemberExpression" &&
    -                callee.object.name === "Object" &&
    -                (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) {
    +                if (lhs.type !== "MemberExpression" || lhs.object.type !== "MemberExpression") {
    +                    return;
    +                }
     
    -                // verify the object being added to is a native prototype
    -                subject = node.arguments[0];
    -                object = subject && subject.object;
    -                if (object &&
    -                    object.type === "Identifier" &&
    -                    (modifiedBuiltins.indexOf(object.name) > -1) &&
    -                    subject.property.name === "prototype") {
    +                affectsProto = lhs.object.computed ?
    +                    lhs.object.property.type === "Literal" && lhs.object.property.value === "prototype" :
    +                    lhs.object.property.name === "prototype";
     
    -                    context.report(node, object.name + " prototype is read only, properties should not be added.");
    +                if (!affectsProto) {
    +                    return;
                     }
    -            }
     
    -        }
    -    };
    -
    -};
    +                modifiedBuiltins.forEach(function(builtin) {
    +                    if (lhs.object.object.name === builtin) {
    +                        context.report(node, builtin + " prototype is read only, properties should not be added.");
    +                    }
    +                });
    +            },
    +
    +            // handle the Object.definePropert[y|ies](Array.prototype) case
    +            CallExpression: function(node) {
    +
    +                var callee = node.callee,
    +                    subject,
    +                    object;
    +
    +                // only worry about Object.definePropert[y|ies]
    +                if (callee.type === "MemberExpression" &&
    +                    callee.object.name === "Object" &&
    +                    (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) {
    +
    +                    // verify the object being added to is a native prototype
    +                    subject = node.arguments[0];
    +                    object = subject && subject.object;
    +                    if (object &&
    +                        object.type === "Identifier" &&
    +                        (modifiedBuiltins.indexOf(object.name) > -1) &&
    +                        subject.property.name === "prototype") {
    +
    +                        context.report(node, object.name + " prototype is read only, properties should not be added.");
    +                    }
    +                }
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    -                },
    -                "uniqueItems": true
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-extra-bind.js b/tools/eslint/lib/rules/no-extra-bind.js
    index 8bfe5e5d181d1f..f75e2fcc25782d 100644
    --- a/tools/eslint/lib/rules/no-extra-bind.js
    +++ b/tools/eslint/lib/rules/no-extra-bind.js
    @@ -1,9 +1,6 @@
     /**
      * @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";
     
    @@ -11,137 +8,149 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var scopeInfo = null;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary calls to `.bind()`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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
    -        });
    -    }
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var scopeInfo = null;
    +
    +        /**
    +         * Reports a given function node.
    +         *
    +         * @param {ASTNode} node - A node to report. This is a FunctionExpression or
    +         *      an ArrowFunctionExpression.
    +         * @returns {void}
    +         */
    +        function report(node) {
    +            context.report({
    +                node: node.parent.parent,
    +                message: "The function binding is unnecessary.",
    +                loc: node.parent.property.loc.start
    +            });
    +        }
    +
    +        /**
    +         * Gets the property name of a given node.
    +         * If the property name is dynamic, this returns an empty string.
    +         *
    +         * @param {ASTNode} node - A node to check. This is a MemberExpression.
    +         * @returns {string} The property name of the node.
    +         */
    +        function getPropertyName(node) {
    +            if (node.computed) {
    +                switch (node.property.type) {
    +                    case "Literal":
    +                        return String(node.property.value);
    +                    case "TemplateLiteral":
    +                        if (node.property.expressions.length === 0) {
    +                            return node.property.quasis[0].value.cooked;
    +                        }
     
    -    /**
    -     * Gets the property name of a given node.
    -     * If the property name is dynamic, this returns an empty string.
    -     *
    -     * @param {ASTNode} node - A node to check. This is a MemberExpression.
    -     * @returns {string} The property name of the node.
    -     */
    -    function getPropertyName(node) {
    -        if (node.computed) {
    -            switch (node.property.type) {
    -                case "Literal":
    -                    return String(node.property.value);
    -                case "TemplateLiteral":
    -                    if (node.property.expressions.length === 0) {
    -                        return node.property.quasis[0].value.cooked;
    -                    }
    -                    // fallthrough
    -                default:
    -                    return false;
    +                        // fallthrough
    +                    default:
    +                        return false;
    +                }
                 }
    +            return node.property.name;
             }
    -        return node.property.name;
    -    }
     
    -    /**
    -     * 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"
    -        );
    -    }
    +        /**
    +         * 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;
     
    -    /**
    -     * 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 enterFunction(node) {
    -        scopeInfo = {
    -            isBound: isCalleeOfBindMethod(node),
    -            thisFound: false,
    -            upper: scopeInfo
    -        };
    -    }
    +            return (
    +                grandparent &&
    +                grandparent.type === "CallExpression" &&
    +                grandparent.callee === parent &&
    +                grandparent.arguments.length === 1 &&
    +                parent.type === "MemberExpression" &&
    +                parent.object === node &&
    +                getPropertyName(parent) === "bind"
    +            );
    +        }
     
    -    /**
    -     * 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 exitFunction(node) {
    -        if (scopeInfo.isBound && !scopeInfo.thisFound) {
    -            report(node);
    +        /**
    +         * 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 enterFunction(node) {
    +            scopeInfo = {
    +                isBound: isCalleeOfBindMethod(node),
    +                thisFound: false,
    +                upper: scopeInfo
    +            };
             }
     
    -        scopeInfo = scopeInfo.upper;
    -    }
    +        /**
    +         * 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 exitFunction(node) {
    +            if (scopeInfo.isBound && !scopeInfo.thisFound) {
    +                report(node);
    +            }
     
    -    /**
    -     * 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);
    +            scopeInfo = scopeInfo.upper;
             }
    -    }
     
    -    /**
    -     * Set the mark as the `this` keyword was found in this scope.
    -     *
    -     * @returns {void}
    -     */
    -    function markAsThisFound() {
    -        if (scopeInfo) {
    -            scopeInfo.thisFound = true;
    +        /**
    +         * 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);
    +            }
             }
    -    }
     
    -    return {
    -        "ArrowFunctionExpression:exit": exitArrowFunction,
    -        "FunctionDeclaration": enterFunction,
    -        "FunctionDeclaration:exit": exitFunction,
    -        "FunctionExpression": enterFunction,
    -        "FunctionExpression:exit": exitFunction,
    -        "ThisExpression": markAsThisFound
    -    };
    -};
    +        /**
    +         * Set the mark as the `this` keyword was found in this scope.
    +         *
    +         * @returns {void}
    +         */
    +        function markAsThisFound() {
    +            if (scopeInfo) {
    +                scopeInfo.thisFound = true;
    +            }
    +        }
     
    -module.exports.schema = [];
    +        return {
    +            "ArrowFunctionExpression:exit": exitArrowFunction,
    +            FunctionDeclaration: enterFunction,
    +            "FunctionDeclaration:exit": exitFunction,
    +            FunctionExpression: enterFunction,
    +            "FunctionExpression:exit": exitFunction,
    +            ThisExpression: markAsThisFound
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-extra-boolean-cast.js b/tools/eslint/lib/rules/no-extra-boolean-cast.js
    index bd7495b891f6b2..f14da0821dbbed 100644
    --- a/tools/eslint/lib/rules/no-extra-boolean-cast.js
    +++ b/tools/eslint/lib/rules/no-extra-boolean-cast.js
    @@ -9,70 +9,82 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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 === "!")
    -        );
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary boolean casts",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    +        schema: []
    +    },
     
    -    return {
    -        "UnaryExpression": function(node) {
    -            var ancestors = context.getAncestors(),
    -                parent = ancestors.pop(),
    -                grandparent = ancestors.pop();
    +    create: function(context) {
     
    -            // Exit early if it's guaranteed not to match
    -            if (node.operator !== "!" ||
    -                    parent.type !== "UnaryExpression" ||
    -                    parent.operator !== "!") {
    -                return;
    -            }
    +        // Node types which have a test which will coerce values to booleans.
    +        var BOOLEAN_NODE_TYPES = [
    +            "IfStatement",
    +            "DoWhileStatement",
    +            "WhileStatement",
    +            "ConditionalExpression",
    +            "ForStatement"
    +        ];
     
    -            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.");
    -            }
    -        },
    -        "CallExpression": function(node) {
    -            var parent = node.parent;
    +        /**
    +         * 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 === "!")
    +            );
    +        }
     
    -            if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") {
    -                return;
    -            }
     
    -            if (isInBooleanContext(node, parent)) {
    -                context.report(node, "Redundant Boolean call.");
    +        return {
    +            UnaryExpression: function(node) {
    +                var ancestors = context.getAncestors(),
    +                    parent = ancestors.pop(),
    +                    grandparent = ancestors.pop();
    +
    +                // Exit early if it's guaranteed not to match
    +                if (node.operator !== "!" ||
    +                        parent.type !== "UnaryExpression" ||
    +                        parent.operator !== "!") {
    +                    return;
    +                }
    +
    +                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.");
    +                }
    +            },
    +            CallExpression: function(node) {
    +                var parent = node.parent;
    +
    +                if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") {
    +                    return;
    +                }
    +
    +                if (isInBooleanContext(node, parent)) {
    +                    context.report(node, "Redundant Boolean call.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-extra-label.js b/tools/eslint/lib/rules/no-extra-label.js
    index c11a7035764d30..f1a48e3688e96d 100644
    --- a/tools/eslint/lib/rules/no-extra-label.js
    +++ b/tools/eslint/lib/rules/no-extra-label.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -17,116 +15,126 @@ 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
    -        };
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary labels",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Removes the top scope of the stack.
    -     *
    -     * @returns {void}
    -     */
    -    function exitBreakableStatement() {
    -        scopeInfo = scopeInfo.upper;
    -    }
    +        schema: []
    +    },
     
    -    /**
    -     * 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)) {
    +    create: 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: node.label.name,
    -                breakable: false,
    +                label: astUtils.getLabel(node),
    +                breakable: true,
                     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)) {
    +        /**
    +         * Removes the top scope of the stack.
    +         *
    +         * @returns {void}
    +         */
    +        function exitBreakableStatement() {
                 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;
    +        /**
    +         * 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
    +                };
    +            }
             }
     
    -        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
    -                    });
    -                }
    +        /**
    +         * 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;
                 }
     
    -            info = info.upper;
    +            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
    -    };
    +        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 763e9235bd7cf6..cf129394ba0fd2 100644
    --- a/tools/eslint/lib/rules/no-extra-parens.js
    +++ b/tools/eslint/lib/rules/no-extra-parens.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,540 +8,585 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +var astUtils = require("../ast-utils.js");
     
    -    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();
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary parentheses",
    +            category: "Possible Errors",
    +            recommended: false
    +        },
     
    -    /**
    -     * Determines if this rule should be enforced for a node given the current configuration.
    -     * @param {ASTNode} node - The node to be checked.
    -     * @returns {boolean} True if the rule should be enforced for this node.
    -     * @private
    -     */
    -    function ruleApplies(node) {
    -        return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
    -    }
    +        schema: {
    +            anyOf: [
    +                {
    +                    type: "array",
    +                    items: [
    +                        {
    +                            enum: ["functions"]
    +                        }
    +                    ],
    +                    minItems: 0,
    +                    maxItems: 1
    +                },
    +                {
    +                    type: "array",
    +                    items: [
    +                        {
    +                            enum: ["all"]
    +                        },
    +                        {
    +                            type: "object",
    +                            properties: {
    +                                conditionalAssign: {type: "boolean"},
    +                                nestedBinaryExpressions: {type: "boolean"}
    +                            },
    +                            additionalProperties: false
    +                        }
    +                    ],
    +                    minItems: 0,
    +                    maxItems: 2
    +                }
    +            ]
    +        }
    +    },
    +
    +    create: function(context) {
    +        var isParenthesised = astUtils.isParenthesised.bind(astUtils, context);
    +        var ALL_NODES = context.options[0] !== "functions";
    +        var EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false;
    +        var NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false;
    +        var sourceCode = context.getSourceCode();
    +
    +        /**
    +         * Determines if this rule should be enforced for a node given the current configuration.
    +         * @param {ASTNode} node - The node to be checked.
    +         * @returns {boolean} True if the rule should be enforced for this node.
    +         * @private
    +         */
    +        function ruleApplies(node) {
    +            return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
    +        }
     
    -    /**
    -     * Determines if a node is surrounded by parentheses.
    -     * @param {ASTNode} node - The node to be checked.
    -     * @returns {boolean} True if the node is parenthesised.
    -     * @private
    -     */
    -    function isParenthesised(node) {
    -        var previousToken = context.getTokenBefore(node),
    -            nextToken = context.getTokenAfter(node);
    -
    -        return previousToken && nextToken &&
    -            previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +        /**
    +         * Determines if a node is surrounded by parentheses twice.
    +         * @param {ASTNode} node - The node to be checked.
    +         * @returns {boolean} True if the node is doubly parenthesised.
    +         * @private
    +         */
    +        function isParenthesisedTwice(node) {
    +            var previousToken = context.getTokenBefore(node, 1),
    +                nextToken = context.getTokenAfter(node, 1);
    +
    +            return isParenthesised(node) && previousToken && nextToken &&
    +                previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +                nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +        }
     
    -    /**
    -     * Determines if a node is surrounded by parentheses twice.
    -     * @param {ASTNode} node - The node to be checked.
    -     * @returns {boolean} True if the node is doubly parenthesised.
    -     * @private
    -     */
    -    function isParenthesisedTwice(node) {
    -        var previousToken = context.getTokenBefore(node, 1),
    -            nextToken = context.getTokenAfter(node, 1);
    -
    -        return isParenthesised(node) && previousToken && nextToken &&
    -            previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +        /**
    +         * Determines if a node is surrounded by (potentially) invalid parentheses.
    +         * @param {ASTNode} node - The node to be checked.
    +         * @returns {boolean} True if the node is incorrectly parenthesised.
    +         * @private
    +         */
    +        function hasExcessParens(node) {
    +            return ruleApplies(node) && isParenthesised(node);
    +        }
     
    -    /**
    -     * Determines if a node is surrounded by (potentially) invalid parentheses.
    -     * @param {ASTNode} node - The node to be checked.
    -     * @returns {boolean} True if the node is incorrectly parenthesised.
    -     * @private
    -     */
    -    function hasExcessParens(node) {
    -        return ruleApplies(node) && isParenthesised(node);
    -    }
    +        /**
    +         * Determines if a node that is expected to be parenthesised is surrounded by
    +         * (potentially) invalid extra parentheses.
    +         * @param {ASTNode} node - The node to be checked.
    +         * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
    +         * @private
    +         */
    +        function hasDoubleExcessParens(node) {
    +            return ruleApplies(node) && isParenthesisedTwice(node);
    +        }
     
    -    /**
    -     * Determines if a node that is expected to be parenthesised is surrounded by
    -     * (potentially) invalid extra parentheses.
    -     * @param {ASTNode} node - The node to be checked.
    -     * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
    -     * @private
    -     */
    -    function hasDoubleExcessParens(node) {
    -        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 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);
    +            }
     
    -    /**
    -     * 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);
             }
     
    -        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;
    +                }
     
    -    /**
    -     * 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) {
    +                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) {
                     case "SequenceExpression":
    -                    if (parent.expressions[0] !== node || isParenthesised(node)) {
    -                        return false;
    -                    }
    -                    break;
    +                    return 0;
     
    -                case "UnaryExpression":
    -                case "UpdateExpression":
    -                    if (parent.prefix || isParenthesised(node)) {
    -                        return false;
    -                    }
    -                    break;
    +                case "AssignmentExpression":
    +                case "ArrowFunctionExpression":
    +                case "YieldExpression":
    +                    return 1;
    +
    +                case "ConditionalExpression":
    +                    return 3;
     
    -                case "BinaryExpression":
                     case "LogicalExpression":
    -                    if (parent.left !== node || isParenthesised(node)) {
    -                        return false;
    +                    switch (node.operator) {
    +                        case "||":
    +                            return 4;
    +                        case "&&":
    +                            return 5;
    +
    +                        // no default
                         }
    -                    break;
     
    -                case "ConditionalExpression":
    -                    if (parent.test !== node || isParenthesised(node)) {
    -                        return false;
    +                    /* falls through */
    +
    +                case "BinaryExpression":
    +
    +                    switch (node.operator) {
    +                        case "|":
    +                            return 6;
    +                        case "^":
    +                            return 7;
    +                        case "&":
    +                            return 8;
    +                        case "==":
    +                        case "!=":
    +                        case "===":
    +                        case "!==":
    +                            return 9;
    +                        case "<":
    +                        case "<=":
    +                        case ">":
    +                        case ">=":
    +                        case "in":
    +                        case "instanceof":
    +                            return 10;
    +                        case "<<":
    +                        case ">>":
    +                        case ">>>":
    +                            return 11;
    +                        case "+":
    +                        case "-":
    +                            return 12;
    +                        case "*":
    +                        case "/":
    +                        case "%":
    +                            return 13;
    +
    +                        // no default
                         }
    -                    break;
    +
    +                    /* falls through */
    +
    +                case "UnaryExpression":
    +                    return 14;
    +
    +                case "UpdateExpression":
    +                    return 15;
     
                     case "CallExpression":
    -                    if (parent.callee !== node || isParenthesised(node)) {
    -                        return false;
    -                    }
    -                    break;
     
    -                case "MemberExpression":
    -                    if (parent.object !== node || isParenthesised(node)) {
    -                        return false;
    +                    // IIFE is allowed to have parens in any position (#655)
    +                    if (node.callee.type === "FunctionExpression") {
    +                        return -1;
                         }
    -                    break;
    +                    return 16;
     
    -                case "ExpressionStatement":
    -                    return true;
    +                case "NewExpression":
    +                    return 17;
     
    -                default:
    -                    return false;
    +                // no default
                 }
    +            return 18;
    +        }
    +
    +        /**
    +         * Report the node
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function report(node) {
    +            var previousToken = context.getTokenBefore(node);
     
    -            node = parent;
    -            parent = parent.parent;
    +            context.report(node, previousToken.loc.start, "Gratuitous parentheses around expression.");
             }
     
    -        /* istanbul ignore next */
    -        throw new Error("unreachable");
    -    }
    +        /**
    +         * 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);
    +            }
    +        }
     
    -    /**
    -     * 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) {
    -            case "SequenceExpression":
    -                return 0;
    -
    -            case "AssignmentExpression":
    -            case "ArrowFunctionExpression":
    -            case "YieldExpression":
    -                return 1;
    -
    -            case "ConditionalExpression":
    -                return 3;
    -
    -            case "LogicalExpression":
    -                switch (node.operator) {
    -                    case "||":
    -                        return 4;
    -                    case "&&":
    -                        return 5;
    -                    // no default
    +        /**
    +         * Evaluate a new call
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function dryCallNew(node) {
    +            if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !(
    +                node.type === "CallExpression" &&
    +                node.callee.type === "FunctionExpression" &&
    +
    +                // One set of parentheses are allowed for a function expression
    +                !hasDoubleExcessParens(node.callee)
    +            )) {
    +                report(node.callee);
    +            }
    +            if (node.arguments.length === 1) {
    +                if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= precedence({type: "AssignmentExpression"})) {
    +                    report(node.arguments[0]);
                     }
    +            } else {
    +                [].forEach.call(node.arguments, function(arg) {
    +                    if (hasExcessParens(arg) && precedence(arg) >= precedence({type: "AssignmentExpression"})) {
    +                        report(arg);
    +                    }
    +                });
    +            }
    +        }
     
    -                /* falls through */
    -            case "BinaryExpression":
    -                switch (node.operator) {
    -                    case "|":
    -                        return 6;
    -                    case "^":
    -                        return 7;
    -                    case "&":
    -                        return 8;
    -                    case "==":
    -                    case "!=":
    -                    case "===":
    -                    case "!==":
    -                        return 9;
    -                    case "<":
    -                    case "<=":
    -                    case ">":
    -                    case ">=":
    -                    case "in":
    -                    case "instanceof":
    -                        return 10;
    -                    case "<<":
    -                    case ">>":
    -                    case ">>>":
    -                        return 11;
    -                    case "+":
    -                    case "-":
    -                        return 12;
    -                    case "*":
    -                    case "/":
    -                    case "%":
    -                        return 13;
    -                    // no default
    +        /**
    +         * Evaluate binary logicals
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function dryBinaryLogical(node) {
    +            if (!NESTED_BINARY) {
    +                var prec = precedence(node);
    +
    +                if (hasExcessParens(node.left) && precedence(node.left) >= prec) {
    +                    report(node.left);
                     }
    -                /* falls through */
    -            case "UnaryExpression":
    -                return 14;
    -            case "UpdateExpression":
    -                return 15;
    -            case "CallExpression":
    -                // IIFE is allowed to have parens in any position (#655)
    -                if (node.callee.type === "FunctionExpression") {
    -                    return -1;
    +                if (hasExcessParens(node.right) && precedence(node.right) > prec) {
    +                    report(node.right);
                     }
    -                return 16;
    -            case "NewExpression":
    -                return 17;
    -            // no default
    +            }
             }
    -        return 18;
    -    }
     
    -    /**
    -     * Report the node
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {void}
    -     * @private
    -     */
    -    function report(node) {
    -        var previousToken = context.getTokenBefore(node);
    -        context.report(node, previousToken.loc.start, "Gratuitous parentheses around expression.");
    -    }
    +        return {
    +            ArrayExpression: function(node) {
    +                [].forEach.call(node.elements, function(e) {
    +                    if (e && hasExcessParens(e) && precedence(e) >= precedence({type: "AssignmentExpression"})) {
    +                        report(e);
    +                    }
    +                });
    +            },
    +
    +            ArrowFunctionExpression: function(node) {
    +                if (node.body.type !== "BlockStatement") {
    +                    if (sourceCode.getFirstToken(node.body).value !== "{" && hasExcessParens(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) {
    +                        report(node.body);
    +                        return;
    +                    }
     
    -    /**
    -     * 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);
    -        }
    -    }
    +                    // Object literals *must* be parenthesised
    +                    if (node.body.type === "ObjectExpression" && hasDoubleExcessParens(node.body)) {
    +                        report(node.body);
    +                        return;
    +                    }
    +                }
    +            },
     
    -    /**
    -     * Evaluate a new call
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {void}
    -     * @private
    -     */
    -    function dryCallNew(node) {
    -        if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !(
    -            node.type === "CallExpression" &&
    -            node.callee.type === "FunctionExpression" &&
    -            // One set of parentheses are allowed for a function expression
    -            !hasDoubleExcessParens(node.callee)
    -        )) {
    -            report(node.callee);
    -        }
    -        if (node.arguments.length === 1) {
    -            if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= precedence({type: "AssignmentExpression"})) {
    -                report(node.arguments[0]);
    -            }
    -        } else {
    -            [].forEach.call(node.arguments, function(arg) {
    -                if (hasExcessParens(arg) && precedence(arg) >= precedence({type: "AssignmentExpression"})) {
    -                    report(arg);
    +            AssignmentExpression: function(node) {
    +                if (hasExcessParens(node.right) && precedence(node.right) >= precedence(node)) {
    +                    report(node.right);
                     }
    -            });
    -        }
    -    }
    +            },
     
    -    /**
    -     * Evaluate binary logicals
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {void}
    -     * @private
    -     */
    -    function dryBinaryLogical(node) {
    -        var prec = precedence(node);
    -        if (hasExcessParens(node.left) && precedence(node.left) >= prec) {
    -            report(node.left);
    -        }
    -        if (hasExcessParens(node.right) && precedence(node.right) > prec) {
    -            report(node.right);
    -        }
    -    }
    +            BinaryExpression: dryBinaryLogical,
    +            CallExpression: dryCallNew,
     
    -    return {
    -        "ArrayExpression": function(node) {
    -            [].forEach.call(node.elements, function(e) {
    -                if (e && hasExcessParens(e) && precedence(e) >= precedence({type: "AssignmentExpression"})) {
    -                    report(e);
    +            ConditionalExpression: function(node) {
    +                if (hasExcessParens(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) {
    +                    report(node.test);
                     }
    -            });
    -        },
    -        "ArrowFunctionExpression": function(node) {
    -            if (node.body.type !== "BlockStatement") {
    -                if (node.body.type !== "ObjectExpression" && hasExcessParens(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) {
    -                    report(node.body);
    -                    return;
    +                if (hasExcessParens(node.consequent) && precedence(node.consequent) >= precedence({type: "AssignmentExpression"})) {
    +                    report(node.consequent);
    +                }
    +                if (hasExcessParens(node.alternate) && precedence(node.alternate) >= precedence({type: "AssignmentExpression"})) {
    +                    report(node.alternate);
                     }
    +            },
     
    -                // Object literals *must* be parenthesised
    -                if (node.body.type === "ObjectExpression" && hasDoubleExcessParens(node.body)) {
    -                    report(node.body);
    -                    return;
    +            DoWhileStatement: function(node) {
    +                if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    +                    report(node.test);
                     }
    -            }
    -        },
    -        "AssignmentExpression": function(node) {
    -            if (hasExcessParens(node.right) && precedence(node.right) >= precedence(node)) {
    -                report(node.right);
    -            }
    -        },
    -        "BinaryExpression": dryBinaryLogical,
    -        "CallExpression": dryCallNew,
    -        "ConditionalExpression": function(node) {
    -            if (hasExcessParens(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) {
    -                report(node.test);
    -            }
    -            if (hasExcessParens(node.consequent) && precedence(node.consequent) >= precedence({type: "AssignmentExpression"})) {
    -                report(node.consequent);
    -            }
    -            if (hasExcessParens(node.alternate) && precedence(node.alternate) >= precedence({type: "AssignmentExpression"})) {
    -                report(node.alternate);
    -            }
    -        },
    -        "DoWhileStatement": function(node) {
    -            if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    -                report(node.test);
    -            }
    -        },
    -        "ExpressionStatement": function(node) {
    -            var firstToken, secondToken, firstTokens;
    -            if (hasExcessParens(node.expression)) {
    -                firstTokens = context.getFirstTokens(node.expression, 2);
    -                firstToken = firstTokens[0];
    -                secondToken = firstTokens[1];
    +            },
    +
    +            ExpressionStatement: function(node) {
    +                var firstToken, secondToken, firstTokens;
    +
    +                if (hasExcessParens(node.expression)) {
    +                    firstTokens = context.getFirstTokens(node.expression, 2);
    +                    firstToken = firstTokens[0];
    +                    secondToken = firstTokens[1];
    +
    +                    if (
    +                        !firstToken ||
    +                        firstToken.value !== "{" &&
    +                        firstToken.value !== "function" &&
    +                        firstToken.value !== "class" &&
    +                        (
    +                            firstToken.value !== "let" ||
    +                            !secondToken ||
    +                            secondToken.value !== "["
    +                        )
    +                    ) {
    +                        report(node.expression);
    +                    }
    +                }
    +            },
    +
    +            ForInStatement: function(node) {
    +                if (hasExcessParens(node.right)) {
    +                    report(node.right);
    +                }
    +            },
    +
    +            ForOfStatement: function(node) {
    +                if (hasExcessParens(node.right)) {
    +                    report(node.right);
    +                }
    +            },
    +
    +            ForStatement: function(node) {
    +                if (node.init && hasExcessParens(node.init)) {
    +                    report(node.init);
    +                }
    +
    +                if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) {
    +                    report(node.test);
    +                }
    +
    +                if (node.update && hasExcessParens(node.update)) {
    +                    report(node.update);
    +                }
    +            },
    +
    +            IfStatement: function(node) {
    +                if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    +                    report(node.test);
    +                }
    +            },
    +
    +            LogicalExpression: dryBinaryLogical,
     
    +            MemberExpression: function(node) {
                     if (
    -                    !firstToken ||
    -                    firstToken.value !== "{" &&
    -                    firstToken.value !== "function" &&
    -                    firstToken.value !== "class" &&
    +                    hasExcessParens(node.object) &&
    +                    precedence(node.object) >= precedence(node) &&
                         (
    -                        firstToken.value !== "let" ||
    -                        !secondToken ||
    -                        secondToken.value !== "["
    +                        node.computed ||
    +                        !(
    +                            (node.object.type === "Literal" &&
    +                            typeof node.object.value === "number" &&
    +                            /^[0-9]+$/.test(context.getFirstToken(node.object).value))
    +                            ||
    +
    +                            // RegExp literal is allowed to have parens (#1589)
    +                            (node.object.type === "Literal" && node.object.regex)
    +                        )
    +                    ) &&
    +                    !(
    +                        (node.object.type === "FunctionExpression" || node.object.type === "ClassExpression") &&
    +                        isHeadOfExpressionStatement(node) &&
    +                        !hasDoubleExcessParens(node.object)
                         )
                     ) {
    -                    report(node.expression);
    +                    report(node.object);
                     }
    -            }
    -        },
    -        "ForInStatement": function(node) {
    -            if (hasExcessParens(node.right)) {
    -                report(node.right);
    -            }
    -        },
    -        "ForOfStatement": function(node) {
    -            if (hasExcessParens(node.right)) {
    -                report(node.right);
    -            }
    -        },
    -        "ForStatement": function(node) {
    -            if (node.init && hasExcessParens(node.init)) {
    -                report(node.init);
    -            }
    +                if (node.computed && hasExcessParens(node.property)) {
    +                    report(node.property);
    +                }
    +            },
     
    -            if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) {
    -                report(node.test);
    -            }
    +            NewExpression: dryCallNew,
    +
    +            ObjectExpression: function(node) {
    +                [].forEach.call(node.properties, function(e) {
    +                    var v = e.value;
    +
    +                    if (v && hasExcessParens(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) {
    +                        report(v);
    +                    }
    +                });
    +            },
    +
    +            ReturnStatement: function(node) {
    +                var returnToken = sourceCode.getFirstToken(node);
    +
    +                if (node.argument &&
    +                        hasExcessParensNoLineTerminator(returnToken, node.argument) &&
     
    -            if (node.update && hasExcessParens(node.update)) {
    -                report(node.update);
    -            }
    -        },
    -        "IfStatement": function(node) {
    -            if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    -                report(node.test);
    -            }
    -        },
    -        "LogicalExpression": dryBinaryLogical,
    -        "MemberExpression": function(node) {
    -            if (
    -                hasExcessParens(node.object) &&
    -                precedence(node.object) >= precedence(node) &&
    -                (
    -                    node.computed ||
    -                    !(
    -                        (node.object.type === "Literal" &&
    -                        typeof node.object.value === "number" &&
    -                        /^[0-9]+$/.test(context.getFirstToken(node.object).value))
    -                        ||
                             // RegExp literal is allowed to have parens (#1589)
    -                        (node.object.type === "Literal" && node.object.regex)
    -                    )
    -                ) &&
    -                !(
    -                    (node.object.type === "FunctionExpression" || node.object.type === "ClassExpression") &&
    -                    isHeadOfExpressionStatement(node) &&
    -                    !hasDoubleExcessParens(node.object)
    -                )
    -            ) {
    -                report(node.object);
    -            }
    -            if (node.computed && hasExcessParens(node.property)) {
    -                report(node.property);
    -            }
    -        },
    -        "NewExpression": dryCallNew,
    -        "ObjectExpression": function(node) {
    -            [].forEach.call(node.properties, function(e) {
    -                var v = e.value;
    -                if (v && hasExcessParens(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) {
    -                    report(v);
    +                        !(node.argument.type === "Literal" && node.argument.regex)) {
    +                    report(node.argument);
                     }
    -            });
    -        },
    -        "ReturnStatement": function(node) {
    -            var returnToken = sourceCode.getFirstToken(node);
    +            },
     
    -            if (node.argument &&
    -                    hasExcessParensNoLineTerminator(returnToken, node.argument) &&
    -                    // RegExp literal is allowed to have parens (#1589)
    -                    !(node.argument.type === "Literal" && node.argument.regex)) {
    -                report(node.argument);
    -            }
    -        },
    -        "SequenceExpression": function(node) {
    -            [].forEach.call(node.expressions, function(e) {
    -                if (hasExcessParens(e) && precedence(e) >= precedence(node)) {
    -                    report(e);
    +            SequenceExpression: function(node) {
    +                [].forEach.call(node.expressions, function(e) {
    +                    if (hasExcessParens(e) && precedence(e) >= precedence(node)) {
    +                        report(e);
    +                    }
    +                });
    +            },
    +
    +            SwitchCase: function(node) {
    +                if (node.test && hasExcessParens(node.test)) {
    +                    report(node.test);
                     }
    -            });
    -        },
    -        "SwitchCase": function(node) {
    -            if (node.test && hasExcessParens(node.test)) {
    -                report(node.test);
    -            }
    -        },
    -        "SwitchStatement": function(node) {
    -            if (hasDoubleExcessParens(node.discriminant)) {
    -                report(node.discriminant);
    -            }
    -        },
    -        "ThrowStatement": function(node) {
    -            var throwToken = sourceCode.getFirstToken(node);
    +            },
     
    -            if (hasExcessParensNoLineTerminator(throwToken, node.argument)) {
    -                report(node.argument);
    -            }
    -        },
    -        "UnaryExpression": dryUnaryUpdate,
    -        "UpdateExpression": dryUnaryUpdate,
    -        "VariableDeclarator": function(node) {
    -            if (node.init && hasExcessParens(node.init) &&
    -                    precedence(node.init) >= precedence({type: "AssignmentExpression"}) &&
    -                    // RegExp literal is allowed to have parens (#1589)
    -                    !(node.init.type === "Literal" && node.init.regex)) {
    -                report(node.init);
    -            }
    -        },
    -        "WhileStatement": function(node) {
    -            if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    -                report(node.test);
    -            }
    -        },
    -        "WithStatement": function(node) {
    -            if (hasDoubleExcessParens(node.object)) {
    -                report(node.object);
    -            }
    -        },
    -        "YieldExpression": function(node) {
    -            var yieldToken;
    +            SwitchStatement: function(node) {
    +                if (hasDoubleExcessParens(node.discriminant)) {
    +                    report(node.discriminant);
    +                }
    +            },
     
    -            if (node.argument) {
    -                yieldToken = sourceCode.getFirstToken(node);
    +            ThrowStatement: function(node) {
    +                var throwToken = sourceCode.getFirstToken(node);
     
    -                if ((precedence(node.argument) >= precedence(node) &&
    -                        hasExcessParensNoLineTerminator(yieldToken, node.argument)) ||
    -                        hasDoubleExcessParens(node.argument)) {
    +                if (hasExcessParensNoLineTerminator(throwToken, node.argument)) {
                         report(node.argument);
                     }
    -            }
    -        }
    -    };
    +            },
     
    -};
    +            UnaryExpression: dryUnaryUpdate,
    +            UpdateExpression: dryUnaryUpdate,
     
    -module.exports.schema = {
    -    "anyOf": [
    -        {
    -            "type": "array",
    -            "items": [
    -                {
    -                    "enum": ["functions"]
    +            VariableDeclarator: function(node) {
    +                if (node.init && hasExcessParens(node.init) &&
    +                        precedence(node.init) >= precedence({type: "AssignmentExpression"}) &&
    +
    +                        // RegExp literal is allowed to have parens (#1589)
    +                        !(node.init.type === "Literal" && node.init.regex)) {
    +                    report(node.init);
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 1
    -        },
    -        {
    -            "type": "array",
    -            "items": [
    -                {
    -                    "enum": ["all"]
    -                },
    -                {
    -                    "type": "object",
    -                    "properties": {
    -                        "conditionalAssign": {"type": "boolean"}
    -                    },
    -                    "additionalProperties": false
    +            },
    +
    +            WhileStatement: function(node) {
    +                if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) {
    +                    report(node.test);
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 2
    -        }
    -    ]
    +            },
    +
    +            WithStatement: function(node) {
    +                if (hasDoubleExcessParens(node.object)) {
    +                    report(node.object);
    +                }
    +            },
    +
    +            YieldExpression: function(node) {
    +                var yieldToken;
    +
    +                if (node.argument) {
    +                    yieldToken = sourceCode.getFirstToken(node);
    +
    +                    if ((precedence(node.argument) >= precedence(node) &&
    +                            hasExcessParensNoLineTerminator(yieldToken, node.argument)) ||
    +                            hasDoubleExcessParens(node.argument)) {
    +                        report(node.argument);
    +                    }
    +                }
    +            }
    +        };
    +
    +    }
     };
    diff --git a/tools/eslint/lib/rules/no-extra-semi.js b/tools/eslint/lib/rules/no-extra-semi.js
    index 04c1eca9b06b8d..e451b9e42e3367 100644
    --- a/tools/eslint/lib/rules/no-extra-semi.js
    +++ b/tools/eslint/lib/rules/no-extra-semi.js
    @@ -9,75 +9,87 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    /**
    -     * Reports an unnecessary semicolon error.
    -     * @param {Node|Token} nodeOrToken - A node or a token to be reported.
    -     * @returns {void}
    -     */
    -    function report(nodeOrToken) {
    -        context.report({
    -            node: nodeOrToken,
    -            message: "Unnecessary semicolon.",
    -            fix: function(fixer) {
    -                return fixer.remove(nodeOrToken);
    -            }
    -        });
    -    }
    -
    -    /**
    -     * Checks for a part of a class body.
    -     * This checks tokens from a specified token to a next MethodDefinition or the end of class body.
    -     *
    -     * @param {Token} firstToken - The first token to check.
    -     * @returns {void}
    -     */
    -    function checkForPartOfClassBody(firstToken) {
    -        for (var token = firstToken;
    -            token.type === "Punctuator" && token.value !== "}";
    -            token = context.getTokenAfter(token)
    -        ) {
    -            if (token.value === ";") {
    -                report(token);
    -            }
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary semicolons",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    -        /**
    -         * Reports this empty statement, except if the parent node is a loop.
    -         * @param {Node} node - A EmptyStatement node to be reported.
    -         * @returns {void}
    -         */
    -        "EmptyStatement": function(node) {
    -            var parent = node.parent,
    -                allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"];
    +        fixable: "code",
    +        schema: []
    +    },
     
    -            if (allowedParentTypes.indexOf(parent.type) === -1) {
    -                report(node);
    -            }
    -        },
    +    create: function(context) {
     
             /**
    -         * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
    -         * @param {Node} node - A ClassBody node to check.
    +         * Reports an unnecessary semicolon error.
    +         * @param {Node|Token} nodeOrToken - A node or a token to be reported.
              * @returns {void}
              */
    -        "ClassBody": function(node) {
    -            checkForPartOfClassBody(context.getFirstToken(node, 1)); // 0 is `{`.
    -        },
    +        function report(nodeOrToken) {
    +            context.report({
    +                node: nodeOrToken,
    +                message: "Unnecessary semicolon.",
    +                fix: function(fixer) {
    +                    return fixer.remove(nodeOrToken);
    +                }
    +            });
    +        }
     
             /**
    -         * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
    -         * @param {Node} node - A MethodDefinition node of the start point.
    +         * Checks for a part of a class body.
    +         * This checks tokens from a specified token to a next MethodDefinition or the end of class body.
    +         *
    +         * @param {Token} firstToken - The first token to check.
              * @returns {void}
              */
    -        "MethodDefinition": function(node) {
    -            checkForPartOfClassBody(context.getTokenAfter(node));
    +        function checkForPartOfClassBody(firstToken) {
    +            for (var token = firstToken;
    +                token.type === "Punctuator" && token.value !== "}";
    +                token = context.getTokenAfter(token)
    +            ) {
    +                if (token.value === ";") {
    +                    report(token);
    +                }
    +            }
             }
    -    };
     
    -};
    +        return {
    +
    +            /**
    +             * Reports this empty statement, except if the parent node is a loop.
    +             * @param {Node} node - A EmptyStatement node to be reported.
    +             * @returns {void}
    +             */
    +            EmptyStatement: function(node) {
    +                var parent = node.parent,
    +                    allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"];
     
    -module.exports.schema = [];
    +                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.
    +             * @param {Node} node - A ClassBody node to check.
    +             * @returns {void}
    +             */
    +            ClassBody: function(node) {
    +                checkForPartOfClassBody(context.getFirstToken(node, 1)); // 0 is `{`.
    +            },
    +
    +            /**
    +             * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
    +             * @param {Node} node - A MethodDefinition node of the start point.
    +             * @returns {void}
    +             */
    +            MethodDefinition: function(node) {
    +                checkForPartOfClassBody(context.getTokenAfter(node));
    +            }
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-fallthrough.js b/tools/eslint/lib/rules/no-fallthrough.js
    index 58dfcf04413386..2edb4972bafd0a 100644
    --- a/tools/eslint/lib/rules/no-fallthrough.js
    +++ b/tools/eslint/lib/rules/no-fallthrough.js
    @@ -8,25 +8,26 @@
     // Requirements
     //------------------------------------------------------------------------------
     
    -var getLast = require("../util").getLast;
    +var lodash = require("lodash");
     
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
     
    -var FALLTHROUGH_COMMENT = /falls?\s?through/i;
    +var DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/i;
     
     /**
      * Checks whether or not a given node has a fallthrough comment.
      * @param {ASTNode} node - A SwitchCase node to get comments.
      * @param {RuleContext} context - A rule context which stores comments.
    - * @returns {boolean} `true` if the node has a fallthrough comment.
    + * @param {RegExp} fallthroughCommentPattern - A pattern to match comment to.
    + * @returns {boolean} `true` if the node has a valid fallthrough comment.
      */
    -function hasFallthroughComment(node, context) {
    +function hasFallthroughComment(node, context, fallthroughCommentPattern) {
         var sourceCode = context.getSourceCode();
    -    var comment = getLast(sourceCode.getComments(node).leading);
    +    var comment = lodash.last(sourceCode.getComments(node).leading);
     
    -    return Boolean(comment && FALLTHROUGH_COMMENT.test(comment.value));
    +    return Boolean(comment && fallthroughCommentPattern.test(comment.value));
     }
     
     /**
    @@ -38,50 +39,97 @@ function isReachable(segment) {
         return segment.reachable;
     }
     
    +/**
    + * Checks whether a node and a token are separated by blank lines
    + * @param {ASTNode} node - The node to check
    + * @param {Token} token - The token to compare against
    + * @returns {boolean} `true` if there are blank lines between node and token
    + */
    +function hasBlankLinesBetween(node, token) {
    +    return token.loc.start.line > node.loc.end.line + 1;
    +}
    +
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var currentCodePath = null;
    -
    -    // We need to use leading comments of the next SwitchCase node because
    -    // trailing comments is wrong if semicolons are omitted.
    -    var fallthroughCase = null;
    -
    -    return {
    -        "onCodePathStart": function(codePath) {
    -            currentCodePath = codePath;
    -        },
    -        "onCodePathEnd": function() {
    -            currentCodePath = currentCodePath.upper;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow fallthrough of `case` statements",
    +            category: "Best Practices",
    +            recommended: true
             },
     
    -        "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
    -                });
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    commentPattern: {
    +                        type: "string"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -            fallthroughCase = null;
    -        },
    +        ]
    +    },
     
    -        "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;
    -            }
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var currentCodePath = null;
    +        var sourceCode = context.getSourceCode();
    +
    +        /*
    +         * We need to use leading comments of the next SwitchCase node because
    +         * trailing comments is wrong if semicolons are omitted.
    +         */
    +        var fallthroughCase = null;
    +        var fallthroughCommentPattern = null;
    +
    +        if (options.commentPattern) {
    +            fallthroughCommentPattern = new RegExp(options.commentPattern);
    +        } else {
    +            fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT;
             }
    -    };
    -};
     
    -module.exports.schema = [];
    +        return {
    +            onCodePathStart: function(codePath) {
    +                currentCodePath = codePath;
    +            },
    +            onCodePathEnd: function() {
    +                currentCodePath = currentCodePath.upper;
    +            },
    +
    +            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, fallthroughCommentPattern)) {
    +                    context.report({
    +                        message: "Expected a 'break' statement before '{{type}}'.",
    +                        data: {type: node.test ? "case" : "default"},
    +                        node: node
    +                    });
    +                }
    +                fallthroughCase = null;
    +            },
    +
    +            "SwitchCase:exit": function(node) {
    +                var nextToken = sourceCode.getTokenAfter(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 || hasBlankLinesBetween(node, nextToken)) &&
    +                    lodash.last(node.parent.cases) !== node) {
    +                    fallthroughCase = node;
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-floating-decimal.js b/tools/eslint/lib/rules/no-floating-decimal.js
    index 61a84f5e46efaa..56ebd3989a4eb8 100644
    --- a/tools/eslint/lib/rules/no-floating-decimal.js
    +++ b/tools/eslint/lib/rules/no-floating-decimal.js
    @@ -9,22 +9,32 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow leading or trailing decimal points in numeric literals",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    -        "Literal": function(node) {
    +        schema: []
    +    },
     
    -            if (typeof node.value === "number") {
    -                if (node.raw.indexOf(".") === 0) {
    -                    context.report(node, "A leading decimal point can be confused with a dot.");
    -                }
    -                if (node.raw.indexOf(".") === node.raw.length - 1) {
    -                    context.report(node, "A trailing decimal point can be confused with a dot.");
    +    create: function(context) {
    +
    +        return {
    +            Literal: function(node) {
    +
    +                if (typeof node.value === "number") {
    +                    if (node.raw.indexOf(".") === 0) {
    +                        context.report(node, "A leading decimal point can be confused with a dot.");
    +                    }
    +                    if (node.raw.indexOf(".") === node.raw.length - 1) {
    +                        context.report(node, "A trailing decimal point can be confused with a dot.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-func-assign.js b/tools/eslint/lib/rules/no-func-assign.js
    index 1ed3042cc03241..ac3afe55c05533 100644
    --- a/tools/eslint/lib/rules/no-func-assign.js
    +++ b/tools/eslint/lib/rules/no-func-assign.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use of function declaration identifiers as variables.
      * @author Ian Christian Myers
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -12,45 +11,56 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    /**
    -     * Reports a reference if is non initializer and writable.
    -     * @param {References} references - Collection of reference to check.
    -     * @returns {void}
    -     */
    -    function checkReference(references) {
    -        astUtils.getModifyingReferences(references).forEach(function(reference) {
    -            context.report(
    -                reference.identifier,
    -                "'{{name}}' is a function.",
    -                {name: reference.identifier.name});
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning `function` declarations",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
     
    -    /**
    -     * 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);
    +        /**
    +         * Reports a reference if is non initializer and writable.
    +         * @param {References} references - Collection of reference to check.
    +         * @returns {void}
    +         */
    +        function checkReference(references) {
    +            astUtils.getModifyingReferences(references).forEach(function(reference) {
    +                context.report(
    +                    reference.identifier,
    +                    "'{{name}}' is a function.",
    +                    {name: reference.identifier.name});
    +            });
             }
    -    }
     
    -    /**
    -     * 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);
    -    }
    +        /**
    +         * 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);
    +            }
    +        }
     
    -    return {
    -        "FunctionDeclaration": checkForFunction,
    -        "FunctionExpression": checkForFunction
    -    };
    -};
    +        /**
    +         * 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);
    +        }
     
    -module.exports.schema = [];
    +        return {
    +            FunctionDeclaration: checkForFunction,
    +            FunctionExpression: checkForFunction
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-implicit-coercion.js b/tools/eslint/lib/rules/no-implicit-coercion.js
    index d45970020db577..058d9f3572e4c9 100644
    --- a/tools/eslint/lib/rules/no-implicit-coercion.js
    +++ b/tools/eslint/lib/rules/no-implicit-coercion.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow the type conversions with shorter notations.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -139,103 +138,119 @@ function getOtherOperand(node, value) {
         }
         return node.left;
     }
    +
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = parseOptions(context.options[0]),
    -        operatorAllowed = false;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow shorthand type conversions",
    +            category: "Best Practices",
    +            recommended: 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)
    -                    });
    -            }
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                boolean: {
    +                    type: "boolean"
    +                },
    +                number: {
    +                    type: "boolean"
    +                },
    +                string: {
    +                    type: "boolean"
    +                },
    +                allow: {
    +                    type: "array",
    +                    items: {
    +                        enum: ALLOWABLE_OPERATORS
    +                    },
    +                    uniqueItems: true
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
     
    -            // +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)
    -                    });
    -            }
    -        },
    +    create: function(context) {
    +        var options = parseOptions(context.options[0]),
    +            operatorAllowed = false;
     
    -        // 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)
    -                    });
    -            }
    +        return {
    +            UnaryExpression: function(node) {
     
    -            // "" + foo
    -            operatorAllowed = options.allow.indexOf("+") >= 0;
    -            if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) {
    -                context.report(
    -                    node,
    -                    "use `String({{code}})` instead.", {
    -                        code: context.getSource(getOtherOperand(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)
    +                        });
    +                }
     
    -        "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, ""))
    -                    });
    -            }
    -        }
    -    };
    -};
    +                // ~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)
    +                        });
    +                }
     
    -module.exports.schema = [{
    -    "type": "object",
    -    "properties": {
    -        "boolean": {
    -            "type": "boolean"
    -        },
    -        "number": {
    -            "type": "boolean"
    -        },
    -        "string": {
    -            "type": "boolean"
    -        },
    -        "allow": {
    -            "type": "array",
    -            "items": {
    -                "enum": ALLOWABLE_OPERATORS
    +                // +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)
    +                        });
    +                }
                 },
    -            "uniqueItems": true
    -        }
    -    },
    -    "additionalProperties": false
    -}];
    +
    +            // 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, ""))
    +                        });
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-implicit-globals.js b/tools/eslint/lib/rules/no-implicit-globals.js
    index 2f4c1fff9ce52f..c2768ea1a0951f 100644
    --- a/tools/eslint/lib/rules/no-implicit-globals.js
    +++ b/tools/eslint/lib/rules/no-implicit-globals.js
    @@ -1,9 +1,7 @@
     /**
      * @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";
     
    @@ -11,36 +9,47 @@
     // 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.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `var` and named `function` declarations in the global scope",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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;
    -                }
    +                scope.implicit.variables.forEach(function(variable) {
    +                    var scopeVariable = scope.set.get(variable.name);
     
    -                variable.defs.forEach(function(def) {
    -                    context.report(def.node, "Implicit global variable, assign as global property instead.");
    +                    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 971b7b4c765fc2..7c1ed2fb6eb989 100644
    --- a/tools/eslint/lib/rules/no-implied-eval.js
    +++ b/tools/eslint/lib/rules/no-implied-eval.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval
      * @author James Allardice
    - * @copyright 2015 Mathias Schreck. All rights reserved.
    - * @copyright 2013 James Allardice. All rights reserved.
      */
     
     "use strict";
    @@ -11,133 +9,152 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    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
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * 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 last(arr) {
    -        return arr ? arr[arr.length - 1] : null;
    -    }
    -
    -    /**
    -     * 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 potentially an implied eval.
    -     * @private
    -     */
    -    function isImpliedEvalMemberExpression(node) {
    -        var object = node.object,
    -            property = node.property,
    -            hasImpliedEvalName = CALLEE_RE.test(property.name) || CALLEE_RE.test(property.value);
    -
    -        return object.name === "window" && hasImpliedEvalName;
    -    }
    -
    -    /**
    -     * 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 isImpliedEvalCallExpression(node) {
    -        var isMemberExpression = (node.callee.type === "MemberExpression"),
    -            isIdentifier = (node.callee.type === "Identifier"),
    -            isImpliedEvalCallee =
    -                (isIdentifier && CALLEE_RE.test(node.callee.name)) ||
    -                (isMemberExpression && isImpliedEvalMemberExpression(node.callee));
    -
    -        return isImpliedEvalCallee && node.arguments.length;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `eval()`-like methods",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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]);
    -    }
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        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
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * 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 last(arr) {
    +            return arr ? arr[arr.length - 1] : null;
    +        }
     
    -    /**
    -     * 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.");
    +        /**
    +         * 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 potentially an implied eval.
    +         * @private
    +         */
    +        function isImpliedEvalMemberExpression(node) {
    +            var object = node.object,
    +                property = node.property,
    +                hasImpliedEvalName = CALLEE_RE.test(property.name) || CALLEE_RE.test(property.value);
    +
    +            return object.name === "window" && hasImpliedEvalName;
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * 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 isImpliedEvalCallExpression(node) {
    +            var isMemberExpression = (node.callee.type === "MemberExpression"),
    +                isIdentifier = (node.callee.type === "Identifier"),
    +                isImpliedEvalCallee =
    +                    (isIdentifier && CALLEE_RE.test(node.callee.name)) ||
    +                    (isMemberExpression && isImpliedEvalMemberExpression(node.callee));
    +
    +            return isImpliedEvalCallee && node.arguments.length;
    +        }
     
    -    return {
    -        "CallExpression": function(node) {
    -            if (isImpliedEvalCallExpression(node)) {
    -                // call expressions create a new substack
    -                impliedEvalAncestorsStack.push([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) {
     
    -        "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();
    -            }
    -        },
    +            // make sure our parent is marked
    +            return node.parent === last(last(impliedEvalAncestorsStack)) &&
     
    -        "BinaryExpression": function(node) {
    -            if (node.operator === "+" && hasImpliedEvalParent(node)) {
    -                last(impliedEvalAncestorsStack).push(node);
    -            }
    -        },
    +                // if our parent is a CallExpression, make sure we're the first argument
    +                (node.parent.type !== "CallExpression" || node === node.parent.arguments[0]);
    +        }
     
    -        "BinaryExpression:exit": function(node) {
    -            if (node === last(last(impliedEvalAncestorsStack))) {
    -                last(impliedEvalAncestorsStack).pop();
    +        /**
    +         * 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.");
                 }
    -        },
    +        }
     
    -        "Literal": function(node) {
    -            if (typeof node.value === "string") {
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            CallExpression: function(node) {
    +                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);
                 }
    -        },
    -
    -        "TemplateLiteral": function(node) {
    -            checkString(node);
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-inline-comments.js b/tools/eslint/lib/rules/no-inline-comments.js
    index 4048802bc8c46a..7835ed30fcc0fe 100644
    --- a/tools/eslint/lib/rules/no-inline-comments.js
    +++ b/tools/eslint/lib/rules/no-inline-comments.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Enforces or disallows inline comments.
      * @author Greg Cochard
    - * @copyright 2014 Greg Cochard. All rights reserved.
      */
     "use strict";
     
    @@ -11,44 +10,54 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow inline comments after code",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Will check that comments are not on lines starting with or ending with code
    -     * @param {ASTNode} node The comment node to check
    -     * @private
    -     * @returns {void}
    -     */
    -    function testCodeAroundComment(node) {
    +        schema: []
    +    },
     
    -        // Get the whole line and cut it off at the start of the comment
    -        var startLine = String(context.getSourceLines()[node.loc.start.line - 1]);
    -        var endLine = String(context.getSourceLines()[node.loc.end.line - 1]);
    +    create: function(context) {
     
    -        var preamble = startLine.slice(0, node.loc.start.column).trim();
    +        /**
    +         * Will check that comments are not on lines starting with or ending with code
    +         * @param {ASTNode} node The comment node to check
    +         * @private
    +         * @returns {void}
    +         */
    +        function testCodeAroundComment(node) {
     
    -        // Also check after the comment
    -        var postamble = endLine.slice(node.loc.end.column).trim();
    +            // Get the whole line and cut it off at the start of the comment
    +            var startLine = String(context.getSourceLines()[node.loc.start.line - 1]);
    +            var endLine = String(context.getSourceLines()[node.loc.end.line - 1]);
     
    -        // Check that this comment isn't an ESLint directive
    -        var isDirective = astUtils.isDirectiveComment(node);
    +            var preamble = startLine.slice(0, node.loc.start.column).trim();
     
    -        // Should be empty if there was only whitespace around the comment
    -        if (!isDirective && (preamble || postamble)) {
    -            context.report(node, "Unexpected comment inline with code.");
    +            // 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 (!isDirective && (preamble || postamble)) {
    +                context.report(node, "Unexpected comment inline with code.");
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -    return {
    +        return {
     
    -        "LineComment": testCodeAroundComment,
    -        "BlockComment": testCodeAroundComment
    +            LineComment: testCodeAroundComment,
    +            BlockComment: testCodeAroundComment
     
    -    };
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-inner-declarations.js b/tools/eslint/lib/rules/no-inner-declarations.js
    index f5503eea8e7f61..3471ce8cc735b8 100644
    --- a/tools/eslint/lib/rules/no-inner-declarations.js
    +++ b/tools/eslint/lib/rules/no-inner-declarations.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to enforce declarations in program or function body root.
      * @author Brandon Mills
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     
     "use strict";
    @@ -10,69 +9,81 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    /**
    -     * Find the nearest Program or Function ancestor node.
    -     * @returns {Object} Ancestor's type and distance from node.
    -     */
    -    function nearestBody() {
    -        var ancestors = context.getAncestors(),
    -            ancestor = ancestors.pop(),
    -            generation = 1;
    -
    -        while (ancestor && ["Program", "FunctionDeclaration",
    -                "FunctionExpression", "ArrowFunctionExpression"
    -                ].indexOf(ancestor.type) < 0) {
    -            generation += 1;
    -            ancestor = ancestors.pop();
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `function` or `var` declarations in nested blocks",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -        return {
    -            // Type of containing ancestor
    -            type: ancestor.type,
    -            // Separation between ancestor and node
    -            distance: generation
    -        };
    -    }
    +        schema: [
    +            {
    +                enum: ["functions", "both"]
    +            }
    +        ]
    +    },
     
    -    /**
    -     * Ensure that a given node is at a program or function body's root.
    -     * @param {ASTNode} node Declaration node to check.
    -     * @returns {void}
    -     */
    -    function check(node) {
    -        var body = nearestBody(node),
    -            valid = ((body.type === "Program" && body.distance === 1) ||
    -                body.distance === 2);
    -
    -        if (!valid) {
    -            context.report(node, "Move {{type}} declaration to {{body}} root.",
    -                {
    -                    type: (node.type === "FunctionDeclaration" ?
    -                        "function" : "variable"),
    -                    body: (body.type === "Program" ?
    -                        "program" : "function body")
    -                }
    -            );
    +    create: function(context) {
    +
    +        /**
    +         * Find the nearest Program or Function ancestor node.
    +         * @returns {Object} Ancestor's type and distance from node.
    +         */
    +        function nearestBody() {
    +            var ancestors = context.getAncestors(),
    +                ancestor = ancestors.pop(),
    +                generation = 1;
    +
    +            while (ancestor && ["Program", "FunctionDeclaration",
    +                    "FunctionExpression", "ArrowFunctionExpression"
    +                    ].indexOf(ancestor.type) < 0) {
    +                generation += 1;
    +                ancestor = ancestors.pop();
    +            }
    +
    +            return {
    +
    +                // Type of containing ancestor
    +                type: ancestor.type,
    +
    +                // Separation between ancestor and node
    +                distance: generation
    +            };
             }
    -    }
     
    -    return {
    +        /**
    +         * Ensure that a given node is at a program or function body's root.
    +         * @param {ASTNode} node Declaration node to check.
    +         * @returns {void}
    +         */
    +        function check(node) {
    +            var body = nearestBody(node),
    +                valid = ((body.type === "Program" && body.distance === 1) ||
    +                    body.distance === 2);
     
    -        "FunctionDeclaration": check,
    -        "VariableDeclaration": function(node) {
    -            if (context.options[0] === "both" && node.kind === "var") {
    -                check(node);
    +            if (!valid) {
    +                context.report(node, "Move {{type}} declaration to {{body}} root.",
    +                    {
    +                        type: (node.type === "FunctionDeclaration" ?
    +                            "function" : "variable"),
    +                        body: (body.type === "Program" ?
    +                            "program" : "function body")
    +                    }
    +                );
                 }
             }
     
    -    };
    +        return {
     
    -};
    +            FunctionDeclaration: check,
    +            VariableDeclaration: function(node) {
    +                if (context.options[0] === "both" && node.kind === "var") {
    +                    check(node);
    +                }
    +            }
    +
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["functions", "both"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-invalid-regexp.js b/tools/eslint/lib/rules/no-invalid-regexp.js
    index 1598bc60203075..6f8b8673786532 100644
    --- a/tools/eslint/lib/rules/no-invalid-regexp.js
    +++ b/tools/eslint/lib/rules/no-invalid-regexp.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Validate strings passed to the RegExp constructor
      * @author Michael Ficarra
    - * @copyright 2014 Michael Ficarra. All rights reserved.
      */
     "use strict";
     
    @@ -15,51 +14,83 @@ var espree = require("espree");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow invalid regular expression strings in `RegExp` constructors",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    /**
    -     * 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";
    -    }
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                allowConstructorFlags: {
    +                    type: "array",
    +                    items: {
    +                        type: "string"
    +                    }
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
     
    -    /**
    -     * 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) {
    -                context.report(node, e.message);
    -            }
    +    create: function(context) {
    +
    +        var options = context.options[0],
    +            allowedFlags = "";
    +
    +        if (options && options.allowConstructorFlags) {
    +            allowedFlags = options.allowConstructorFlags.join("");
    +        }
    +
    +        /**
    +         * Check if node is a string
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {boolean} True if its a string
    +         * @private
    +         */
    +        function isString(node) {
    +            return node && node.type === "Literal" && typeof node.value === "string";
    +        }
    +
    +        /**
    +         * Validate strings passed to the RegExp constructor
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function check(node) {
    +            if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
    +                var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";
     
    -            if (flags) {
    +                if (allowedFlags) {
    +                    flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), "");
    +                }
     
                     try {
    -                    espree.parse("/./" + flags, context.parserOptions);
    -                } catch (ex) {
    -                    context.report(node, "Invalid flags supplied to RegExp constructor '" + flags + "'");
    +                    void new RegExp(node.arguments[0].value);
    +                } catch (e) {
    +                    context.report(node, e.message);
    +                }
    +
    +                if (flags) {
    +
    +                    try {
    +                        espree.parse("/./" + flags, context.parserOptions);
    +                    } catch (ex) {
    +                        context.report(node, "Invalid flags supplied to RegExp constructor '" + flags + "'");
    +                    }
                     }
    -            }
     
    +            }
             }
    -    }
     
    -    return {
    -        "CallExpression": check,
    -        "NewExpression": check
    -    };
    +        return {
    +            CallExpression: check,
    +            NewExpression: check
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-invalid-this.js b/tools/eslint/lib/rules/no-invalid-this.js
    index 0bde480c2ad903..198bfd706ad49d 100644
    --- a/tools/eslint/lib/rules/no-invalid-this.js
    +++ b/tools/eslint/lib/rules/no-invalid-this.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -17,91 +15,108 @@ 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
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `this` keywords outside of classes or class-like objects",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Pops the current checking context from the stack.
    -     * @returns {void}
    -     */
    -    function exitFunction() {
    -        stack.pop();
    -    }
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var stack = [],
    +            sourceCode = context.getSourceCode();
     
    -    return {
    -        // `this` is invalid only under strict mode.
    -        // Modules is always strict mode.
    -        "Program": function(node) {
    -            var scope = context.getScope(),
    -                features = context.parserOptions.ecmaFeatures || {};
    +        /**
    +         * 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: true,
    +                init: !context.getScope().isStrict,
                     node: node,
    -                valid: !(
    -                    scope.isStrict ||
    -                    node.sourceType === "module" ||
    -                    (features.globalReturn && scope.childScopes[0].isStrict)
    -                )
    +                valid: true
                 });
    -        },
    -        "Program:exit": function() {
    +        }
    +
    +        /**
    +         * 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)
    +                    )
    +                });
    +            },
     
    -        "FunctionDeclaration": enterFunction,
    -        "FunctionDeclaration:exit": exitFunction,
    -        "FunctionExpression": enterFunction,
    -        "FunctionExpression:exit": exitFunction,
    +            "Program:exit": function() {
    +                stack.pop();
    +            },
     
    -        // 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'.");
    +            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 b49f747b8a08be..1dbea8f5a936fa 100644
    --- a/tools/eslint/lib/rules/no-irregular-whitespace.js
    +++ b/tools/eslint/lib/rules/no-irregular-whitespace.js
    @@ -1,7 +1,7 @@
     /**
      * @fileoverview Rule to disalow whitespace that is not a tab or space, whitespace inside strings and comments are allowed
      * @author Jonathan Kingston
    - * @copyright 2014 Jonathan Kingston. All rights reserved.
    + * @author Christophe Porteneuve
      */
     
     "use strict";
    @@ -10,126 +10,197 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var irregularWhitespace = /[\u0085\u00A0\ufeff\f\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mg,
    -        irregularLineTerminators = /[\u2028\u2029]/mg;
    -
    -    // Module store of errors that we have found
    -    var errors = [];
    -
    -    /**
    -     * Removes errors that occur inside a string node
    -     * @param {ASTNode} node to check for matching errors.
    -     * @returns {void}
    -     * @private
    -     */
    -    function removeStringError(node) {
    -        var locStart = node.loc.start;
    -        var locEnd = node.loc.end;
    -
    -        errors = errors.filter(function(error) {
    -            var errorLoc = error[1];
    -            if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
    -                if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) {
    -                    return false;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow irregular whitespace outside of strings and comments",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    skipComments: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var irregularWhitespace = /[\u0085\u00A0\ufeff\f\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mg,
    +            irregularLineTerminators = /[\u2028\u2029]/mg;
    +
    +        // Module store of errors that we have found
    +        var errors = [];
    +
    +        // Comment nodes.  We accumulate these as we go, so we can be sure to trigger them after the whole `Program` entity is parsed, even for top-of-file comments.
    +        var commentNodes = [];
    +
    +        // Lookup the `skipComments` option, which defaults to `false`.
    +        var options = context.options[0] || {};
    +        var skipComments = !!options.skipComments;
    +
    +        /**
    +         * Removes errors that occur inside a string node
    +         * @param {ASTNode} node to check for matching errors.
    +         * @returns {void}
    +         * @private
    +         */
    +        function removeWhitespaceError(node) {
    +            var locStart = node.loc.start;
    +            var locEnd = node.loc.end;
    +
    +            errors = errors.filter(function(error) {
    +                var errorLoc = error[1];
    +
    +                if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
    +                    if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) {
    +                        return false;
    +                    }
    +                }
    +                return true;
    +            });
    +        }
    +
    +        /**
    +         * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
    +         * @param {ASTNode} node to check for matching errors.
    +         * @returns {void}
    +         * @private
    +         */
    +        function removeInvalidNodeErrorsInIdentifierOrLiteral(node) {
    +            if (typeof node.value === "string") {
    +
    +                // If we have irregular characters remove them from the errors list
    +                if (node.raw.match(irregularWhitespace) || node.raw.match(irregularLineTerminators)) {
    +                    removeWhitespaceError(node);
                     }
                 }
    -            return true;
    -        });
    -    }
    +        }
     
    -    /**
    -     * Checks nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
    -     * @param {ASTNode} node to check for matching errors.
    -     * @returns {void}
    -     * @private
    -     */
    -    function removeInvalidNodeErrors(node) {
    -        if (typeof node.value === "string") {
    -            // If we have irregular characters remove them from the errors list
    -            if (node.raw.match(irregularWhitespace) || node.raw.match(irregularLineTerminators)) {
    -                removeStringError(node);
    +        /**
    +         * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
    +         * @param {ASTNode} node to check for matching errors.
    +         * @returns {void}
    +         * @private
    +         */
    +        function removeInvalidNodeErrorsInComment(node) {
    +            if (node.value.match(irregularWhitespace) || node.value.match(irregularLineTerminators)) {
    +                removeWhitespaceError(node);
                 }
             }
    -    }
     
    -    /**
    -     * Checks the program source for irregular whitespace
    -     * @param {ASTNode} node The program node
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkForIrregularWhitespace(node) {
    -        var sourceLines = context.getSourceLines();
    -
    -        sourceLines.forEach(function(sourceLine, lineIndex) {
    -            var lineNumber = lineIndex + 1,
    +        /**
    +         * Checks the program source for irregular whitespace
    +         * @param {ASTNode} node The program node
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkForIrregularWhitespace(node) {
    +            var sourceLines = context.getSourceLines();
    +
    +            sourceLines.forEach(function(sourceLine, lineIndex) {
    +                var lineNumber = lineIndex + 1,
    +                    location,
    +                    match;
    +
    +                while ((match = irregularWhitespace.exec(sourceLine)) !== null) {
    +                    location = {
    +                        line: lineNumber,
    +                        column: match.index
    +                    };
    +
    +                    errors.push([node, location, "Irregular whitespace not allowed"]);
    +                }
    +            });
    +        }
    +
    +        /**
    +         * Checks the program source for irregular line terminators
    +         * @param {ASTNode} node The program node
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkForIrregularLineTerminators(node) {
    +            var source = context.getSource(),
    +                sourceLines = context.getSourceLines(),
    +                linebreaks = source.match(/\r\n|\r|\n|\u2028|\u2029/g),
    +                lastLineIndex = -1,
    +                lineIndex,
                     location,
                     match;
     
    -            while ((match = irregularWhitespace.exec(sourceLine)) !== null) {
    +            while ((match = irregularLineTerminators.exec(source)) !== null) {
    +                lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0;
    +
                     location = {
    -                    line: lineNumber,
    -                    column: match.index
    +                    line: lineIndex + 1,
    +                    column: sourceLines[lineIndex].length
                     };
     
                     errors.push([node, location, "Irregular whitespace not allowed"]);
    +                lastLineIndex = lineIndex;
                 }
    -        });
    -    }
    -
    -    /**
    -     * Checks the program source for irregular line terminators
    -     * @param {ASTNode} node The program node
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkForIrregularLineTerminators(node) {
    -        var source = context.getSource(),
    -            sourceLines = context.getSourceLines(),
    -            linebreaks = source.match(/\r\n|\r|\n|\u2028|\u2029/g),
    -            lastLineIndex = -1,
    -            lineIndex,
    -            location,
    -            match;
    -
    -        while ((match = irregularLineTerminators.exec(source)) !== null) {
    -            lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0;
    -
    -            location = {
    -                line: lineIndex + 1,
    -                column: sourceLines[lineIndex].length
    -            };
    -
    -            errors.push([node, location, "Irregular whitespace not allowed"]);
    -            lastLineIndex = lineIndex;
             }
    -    }
     
    -    return {
    -        "Program": function(node) {
    -            /**
    -             * As we can easily fire warnings for all white space issues with all the source its simpler to fire them here
    -             * This means we can check all the application code without having to worry about issues caused in the parser tokens
    -             * When writing this code also evaluating per node was missing out connecting tokens in some cases
    -             * We can later filter the errors when they are found to be not an issue in nodes we don't care about
    -             */
    -
    -            checkForIrregularWhitespace(node);
    -            checkForIrregularLineTerminators(node);
    -        },
    +        /**
    +         * Stores a comment node (`LineComment` or `BlockComment`) for later stripping of errors within; a necessary deferring of processing to deal with top-of-file comments.
    +         * @param {ASTNode} node The comment node
    +         * @returns {void}
    +         * @private
    +         */
    +        function rememberCommentNode(node) {
    +            commentNodes.push(node);
    +        }
     
    -        "Identifier": removeInvalidNodeErrors,
    -        "Literal": removeInvalidNodeErrors,
    -        "Program:exit": function() {
    +        /**
    +         * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`.
    +         * @returns {void}
    +         * @private
    +         */
    +        function noop() {}
    +
    +        return {
    +            Program: function(node) {
    +
    +                /*
    +                 * As we can easily fire warnings for all white space issues with
    +                 * all the source its simpler to fire them here.
    +                 * This means we can check all the application code without having
    +                 * to worry about issues caused in the parser tokens.
    +                 * When writing this code also evaluating per node was missing out
    +                 * connecting tokens in some cases.
    +                 * We can later filter the errors when they are found to be not an
    +                 * issue in nodes we don't care about.
    +                 */
    +
    +                checkForIrregularWhitespace(node);
    +                checkForIrregularLineTerminators(node);
    +            },
    +
    +            Identifier: removeInvalidNodeErrorsInIdentifierOrLiteral,
    +            Literal: removeInvalidNodeErrorsInIdentifierOrLiteral,
    +            LineComment: skipComments ? rememberCommentNode : noop,
    +            BlockComment: skipComments ? rememberCommentNode : noop,
    +            "Program:exit": function() {
    +
    +                if (skipComments) {
    +
    +                    // First strip errors occurring in comment nodes.  We have to do this post-`Program` to deal with top-of-file comments.
    +                    commentNodes.forEach(removeInvalidNodeErrorsInComment);
    +                }
     
    -            // If we have any errors remaining report on them
    -            errors.forEach(function(error) {
    -                context.report.apply(context, error);
    -            });
    -        }
    -    };
    +                // If we have any errors remaining report on them
    +                errors.forEach(function(error) {
    +                    context.report.apply(context, error);
    +                });
    +            }
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-iterator.js b/tools/eslint/lib/rules/no-iterator.js
    index 817980c99f663a..67c1c1bb2a22fc 100644
    --- a/tools/eslint/lib/rules/no-iterator.js
    +++ b/tools/eslint/lib/rules/no-iterator.js
    @@ -9,20 +9,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of the `__iterator__` property",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "MemberExpression": function(node) {
    +    create: function(context) {
     
    -            if (node.property &&
    -                    (node.property.type === "Identifier" && node.property.name === "__iterator__" && !node.computed) ||
    -                    (node.property.type === "Literal" && node.property.value === "__iterator__")) {
    -                context.report(node, "Reserved name '__iterator__'.");
    +        return {
    +
    +            MemberExpression: function(node) {
    +
    +                if (node.property &&
    +                        (node.property.type === "Identifier" && node.property.name === "__iterator__" && !node.computed) ||
    +                        (node.property.type === "Literal" && node.property.value === "__iterator__")) {
    +                    context.report(node, "Reserved name '__iterator__'.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-label-var.js b/tools/eslint/lib/rules/no-label-var.js
    index 20fbfc182df41f..7c6d56f3552a3a 100644
    --- a/tools/eslint/lib/rules/no-label-var.js
    +++ b/tools/eslint/lib/rules/no-label-var.js
    @@ -15,43 +15,53 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * 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;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow labels that share a name with a variable",
    +            category: "Variables",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * 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;
    +        }
     
    -    return {
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -        "LabeledStatement": function(node) {
    +        return {
     
    -            // Fetch the innermost scope.
    -            var scope = context.getScope();
    +            LabeledStatement: function(node) {
     
    -            // Recursively find the identifier walking up the scope, starting
    -            // with the innermost scope.
    -            if (findIdentifier(scope, node.label.name)) {
    -                context.report(node, "Found identifier with same name as label.");
    +                // Fetch the innermost scope.
    +                var scope = context.getScope();
    +
    +                // Recursively find the identifier walking up the scope, starting
    +                // with the innermost scope.
    +                if (findIdentifier(scope, node.label.name)) {
    +                    context.report(node, "Found identifier with same name as label.");
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-labels.js b/tools/eslint/lib/rules/no-labels.js
    index 7d7ac206c135f3..da0cd8e7426643 100644
    --- a/tools/eslint/lib/rules/no-labels.js
    +++ b/tools/eslint/lib/rules/no-labels.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -16,119 +14,130 @@ 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";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow labeled statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowLoop: {
    +                        type: "boolean"
    +                    },
    +                    allowSwitch: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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 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;
    +        /**
    +         * 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;
                 }
    -            info = info.upper;
             }
     
    -        /* istanbul ignore next: syntax error */
    -        return "other";
    -    }
    -
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "LabeledStatement": function(node) {
    -            scopeInfo = {
    -                label: node.label.name,
    -                kind: getBodyKind(node.body),
    -                upper: scopeInfo
    -            };
    -        },
    -
    -        "LabeledStatement:exit": function(node) {
    -            if (!isAllowed(scopeInfo.kind)) {
    -                context.report({
    -                    node: node,
    -                    message: "Unexpected labeled statement."
    -                });
    +        /**
    +         * 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;
                 }
     
    -            scopeInfo = scopeInfo.upper;
    -        },
    +            /* istanbul ignore next: syntax error */
    +            return "other";
    +        }
     
    -        "BreakStatement": function(node) {
    -            if (node.label && !isAllowed(getKind(node.label.name))) {
    -                context.report({
    -                    node: node,
    -                    message: "Unexpected label in break statement."
    -                });
    -            }
    -        },
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            LabeledStatement: function(node) {
    +                scopeInfo = {
    +                    label: node.label.name,
    +                    kind: getBodyKind(node.body),
    +                    upper: scopeInfo
    +                };
    +            },
     
    -        "ContinueStatement": function(node) {
    -            if (node.label && !isAllowed(getKind(node.label.name))) {
    -                context.report({
    -                    node: node,
    -                    message: "Unexpected label in continue statement."
    -                });
    -            }
    -        }
    -    };
    +            "LabeledStatement:exit": function(node) {
    +                if (!isAllowed(scopeInfo.kind)) {
    +                    context.report({
    +                        node: node,
    +                        message: "Unexpected labeled statement."
    +                    });
    +                }
     
    -};
    +                scopeInfo = scopeInfo.upper;
    +            },
     
    -module.exports.schema = [
    -    {
    -        type: "object",
    -        properties: {
    -            allowLoop: {
    -                type: "boolean"
    +            BreakStatement: function(node) {
    +                if (node.label && !isAllowed(getKind(node.label.name))) {
    +                    context.report({
    +                        node: node,
    +                        message: "Unexpected label in break statement."
    +                    });
    +                }
                 },
    -            allowSwitch: {
    -                type: "boolean"
    +
    +            ContinueStatement: function(node) {
    +                if (node.label && !isAllowed(getKind(node.label.name))) {
    +                    context.report({
    +                        node: node,
    +                        message: "Unexpected label in continue statement."
    +                    });
    +                }
                 }
    -        },
    -        additionalProperties: false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-lone-blocks.js b/tools/eslint/lib/rules/no-lone-blocks.js
    index 07f819ec78f7fc..113cd89b937c66 100644
    --- a/tools/eslint/lib/rules/no-lone-blocks.js
    +++ b/tools/eslint/lib/rules/no-lone-blocks.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag blocks with no reason to exist
      * @author Brandon Mills
    - * @copyright 2015 Roberto Vidal. All rights reserved.
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     
     "use strict";
    @@ -11,92 +9,104 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    // A stack of lone blocks to be checked for block-level bindings
    -    var loneBlocks = [],
    -        ruleDef;
    -
    -    /**
    -     * Reports a node as invalid.
    -     * @param {ASTNode} node - The node to be reported.
    -     * @returns {void}
    -    */
    -    function report(node) {
    -        var parent = context.getAncestors().pop();
    -        context.report(node, parent.type === "Program" ?
    -            "Block is redundant." :
    -            "Nested block is redundant."
    -        );
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary nested blocks",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        // A stack of lone blocks to be checked for block-level bindings
    +        var loneBlocks = [],
    +            ruleDef;
    +
    +        /**
    +         * Reports a node as invalid.
    +         * @param {ASTNode} node - The node to be reported.
    +         * @returns {void}
    +        */
    +        function report(node) {
    +            var parent = context.getAncestors().pop();
    +
    +            context.report(node, parent.type === "Program" ?
    +                "Block is redundant." :
    +                "Nested block is redundant."
    +            );
    +        }
     
    -    /**
    -     * Checks for any ocurrence of BlockStatement > BlockStatement or Program > BlockStatement
    -     * @returns {boolean} True if the current node is a lone block.
    -    */
    -    function isLoneBlock() {
    -        var parent = context.getAncestors().pop();
    -        return parent.type === "BlockStatement" || parent.type === "Program";
    -    }
    +        /**
    +         * Checks for any ocurrence of BlockStatement > BlockStatement or Program > BlockStatement
    +         * @returns {boolean} True if the current node is a lone block.
    +        */
    +        function isLoneBlock() {
    +            var parent = context.getAncestors().pop();
     
    -    /**
    -     * Checks the enclosing block of the current node for block-level bindings,
    -     * and "marks it" as valid if any.
    -     * @returns {void}
    -    */
    -    function markLoneBlock() {
    -        if (loneBlocks.length === 0) {
    -            return;
    +            return parent.type === "BlockStatement" || parent.type === "Program";
             }
     
    -        var block = context.getAncestors().pop();
    +        /**
    +         * Checks the enclosing block of the current node for block-level bindings,
    +         * and "marks it" as valid if any.
    +         * @returns {void}
    +        */
    +        function markLoneBlock() {
    +            if (loneBlocks.length === 0) {
    +                return;
    +            }
     
    -        if (loneBlocks[loneBlocks.length - 1] === block) {
    -            loneBlocks.pop();
    -        }
    -    }
    +            var block = context.getAncestors().pop();
     
    -    // Default rule definition: report all lone blocks
    -    ruleDef = {
    -        BlockStatement: function(node) {
    -            if (isLoneBlock(node)) {
    -                report(node);
    +            if (loneBlocks[loneBlocks.length - 1] === block) {
    +                loneBlocks.pop();
                 }
             }
    -    };
     
    -    // ES6: report blocks without block-level bindings
    -    if (context.parserOptions.ecmaVersion >= 6) {
    +        // Default rule definition: report all lone blocks
             ruleDef = {
    -            "BlockStatement": function(node) {
    +            BlockStatement: function(node) {
                     if (isLoneBlock(node)) {
    -                    loneBlocks.push(node);
    -                }
    -            },
    -            "BlockStatement:exit": function(node) {
    -                if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) {
    -                    loneBlocks.pop();
                         report(node);
                     }
                 }
             };
     
    -        ruleDef.VariableDeclaration = function(node) {
    -            if (node.kind === "let" || node.kind === "const") {
    -                markLoneBlock(node);
    -            }
    -        };
    +        // ES6: report blocks without block-level bindings
    +        if (context.parserOptions.ecmaVersion >= 6) {
    +            ruleDef = {
    +                BlockStatement: function(node) {
    +                    if (isLoneBlock(node)) {
    +                        loneBlocks.push(node);
    +                    }
    +                },
    +                "BlockStatement:exit": function(node) {
    +                    if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) {
    +                        loneBlocks.pop();
    +                        report(node);
    +                    }
    +                }
    +            };
     
    -        ruleDef.FunctionDeclaration = function(node) {
    -            if (context.getScope().isStrict) {
    -                markLoneBlock(node);
    -            }
    -        };
    +            ruleDef.VariableDeclaration = function(node) {
    +                if (node.kind === "let" || node.kind === "const") {
    +                    markLoneBlock(node);
    +                }
    +            };
     
    -        ruleDef.ClassDeclaration = markLoneBlock;
    -    }
    +            ruleDef.FunctionDeclaration = function(node) {
    +                if (context.getScope().isStrict) {
    +                    markLoneBlock(node);
    +                }
    +            };
     
    -    return ruleDef;
    -};
    +            ruleDef.ClassDeclaration = markLoneBlock;
    +        }
     
    -module.exports.schema = [];
    +        return ruleDef;
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-lonely-if.js b/tools/eslint/lib/rules/no-lonely-if.js
    index 0d8ab9124a6e53..1efd1acc018265 100644
    --- a/tools/eslint/lib/rules/no-lonely-if.js
    +++ b/tools/eslint/lib/rules/no-lonely-if.js
    @@ -8,23 +8,33 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `if` statements as the only statement in `else` blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    -        "IfStatement": function(node) {
    -            var ancestors = context.getAncestors(),
    -                parent = ancestors.pop(),
    -                grandparent = ancestors.pop();
    +        schema: []
    +    },
     
    -            if (parent && parent.type === "BlockStatement" &&
    -                    parent.body.length === 1 && grandparent &&
    -                    grandparent.type === "IfStatement" &&
    -                    parent === grandparent.alternate) {
    -                context.report(node, "Unexpected if as the only statement in an else block.");
    +    create: function(context) {
    +
    +        return {
    +            IfStatement: function(node) {
    +                var ancestors = context.getAncestors(),
    +                    parent = ancestors.pop(),
    +                    grandparent = ancestors.pop();
    +
    +                if (parent && parent.type === "BlockStatement" &&
    +                        parent.body.length === 1 && grandparent &&
    +                        grandparent.type === "IfStatement" &&
    +                        parent === grandparent.alternate) {
    +                    context.report(node, "Unexpected if as the only statement in an else block.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-loop-func.js b/tools/eslint/lib/rules/no-loop-func.js
    index d2dd27ba771b6a..2b76093cce4d8f 100644
    --- a/tools/eslint/lib/rules/no-loop-func.js
    +++ b/tools/eslint/lib/rules/no-loop-func.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag creation of function inside a loop
      * @author Ilya Volodin
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -22,6 +21,7 @@
      */
     function getContainingLoopNode(node) {
         var parent = node.parent;
    +
         while (parent) {
             switch (parent.type) {
                 case "WhileStatement":
    @@ -29,6 +29,7 @@ function getContainingLoopNode(node) {
                     return parent;
     
                 case "ForStatement":
    +
                     // `init` is outside of the loop.
                     if (parent.init !== node) {
                         return parent;
    @@ -37,6 +38,7 @@ function getContainingLoopNode(node) {
     
                 case "ForInStatement":
                 case "ForOfStatement":
    +
                     // `right` is outside of the loop.
                     if (parent.right !== node) {
                         return parent;
    @@ -46,6 +48,7 @@ function getContainingLoopNode(node) {
                 case "ArrowFunctionExpression":
                 case "FunctionExpression":
                 case "FunctionDeclaration":
    +
                     // We don't need to check nested functions.
                     return null;
     
    @@ -133,6 +136,7 @@ function isSafe(funcNode, loopNode, reference) {
          */
         function isSafeReference(upperRef) {
             var id = upperRef.identifier;
    +
             return (
                 !upperRef.isWrite() ||
                 variable.scope.variableScope === upperRef.from.variableScope &&
    @@ -147,35 +151,48 @@ function isSafe(funcNode, loopNode, reference) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    /**
    -     * 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 loopNode = getContainingLoopNode(node);
    -        if (!loopNode) {
    -            return;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `function` declarations and expressions inside loop statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * 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 loopNode = getContainingLoopNode(node);
    +
    +            if (!loopNode) {
    +                return;
    +            }
    +
    +            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");
    +            }
             }
     
    -        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");
    -        }
    +        return {
    +            ArrowFunctionExpression: checkForLoops,
    +            FunctionExpression: checkForLoops,
    +            FunctionDeclaration: checkForLoops
    +        };
         }
    -
    -    return {
    -        "ArrowFunctionExpression": checkForLoops,
    -        "FunctionExpression": checkForLoops,
    -        "FunctionDeclaration": checkForLoops
    -    };
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-magic-numbers.js b/tools/eslint/lib/rules/no-magic-numbers.js
    index 40d885f5f81b46..2e7434c1a58f16 100644
    --- a/tools/eslint/lib/rules/no-magic-numbers.js
    +++ b/tools/eslint/lib/rules/no-magic-numbers.js
    @@ -1,32 +1,6 @@
     /**
      * @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";
    @@ -35,115 +9,136 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var config = context.options[0] || {},
    -        detectObjects = !!config.detectObjects,
    -        enforceConst = !!config.enforceConst,
    -        ignore = config.ignore || [],
    -        ignoreArrayIndexes = !!config.ignoreArrayIndexes;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow magic numbers",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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";
    -    }
    +        schema: [{
    +            type: "object",
    +            properties: {
    +                detectObjects: {
    +                    type: "boolean"
    +                },
    +                enforceConst: {
    +                    type: "boolean"
    +                },
    +                ignore: {
    +                    type: "array",
    +                    items: {
    +                        type: "number"
    +                    },
    +                    uniqueItems: true
    +                },
    +                ignoreArrayIndexes: {
    +                    type: "boolean"
    +                }
    +            },
    +            additionalProperties: false
    +        }]
    +    },
     
    -    /**
    -     * 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;
    -    }
    +    create: function(context) {
    +        var config = context.options[0] || {},
    +            detectObjects = !!config.detectObjects,
    +            enforceConst = !!config.enforceConst,
    +            ignore = config.ignore || [],
    +            ignoreArrayIndexes = !!config.ignoreArrayIndexes;
     
    -    /**
    -     * 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 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 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;
    -    }
    +        /**
    +         * 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;
    +        }
     
    -    return {
    -        "Literal": function(node) {
    -            var parent = node.parent,
    -                value = node.value,
    -                raw = node.raw,
    -                okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"];
    +        /**
    +         * 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");
    +        }
     
    -            if (!isNumber(node)) {
    -                return;
    -            }
    +        /**
    +         * Returns whether the number should be ignored when used to define a JSX prop
    +         * @param {ASTNode} parent - the non-"UnaryExpression" parent
    +         * @returns {boolean} true if the number should be ignored
    +         */
    +        function shouldIgnoreJSXNumbers(parent) {
    +            return parent.type.indexOf("JSX") === 0;
    +        }
     
    -            // 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;
    -            }
    +        /**
    +         * 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;
    +        }
     
    -            if (shouldIgnoreNumber(value) ||
    -                shouldIgnoreParseInt(parent, node) ||
    -                shouldIgnoreArrayIndexes(parent)) {
    -                return;
    -            }
    +        return {
    +            Literal: function(node) {
    +                var parent = node.parent,
    +                    value = node.value,
    +                    raw = node.raw,
    +                    okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"];
    +
    +                if (!isNumber(node)) {
    +                    return;
    +                }
    +
    +                // For negative magic numbers: update the value and parent node
    +                if (parent.type === "UnaryExpression" && parent.operator === "-") {
    +                    node = parent;
    +                    parent = node.parent;
    +                    value = -value;
    +                    raw = "-" + raw;
    +                }
    +
    +                if (shouldIgnoreNumber(value) ||
    +                    shouldIgnoreParseInt(parent, node) ||
    +                    shouldIgnoreArrayIndexes(parent) ||
    +                    shouldIgnoreJSXNumbers(parent)) {
    +                    return;
    +                }
     
    -            if (parent.type === "VariableDeclarator") {
    -                if (enforceConst && parent.parent.kind !== "const") {
    +                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 ||
    +                    (parent.type === "AssignmentExpression" && parent.operator !== "=")) {
                         context.report({
                             node: node,
    -                        message: "Number constants declarations must use 'const'"
    +                        message: "No magic number: " + raw
                         });
                     }
    -            } 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 c1b921ed5df134..b6d365a9dbb52d 100644
    --- a/tools/eslint/lib/rules/no-mixed-requires.js
    +++ b/tools/eslint/lib/rules/no-mixed-requires.js
    @@ -9,189 +9,214 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `require` calls to be mixed with regular `var` declarations",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        type: "boolean"
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            grouping: {
    +                                type: "boolean"
    +                            },
    +                            allowCall: {
    +                                type: "boolean"
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
     
    -    var grouping = false,
    -        allowCall = false,
    -        options = context.options[0];
    +    create: function(context) {
     
    -    if (typeof options === "object") {
    -        grouping = options.grouping;
    -        allowCall = options.allowCall;
    -    } else {
    -        grouping = !!options;
    -    }
    +        var grouping = false,
    +            allowCall = false,
    +            options = context.options[0];
     
    -    /**
    -     * Returns the list of built-in modules.
    -     *
    -     * @returns {string[]} An array of built-in Node.js modules.
    -     */
    -    function getBuiltinModules() {
    -        // This list is generated using `require("repl")._builtinLibs.concat('repl').sort()`
    -        // This particular list is as per nodejs v0.12.2 and iojs v0.7.1
    -        return [
    -            "assert", "buffer", "child_process", "cluster", "crypto",
    -            "dgram", "dns", "domain", "events", "fs", "http", "https",
    -            "net", "os", "path", "punycode", "querystring", "readline",
    -            "repl", "smalloc", "stream", "string_decoder", "tls", "tty",
    -            "url", "util", "v8", "vm", "zlib"
    -        ];
    -    }
    -
    -    var BUILTIN_MODULES = getBuiltinModules();
    -
    -    var DECL_REQUIRE = "require",
    -        DECL_UNINITIALIZED = "uninitialized",
    -        DECL_OTHER = "other";
    -
    -    var REQ_CORE = "core",
    -        REQ_FILE = "file",
    -        REQ_MODULE = "module",
    -        REQ_COMPUTED = "computed";
    -
    -    /**
    -     * Determines the type of a declaration statement.
    -     * @param {ASTNode} initExpression The init node of the VariableDeclarator.
    -     * @returns {string} The type of declaration represented by the expression.
    -     */
    -    function getDeclarationType(initExpression) {
    -        if (!initExpression) {
    -            // "var x;"
    -            return DECL_UNINITIALIZED;
    +        if (typeof options === "object") {
    +            grouping = options.grouping;
    +            allowCall = options.allowCall;
    +        } else {
    +            grouping = !!options;
             }
     
    -        if (initExpression.type === "CallExpression" &&
    -            initExpression.callee.type === "Identifier" &&
    -            initExpression.callee.name === "require"
    -        ) {
    -            // "var x = require('util');"
    -            return DECL_REQUIRE;
    -        } else if (allowCall &&
    -            initExpression.type === "CallExpression" &&
    -            initExpression.callee.type === "CallExpression"
    -        ) {
    -            // "var x = require('diagnose')('sub-module');"
    -            return getDeclarationType(initExpression.callee);
    -        } else if (initExpression.type === "MemberExpression") {
    -            // "var x = require('glob').Glob;"
    -            return getDeclarationType(initExpression.object);
    +        /**
    +         * Returns the list of built-in modules.
    +         *
    +         * @returns {string[]} An array of built-in Node.js modules.
    +         */
    +        function getBuiltinModules() {
    +
    +            /*
    +             * This list is generated using:
    +             * `require("repl")._builtinLibs.concat('repl').sort()`
    +             * This particular list is as per nodejs v0.12.2 and iojs v0.7.1
    +             */
    +            return [
    +                "assert", "buffer", "child_process", "cluster", "crypto",
    +                "dgram", "dns", "domain", "events", "fs", "http", "https",
    +                "net", "os", "path", "punycode", "querystring", "readline",
    +                "repl", "smalloc", "stream", "string_decoder", "tls", "tty",
    +                "url", "util", "v8", "vm", "zlib"
    +            ];
             }
     
    -        // "var x = 42;"
    -        return DECL_OTHER;
    -    }
    +        var BUILTIN_MODULES = getBuiltinModules();
     
    -    /**
    -     * Determines the type of module that is loaded via require.
    -     * @param {ASTNode} initExpression The init node of the VariableDeclarator.
    -     * @returns {string} The module type.
    -     */
    -    function inferModuleType(initExpression) {
    -        if (initExpression.type === "MemberExpression") {
    -            // "var x = require('glob').Glob;"
    -            return inferModuleType(initExpression.object);
    -        } else if (initExpression.arguments.length === 0) {
    -            // "var x = require();"
    -            return REQ_COMPUTED;
    -        }
    +        var DECL_REQUIRE = "require",
    +            DECL_UNINITIALIZED = "uninitialized",
    +            DECL_OTHER = "other";
     
    -        var arg = initExpression.arguments[0];
    +        var REQ_CORE = "core",
    +            REQ_FILE = "file",
    +            REQ_MODULE = "module",
    +            REQ_COMPUTED = "computed";
     
    -        if (arg.type !== "Literal" || typeof arg.value !== "string") {
    -            // "var x = require(42);"
    -            return REQ_COMPUTED;
    -        }
    +        /**
    +         * Determines the type of a declaration statement.
    +         * @param {ASTNode} initExpression The init node of the VariableDeclarator.
    +         * @returns {string} The type of declaration represented by the expression.
    +         */
    +        function getDeclarationType(initExpression) {
    +            if (!initExpression) {
     
    -        if (BUILTIN_MODULES.indexOf(arg.value) !== -1) {
    -            // "var fs = require('fs');"
    -            return REQ_CORE;
    -        } else if (/^\.{0,2}\//.test(arg.value)) {
    -            // "var utils = require('./utils');"
    -            return REQ_FILE;
    -        } else {
    -            // "var async = require('async');"
    -            return REQ_MODULE;
    +                // "var x;"
    +                return DECL_UNINITIALIZED;
    +            }
    +
    +            if (initExpression.type === "CallExpression" &&
    +                initExpression.callee.type === "Identifier" &&
    +                initExpression.callee.name === "require"
    +            ) {
    +
    +                // "var x = require('util');"
    +                return DECL_REQUIRE;
    +            } else if (allowCall &&
    +                initExpression.type === "CallExpression" &&
    +                initExpression.callee.type === "CallExpression"
    +            ) {
    +
    +                // "var x = require('diagnose')('sub-module');"
    +                return getDeclarationType(initExpression.callee);
    +            } else if (initExpression.type === "MemberExpression") {
    +
    +                // "var x = require('glob').Glob;"
    +                return getDeclarationType(initExpression.object);
    +            }
    +
    +            // "var x = 42;"
    +            return DECL_OTHER;
             }
    -    }
     
    -    /**
    -     * Check if the list of variable declarations is mixed, i.e. whether it
    -     * contains both require and other declarations.
    -     * @param {ASTNode} declarations The list of VariableDeclarators.
    -     * @returns {boolean} True if the declarations are mixed, false if not.
    -     */
    -    function isMixed(declarations) {
    -        var contains = {};
    -
    -        declarations.forEach(function(declaration) {
    -            var type = getDeclarationType(declaration.init);
    -            contains[type] = true;
    -        });
    -
    -        return !!(
    -            contains[DECL_REQUIRE] &&
    -            (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
    -        );
    -    }
    +        /**
    +         * Determines the type of module that is loaded via require.
    +         * @param {ASTNode} initExpression The init node of the VariableDeclarator.
    +         * @returns {string} The module type.
    +         */
    +        function inferModuleType(initExpression) {
    +            if (initExpression.type === "MemberExpression") {
    +
    +                // "var x = require('glob').Glob;"
    +                return inferModuleType(initExpression.object);
    +            } else if (initExpression.arguments.length === 0) {
     
    -    /**
    -     * Check if all require declarations in the given list are of the same
    -     * type.
    -     * @param {ASTNode} declarations The list of VariableDeclarators.
    -     * @returns {boolean} True if the declarations are grouped, false if not.
    -     */
    -    function isGrouped(declarations) {
    -        var found = {};
    -
    -        declarations.forEach(function(declaration) {
    -            if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
    -                found[inferModuleType(declaration.init)] = true;
    +                // "var x = require();"
    +                return REQ_COMPUTED;
                 }
    -        });
     
    -        return Object.keys(found).length <= 1;
    -    }
    +            var arg = initExpression.arguments[0];
    +
    +            if (arg.type !== "Literal" || typeof arg.value !== "string") {
    +
    +                // "var x = require(42);"
    +                return REQ_COMPUTED;
    +            }
     
    +            if (BUILTIN_MODULES.indexOf(arg.value) !== -1) {
     
    -    return {
    +                // "var fs = require('fs');"
    +                return REQ_CORE;
    +            } else if (/^\.{0,2}\//.test(arg.value)) {
     
    -        "VariableDeclaration": function(node) {
    +                // "var utils = require('./utils');"
    +                return REQ_FILE;
    +            } else {
     
    -            if (isMixed(node.declarations)) {
    -                context.report(
    -                    node,
    -                    "Do not mix 'require' and other declarations."
    -                );
    -            } else if (grouping && !isGrouped(node.declarations)) {
    -                context.report(
    -                    node,
    -                    "Do not mix core, module, file and computed requires."
    -                );
    +                // "var async = require('async');"
    +                return REQ_MODULE;
                 }
             }
    -    };
     
    -};
    +        /**
    +         * Check if the list of variable declarations is mixed, i.e. whether it
    +         * contains both require and other declarations.
    +         * @param {ASTNode} declarations The list of VariableDeclarators.
    +         * @returns {boolean} True if the declarations are mixed, false if not.
    +         */
    +        function isMixed(declarations) {
    +            var contains = {};
    +
    +            declarations.forEach(function(declaration) {
    +                var type = getDeclarationType(declaration.init);
    +
    +                contains[type] = true;
    +            });
    +
    +            return !!(
    +                contains[DECL_REQUIRE] &&
    +                (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
    +            );
    +        }
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "type": "boolean"
    -            },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "grouping": {
    -                        "type": "boolean"
    -                    },
    -                    "allowCall": {
    -                        "type": "boolean"
    -                    }
    -                },
    -                "additionalProperties": false
    +        /**
    +         * Check if all require declarations in the given list are of the same
    +         * type.
    +         * @param {ASTNode} declarations The list of VariableDeclarators.
    +         * @returns {boolean} True if the declarations are grouped, false if not.
    +         */
    +        function isGrouped(declarations) {
    +            var found = {};
    +
    +            declarations.forEach(function(declaration) {
    +                if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
    +                    found[inferModuleType(declaration.init)] = true;
    +                }
    +            });
    +
    +            return Object.keys(found).length <= 1;
    +        }
    +
    +
    +        return {
    +
    +            VariableDeclaration: function(node) {
    +
    +                if (isMixed(node.declarations)) {
    +                    context.report(
    +                        node,
    +                        "Do not mix 'require' and other declarations."
    +                    );
    +                } else if (grouping && !isGrouped(node.declarations)) {
    +                    context.report(
    +                        node,
    +                        "Do not mix core, module, file and computed requires."
    +                    );
    +                }
                 }
    -        ]
    +        };
    +
         }
    -];
    +};
    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 6ce27dadc74905..b3cdd38a600f97 100644
    --- a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
    +++ b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
    @@ -1,9 +1,6 @@
     /**
      * @fileoverview Disallow mixed spaces and tabs for indentation
      * @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";
     
    @@ -11,124 +8,136 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow mixed spaces and tabs for indentation",
    +            category: "Stylistic Issues",
    +            recommended: true
    +        },
     
    -    var smartTabs,
    -        ignoredLocs = [];
    +        schema: [
    +            {
    +                enum: ["smart-tabs", true, false]
    +            }
    +        ]
    +    },
     
    -    switch (context.options[0]) {
    -        case true: // Support old syntax, maybe add deprecation warning here
    -        case "smart-tabs":
    -            smartTabs = true;
    -            break;
    -        default:
    -            smartTabs = false;
    -    }
    +    create: function(context) {
     
    -    /**
    -     * 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;
    -    }
    +        var smartTabs,
    +            ignoredLocs = [];
     
    -    /**
    -     * 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;
    +        switch (context.options[0]) {
    +            case true: // Support old syntax, maybe add deprecation warning here
    +            case "smart-tabs":
    +                smartTabs = true;
    +                break;
    +            default:
    +                smartTabs = false;
             }
    -        return line === loc.end.line && column > loc.end.column;
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * 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;
    +        }
     
    -    return {
    +        /**
    +         * 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;
    +        }
     
    -        "TemplateElement": function(node) {
    -            ignoredLocs.push(node.loc);
    -        },
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -        "Program:exit": function(node) {
    -            /*
    -             * At least one space followed by a tab
    -             * or the reverse before non-tab/-space
    -             * characters begin.
    -             */
    -            var regex = /^(?=[\t ]*(\t | \t))/,
    -                match,
    -                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;
    -                }
    +        return {
     
    -                if (beforeLoc(second, first.start.line, second.start.column)) {
    -                    return -1;
    -                }
    +            TemplateElement: function(node) {
    +                ignoredLocs.push(node.loc);
    +            },
     
    -                return 0;
    -            });
    +            "Program:exit": function(node) {
     
    -            if (smartTabs) {
                     /*
                      * At least one space followed by a tab
    -                 * before non-tab/-space characters begin.
    +                 * or the reverse before non-tab/-space
    +                 * characters begin.
                      */
    -                regex = /^(?=[\t ]* \t)/;
    -            }
    -
    -            lines.forEach(function(line, i) {
    -                match = regex.exec(line);
    +                var regex = /^(?=[\t ]*(\t | \t))/,
    +                    match,
    +                    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 (match) {
    -                    var lineNumber = i + 1,
    -                        column = match.index + 1;
    +                    if (beforeLoc(second, first.start.line, second.start.column)) {
    +                        return -1;
    +                    }
     
    -                    for (var j = 0; j < ignoredLocs.length; j++) {
    -                        if (beforeLoc(ignoredLocs[j], lineNumber, column)) {
    -                            continue;
    -                        }
    -                        if (afterLoc(ignoredLocs[j], lineNumber, column)) {
    -                            continue;
    -                        }
    +                    return 0;
    +                });
     
    -                        return;
    -                    }
    +                if (smartTabs) {
     
    -                    context.report(node, { line: lineNumber, column: column }, "Mixed spaces and tabs.");
    +                    /*
    +                     * At least one space followed by a tab
    +                     * before non-tab/-space characters begin.
    +                     */
    +                    regex = /^(?=[\t ]* \t)/;
                     }
    -            });
    -        }
     
    -    };
    +                lines.forEach(function(line, i) {
    +                    match = regex.exec(line);
     
    -};
    +                    if (match) {
    +                        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.");
    +                    }
    +                });
    +            }
    +
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["smart-tabs", true, false]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-multi-spaces.js b/tools/eslint/lib/rules/no-multi-spaces.js
    index c6177e32825c5b..d6c0e4198d16b3 100644
    --- a/tools/eslint/lib/rules/no-multi-spaces.js
    +++ b/tools/eslint/lib/rules/no-multi-spaces.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Disallow use of multiple spaces.
      * @author Nicholas C. Zakas
    - * @copyright 2015 Brandon Mills. All rights reserved.
    - * @copyright 2015 Nicholas C. Zakas. All rights reserved.
      */
     
     "use strict";
    @@ -11,129 +9,141 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    // the index of the last comment that was checked
    -    var exceptions = { "Property": true },
    -        hasExceptions = true,
    -        options = context.options[0],
    -        lastCommentIndex = 0;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow multiple spaces",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    if (options && options.exceptions) {
    -        Object.keys(options.exceptions).forEach(function(key) {
    -            if (options.exceptions[key]) {
    -                exceptions[key] = true;
    -            } else {
    -                delete exceptions[key];
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "object",
    +                        patternProperties: {
    +                            "^([A-Z][a-z]*)+$": {
    +                                type: "boolean"
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -        });
    -        hasExceptions = Object.keys(exceptions).length > 0;
    -    }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        // the index of the last comment that was checked
    +        var exceptions = { Property: true },
    +            hasExceptions = true,
    +            options = context.options[0],
    +            lastCommentIndex = 0;
    +
    +        if (options && options.exceptions) {
    +            Object.keys(options.exceptions).forEach(function(key) {
    +                if (options.exceptions[key]) {
    +                    exceptions[key] = true;
    +                } else {
    +                    delete exceptions[key];
    +                }
    +            });
    +            hasExceptions = Object.keys(exceptions).length > 0;
    +        }
    +
    +        /**
    +         * 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
    +         */
    +        function isIndexInComment(index, comments) {
    +
    +            var comment;
    +
    +            while (lastCommentIndex < comments.length) {
    +
    +                comment = comments[lastCommentIndex];
    +
    +                if (comment.range[0] <= index && index < comment.range[1]) {
    +                    return true;
    +                } else if (index > comment.range[1]) {
    +                    lastCommentIndex++;
    +                } else {
    +                    break;
    +                }
     
    -    /**
    -     * 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
    -     */
    -    function isIndexInComment(index, comments) {
    -
    -        var comment;
    -
    -        while (lastCommentIndex < comments.length) {
    -
    -            comment = comments[lastCommentIndex];
    -
    -            if (comment.range[0] <= index && index < comment.range[1]) {
    -                return true;
    -            } else if (index > comment.range[1]) {
    -                lastCommentIndex++;
    -            } else {
    -                break;
                 }
     
    +            return false;
             }
     
    -        return false;
    -    }
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            Program: function() {
    +
    +                var source = context.getSource(),
    +                    allComments = context.getAllComments(),
    +                    pattern = /[^\n\r\u2028\u2029\t ].? {2,}/g,  // note: repeating space
    +                    token,
    +                    previousToken,
    +                    parent;
    +
    +
    +                /**
    +                 * Creates a fix function that removes the multiple spaces between the two tokens
    +                 * @param {RuleFixer} leftToken left token
    +                 * @param {RuleFixer} rightToken right token
    +                 * @returns {function} fix function
    +                 * @private
    +                 */
    +                function createFix(leftToken, rightToken) {
    +                    return function(fixer) {
    +                        return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ");
    +                    };
    +                }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "Program": function() {
    -
    -            var source = context.getSource(),
    -                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)) {
     
    -            while (pattern.test(source)) {
    +                    // do not flag anything inside of comments
    +                    if (!isIndexInComment(pattern.lastIndex, allComments)) {
     
    -                // do not flag anything inside of comments
    -                if (!isIndexInComment(pattern.lastIndex, allComments)) {
    +                        token = context.getTokenByRangeStart(pattern.lastIndex);
    +                        if (token) {
    +                            previousToken = context.getTokenBefore(token);
     
    -                    token = context.getTokenByRangeStart(pattern.lastIndex);
    -                    if (token) {
    -                        previousToken = context.getTokenBefore(token);
    +                            if (hasExceptions) {
    +                                parent = context.getNodeByRangeIndex(pattern.lastIndex - 1);
    +                            }
     
    -                        if (hasExceptions) {
    -                            parent = context.getNodeByRangeIndex(pattern.lastIndex - 1);
    +                            if (!parent || !exceptions[parent.type]) {
    +                                context.report({
    +                                    node: token,
    +                                    loc: token.loc.start,
    +                                    message: "Multiple spaces found before '{{value}}'.",
    +                                    data: { value: token.value },
    +                                    fix: createFix(previousToken, token)
    +                                });
    +                            }
                             }
     
    -                        if (!parent || !exceptions[parent.type]) {
    -                            context.report({
    -                                node: token,
    -                                loc: token.loc.start,
    -                                message: "Multiple spaces found before '{{value}}'.",
    -                                data: { value: token.value },
    -                                fix: createFix(previousToken, token)
    -                            });
    -                        }
                         }
    -
                     }
                 }
    -        }
    -    };
    -
    -};
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "object",
    -                "patternProperties": {
    -                    "^([A-Z][a-z]*)+$": {
    -                        "type": "boolean"
    -                    }
    -                },
    -                "additionalProperties": false
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-multi-str.js b/tools/eslint/lib/rules/no-multi-str.js
    index 470c65871ea6a1..fe7fee4a60a38c 100644
    --- a/tools/eslint/lib/rules/no-multi-str.js
    +++ b/tools/eslint/lib/rules/no-multi-str.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag when using multiline strings
      * @author Ilya Volodin
    - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -11,33 +9,43 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    /**
    -     * Determines if a given node is part of JSX syntax.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {boolean} True if the node is a JSX node, false if not.
    -     * @private
    -     */
    -    function isJSXElement(node) {
    -        return node.type.indexOf("JSX") === 0;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow multiline strings",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * Determines if a given node is part of JSX syntax.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {boolean} True if the node is a JSX node, false if not.
    +         * @private
    +         */
    +        function isJSXElement(node) {
    +            return node.type.indexOf("JSX") === 0;
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -    return {
    +        return {
     
    -        "Literal": function(node) {
    -            var lineBreak = /\n/;
    +            Literal: function(node) {
    +                var lineBreak = /\n/;
     
    -            if (lineBreak.test(node.raw) && !isJSXElement(node.parent)) {
    -                context.report(node, "Multiline support is limited to browsers supporting ES5 only.");
    +                if (lineBreak.test(node.raw) && !isJSXElement(node.parent)) {
    +                    context.report(node, "Multiline support is limited to browsers supporting ES5 only.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-multiple-empty-lines.js b/tools/eslint/lib/rules/no-multiple-empty-lines.js
    index c41458d9528c0e..02a41fdbe34f8c 100644
    --- a/tools/eslint/lib/rules/no-multiple-empty-lines.js
    +++ b/tools/eslint/lib/rules/no-multiple-empty-lines.js
    @@ -2,7 +2,6 @@
      * @fileoverview Disallows multiple blank lines.
      * implementation adapted from the no-trailing-spaces rule.
      * @author Greg Cochard
    - * @copyright 2014 Greg Cochard. All rights reserved.
      */
     "use strict";
     
    @@ -10,136 +9,162 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow multiple empty lines",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    // Use options.max or 2 as default
    -    var max = 2,
    -        maxEOF,
    -        maxBOF;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    max: {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    maxEOF: {
    +                        type: "integer",
    +                        minimum: 0
    +                    },
    +                    maxBOF: {
    +                        type: "integer",
    +                        minimum: 0
    +                    }
    +                },
    +                required: ["max"],
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    // store lines that appear empty but really aren't
    -    var notEmpty = [];
    +    create: function(context) {
     
    -    if (context.options.length) {
    -        max = context.options[0].max;
    -        maxEOF = context.options[0].maxEOF;
    -        maxBOF = context.options[0].maxBOF;
    -    }
    +        // Use options.max or 2 as default
    +        var max = 2,
    +            maxEOF,
    +            maxBOF;
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        // store lines that appear empty but really aren't
    +        var notEmpty = [];
     
    -    return {
    +        if (context.options.length) {
    +            max = context.options[0].max;
    +            maxEOF = context.options[0].maxEOF;
    +            maxBOF = context.options[0].maxBOF;
    +        }
     
    -        "TemplateLiteral": function(node) {
    -            var start = node.loc.start.line;
    -            var end = node.loc.end.line;
    -            while (start <= end) {
    -                notEmpty.push(start);
    -                start++;
    -            }
    -        },
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +
    +            TemplateLiteral: function(node) {
    +                var start = node.loc.start.line;
    +                var end = node.loc.end.line;
     
    -        "Program:exit": function checkBlankLines(node) {
    -            var lines = context.getSourceLines(),
    -                currentLocation = -1,
    -                lastLocation,
    -                blankCounter = 0,
    -                location,
    -                firstOfEndingBlankLines,
    -                firstNonBlankLine = -1,
    -                trimmedLines = [];
    -
    -            lines.forEach(function(str, i) {
    -                var trimmed = str.trim();
    -                if ((firstNonBlankLine === -1) && (trimmed !== "")) {
    -                    firstNonBlankLine = i;
    +                while (start <= end) {
    +                    notEmpty.push(start);
    +                    start++;
                     }
    +            },
    +
    +            "Program:exit": function checkBlankLines(node) {
    +                var lines = context.getSourceLines(),
    +                    currentLocation = -1,
    +                    lastLocation,
    +                    blankCounter = 0,
    +                    location,
    +                    firstOfEndingBlankLines,
    +                    firstNonBlankLine = -1,
    +                    trimmedLines = [];
    +
    +                lines.forEach(function(str, i) {
    +                    var trimmed = str.trim();
    +
    +                    if ((firstNonBlankLine === -1) && (trimmed !== "")) {
    +                        firstNonBlankLine = i;
    +                    }
     
    -                trimmedLines.push(trimmed);
    -            });
    +                    trimmedLines.push(trimmed);
    +                });
     
    -            // add the notEmpty lines in there with a placeholder
    -            notEmpty.forEach(function(x, i) {
    -                trimmedLines[i] = x;
    -            });
    +                // add the notEmpty lines in there with a placeholder
    +                notEmpty.forEach(function(x, i) {
    +                    trimmedLines[i] = x;
    +                });
     
    -            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--;
    +                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.");
    -            }
    +                // 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) {
                     lastLocation = currentLocation;
                     currentLocation = trimmedLines.indexOf("", currentLocation + 1);
    -                if (lastLocation === currentLocation - 1) {
    -                    blankCounter++;
    -                } else {
    -                    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.");
    -                        }
    +                while (currentLocation !== -1) {
    +                    lastLocation = currentLocation;
    +                    currentLocation = trimmedLines.indexOf("", currentLocation + 1);
    +                    if (lastLocation === currentLocation - 1) {
    +                        blankCounter++;
                         } 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.");
    +                        location = {
    +                            line: lastLocation + 1,
    +                            column: 1
    +                        };
    +
    +                        if (lastLocation < firstOfEndingBlankLines) {
    +
    +                            // within the file, not at the end
    +                            if (blankCounter >= max) {
    +                                context.report({
    +                                    node: node,
    +                                    loc: location,
    +                                    message: "More than " + max + " blank " + (max === 1 ? "line" : "lines") + " not allowed."
    +                                });
    +                            }
    +                        } else {
    +
    +                            // inside the last blank lines
    +                            if (blankCounter > maxEOF) {
    +                                context.report({
    +                                    node: node,
    +                                    loc: location,
    +                                    message: "Too many blank lines at the end of file. Max of " + maxEOF + " allowed."
    +                                });
    +                            }
                             }
    -                    }
     
    -                    // Finally, reset the blank counter
    -                    blankCounter = 0;
    +                        // Finally, reset the blank counter
    +                        blankCounter = 0;
    +                    }
                     }
                 }
    -        }
    -    };
    -
    -};
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "max": {
    -                "type": "integer",
    -                "minimum": 0
    -            },
    -            "maxEOF": {
    -                "type": "integer",
    -                "minimum": 0
    -            },
    -            "maxBOF": {
    -                "type": "integer",
    -                "minimum": 0
    -            }
    -        },
    -        "required": ["max"],
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-native-reassign.js b/tools/eslint/lib/rules/no-native-reassign.js
    index 50175388acd252..7d45e277d502c1 100644
    --- a/tools/eslint/lib/rules/no-native-reassign.js
    +++ b/tools/eslint/lib/rules/no-native-reassign.js
    @@ -9,63 +9,75 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var config = context.options[0];
    -    var exceptions = (config && config.exceptions) || [];
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning native objects",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "array",
    +                        items: {type: "string"},
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -        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
    -            });
    -        }
    -    }
    +    create: function(context) {
    +        var config = context.options[0];
    +        var exceptions = (config && config.exceptions) || [];
     
    -    /**
    -     * 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);
    +        /**
    +         * Reports write references.
    +         * @param {Reference} reference - A reference to check.
    +         * @param {int} index - The index of the reference in the references.
    +         * @param {Reference[]} references - The array that the reference belongs to.
    +         * @returns {void}
    +         */
    +        function checkReference(reference, index, references) {
    +            var identifier = reference.identifier;
    +
    +            if (reference.init === false &&
    +                reference.isWrite() &&
    +
    +                // Destructuring assignments can have multiple default value,
    +                // so possibly there are multiple writeable references for the same identifier.
    +                (index === 0 || references[index - 1].identifier !== identifier)
    +            ) {
    +                context.report({
    +                    node: identifier,
    +                    message: "{{name}} is a read-only native object.",
    +                    data: identifier
    +                });
    +            }
             }
    -    }
     
    -    return {
    -        "Program": function() {
    -            var globalScope = context.getScope();
    -            globalScope.variables.forEach(checkVariable);
    +        /**
    +         * 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);
    +            }
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "array",
    -                "items": {"type": "string"},
    -                "uniqueItems": true
    +        return {
    +            Program: function() {
    +                var globalScope = context.getScope();
    +
    +                globalScope.variables.forEach(checkVariable);
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-negated-condition.js b/tools/eslint/lib/rules/no-negated-condition.js
    index 0d5b283e54aef6..5f1037472c5e07 100644
    --- a/tools/eslint/lib/rules/no-negated-condition.js
    +++ b/tools/eslint/lib/rules/no-negated-condition.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,65 +8,75 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow negated conditions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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";
    -    }
    +        schema: []
    +    },
     
    -    /**
    -     * 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 === "!";
    -    }
    +    create: function(context) {
     
    -    /**
    -     * 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 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 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);
    -    }
    +        /**
    +         * 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 === "!";
    +        }
     
    -    return {
    -        "IfStatement": function(node) {
    -            if (!hasElseWithoutCondition(node)) {
    -                return;
    -            }
    +        /**
    +         * 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 === "!==");
    +        }
     
    -            if (isNegatedIf(node)) {
    -                context.report(node, "Unexpected negated condition.");
    -            }
    -        },
    -        "ConditionalExpression": function(node) {
    -            if (isNegatedIf(node)) {
    -                context.report(node, "Unexpected negated condition.");
    -            }
    +        /**
    +         * 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);
             }
    -    };
    -};
     
    -module.exports.schema = [];
    +        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.");
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-negated-in-lhs.js b/tools/eslint/lib/rules/no-negated-in-lhs.js
    index 67be9bb06d386e..891b75dd2f4171 100644
    --- a/tools/eslint/lib/rules/no-negated-in-lhs.js
    +++ b/tools/eslint/lib/rules/no-negated-in-lhs.js
    @@ -9,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow negating the left operand in `in` expressions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "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");
    +    create: function(context) {
    +
    +        return {
    +
    +            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");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-nested-ternary.js b/tools/eslint/lib/rules/no-nested-ternary.js
    index 2686ebd9814ac0..34f9eaaa8dbc8a 100644
    --- a/tools/eslint/lib/rules/no-nested-ternary.js
    +++ b/tools/eslint/lib/rules/no-nested-ternary.js
    @@ -9,16 +9,26 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow nested ternary expressions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    -        "ConditionalExpression": function(node) {
    -            if (node.alternate.type === "ConditionalExpression" ||
    -                    node.consequent.type === "ConditionalExpression") {
    -                context.report(node, "Do not nest ternary expressions");
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +            ConditionalExpression: function(node) {
    +                if (node.alternate.type === "ConditionalExpression" ||
    +                        node.consequent.type === "ConditionalExpression") {
    +                    context.report(node, "Do not nest ternary expressions");
    +                }
                 }
    -        }
    -    };
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new-func.js b/tools/eslint/lib/rules/no-new-func.js
    index cbc0248fb11b70..7b01db0cd28d4b 100644
    --- a/tools/eslint/lib/rules/no-new-func.js
    +++ b/tools/eslint/lib/rules/no-new-func.js
    @@ -9,29 +9,39 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * 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.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `new` operators with the `Function` object",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * 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
    -    };
    +        return {
    +            NewExpression: validateCallee,
    +            CallExpression: validateCallee
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new-object.js b/tools/eslint/lib/rules/no-new-object.js
    index dd1cd10d758227..4fc2a3bebb09f6 100644
    --- a/tools/eslint/lib/rules/no-new-object.js
    +++ b/tools/eslint/lib/rules/no-new-object.js
    @@ -9,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `Object` constructors",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "NewExpression": function(node) {
    -            if (node.callee.name === "Object") {
    -                context.report(node, "The object literal notation {} is preferrable.");
    +    create: function(context) {
    +
    +        return {
    +
    +            NewExpression: function(node) {
    +                if (node.callee.name === "Object") {
    +                    context.report(node, "The object literal notation {} is preferrable.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new-require.js b/tools/eslint/lib/rules/no-new-require.js
    index cd2eec562fcd64..b39d9c3e373e26 100644
    --- a/tools/eslint/lib/rules/no-new-require.js
    +++ b/tools/eslint/lib/rules/no-new-require.js
    @@ -9,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `new` operators with calls to `require`",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "NewExpression": function(node) {
    -            if (node.callee.type === "Identifier" && node.callee.name === "require") {
    -                context.report(node, "Unexpected use of new with require.");
    +    create: function(context) {
    +
    +        return {
    +
    +            NewExpression: function(node) {
    +                if (node.callee.type === "Identifier" && node.callee.name === "require") {
    +                    context.report(node, "Unexpected use of new with require.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new-symbol.js b/tools/eslint/lib/rules/no-new-symbol.js
    index aeae5d62f057ae..c7c524641ee6bd 100644
    --- a/tools/eslint/lib/rules/no-new-symbol.js
    +++ b/tools/eslint/lib/rules/no-new-symbol.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,23 +9,35 @@
     // 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 = {
    +    meta: {
    +        docs: {
    +            description: "disallow `new` operators with the `Symbol` object",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +            "Program:exit": function() {
    +                var globalScope = context.getScope();
    +                var variable = globalScope.set.get("Symbol");
    +
    +                if (variable && variable.defs.length === 0) {
    +                    variable.references.forEach(function(ref) {
    +                        var node = ref.identifier;
    +
    +                        if (node.parent && node.parent.type === "NewExpression") {
    +                            context.report(node, "`Symbol` cannot be called as a constructor.");
    +                        }
    +                    });
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new-wrappers.js b/tools/eslint/lib/rules/no-new-wrappers.js
    index da609572da39f8..eec774fdcad14f 100644
    --- a/tools/eslint/lib/rules/no-new-wrappers.js
    +++ b/tools/eslint/lib/rules/no-new-wrappers.js
    @@ -9,18 +9,29 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "NewExpression": function(node) {
    -            var wrapperObjects = ["String", "Number", "Boolean", "Math", "JSON"];
    -            if (wrapperObjects.indexOf(node.callee.name) > -1) {
    -                context.report(node, "Do not use {{fn}} as a constructor.", { fn: node.callee.name });
    +    create: function(context) {
    +
    +        return {
    +
    +            NewExpression: function(node) {
    +                var wrapperObjects = ["String", "Number", "Boolean", "Math", "JSON"];
    +
    +                if (wrapperObjects.indexOf(node.callee.name) > -1) {
    +                    context.report(node, "Do not use {{fn}} as a constructor.", { fn: node.callee.name });
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-new.js b/tools/eslint/lib/rules/no-new.js
    index e431d4fb78e3b6..154bced9bcfb29 100644
    --- a/tools/eslint/lib/rules/no-new.js
    +++ b/tools/eslint/lib/rules/no-new.js
    @@ -10,18 +10,28 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `new` operators outside of assignments or comparisons",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "ExpressionStatement": function(node) {
    +    create: function(context) {
     
    -            if (node.expression.type === "NewExpression") {
    -                context.report(node, "Do not use 'new' for side effects.");
    +        return {
    +
    +            ExpressionStatement: function(node) {
    +
    +                if (node.expression.type === "NewExpression") {
    +                    context.report(node, "Do not use 'new' for side effects.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-obj-calls.js b/tools/eslint/lib/rules/no-obj-calls.js
    index f3845c508fb75f..0f58ab93dbd6d6 100644
    --- a/tools/eslint/lib/rules/no-obj-calls.js
    +++ b/tools/eslint/lib/rules/no-obj-calls.js
    @@ -9,20 +9,31 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow calling global object properties as functions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    -        "CallExpression": function(node) {
    +        schema: []
    +    },
     
    -            if (node.callee.type === "Identifier") {
    -                var name = node.callee.name;
    -                if (name === "Math" || name === "JSON") {
    -                    context.report(node, "'{{name}}' is not a function.", { name: name });
    +    create: function(context) {
    +
    +        return {
    +            CallExpression: function(node) {
    +
    +                if (node.callee.type === "Identifier") {
    +                    var name = node.callee.name;
    +
    +                    if (name === "Math" || name === "JSON") {
    +                        context.report(node, "'{{name}}' is not a function.", { name: name });
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-octal-escape.js b/tools/eslint/lib/rules/no-octal-escape.js
    index 16e58316ddaba0..3ca01324b5ea2d 100644
    --- a/tools/eslint/lib/rules/no-octal-escape.js
    +++ b/tools/eslint/lib/rules/no-octal-escape.js
    @@ -9,31 +9,41 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow octal escape sequences in string literals",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Literal": function(node) {
    -            if (typeof node.value !== "string") {
    -                return;
    -            }
    +    create: function(context) {
    +
    +        return {
     
    -            var match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-3][0-7]{1,2}|[4-7][0-7]|[0-7])/),
    -                octalDigit;
    +            Literal: function(node) {
    +                if (typeof node.value !== "string") {
    +                    return;
    +                }
     
    -            if (match) {
    -                octalDigit = match[2];
    +                var match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-3][0-7]{1,2}|[4-7][0-7]|[0-7])/),
    +                    octalDigit;
     
    -                // \0 is actually not considered an octal
    -                if (match[2] !== "0" || typeof match[3] !== "undefined") {
    -                    context.report(node, "Don't use octal: '\\{{octalDigit}}'. Use '\\u....' instead.",
    -                            { octalDigit: octalDigit });
    +                if (match) {
    +                    octalDigit = match[2];
    +
    +                    // \0 is actually not considered an octal
    +                    if (match[2] !== "0" || typeof match[3] !== "undefined") {
    +                        context.report(node, "Don't use octal: '\\{{octalDigit}}'. Use '\\u....' instead.",
    +                                { octalDigit: octalDigit });
    +                    }
                     }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-octal.js b/tools/eslint/lib/rules/no-octal.js
    index 5a00c9506ecae3..1332dde5e8234f 100644
    --- a/tools/eslint/lib/rules/no-octal.js
    +++ b/tools/eslint/lib/rules/no-octal.js
    @@ -9,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow octal literals",
    +            category: "Best Practices",
    +            recommended: true
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Literal": function(node) {
    -            if (typeof node.value === "number" && /^0[0-7]/.test(node.raw)) {
    -                context.report(node, "Octal literals should not be used.");
    +    create: function(context) {
    +
    +        return {
    +
    +            Literal: function(node) {
    +                if (typeof node.value === "number" && /^0[0-7]/.test(node.raw)) {
    +                    context.report(node, "Octal literals should not be used.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-param-reassign.js b/tools/eslint/lib/rules/no-param-reassign.js
    index 6bfa681afb46b9..fad61fc0c1eb9b 100644
    --- a/tools/eslint/lib/rules/no-param-reassign.js
    +++ b/tools/eslint/lib/rules/no-param-reassign.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Disallow reassignment of function parameters.
      * @author Nat Burns
    - * @copyright 2014 Nat Burns. All rights reserved.
      */
     "use strict";
     
    @@ -11,26 +10,40 @@
     
     var stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/;
     
    -module.exports = function(context) {
    -    var props = context.options[0] && Boolean(context.options[0].props);
    -
    -    /**
    -     * 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 isModifying(reference) {
    -        if (reference.isWrite()) {
    -            return true;
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow reassigning `function` parameters",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -        // Checks whether its property is modified.
    -        if (props) {
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    props: {type: "boolean"}
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var props = context.options[0] && Boolean(context.options[0].props);
    +
    +        /**
    +         * Checks whether or not the reference modifies properties of its variable.
    +         * @param {Reference} reference - A reference to check.
    +         * @returns {boolean} Whether or not the reference modifies properties of its variable.
    +         */
    +        function isModifyingProp(reference) {
                 var node = reference.identifier;
                 var parent = node.parent;
    +
                 while (parent && !stopNodePattern.test(parent.type)) {
                     switch (parent.type) {
    +
                         // e.g. foo.a = 0;
                         case "AssignmentExpression":
                             return parent.left === node;
    @@ -65,72 +78,70 @@ module.exports = function(context) {
                     }
     
                     node = parent;
    -                parent = parent.parent;
    +                parent = node.parent;
                 }
    -        }
     
    -        return false;
    -    }
    +            return false;
    +        }
     
    -    /**
    -     * 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 checkReference(reference, index, references) {
    -        var identifier = reference.identifier;
    -
    -        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});
    +        /**
    +         * 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 checkReference(reference, index, references) {
    +            var identifier = reference.identifier;
    +
    +            if (identifier &&
    +                !reference.init &&
    +
    +                // Destructuring assignments can have multiple default value,
    +                // so possibly there are multiple writeable references for the same identifier.
    +                (index === 0 || references[index - 1].identifier !== identifier)
    +            ) {
    +                if (reference.isWrite()) {
    +                    context.report(
    +                        identifier,
    +                        "Assignment to function parameter '{{name}}'.",
    +                        {name: identifier.name});
    +                } else if (props && isModifyingProp(reference)) {
    +                    context.report(
    +                        identifier,
    +                        "Assignment to property of function parameter '{{name}}'.",
    +                        {name: identifier.name});
    +                }
    +            }
             }
    -    }
     
    -    /**
    -     * 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 === "Parameter") {
    -            variable.references.forEach(checkReference);
    +        /**
    +         * 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 === "Parameter") {
    +                variable.references.forEach(checkReference);
    +            }
             }
    -    }
     
    -    /**
    -     * 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);
    -    }
    +        /**
    +         * 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 {
    -        // `:exit` is needed for the `node.parent` property of identifier nodes.
    -        "FunctionDeclaration:exit": checkForFunction,
    -        "FunctionExpression:exit": checkForFunction,
    -        "ArrowFunctionExpression:exit": checkForFunction
    -    };
    +        return {
     
    -};
    +            // `:exit` is needed for the `node.parent` property of identifier nodes.
    +            "FunctionDeclaration:exit": checkForFunction,
    +            "FunctionExpression:exit": checkForFunction,
    +            "ArrowFunctionExpression:exit": checkForFunction
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "props": {"type": "boolean"}
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-path-concat.js b/tools/eslint/lib/rules/no-path-concat.js
    index c6d512bc0e76c9..1412c6c32e3546 100644
    --- a/tools/eslint/lib/rules/no-path-concat.js
    +++ b/tools/eslint/lib/rules/no-path-concat.js
    @@ -8,32 +8,42 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow string concatenation with `__dirname` and `__filename`",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    var MATCHER = /^__(?:dir|file)name$/;
    +        schema: []
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +    create: function(context) {
     
    -    return {
    +        var MATCHER = /^__(?:dir|file)name$/;
     
    -        "BinaryExpression": function(node) {
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            var left = node.left,
    -                right = node.right;
    +        return {
     
    -            if (node.operator === "+" &&
    -                    ((left.type === "Identifier" && MATCHER.test(left.name)) ||
    -                    (right.type === "Identifier" && MATCHER.test(right.name)))
    -            ) {
    +            BinaryExpression: function(node) {
     
    -                context.report(node, "Use path.join() or path.resolve() instead of + to create paths.");
    +                var left = node.left,
    +                    right = node.right;
    +
    +                if (node.operator === "+" &&
    +                        ((left.type === "Identifier" && MATCHER.test(left.name)) ||
    +                        (right.type === "Identifier" && MATCHER.test(right.name)))
    +                ) {
    +
    +                    context.report(node, "Use path.join() or path.resolve() instead of + to create paths.");
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-plusplus.js b/tools/eslint/lib/rules/no-plusplus.js
    index 42df6a5f2d3d0b..159a42be2c13d1 100644
    --- a/tools/eslint/lib/rules/no-plusplus.js
    +++ b/tools/eslint/lib/rules/no-plusplus.js
    @@ -10,36 +10,46 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the unary operators `++` and `--`",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var config = context.options[0],
    -        allowInForAfterthought = false;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowForLoopAfterthoughts: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    if (typeof config === "object") {
    -        allowInForAfterthought = config.allowForLoopAfterthoughts === true;
    -    }
    +    create: function(context) {
     
    -    return {
    +        var config = context.options[0],
    +            allowInForAfterthought = false;
     
    -        "UpdateExpression": function(node) {
    -            if (allowInForAfterthought && node.parent.type === "ForStatement") {
    -                return;
    -            }
    -            context.report(node, "Unary operator '" + node.operator + "' used.");
    +        if (typeof config === "object") {
    +            allowInForAfterthought = config.allowForLoopAfterthoughts === true;
             }
     
    -    };
    -
    -};
    +        return {
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "allowForLoopAfterthoughts": {
    -                "type": "boolean"
    +            UpdateExpression: function(node) {
    +                if (allowInForAfterthought && node.parent.type === "ForStatement") {
    +                    return;
    +                }
    +                context.report(node, "Unary operator '" + node.operator + "' used.");
                 }
    -        },
    -        "additionalProperties": false
    +
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-process-env.js b/tools/eslint/lib/rules/no-process-env.js
    index 6a5395e57976fe..af48c78029880e 100644
    --- a/tools/eslint/lib/rules/no-process-env.js
    +++ b/tools/eslint/lib/rules/no-process-env.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Disallow the use of process.env()
      * @author Vignesh Anand
    - * @copyright 2014 Vignesh Anand. All rights reserved.
      */
     "use strict";
     
    @@ -9,22 +8,32 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `process.env`",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "MemberExpression": function(node) {
    -            var objectName = node.object.name,
    -                propertyName = node.property.name;
    +    create: function(context) {
     
    -            if (objectName === "process" && !node.computed && propertyName && propertyName === "env") {
    -                context.report(node, "Unexpected use of process.env.");
    -            }
    +        return {
     
    -        }
    +            MemberExpression: function(node) {
    +                var objectName = node.object.name,
    +                    propertyName = node.property.name;
     
    -    };
    +                if (objectName === "process" && !node.computed && propertyName && propertyName === "env") {
    +                    context.report(node, "Unexpected use of process.env.");
    +                }
     
    -};
    +            }
     
    -module.exports.schema = [];
    +        };
    +
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-process-exit.js b/tools/eslint/lib/rules/no-process-exit.js
    index a1fa3b29dae713..6d8674418bb590 100644
    --- a/tools/eslint/lib/rules/no-process-exit.js
    +++ b/tools/eslint/lib/rules/no-process-exit.js
    @@ -8,26 +8,36 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `process.exit()`",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        schema: []
    +    },
     
    -    return {
    +    create: function(context) {
     
    -        "CallExpression": function(node) {
    -            var callee = node.callee;
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            if (callee.type === "MemberExpression" && callee.object.name === "process" &&
    -                callee.property.name === "exit"
    -            ) {
    -                context.report(node, "Don't use process.exit(); throw an error instead.");
    +        return {
    +
    +            CallExpression: function(node) {
    +                var callee = node.callee;
    +
    +                if (callee.type === "MemberExpression" && callee.object.name === "process" &&
    +                    callee.property.name === "exit"
    +                ) {
    +                    context.report(node, "Don't use process.exit(); throw an error instead.");
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-proto.js b/tools/eslint/lib/rules/no-proto.js
    index f91a46afebf8c5..325f3d1c019b64 100644
    --- a/tools/eslint/lib/rules/no-proto.js
    +++ b/tools/eslint/lib/rules/no-proto.js
    @@ -9,20 +9,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of the `__proto__` property",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "MemberExpression": function(node) {
    +    create: function(context) {
     
    -            if (node.property &&
    -                    (node.property.type === "Identifier" && node.property.name === "__proto__" && !node.computed) ||
    -                    (node.property.type === "Literal" && node.property.value === "__proto__")) {
    -                context.report(node, "The '__proto__' property is deprecated.");
    +        return {
    +
    +            MemberExpression: function(node) {
    +
    +                if (node.property &&
    +                        (node.property.type === "Identifier" && node.property.name === "__proto__" && !node.computed) ||
    +                        (node.property.type === "Literal" && node.property.value === "__proto__")) {
    +                    context.report(node, "The '__proto__' property is deprecated.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-redeclare.js b/tools/eslint/lib/rules/no-redeclare.js
    index 83a6eed9f03205..4253cc85334658 100644
    --- a/tools/eslint/lib/rules/no-redeclare.js
    +++ b/tools/eslint/lib/rules/no-redeclare.js
    @@ -9,88 +9,98 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = {
    -        builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals)
    -    };
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `var` redeclaration",
    +            category: "Best Practices",
    +            recommended: true
    +        },
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    builtinGlobals: {type: "boolean"}
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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.
    -     * @returns {void}
    -     * @private
    -     */
    -    function findVariablesInScope(scope) {
    -        scope.variables.forEach(function(variable) {
    -            var hasBuiltin = options.builtinGlobals && "writeable" in variable;
    -            var count = (hasBuiltin ? 1 : 0) + variable.identifiers.length;
    +        /**
    +         * Find variables in a given scope and flag redeclared ones.
    +         * @param {Scope} scope - An escope scope object.
    +         * @returns {void}
    +         * @private
    +         */
    +        function findVariablesInScope(scope) {
    +            scope.variables.forEach(function(variable) {
    +                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];
    -                });
    +                if (count >= 2) {
    +                    variable.identifiers.sort(function(a, b) {
    +                        return a.range[1] - b.range[1];
    +                    });
     
    -                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});
    +                    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});
    +                    }
                     }
    -            }
    -        });
    +            });
     
    -    }
    +        }
     
    -    /**
    -     * Find variables in the current scope.
    -     * @param {ASTNode} node - The Program node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkForGlobal(node) {
    -        var scope = context.getScope(),
    -            parserOptions = context.parserOptions,
    -            ecmaFeatures = parserOptions.ecmaFeatures || {};
    +        /**
    +         * Find variables in the current scope.
    +         * @param {ASTNode} node - The Program node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkForGlobal(node) {
    +            var scope = context.getScope(),
    +                parserOptions = context.parserOptions,
    +                ecmaFeatures = parserOptions.ecmaFeatures || {};
     
    -        // Nodejs env or modules has a special scope.
    -        if (ecmaFeatures.globalReturn || node.sourceType === "module") {
    -            findVariablesInScope(scope.childScopes[0]);
    -        } else {
    -            findVariablesInScope(scope);
    +            // Nodejs env or modules has a special scope.
    +            if (ecmaFeatures.globalReturn || node.sourceType === "module") {
    +                findVariablesInScope(scope.childScopes[0]);
    +            } else {
    +                findVariablesInScope(scope);
    +            }
             }
    -    }
     
    -    /**
    -     * Find variables in the current scope.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkForBlock() {
    -        findVariablesInScope(context.getScope());
    -    }
    +        /**
    +         * Find variables in the current scope.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkForBlock() {
    +            findVariablesInScope(context.getScope());
    +        }
     
    -    if (context.parserOptions.ecmaVersion >= 6) {
    -        return {
    -            "Program": checkForGlobal,
    -            "BlockStatement": checkForBlock,
    -            "SwitchStatement": checkForBlock
    -        };
    -    } else {
    -        return {
    -            "Program": checkForGlobal,
    -            "FunctionDeclaration": checkForBlock,
    -            "FunctionExpression": checkForBlock,
    -            "ArrowFunctionExpression": checkForBlock
    -        };
    +        if (context.parserOptions.ecmaVersion >= 6) {
    +            return {
    +                Program: checkForGlobal,
    +                BlockStatement: checkForBlock,
    +                SwitchStatement: checkForBlock
    +            };
    +        } else {
    +            return {
    +                Program: checkForGlobal,
    +                FunctionDeclaration: checkForBlock,
    +                FunctionExpression: checkForBlock,
    +                ArrowFunctionExpression: checkForBlock
    +            };
    +        }
         }
     };
    -
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "builtinGlobals": {"type": "boolean"}
    -        },
    -        "additionalProperties": false
    -    }
    -];
    diff --git a/tools/eslint/lib/rules/no-regex-spaces.js b/tools/eslint/lib/rules/no-regex-spaces.js
    index 0de9a49f35a108..05841319243807 100644
    --- a/tools/eslint/lib/rules/no-regex-spaces.js
    +++ b/tools/eslint/lib/rules/no-regex-spaces.js
    @@ -9,27 +9,37 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    return {
    -
    -        "Literal": function(node) {
    -            var token = context.getFirstToken(node),
    -                nodeType = token.type,
    -                nodeValue = token.value,
    -                multipleSpacesRegex = /( {2,})+?/,
    -                regexResults;
    -
    -            if (nodeType === "RegularExpression") {
    -                regexResults = multipleSpacesRegex.exec(nodeValue);
    -
    -                if (regexResults !== null) {
    -                    context.report(node, "Spaces are hard to count. Use {" + regexResults[0].length + "}.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow multiple spaces in regular expression literals",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +
    +            Literal: function(node) {
    +                var token = context.getFirstToken(node),
    +                    nodeType = token.type,
    +                    nodeValue = token.value,
    +                    multipleSpacesRegex = /( {2,})+?/,
    +                    regexResults;
    +
    +                if (nodeType === "RegularExpression") {
    +                    regexResults = multipleSpacesRegex.exec(nodeValue);
    +
    +                    if (regexResults !== null) {
    +                        context.report(node, "Spaces are hard to count. Use {" + regexResults[0].length + "}.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-restricted-globals.js b/tools/eslint/lib/rules/no-restricted-globals.js
    new file mode 100644
    index 00000000000000..3292705b13b31d
    --- /dev/null
    +++ b/tools/eslint/lib/rules/no-restricted-globals.js
    @@ -0,0 +1,80 @@
    +/**
    + * @fileoverview Restrict usage of specified globals.
    + * @author Benoît Zugmeyer
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified global variables",
    +            category: "Variables",
    +            recommended: false
    +        },
    +
    +        schema: {
    +            type: "array",
    +            items: {
    +                type: "string"
    +            },
    +            uniqueItems: true
    +        }
    +    },
    +
    +    create: function(context) {
    +        var restrictedGlobals = context.options;
    +
    +        // if no globals are restricted we don't need to check
    +        if (restrictedGlobals.length === 0) {
    +            return {};
    +        }
    +
    +        /**
    +         * Report a variable to be used as a restricted global.
    +         * @param {Reference} reference the variable reference
    +         * @returns {void}
    +         * @private
    +         */
    +        function reportReference(reference) {
    +            context.report(reference.identifier, "Unexpected use of '{{name}}'", {
    +                name: reference.identifier.name
    +            });
    +        }
    +
    +        /**
    +         * Check if the given name is a restricted global name.
    +         * @param {string} name name of a variable
    +         * @returns {boolean} whether the variable is a restricted global or not
    +         * @private
    +         */
    +        function isRestricted(name) {
    +            return restrictedGlobals.indexOf(name) >= 0;
    +        }
    +
    +        return {
    +            Program: function() {
    +                var scope = context.getScope();
    +
    +                // Report variables declared elsewhere (ex: variables defined as "global" by eslint)
    +                scope.variables.forEach(function(variable) {
    +                    if (!variable.defs.length && isRestricted(variable.name)) {
    +                        variable.references.forEach(reportReference);
    +                    }
    +                });
    +
    +                // Report variables not declared at all
    +                scope.through.forEach(function(reference) {
    +                    if (isRestricted(reference.identifier.name)) {
    +                        reportReference(reference);
    +                    }
    +                });
    +
    +            }
    +        };
    +    }
    +};
    +
    diff --git a/tools/eslint/lib/rules/no-restricted-imports.js b/tools/eslint/lib/rules/no-restricted-imports.js
    index 0ecd2b310813ed..3129ce72784b2a 100644
    --- a/tools/eslint/lib/rules/no-restricted-imports.js
    +++ b/tools/eslint/lib/rules/no-restricted-imports.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,34 +8,44 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var restrictedImports = context.options;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified modules when loaded by `import`",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    // if no imports are restricted we don"t need to check
    -    if (restrictedImports.length === 0) {
    -        return {};
    -    }
    +        schema: {
    +            type: "array",
    +            items: {
    +                type: "string"
    +            },
    +            uniqueItems: true
    +        }
    +    },
    +
    +    create: 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) {
    +        return {
    +            ImportDeclaration: function(node) {
    +                if (node && node.source && node.source.value) {
     
    -                var value = node.source.value.trim();
    +                    var value = node.source.value.trim();
     
    -                if (restrictedImports.indexOf(value) !== -1) {
    -                    context.report(node, "'{{importName}}' import is restricted from being used.", {
    -                        importName: value
    -                    });
    +                    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 b915ed8cd349d9..43e53915628a77 100644
    --- a/tools/eslint/lib/rules/no-restricted-modules.js
    +++ b/tools/eslint/lib/rules/no-restricted-modules.js
    @@ -8,73 +8,84 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    // trim restricted module names
    -    var restrictedModules = context.options;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified modules when loaded by `require`",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    // if no modules are restricted we don't need to check the CallExpressions
    -    if (restrictedModules.length === 0) {
    -        return {};
    -    }
    +        schema: {
    +            type: "array",
    +            items: {
    +                type: "string"
    +            },
    +            uniqueItems: true
    +        }
    +    },
     
    -    /**
    -     * 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";
    -    }
    +    create: function(context) {
     
    -    /**
    -     * 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";
    -    }
    +        // trim restricted module names
    +        var restrictedModules = context.options;
     
    -    /**
    -     * Function to check if a node has an argument that is an restricted module and return its name.
    -     * @param {ASTNode} node The node to check
    -     * @returns {undefined|String} restricted module name or undefined if node argument isn't restricted.
    -     */
    -    function getRestrictedModuleName(node) {
    -        var moduleName;
    +        // if no modules are restricted we don't need to check the CallExpressions
    +        if (restrictedModules.length === 0) {
    +            return {};
    +        }
     
    -        // node has arguments and first argument is string
    -        if (node.arguments.length && isString(node.arguments[0])) {
    -            var argumentValue = node.arguments[0].value.trim();
    +        /**
    +         * 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";
    +        }
     
    -            // check if argument value is in restricted modules array
    -            if (restrictedModules.indexOf(argumentValue) !== -1) {
    -                moduleName = argumentValue;
    -            }
    +        /**
    +         * 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";
             }
     
    -        return moduleName;
    -    }
    +        /**
    +         * Function to check if a node has an argument that is an restricted module and return its name.
    +         * @param {ASTNode} node The node to check
    +         * @returns {undefined|String} restricted module name or undefined if node argument isn't restricted.
    +         */
    +        function getRestrictedModuleName(node) {
    +            var moduleName;
     
    -    return {
    -        "CallExpression": function(node) {
    -            if (isRequireCall(node)) {
    -                var restrictedModuleName = getRestrictedModuleName(node);
    +            // node has arguments and first argument is string
    +            if (node.arguments.length && isString(node.arguments[0])) {
    +                var argumentValue = node.arguments[0].value.trim();
     
    -                if (restrictedModuleName) {
    -                    context.report(node, "'{{moduleName}}' module is restricted from being used.", {
    -                        moduleName: restrictedModuleName
    -                    });
    +                // check if argument value is in restricted modules array
    +                if (restrictedModules.indexOf(argumentValue) !== -1) {
    +                    moduleName = argumentValue;
                     }
                 }
    +
    +            return moduleName;
             }
    -    };
    -};
     
    -module.exports.schema = {
    -    "type": "array",
    -    "items": {
    -        "type": "string"
    -    },
    -    "uniqueItems": true
    +        return {
    +            CallExpression: function(node) {
    +                if (isRequireCall(node)) {
    +                    var restrictedModuleName = getRestrictedModuleName(node);
    +
    +                    if (restrictedModuleName) {
    +                        context.report(node, "'{{moduleName}}' module is restricted from being used.", {
    +                            moduleName: restrictedModuleName
    +                        });
    +                    }
    +                }
    +            }
    +        };
    +    }
     };
    diff --git a/tools/eslint/lib/rules/no-restricted-syntax.js b/tools/eslint/lib/rules/no-restricted-syntax.js
    index 1f88beda994c21..cd9eb603f9870b 100644
    --- a/tools/eslint/lib/rules/no-restricted-syntax.js
    +++ b/tools/eslint/lib/rules/no-restricted-syntax.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use of certain node types
      * @author Burak Yigit Kaya
    - * @copyright 2015 Burak Yigit Kaya. All rights reserved.
      */
     "use strict";
     
    @@ -11,33 +10,44 @@
     
     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;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified syntax",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -        return result;
    -    }, {});
    +        schema: {
    +            type: "array",
    +            items: [
    +                {
    +                    enum: Object.keys(nodeTypes).map(function(k) {
    +                        return nodeTypes[k];
    +                    })
    +                }
    +            ],
    +            uniqueItems: true,
    +            minItems: 0
    +        }
    +    },
     
    -};
    +    create: function(context) {
     
    -module.exports.schema = {
    -    "type": "array",
    -    "items": [
    -        {
    -            "enum": Object.keys(nodeTypes).map(function(k) {
    -                return nodeTypes[k];
    -            })
    +        /**
    +         * 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);
             }
    -    ],
    -    "uniqueItems": true,
    -    "minItems": 0
    +
    +        return context.options.reduce(function(result, nodeType) {
    +            result[nodeType] = warn;
    +
    +            return result;
    +        }, {});
    +
    +    }
     };
    diff --git a/tools/eslint/lib/rules/no-return-assign.js b/tools/eslint/lib/rules/no-return-assign.js
    index 58d1db4222f27c..0d9e0b4b07b318 100644
    --- a/tools/eslint/lib/rules/no-return-assign.js
    +++ b/tools/eslint/lib/rules/no-return-assign.js
    @@ -34,39 +34,51 @@ function isEnclosedInParens(node, context) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var always = (context.options[0] || "except-parens") !== "except-parens";
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow assignment operators in `return` statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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);
    -        }
    -    }
    +        schema: [
    +            {
    +                enum: ["except-parens", "always"]
    +            }
    +        ]
    +    },
     
    -    return {
    -        "ReturnStatement": function(node) {
    -            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);
    +    create: 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);
                 }
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "enum": ["except-parens", "always"]
    +        return {
    +            ReturnStatement: function(node) {
    +                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 9526061b24fe3e..0605cd86429054 100644
    --- a/tools/eslint/lib/rules/no-script-url.js
    +++ b/tools/eslint/lib/rules/no-script-url.js
    @@ -11,24 +11,34 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `javascript",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Literal": function(node) {
    +    create: function(context) {
     
    -            var value;
    +        return {
     
    -            if (node.value && typeof node.value === "string") {
    -                value = node.value.toLowerCase();
    +            Literal: function(node) {
     
    -                if (value.indexOf("javascript:") === 0) {
    -                    context.report(node, "Script URL is a form of eval.");
    +                var value;
    +
    +                if (node.value && typeof node.value === "string") {
    +                    value = node.value.toLowerCase();
    +
    +                    if (value.indexOf("javascript:") === 0) {
    +                        context.report(node, "Script URL is a form of eval.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-self-assign.js b/tools/eslint/lib/rules/no-self-assign.js
    index 67af024191b455..bcccc3d8380a09 100644
    --- a/tools/eslint/lib/rules/no-self-assign.js
    +++ b/tools/eslint/lib/rules/no-self-assign.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -25,6 +23,7 @@ function eachSelfAssignment(left, right, report) {
         var i, j;
     
         if (!left || !right) {
    +
             // do nothing
         } else if (
             left.type === "Identifier" &&
    @@ -37,6 +36,7 @@ function eachSelfAssignment(left, right, report) {
             right.type === "ArrayExpression"
         ) {
             var end = Math.min(left.elements.length, right.elements.length);
    +
             for (i = 0; i < end; ++i) {
                 var rightElement = right.elements[i];
     
    @@ -57,9 +57,11 @@ function eachSelfAssignment(left, right, report) {
             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;
    @@ -93,26 +95,39 @@ function eachSelfAssignment(left, right, 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
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow assignments where both sides are exactly the same",
    +            category: "Best Practices",
    +            recommended: true
    +        },
    +
    +        schema: []
    +    },
     
    -    return {
    -        "AssignmentExpression": function(node) {
    -            eachSelfAssignment(node.left, node.right, report);
    +    create: 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
    +            });
             }
    -    };
    -};
     
    -module.exports.schema = [];
    +        return {
    +            AssignmentExpression: function(node) {
    +                if (node.operator === "=") {
    +                    eachSelfAssignment(node.left, node.right, report);
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-self-compare.js b/tools/eslint/lib/rules/no-self-compare.js
    index 6d8e11a5950261..eef05080b75a15 100644
    --- a/tools/eslint/lib/rules/no-self-compare.js
    +++ b/tools/eslint/lib/rules/no-self-compare.js
    @@ -10,20 +10,31 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow comparisons where both sides are exactly the same",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "BinaryExpression": function(node) {
    -            var operators = ["===", "==", "!==", "!=", ">", "<", ">=", "<="];
    -            if (operators.indexOf(node.operator) > -1 &&
    -                (node.left.type === "Identifier" && node.right.type === "Identifier" && node.left.name === node.right.name ||
    -                node.left.type === "Literal" && node.right.type === "Literal" && node.left.value === node.right.value)) {
    -                context.report(node, "Comparing to itself is potentially pointless.");
    +    create: function(context) {
    +
    +        return {
    +
    +            BinaryExpression: function(node) {
    +                var operators = ["===", "==", "!==", "!=", ">", "<", ">=", "<="];
    +
    +                if (operators.indexOf(node.operator) > -1 &&
    +                    (node.left.type === "Identifier" && node.right.type === "Identifier" && node.left.name === node.right.name ||
    +                    node.left.type === "Literal" && node.right.type === "Literal" && node.left.value === node.right.value)) {
    +                    context.report(node, "Comparing to itself is potentially pointless.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js
    index 538e36a12fc2a6..ea20a4b955dce0 100644
    --- a/tools/eslint/lib/rules/no-sequences.js
    +++ b/tools/eslint/lib/rules/no-sequences.js
    @@ -9,87 +9,99 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    /**
    -     * Parts of the grammar that are required to have parens.
    -     */
    -    var parenthesized = {
    -        "DoWhileStatement": "test",
    -        "IfStatement": "test",
    -        "SwitchStatement": "discriminant",
    -        "WhileStatement": "test",
    -        "WithStatement": "object"
    -
    -        // Omitting CallExpression - commas are parsed as argument separators
    -        // Omitting NewExpression - commas are parsed as argument separators
    -        // Omitting ForInStatement - parts aren't individually parenthesised
    -        // Omitting ForStatement - parts aren't individually parenthesised
    -    };
    -
    -    /**
    -     * Determines whether a node is required by the grammar to be wrapped in
    -     * parens, e.g. the test of an if statement.
    -     * @param {ASTNode} node - The AST node
    -     * @returns {boolean} True if parens around node belong to parent node.
    -     */
    -    function requiresExtraParens(node) {
    -        return node.parent && parenthesized[node.parent.type] &&
    -                node === node.parent[parenthesized[node.parent.type]];
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow comma operators",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Check if a node is wrapped in parens.
    -     * @param {ASTNode} node - The AST node
    -     * @returns {boolean} True if the node has a paren on each side.
    -     */
    -    function isParenthesised(node) {
    -        var previousToken = context.getTokenBefore(node),
    -            nextToken = context.getTokenAfter(node);
    -
    -        return previousToken && nextToken &&
    -            previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +        schema: []
    +    },
     
    -    /**
    -     * Check if a node is wrapped in two levels of parens.
    -     * @param {ASTNode} node - The AST node
    -     * @returns {boolean} True if two parens surround the node on each side.
    -     */
    -    function isParenthesisedTwice(node) {
    -        var previousToken = context.getTokenBefore(node, 1),
    -            nextToken = context.getTokenAfter(node, 1);
    -
    -        return isParenthesised(node) && previousToken && nextToken &&
    -            previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    -            nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    -    }
    +    create: function(context) {
     
    -    return {
    -        "SequenceExpression": function(node) {
    -            // Always allow sequences in for statement update
    -            if (node.parent.type === "ForStatement" &&
    -                    (node === node.parent.init || node === node.parent.update)) {
    -                return;
    -            }
    +        /**
    +         * Parts of the grammar that are required to have parens.
    +         */
    +        var parenthesized = {
    +            DoWhileStatement: "test",
    +            IfStatement: "test",
    +            SwitchStatement: "discriminant",
    +            WhileStatement: "test",
    +            WithStatement: "object"
    +
    +            // Omitting CallExpression - commas are parsed as argument separators
    +            // Omitting NewExpression - commas are parsed as argument separators
    +            // Omitting ForInStatement - parts aren't individually parenthesised
    +            // Omitting ForStatement - parts aren't individually parenthesised
    +        };
    +
    +        /**
    +         * Determines whether a node is required by the grammar to be wrapped in
    +         * parens, e.g. the test of an if statement.
    +         * @param {ASTNode} node - The AST node
    +         * @returns {boolean} True if parens around node belong to parent node.
    +         */
    +        function requiresExtraParens(node) {
    +            return node.parent && parenthesized[node.parent.type] &&
    +                    node === node.parent[parenthesized[node.parent.type]];
    +        }
    +
    +        /**
    +         * Check if a node is wrapped in parens.
    +         * @param {ASTNode} node - The AST node
    +         * @returns {boolean} True if the node has a paren on each side.
    +         */
    +        function isParenthesised(node) {
    +            var previousToken = context.getTokenBefore(node),
    +                nextToken = context.getTokenAfter(node);
    +
    +            return previousToken && nextToken &&
    +                previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +                nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +        }
    +
    +        /**
    +         * Check if a node is wrapped in two levels of parens.
    +         * @param {ASTNode} node - The AST node
    +         * @returns {boolean} True if two parens surround the node on each side.
    +         */
    +        function isParenthesisedTwice(node) {
    +            var previousToken = context.getTokenBefore(node, 1),
    +                nextToken = context.getTokenAfter(node, 1);
     
    -            // Wrapping a sequence in extra parens indicates intent
    -            if (requiresExtraParens(node)) {
    -                if (isParenthesisedTwice(node)) {
    +            return isParenthesised(node) && previousToken && nextToken &&
    +                previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
    +                nextToken.value === ")" && nextToken.range[0] >= node.range[1];
    +        }
    +
    +        return {
    +            SequenceExpression: function(node) {
    +
    +                // Always allow sequences in for statement update
    +                if (node.parent.type === "ForStatement" &&
    +                        (node === node.parent.init || node === node.parent.update)) {
                         return;
                     }
    -            } else {
    -                if (isParenthesised(node)) {
    -                    return;
    +
    +                // Wrapping a sequence in extra parens indicates intent
    +                if (requiresExtraParens(node)) {
    +                    if (isParenthesisedTwice(node)) {
    +                        return;
    +                    }
    +                } else {
    +                    if (isParenthesised(node)) {
    +                        return;
    +                    }
                     }
    -            }
     
    -            var child = context.getTokenAfter(node.expressions[0]);
    -            context.report(node, child.loc.start, "Unexpected use of comma operator.");
    -        }
    -    };
    +                var child = context.getTokenAfter(node.expressions[0]);
     
    -};
    +                context.report(node, child.loc.start, "Unexpected use of comma operator.");
    +            }
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-shadow-restricted-names.js b/tools/eslint/lib/rules/no-shadow-restricted-names.js
    index e39cd00f472e7f..b7731d9d6767bb 100644
    --- a/tools/eslint/lib/rules/no-shadow-restricted-names.js
    +++ b/tools/eslint/lib/rules/no-shadow-restricted-names.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1)
      * @author Michael Ficarra
    - * @copyright 2013 Michael Ficarra. All rights reserved.
      */
     "use strict";
     
    @@ -9,46 +8,56 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow identifiers from shadowing restricted names",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    var RESTRICTED = ["undefined", "NaN", "Infinity", "arguments", "eval"];
    +        schema: []
    +    },
     
    -    /**
    -     * 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 + "'.");
    -        }
    -    }
    +    create: function(context) {
     
    -    return {
    -        "VariableDeclarator": function(node) {
    -            checkForViolation(node.id);
    -        },
    -        "ArrowFunctionExpression": function(node) {
    -            [].map.call(node.params, checkForViolation);
    -        },
    -        "FunctionExpression": function(node) {
    -            if (node.id) {
    -                checkForViolation(node.id);
    +        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 + "'.");
                 }
    -            [].map.call(node.params, checkForViolation);
    -        },
    -        "FunctionDeclaration": function(node) {
    -            if (node.id) {
    +        }
    +
    +        return {
    +            VariableDeclarator: function(node) {
                     checkForViolation(node.id);
    +            },
    +            ArrowFunctionExpression: function(node) {
                     [].map.call(node.params, checkForViolation);
    +            },
    +            FunctionExpression: function(node) {
    +                if (node.id) {
    +                    checkForViolation(node.id);
    +                }
    +                [].map.call(node.params, checkForViolation);
    +            },
    +            FunctionDeclaration: function(node) {
    +                if (node.id) {
    +                    checkForViolation(node.id);
    +                    [].map.call(node.params, checkForViolation);
    +                }
    +            },
    +            CatchClause: function(node) {
    +                checkForViolation(node.param);
                 }
    -        },
    -        "CatchClause": function(node) {
    -            checkForViolation(node.param);
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-shadow.js b/tools/eslint/lib/rules/no-shadow.js
    index 6414e53e21003d..ee0dd69f3a571f 100644
    --- a/tools/eslint/lib/rules/no-shadow.js
    +++ b/tools/eslint/lib/rules/no-shadow.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag on declaring variables already declared in the outer scope
      * @author Ilya Volodin
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -16,158 +15,174 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var options = {
    -        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;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `var` declarations from shadowing variables in the outer scope",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    /**
    -     * Checks if a variable of the class name in the class scope of ClassDeclaration.
    -     *
    -     * ClassDeclaration creates two variables of its name into its outer scope and its class scope.
    -     * So we should ignore the variable in the class scope.
    -     *
    -     * @param {Object} variable The variable to check.
    -     * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration.
    -     */
    -    function isDuplicatedClassNameVariable(variable) {
    -        var block = variable.scope.block;
    -        return block.type === "ClassDeclaration" && block.id === variable.identifiers[0];
    -    }
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    builtinGlobals: {type: "boolean"},
    +                    hoist: {enum: ["all", "functions", "never"]},
    +                    allow: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var options = {
    +            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 is inside the initializer of scopeVar.
    -     *
    -     * To avoid reporting at declarations such as `var a = function a() {};`.
    -     * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
    -     *
    -     * @param {Object} variable The variable to check.
    -     * @param {Object} scopeVar The scope variable to look for.
    -     * @returns {boolean} Whether or not the variable is inside initializer of scopeVar.
    -     */
    -    function isOnInitializer(variable, scopeVar) {
    -        var outerScope = scopeVar.scope;
    -        var outerDef = scopeVar.defs[0];
    -        var outer = outerDef && outerDef.parent && outerDef.parent.range;
    -        var innerScope = variable.scope;
    -        var innerDef = variable.defs[0];
    -        var inner = innerDef && innerDef.name.range;
    -
    -        return (
    -            outer &&
    -            inner &&
    -            outer[0] < inner[0] &&
    -            inner[1] < outer[1] &&
    -            ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
    -            outerScope === innerScope.upper
    -        );
    -    }
    +        /**
    +         * Checks if a variable of the class name in the class scope of ClassDeclaration.
    +         *
    +         * ClassDeclaration creates two variables of its name into its outer scope and its class scope.
    +         * So we should ignore the variable in the class scope.
    +         *
    +         * @param {Object} variable The variable to check.
    +         * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration.
    +         */
    +        function isDuplicatedClassNameVariable(variable) {
    +            var block = variable.scope.block;
    +
    +            return block.type === "ClassDeclaration" && block.id === variable.identifiers[0];
    +        }
     
    -    /**
    -     * Get a range of a variable's identifier node.
    -     * @param {Object} variable The variable to get.
    -     * @returns {Array|undefined} The range of the variable's identifier node.
    -     */
    -    function getNameRange(variable) {
    -        var def = variable.defs[0];
    -        return def && def.name.range;
    -    }
    +        /**
    +         * Checks if a variable is inside the initializer of scopeVar.
    +         *
    +         * To avoid reporting at declarations such as `var a = function a() {};`.
    +         * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
    +         *
    +         * @param {Object} variable The variable to check.
    +         * @param {Object} scopeVar The scope variable to look for.
    +         * @returns {boolean} Whether or not the variable is inside initializer of scopeVar.
    +         */
    +        function isOnInitializer(variable, scopeVar) {
    +            var outerScope = scopeVar.scope;
    +            var outerDef = scopeVar.defs[0];
    +            var outer = outerDef && outerDef.parent && outerDef.parent.range;
    +            var innerScope = variable.scope;
    +            var innerDef = variable.defs[0];
    +            var inner = innerDef && innerDef.name.range;
    +
    +            return (
    +                outer &&
    +                inner &&
    +                outer[0] < inner[0] &&
    +                inner[1] < outer[1] &&
    +                ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
    +                outerScope === innerScope.upper
    +            );
    +        }
     
    -    /**
    -     * Checks if a variable is in TDZ of scopeVar.
    -     * @param {Object} variable The variable to check.
    -     * @param {Object} scopeVar The variable of TDZ.
    -     * @returns {boolean} Whether or not the variable is in TDZ of scopeVar.
    -     */
    -    function isInTdz(variable, scopeVar) {
    -        var outerDef = scopeVar.defs[0];
    -        var inner = getNameRange(variable);
    -        var outer = getNameRange(scopeVar);
    -        return (
    -            inner &&
    -            outer &&
    -            inner[1] < outer[0] &&
    -            // Excepts FunctionDeclaration if is {"hoist":"function"}.
    -            (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration")
    -        );
    -    }
    +        /**
    +         * Get a range of a variable's identifier node.
    +         * @param {Object} variable The variable to get.
    +         * @returns {Array|undefined} The range of the variable's identifier node.
    +         */
    +        function getNameRange(variable) {
    +            var def = variable.defs[0];
     
    -    /**
    -     * Checks the current context for shadowed variables.
    -     * @param {Scope} scope - Fixme
    -     * @returns {void}
    -     */
    -    function checkForShadows(scope) {
    -        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;
    -            }
    +            return def && def.name.range;
    +        }
     
    -            // 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
    -                });
    -            }
    +        /**
    +         * Checks if a variable is in TDZ of scopeVar.
    +         * @param {Object} variable The variable to check.
    +         * @param {Object} scopeVar The variable of TDZ.
    +         * @returns {boolean} Whether or not the variable is in TDZ of scopeVar.
    +         */
    +        function isInTdz(variable, scopeVar) {
    +            var outerDef = scopeVar.defs[0];
    +            var inner = getNameRange(variable);
    +            var outer = getNameRange(scopeVar);
    +
    +            return (
    +                inner &&
    +                outer &&
    +                inner[1] < outer[0] &&
    +
    +                // Excepts FunctionDeclaration if is {"hoist":"function"}.
    +                (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration")
    +            );
             }
    -    }
     
    -    return {
    -        "Program:exit": function() {
    -            var globalScope = context.getScope();
    -            var stack = globalScope.childScopes.slice();
    -            var scope;
    +        /**
    +         * Checks the current context for shadowed variables.
    +         * @param {Scope} scope - Fixme
    +         * @returns {void}
    +         */
    +        function checkForShadows(scope) {
    +            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;
    +                }
     
    -            while (stack.length) {
    -                scope = stack.pop();
    -                stack.push.apply(stack, scope.childScopes);
    -                checkForShadows(scope);
    +                // 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();
    +                var stack = globalScope.childScopes.slice();
    +                var scope;
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "builtinGlobals": {"type": "boolean"},
    -            "hoist": {"enum": ["all", "functions", "never"]},
    -            "allow": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    +                while (stack.length) {
    +                    scope = stack.pop();
    +                    stack.push.apply(stack, scope.childScopes);
    +                    checkForShadows(scope);
                     }
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-spaced-func.js b/tools/eslint/lib/rules/no-spaced-func.js
    index 551a3c609717c5..f0a16121136cf6 100644
    --- a/tools/eslint/lib/rules/no-spaced-func.js
    +++ b/tools/eslint/lib/rules/no-spaced-func.js
    @@ -9,52 +9,63 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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 = 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);
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow spacing between `function` identifiers and their applications",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        fixable: "whitespace",
    +        schema: []
    +    },
    +
    +    create: 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 = sourceCode.getLastToken(node.callee),
    +                prevToken = lastCalleeToken,
    +                parenToken = sourceCode.getTokenAfter(lastCalleeToken);
     
    -        // look for a space between the callee and the open 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]]);
    -                }
    -            });
    +            // 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 (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]]);
    +                    }
    +                });
    +            }
             }
    -    }
     
    -    return {
    -        "CallExpression": detectOpenSpaces,
    -        "NewExpression": detectOpenSpaces
    -    };
    +        return {
    +            CallExpression: detectOpenSpaces,
    +            NewExpression: detectOpenSpaces
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-sparse-arrays.js b/tools/eslint/lib/rules/no-sparse-arrays.js
    index 808ec99bfc16fa..b1ae0ba74036b4 100644
    --- a/tools/eslint/lib/rules/no-sparse-arrays.js
    +++ b/tools/eslint/lib/rules/no-sparse-arrays.js
    @@ -8,26 +8,36 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow sparse arrays",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    +        schema: []
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +    create: function(context) {
     
    -    return {
     
    -        "ArrayExpression": function(node) {
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            var emptySpot = node.elements.indexOf(null) > -1;
    +        return {
     
    -            if (emptySpot) {
    -                context.report(node, "Unexpected comma in middle of array.");
    +            ArrayExpression: function(node) {
    +
    +                var emptySpot = node.elements.indexOf(null) > -1;
    +
    +                if (emptySpot) {
    +                    context.report(node, "Unexpected comma in middle of array.");
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-sync.js b/tools/eslint/lib/rules/no-sync.js
    index 481514b83d492b..be6860e75af4ac 100644
    --- a/tools/eslint/lib/rules/no-sync.js
    +++ b/tools/eslint/lib/rules/no-sync.js
    @@ -11,20 +11,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow synchronous methods",
    +            category: "Node.js and CommonJS",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "MemberExpression": function(node) {
    -            var propertyName = node.property.name,
    -                syncRegex = /.*Sync$/;
    +    create: function(context) {
     
    -            if (syncRegex.exec(propertyName) !== null) {
    -                context.report(node, "Unexpected sync method: '" + propertyName + "'.");
    +        return {
    +
    +            MemberExpression: function(node) {
    +                var propertyName = node.property.name,
    +                    syncRegex = /.*Sync$/;
    +
    +                if (syncRegex.exec(propertyName) !== null) {
    +                    context.report(node, "Unexpected sync method: '" + propertyName + "'.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-ternary.js b/tools/eslint/lib/rules/no-ternary.js
    index 79f8576b5fc8a7..fb986152bbf74b 100644
    --- a/tools/eslint/lib/rules/no-ternary.js
    +++ b/tools/eslint/lib/rules/no-ternary.js
    @@ -9,16 +9,26 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow ternary operators",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "ConditionalExpression": function(node) {
    -            context.report(node, "Ternary operator used.");
    -        }
    +    create: function(context) {
     
    -    };
    +        return {
     
    -};
    +            ConditionalExpression: function(node) {
    +                context.report(node, "Ternary operator used.");
    +            }
    +
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-this-before-super.js b/tools/eslint/lib/rules/no-this-before-super.js
    index ade30340c6c64c..fb172f47f3a6fa 100644
    --- a/tools/eslint/lib/rules/no-this-before-super.js
    +++ b/tools/eslint/lib/rules/no-this-before-super.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow using `this`/`super` before `super()`.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -35,157 +34,266 @@ function isConstructorFunction(node) {
     // 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);
    -
    -    /**
    -     * 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 isCalled(segment) {
    -        return Boolean(segInfoMap[segment.id]);
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `this`/`super` before calling `super()` in constructors",
    +            category: "ECMAScript 6",
    +            recommended: true
    +        },
     
    -    /**
    -     * Checks whether or not this is in a constructor.
    -     * @returns {boolean} `true` if this is in a constructor.
    -     */
    -    function isInConstructor() {
    -        return Boolean(
    -            funcInfo &&
    -            funcInfo.hasExtends &&
    -            funcInfo.scope === context.getScope().variableScope
    -        );
    -    }
    +        schema: []
    +    },
     
    -    /**
    -     * Checks whether or not this is before `super()` is called.
    -     * @returns {boolean} `true` if this is before `super()` is called.
    -     */
    -    function isBeforeCallOfSuper() {
    -        return (
    -            isInConstructor(funcInfo) &&
    -            !funcInfo.codePath.currentSegments.every(isCalled)
    -        );
    -    }
    +    create: function(context) {
     
    -    return {
    -        /**
    -         * Stacks a constructor information.
    -         * @param {CodePath} codePath - A code path which was started.
    -         * @param {ASTNode} node - The current node.
    -         * @returns {void}
    +        /*
    +         * 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.
              */
    -        "onCodePathStart": function(codePath, node) {
    -            if (!isConstructorFunction(node)) {
    -                return;
    -            }
    -
    -            // 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
    -            };
    -        },
    +        var funcInfo = null;
     
    -        /**
    -         * Pops a constructor information.
    -         * @param {CodePath} codePath - A code path which was ended.
    -         * @param {ASTNode} node - The current node.
    -         * @returns {void}
    +        /*
    +         * Information for each code path segment.
    +         * Each key is the id of a code path segment.
    +         * Each value is an object:
    +         * - superCalled:  The flag which shows `super()` called in all code paths.
    +         * - invalidNodes: The array of invalid ThisExpression and Super nodes.
              */
    -        "onCodePathEnd": function(codePath, node) {
    -            if (isConstructorFunction(node)) {
    -                funcInfo = funcInfo.upper;
    -            }
    -        },
    +        var segInfoMap = Object.create(null);
     
             /**
    -         * Initialize information of a given code path segment.
    -         * @param {CodePathSegment} segment - A code path segment to initialize.
    -         * @returns {void}
    +         * 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.
              */
    -        "onCodePathSegmentStart": function(segment) {
    -            if (!isInConstructor(funcInfo)) {
    -                return;
    -            }
    -
    -            // Initialize info.
    -            segInfoMap[segment.id] = (
    -                segment.prevSegments.length > 0 &&
    -                segment.prevSegments.every(isCalled)
    -            );
    -        },
    +        function isCalled(segment) {
    +            return !segment.reachable || segInfoMap[segment.id].superCalled;
    +        }
     
             /**
    -         * Reports if this is before `super()`.
    -         * @param {ASTNode} node - A target node.
    -         * @returns {void}
    +         * Checks whether or not this is in a constructor.
    +         * @returns {boolean} `true` if this is in a constructor.
              */
    -        "ThisExpression": function(node) {
    -            if (isBeforeCallOfSuper()) {
    -                context.report({
    -                    message: "'this' is not allowed before 'super()'.",
    -                    node: node
    -                });
    -            }
    -        },
    +        function isInConstructorOfDerivedClass() {
    +            return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends);
    +        }
     
             /**
    -         * Reports if this is before `super()`.
    -         * @param {ASTNode} node - A target node.
    -         * @returns {void}
    +         * Checks whether or not this is before `super()` is called.
    +         * @returns {boolean} `true` if this is before `super()` is called.
              */
    -        "Super": function(node) {
    -            if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) {
    -                context.report({
    -                    message: "'super' is not allowed before 'super()'.",
    -                    node: node
    -                });
    -            }
    -        },
    +        function isBeforeCallOfSuper() {
    +            return (
    +                isInConstructorOfDerivedClass(funcInfo) &&
    +                !funcInfo.codePath.currentSegments.every(isCalled)
    +            );
    +        }
     
             /**
    -         * Marks `super()` called.
    -         * @param {ASTNode} node - A target node.
    +         * Sets a given node as invalid.
    +         * @param {ASTNode} node - A node to set as invalid. This is one of
    +         *      a ThisExpression and a Super.
              * @returns {void}
              */
    -        "CallExpression:exit": function(node) {
    -            if (node.callee.type === "Super" && isBeforeCallOfSuper()) {
    -                var segments = funcInfo.codePath.currentSegments;
    -                for (var i = 0; i < segments.length; ++i) {
    -                    segInfoMap[segments[i].id] = true;
    +        function setInvalid(node) {
    +            var segments = funcInfo.codePath.currentSegments;
    +
    +            for (var i = 0; i < segments.length; ++i) {
    +                var segment = segments[i];
    +
    +                if (segment.reachable) {
    +                    segInfoMap[segment.id].invalidNodes.push(node);
                     }
                 }
    -        },
    +        }
     
             /**
    -         * Resets state.
    +         * Sets the current segment as `super` was called.
              * @returns {void}
              */
    -        "Program:exit": function() {
    -            segInfoMap = Object.create(null);
    +        function setSuperCalled() {
    +            var segments = funcInfo.codePath.currentSegments;
    +
    +            for (var i = 0; i < segments.length; ++i) {
    +                var segment = segments[i];
    +
    +                if (segment.reachable) {
    +                    segInfoMap[segment.id].superCalled = true;
    +                }
    +            }
             }
    -    };
    -};
     
    -module.exports.schema = [];
    +        return {
    +
    +            /**
    +             * Adds information of a constructor into the stack.
    +             * @param {CodePath} codePath - A code path which was started.
    +             * @param {ASTNode} node - The current node.
    +             * @returns {void}
    +             */
    +            onCodePathStart: function(codePath, node) {
    +                if (isConstructorFunction(node)) {
    +
    +                    // Class > ClassBody > MethodDefinition > FunctionExpression
    +                    var classNode = node.parent.parent.parent;
    +
    +                    funcInfo = {
    +                        upper: funcInfo,
    +                        isConstructor: true,
    +                        hasExtends: Boolean(
    +                            classNode.superClass &&
    +                            !astUtils.isNullOrUndefined(classNode.superClass)
    +                        ),
    +                        codePath: codePath
    +                    };
    +                } else {
    +                    funcInfo = {
    +                        upper: funcInfo,
    +                        isConstructor: false,
    +                        hasExtends: false,
    +                        codePath: codePath
    +                    };
    +                }
    +            },
    +
    +            /**
    +             * Removes the top of stack item.
    +             *
    +             * And this treverses all segments of this code path then reports every
    +             * invalid node.
    +             *
    +             * @param {CodePath} codePath - A code path which was ended.
    +             * @param {ASTNode} node - The current node.
    +             * @returns {void}
    +             */
    +            onCodePathEnd: function(codePath) {
    +                var isDerivedClass = funcInfo.hasExtends;
    +
    +                funcInfo = funcInfo.upper;
    +                if (!isDerivedClass) {
    +                    return;
    +                }
    +
    +                codePath.traverseSegments(function(segment, controller) {
    +                    var info = segInfoMap[segment.id];
    +
    +                    for (var i = 0; i < info.invalidNodes.length; ++i) {
    +                        var invalidNode = info.invalidNodes[i];
    +
    +                        context.report({
    +                            message: "'{{kind}}' is not allowed before 'super()'.",
    +                            node: invalidNode,
    +                            data: {
    +                                kind: invalidNode.type === "Super" ? "super" : "this"
    +                            }
    +                        });
    +                    }
    +
    +                    if (info.superCalled) {
    +                        controller.skip();
    +                    }
    +                });
    +            },
    +
    +            /**
    +             * Initialize information of a given code path segment.
    +             * @param {CodePathSegment} segment - A code path segment to initialize.
    +             * @returns {void}
    +             */
    +            onCodePathSegmentStart: function(segment) {
    +                if (!isInConstructorOfDerivedClass(funcInfo)) {
    +                    return;
    +                }
    +
    +                // Initialize info.
    +                segInfoMap[segment.id] = {
    +                    superCalled: (
    +                        segment.prevSegments.length > 0 &&
    +                        segment.prevSegments.every(isCalled)
    +                    ),
    +                    invalidNodes: []
    +                };
    +            },
    +
    +            /**
    +             * Update information of the code path segment when a code path was
    +             * looped.
    +             * @param {CodePathSegment} fromSegment - The code path segment of the
    +             *      end of a loop.
    +             * @param {CodePathSegment} toSegment - A code path segment of the head
    +             *      of a loop.
    +             * @returns {void}
    +             */
    +            onCodePathSegmentLoop: function(fromSegment, toSegment) {
    +                if (!isInConstructorOfDerivedClass(funcInfo)) {
    +                    return;
    +                }
    +
    +                // Update information inside of the loop.
    +                funcInfo.codePath.traverseSegments(
    +                    {first: toSegment, last: fromSegment},
    +                    function(segment, controller) {
    +                        var info = segInfoMap[segment.id];
    +
    +                        if (info.superCalled) {
    +                            info.invalidNodes = [];
    +                            controller.skip();
    +                        } else if (
    +                            segment.prevSegments.length > 0 &&
    +                            segment.prevSegments.every(isCalled)
    +                        ) {
    +                            info.superCalled = true;
    +                            info.invalidNodes = [];
    +                        }
    +                    }
    +                );
    +            },
    +
    +            /**
    +             * Reports if this is before `super()`.
    +             * @param {ASTNode} node - A target node.
    +             * @returns {void}
    +             */
    +            ThisExpression: function(node) {
    +                if (isBeforeCallOfSuper()) {
    +                    setInvalid(node);
    +                }
    +            },
    +
    +            /**
    +             * Reports if this is before `super()`.
    +             * @param {ASTNode} node - A target node.
    +             * @returns {void}
    +             */
    +            Super: function(node) {
    +                if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) {
    +                    setInvalid(node);
    +                }
    +            },
    +
    +            /**
    +             * Marks `super()` called.
    +             * @param {ASTNode} node - A target node.
    +             * @returns {void}
    +             */
    +            "CallExpression:exit": function(node) {
    +                if (node.callee.type === "Super" && isBeforeCallOfSuper()) {
    +                    setSuperCalled();
    +                }
    +            },
    +
    +            /**
    +             * Resets state.
    +             * @returns {void}
    +             */
    +            "Program:exit": function() {
    +                segInfoMap = Object.create(null);
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-throw-literal.js b/tools/eslint/lib/rules/no-throw-literal.js
    index 1a0c01ab360690..bedf94379e81f3 100644
    --- a/tools/eslint/lib/rules/no-throw-literal.js
    +++ b/tools/eslint/lib/rules/no-throw-literal.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -31,6 +29,7 @@ function couldBeError(node) {
     
             case "SequenceExpression":
                 var exprs = node.expressions;
    +
                 return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1]);
     
             case "LogicalExpression":
    @@ -48,23 +47,33 @@ function couldBeError(node) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow throwing literals as exceptions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
     
    -    return {
    +    create: function(context) {
     
    -        "ThrowStatement": function(node) {
    -            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.");
    +        return {
    +
    +            ThrowStatement: function(node) {
    +                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.");
    +                    }
                     }
    -            }
     
    -        }
    +            }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-trailing-spaces.js b/tools/eslint/lib/rules/no-trailing-spaces.js
    index ac3c975d6e3eba..a08907fc95f343 100644
    --- a/tools/eslint/lib/rules/no-trailing-spaces.js
    +++ b/tools/eslint/lib/rules/no-trailing-spaces.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Disallow trailing spaces at the end of lines.
      * @author Nodeca Team 
    - * @copyright 2015 Greg Cochard
      */
     "use strict";
     
    @@ -9,98 +8,128 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]",
    -        SKIP_BLANK = "^" + 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
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -
    -        "Program": function checkTrailingSpaces(node) {
    -
    -            // Let's hack. Since Espree does not return whitespace nodes,
    -            // fetch the source code and do matching via regexps.
    -
    -            var src = context.getSource(),
    -                re = new RegExp(NONBLANK),
    -                skipMatch = new RegExp(SKIP_BLANK),
    -                matches, lines = src.split(/\r?\n/),
    -                linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g),
    -                location,
    -                totalLength = 0,
    -                fixRange = [];
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow trailing whitespace at the end of lines",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -            for (var i = 0, ii = lines.length; i < ii; i++) {
    -                matches = re.exec(lines[i]);
    +        fixable: "whitespace",
     
    -                // 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;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    skipBlankLines: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var sourceCode = context.getSourceCode();
    +
    +        var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]",
    +            SKIP_BLANK = "^" + 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);
    +                }
    +            });
    +        }
     
    -                if (matches) {
     
    -                    // If the line has only whitespace, and skipBlankLines
    -                    // is true, don't report it
    -                    if (skipBlankLines && skipMatch.test(lines[i])) {
    -                        continue;
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +
    +            Program: function checkTrailingSpaces(node) {
    +
    +                // Let's hack. Since Espree does not return whitespace nodes,
    +                // fetch the source code and do matching via regexps.
    +
    +                var re = new RegExp(NONBLANK),
    +                    skipMatch = new RegExp(SKIP_BLANK),
    +                    matches,
    +                    lines = sourceCode.lines,
    +                    linebreaks = sourceCode.getText().match(/\r\n|\r|\n|\u2028|\u2029/g),
    +                    location,
    +                    totalLength = 0,
    +                    rangeStart,
    +                    rangeEnd,
    +                    fixRange = [],
    +                    containingNode;
    +
    +                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) {
    +                        location = {
    +                            line: i + 1,
    +                            column: matches.index
    +                        };
    +
    +                        rangeStart = totalLength + location.column;
    +                        rangeEnd = totalLength + lineLength - linebreakLength;
    +                        containingNode = sourceCode.getNodeByRangeIndex(rangeStart);
    +
    +                        if (containingNode && containingNode.type === "TemplateElement" &&
    +                          rangeStart > containingNode.parent.range[0] &&
    +                          rangeEnd < containingNode.parent.range[1]) {
    +                            totalLength += lineLength;
    +                            continue;
    +                        }
    +
    +                        // If the line has only whitespace, and skipBlankLines
    +                        // is true, don't report it
    +                        if (skipBlankLines && skipMatch.test(lines[i])) {
    +                            continue;
    +                        }
    +
    +                        fixRange = [rangeStart, rangeEnd];
    +                        report(node, location, fixRange);
                         }
    -                    location = {
    -                        line: i + 1,
    -                        column: matches.index
    -                    };
    -
    -                    fixRange = [totalLength + location.column, totalLength + lineLength - linebreakLength];
     
    -                    report(node, location, fixRange);
    +                    totalLength += lineLength;
                     }
    -
    -                totalLength += lineLength;
                 }
    -        }
     
    -    };
    -};
    -
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "skipBlankLines": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-undef-init.js b/tools/eslint/lib/rules/no-undef-init.js
    index 1348c641e362a8..8622e45701f0a1 100644
    --- a/tools/eslint/lib/rules/no-undef-init.js
    +++ b/tools/eslint/lib/rules/no-undef-init.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,20 +9,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow initializing variables to `undefined`",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "VariableDeclarator": function(node) {
    -            var name = node.id.name,
    -                init = node.init && node.init.name;
    +    create: function(context) {
     
    -            if (init === "undefined" && node.parent.kind !== "const") {
    -                context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name });
    +        return {
    +
    +            VariableDeclarator: function(node) {
    +                var name = node.id.name,
    +                    init = node.init && node.init.name;
    +
    +                if (init === "undefined" && node.parent.kind !== "const") {
    +                    context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name });
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-undef.js b/tools/eslint/lib/rules/no-undef.js
    index e8822c8888a9c6..b76ce4bb5bfefc 100644
    --- a/tools/eslint/lib/rules/no-undef.js
    +++ b/tools/eslint/lib/rules/no-undef.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag references to undeclared variables.
      * @author Mark Macdonald
    - * @copyright 2015 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2013 Mark Macdonald. All rights reserved.
      */
     "use strict";
     
    @@ -17,6 +15,7 @@
      */
     function hasTypeOfOperator(node) {
         var parent = node.parent;
    +
         return parent.type === "UnaryExpression" && parent.operator === "typeof";
     }
     
    @@ -24,39 +23,49 @@ function hasTypeOfOperator(node) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = context.options[0];
    -    var considerTypeOf = options && options.typeof === true || false;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments",
    +            category: "Variables",
    +            recommended: true
    +        },
     
    -    return {
    -        "Program:exit": function(/* node */) {
    -            var globalScope = context.getScope();
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    typeof: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -            globalScope.through.forEach(function(ref) {
    -                var identifier = ref.identifier;
    +    create: function(context) {
    +        var options = context.options[0];
    +        var considerTypeOf = options && options.typeof === true || false;
     
    -                if (!considerTypeOf && hasTypeOfOperator(identifier)) {
    -                    return;
    -                }
    +        return {
    +            "Program:exit": function(/* node */) {
    +                var globalScope = context.getScope();
     
    -                context.report({
    -                    node: identifier,
    -                    message: "'{{name}}' is not defined.",
    -                    data: identifier
    -                });
    -            });
    -        }
    -    };
    -};
    +                globalScope.through.forEach(function(ref) {
    +                    var identifier = ref.identifier;
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "typeof": {
    -                "type": "boolean"
    +                    if (!considerTypeOf && hasTypeOfOperator(identifier)) {
    +                        return;
    +                    }
    +
    +                    context.report({
    +                        node: identifier,
    +                        message: "'{{name}}' is not defined.",
    +                        data: identifier
    +                    });
    +                });
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-undefined.js b/tools/eslint/lib/rules/no-undefined.js
    index 222be573d229ca..3ad2128b4efb0c 100644
    --- a/tools/eslint/lib/rules/no-undefined.js
    +++ b/tools/eslint/lib/rules/no-undefined.js
    @@ -8,20 +8,31 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of `undefined` as an identifier",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: []
    +    },
     
    -        "Identifier": function(node) {
    -            if (node.name === "undefined") {
    -                var parent = context.getAncestors().pop();
    -                if (!parent || parent.type !== "MemberExpression" || node !== parent.property || parent.computed) {
    -                    context.report(node, "Unexpected use of undefined.");
    +    create: function(context) {
    +
    +        return {
    +
    +            Identifier: function(node) {
    +                if (node.name === "undefined") {
    +                    var parent = context.getAncestors().pop();
    +
    +                    if (!parent || parent.type !== "MemberExpression" || node !== parent.property || parent.computed) {
    +                        context.report(node, "Unexpected use of undefined.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-underscore-dangle.js b/tools/eslint/lib/rules/no-underscore-dangle.js
    index 73ab054de829d0..4217f8adc53b96 100644
    --- a/tools/eslint/lib/rules/no-underscore-dangle.js
    +++ b/tools/eslint/lib/rules/no-underscore-dangle.js
    @@ -9,135 +9,146 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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;
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow dangling underscores in identifiers",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allow: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    allowAfterThis: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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;
    +            });
    +        }
     
    -        return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_");
    -    }
    +        /**
    +         * 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;
     
    -    /**
    -     * 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__";
    -    }
    +            return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_");
    +        }
     
    -    /**
    -     * 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 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 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;
    +        /**
    +         * 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) {
     
    -            if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) {
    -                context.report(node, "Unexpected dangling '_' in '" + identifier + "'.");
    -            }
    +            // Checks for the underscore library usage here
    +            return 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) && !isAllowed(identifier)) {
    -            context.report(node, "Unexpected dangling '_' in '" + 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) && !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,
    -            isMemberOfThis = node.object.type === "ThisExpression";
    -
    -        if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
    -            !(isMemberOfThis && allowAfterThis) &&
    -            !isSpecialCaseIdentifierForMemberExpression(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) && !isAllowed(identifier)) {
    +                context.report(node, "Unexpected dangling '_' in '" + identifier + "'.");
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        /**
    +         * 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,
    +                isMemberOfThis = node.object.type === "ThisExpression";
    +
    +            if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
    +                !(isMemberOfThis && allowAfterThis) &&
    +                !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) {
    +                context.report(node, "Unexpected dangling '_' in '" + identifier + "'.");
    +            }
    +        }
     
    -    return {
    -        "FunctionDeclaration": checkForTrailingUnderscoreInFunctionDeclaration,
    -        "VariableDeclarator": checkForTrailingUnderscoreInVariableExpression,
    -        "MemberExpression": checkForTrailingUnderscoreInMemberExpression
    -    };
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -};
    +        return {
    +            FunctionDeclaration: checkForTrailingUnderscoreInFunctionDeclaration,
    +            VariableDeclarator: checkForTrailingUnderscoreInVariableExpression,
    +            MemberExpression: checkForTrailingUnderscoreInMemberExpression
    +        };
     
    -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 312376a334ac30..c066673301a81c 100644
    --- a/tools/eslint/lib/rules/no-unexpected-multiline.js
    +++ b/tools/eslint/lib/rules/no-unexpected-multiline.js
    @@ -1,70 +1,79 @@
     /**
      * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not.
      * @author Glen Mailer
    - * @copyright 2015 Glen Mailer
      */
     "use strict";
     
     //------------------------------------------------------------------------------
     // Rule Definition
     //------------------------------------------------------------------------------
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow confusing multiline expressions",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    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.";
    +        schema: []
    +    },
     
    -    /**
    -     * 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 checkForBreakAfter(node, msg) {
    -        var nodeExpressionEnd = node;
    -        var openParen = context.getTokenAfter(node);
    +    create: function(context) {
     
    -        // Move along until the end of the wrapped expression
    -        while (openParen.value === ")") {
    -            nodeExpressionEnd = openParen;
    -            openParen = context.getTokenAfter(nodeExpressionEnd);
    -        }
    +        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.";
     
    -        if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
    -            context.report(node, openParen.loc.start, msg, { char: openParen.value });
    +        /**
    +         * 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 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 });
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -    return {
    +        return {
     
    -        "MemberExpression": function(node) {
    -            if (!node.computed) {
    -                return;
    -            }
    -            checkForBreakAfter(node.object, PROPERTY_MESSAGE);
    -        },
    +            MemberExpression: function(node) {
    +                if (!node.computed) {
    +                    return;
    +                }
    +                checkForBreakAfter(node.object, 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);
    -        },
    +            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;
    +            CallExpression: function(node) {
    +                if (node.arguments.length === 0) {
    +                    return;
    +                }
    +                checkForBreakAfter(node.callee, FUNCTION_MESSAGE);
                 }
    -            checkForBreakAfter(node.callee, FUNCTION_MESSAGE);
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-unmodified-loop-condition.js b/tools/eslint/lib/rules/no-unmodified-loop-condition.js
    index f66e7aa7554908..ed49b5996ef641 100644
    --- a/tools/eslint/lib/rules/no-unmodified-loop-condition.js
    +++ b/tools/eslint/lib/rules/no-unmodified-loop-condition.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -12,7 +10,7 @@
     //------------------------------------------------------------------------------
     
     var Map = require("es6-map"),
    -    estraverse = require("../util/estraverse"),
    +    Traverser = require("../util/traverser"),
         astUtils = require("../ast-utils");
     
     //------------------------------------------------------------------------------
    @@ -29,8 +27,8 @@ 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 {ASTNode} group - BinaryExpression or ConditionalExpression nodes
    + *      that the reference is belonging to.
      * @property {function} isInLoop - The predicate which checks a given reference
      *      is in this loop.
      * @property {boolean} modified - The flag that the reference is modified in
    @@ -46,6 +44,7 @@ var DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/;
     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;
             }
    @@ -66,13 +65,13 @@ function isUnmodified(condition) {
     
     /**
      * 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.
    + * flag and does not have the group this condition belongs to.
      *
      * @param {LoopConditionInfo} condition - A loop condition info to check.
      * @returns {boolean} `true` if the loop condition info is "unmodified".
      */
     function isUnmodifiedAndNotBelongToGroup(condition) {
    -    return !condition.modified && condition.groups.length === 0;
    +    return !(condition.modified || condition.group);
     }
     
     /**
    @@ -85,6 +84,7 @@ function isUnmodifiedAndNotBelongToGroup(condition) {
     function isInRange(node, reference) {
         var or = node.range;
         var ir = reference.identifier.range;
    +
         return or[0] <= ir[0] && ir[1] <= or[1];
     }
     
    @@ -115,9 +115,10 @@ var isInLoop = {
      * @returns {boolean} `true` if the node is dynamic.
      */
     function hasDynamicExpressions(root) {
    -    var retv = false;
    +    var retv = false,
    +        traverser = new Traverser();
     
    -    estraverse.traverse(root, {
    +    traverser.traverse(root, {
             enter: function(node) {
                 if (DYNAMIC_PATTERN.test(node.type)) {
                     retv = true;
    @@ -142,32 +143,38 @@ function toLoopCondition(reference) {
             return null;
         }
     
    -    var groups = [];
    +    var group = null;
         var child = reference.identifier;
         var node = child.parent;
    +
         while (node) {
             if (SENTINEL_PATTERN.test(node.type)) {
                 if (LOOP_PATTERN.test(node.type) && node.test === child) {
    +
                     // This reference is inside of a loop condition.
                     return {
                         reference: reference,
    -                    groups: groups,
    +                    group: group,
                         isInLoop: isInLoop[node.type].bind(null, node),
                         modified: false
                     };
                 }
    +
                 // This reference is outside of a loop condition.
                 break;
             }
     
    -        // If it's inside of a group, OK if either operand is modified.
    -        // So stores the group that the reference is belonging to.
    +        /*
    +         * If it's inside of a group, OK if either operand is modified.
    +         * So stores the group this reference belongs to.
    +         */
             if (GROUP_PATTERN.test(node.type)) {
    +
    +            // If this expression is dynamic, no need to check.
                 if (hasDynamicExpressions(node)) {
    -                // This expression is dynamic, so don't check.
                     break;
                 } else {
    -                groups.push(node);
    +                group = node;
                 }
             }
     
    @@ -213,9 +220,16 @@ function updateModifiedFlag(conditions, modifiers) {
             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.
    +            var modifier = modifiers[j],
    +                inLoop;
    +
    +            /*
    +             * Besides checking for the condition being in the loop, we want to
    +             * check the function that this modifier is belonging to is called
    +             * in the loop.
    +             * FIXME: This should probably be extracted to a function.
    +             */
    +            inLoop = condition.isInLoop(modifier) || Boolean(
                     (funcNode = getEncloseFunctionDeclaration(modifier)) &&
                     (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) &&
                     funcVar.references.some(condition.isInLoop)
    @@ -229,109 +243,125 @@ function updateModifiedFlag(conditions, modifiers) {
     // 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
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unmodified loop conditions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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);
    +        /**
    +         * Registers given conditions to the group the condition belongs to.
    +         *
    +         * @param {LoopConditionInfo[]} conditions - A loop condition info to
    +         *      register.
    +         * @returns {void}
    +         */
    +        function registerConditionsToGroup(conditions) {
    +            for (var i = 0; i < conditions.length; ++i) {
    +                var condition = conditions[i];
    +
    +                if (condition.group) {
    +                    var group = groupMap.get(condition.group);
    +
    +                    if (!group) {
    +                        group = [];
    +                        groupMap.set(condition.group, group);
    +                    }
    +                    group.push(condition);
                     }
    -                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);
    +        /**
    +         * 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;
    -        }
    +        /**
    +         * 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);
     
    -        // Registers the conditions to belonging groups.
    -        registerConditionsToGroup(conditions);
    +            if (modifiers.length > 0) {
    +                updateModifiedFlag(conditions, modifiers);
    +            }
     
    -        // 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);
             }
     
    -        // 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()];
     
    -    return {
    -        "Program:exit": function() {
    -            var queue = [context.getScope()];
    -            groupMap = new Map();
    +                groupMap = new Map();
     
    -            var scope;
    -            while ((scope = queue.pop())) {
    -                pushAll(queue, scope.childScopes);
    -                scope.variables.forEach(checkReferences);
    -            }
    +                var scope;
     
    -            groupMap.forEach(checkConditionsInGroup);
    -            groupMap = null;
    -        }
    -    };
    -};
    +                while ((scope = queue.pop())) {
    +                    pushAll(queue, scope.childScopes);
    +                    scope.variables.forEach(checkReferences);
    +                }
     
    -module.exports.schema = [];
    +                groupMap.forEach(checkConditionsInGroup);
    +                groupMap = null;
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-unneeded-ternary.js b/tools/eslint/lib/rules/no-unneeded-ternary.js
    index fcbff265f91db0..1c344a42e615ea 100644
    --- a/tools/eslint/lib/rules/no-unneeded-ternary.js
    +++ b/tools/eslint/lib/rules/no-unneeded-ternary.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag no-unneeded-ternary
      * @author Gyandeep Singh
    - * @copyright 2015 Gyandeep Singh. All rights reserved.
    - * @copyright 2015 Michael Ficarra. All rights reserved.
      */
     
     "use strict";
    @@ -11,52 +9,62 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = context.options[0] || {};
    -    var defaultAssignment = options.defaultAssignment !== false;
    -
    -    /**
    -     * Test if the node is a boolean literal
    -     * @param {ASTNode} node - The node to report.
    -     * @returns {boolean} True if the its a boolean literal
    -     * @private
    -     */
    -    function isBooleanLiteral(node) {
    -        return node.type === "Literal" && typeof node.value === "boolean";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow ternary operators when simpler alternatives exist",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    -    }
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    defaultAssignment: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    return {
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var defaultAssignment = options.defaultAssignment !== false;
     
    -        "ConditionalExpression": function(node) {
    -            if (isBooleanLiteral(node.alternate) && isBooleanLiteral(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");
    -            }
    +        /**
    +         * Test if the node is a boolean literal
    +         * @param {ASTNode} node - The node to report.
    +         * @returns {boolean} True if the its a boolean literal
    +         * @private
    +         */
    +        function isBooleanLiteral(node) {
    +            return node.type === "Literal" && typeof node.value === "boolean";
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "defaultAssignment": {
    -                "type": "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)) {
    +                    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");
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-unreachable.js b/tools/eslint/lib/rules/no-unreachable.js
    index 7c9c267ac18a2a..c28a6d2f2fa787 100644
    --- a/tools/eslint/lib/rules/no-unreachable.js
    +++ b/tools/eslint/lib/rules/no-unreachable.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -32,59 +30,73 @@ function isUnreachable(segment) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var currentCodePath = null;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    /**
    -     * Reports a given node if it's unreachable.
    -     * @param {ASTNode} node - A statement node to report.
    -     * @returns {void}
    -     */
    -    function reportIfUnreachable(node) {
    -        if (currentCodePath.currentSegments.every(isUnreachable)) {
    -            context.report({message: "Unreachable code.", node: node});
    -        }
    -    }
    +        schema: []
    +    },
     
    -    return {
    -        // Manages the current code path.
    -        "onCodePathStart": function(codePath) {
    -            currentCodePath = codePath;
    -        },
    -        "onCodePathEnd": function() {
    -            currentCodePath = currentCodePath.upper;
    -        },
    +    create: function(context) {
    +        var currentCodePath = null;
     
    -        // 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);
    +        /**
    +         * Reports a given node if it's unreachable.
    +         * @param {ASTNode} node - A statement node to report.
    +         * @returns {void}
    +         */
    +        function reportIfUnreachable(node) {
    +            if (currentCodePath.currentSegments.every(isUnreachable)) {
    +                context.report({message: "Unreachable code.", node: node});
                 }
    -        },
    -        WhileStatement: reportIfUnreachable,
    -        WithStatement: reportIfUnreachable,
    -        ExportNamedDeclaration: reportIfUnreachable,
    -        ExportDefaultDeclaration: reportIfUnreachable,
    -        ExportAllDeclaration: reportIfUnreachable
    -    };
    -};
    +        }
     
    -module.exports.schema = [];
    +        return {
    +
    +            // 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
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-unsafe-finally.js b/tools/eslint/lib/rules/no-unsafe-finally.js
    new file mode 100644
    index 00000000000000..55ea2971f88ebf
    --- /dev/null
    +++ b/tools/eslint/lib/rules/no-unsafe-finally.js
    @@ -0,0 +1,78 @@
    +/**
    + * @fileoverview Rule to flag unsafe statements in finally block
    + * @author Onur Temizkan
    + */
    +
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Helpers
    +//------------------------------------------------------------------------------
    +
    +var SENTINEL_NODE_TYPE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/;
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow control flow statements in finally blocks",
    +            category: "Possible Errors",
    +            recommended: false
    +        }
    +    },
    +    create: function(context) {
    +
    +        /**
    +         * Checks if the node is the finalizer of a TryStatement
    +         *
    +         * @param {ASTNode} node - node to check.
    +         * @returns {Boolean} - true if the node is the finalizer of a TryStatement
    +         */
    +        function isFinallyBlock(node) {
    +            return node.parent.type === "TryStatement" && node.parent.finalizer === node;
    +        }
    +
    +        /**
    +         * Climbs up the tree if the node is not a sentinel node
    +         *
    +         * @param {ASTNode} node - node to check.
    +         * @returns {Boolean} - return whether the node is a finally block or a sentinel node
    +         */
    +        function isInFinallyBlock(node) {
    +            while (node && !SENTINEL_NODE_TYPE.test(node.type)) {
    +                if (isFinallyBlock(node)) {
    +                    return true;
    +                }
    +                node = node.parent;
    +            }
    +            return false;
    +        }
    +
    +        /**
    +         * Checks whether the possibly-unsafe statement is inside a finally block.
    +         *
    +         * @param {ASTNode} node - node to check.
    +         * @returns {void}
    +         */
    +        function check(node) {
    +            if (isInFinallyBlock(node)) {
    +                context.report({
    +                    message: "Unsafe usage of " + node.type,
    +                    node: node,
    +                    line: node.loc.line,
    +                    column: node.loc.column
    +                });
    +            }
    +        }
    +
    +        return {
    +            ReturnStatement: check,
    +            ThrowStatement: check,
    +            BreakStatement: check,
    +            ContinueStatement: check
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-unused-expressions.js b/tools/eslint/lib/rules/no-unused-expressions.js
    index 82e21c04e7c306..9438268ab24c33 100644
    --- a/tools/eslint/lib/rules/no-unused-expressions.js
    +++ b/tools/eslint/lib/rules/no-unused-expressions.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Flag expressions in statement position that do not side effect
      * @author Michael Ficarra
    - * @copyright 2013 Michael Ficarra. All rights reserved.
      */
     "use strict";
     
    @@ -9,98 +8,110 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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
    -     */
    -    function looksLikeDirective(node) {
    -        return node.type === "ExpressionStatement" &&
    -            node.expression.type === "Literal" && typeof node.expression.value === "string";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unused expressions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * @param {Function} predicate - ([a] -> Boolean) the function used to make the determination
    -     * @param {a[]} list - the input list
    -     * @returns {a[]} the leading sequence of members in the given list that pass the given predicate
    -     */
    -    function takeWhile(predicate, list) {
    -        for (var i = 0, l = list.length; i < l; ++i) {
    -            if (!predicate(list[i])) {
    -                break;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowShortCircuit: {
    +                        type: "boolean"
    +                    },
    +                    allowTernary: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -        }
    -        return [].slice.call(list, 0, i);
    -    }
    +        ]
    +    },
     
    -    /**
    -     * @param {ASTNode} node - a Program or BlockStatement node
    -     * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
    -     */
    -    function directives(node) {
    -        return takeWhile(looksLikeDirective, node.body);
    -    }
    +    create: function(context) {
    +        var config = context.options[0] || {},
    +            allowShortCircuit = config.allowShortCircuit || false,
    +            allowTernary = config.allowTernary || false;
     
    -    /**
    -     * @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
    -     */
    -    function isDirective(node, ancestors) {
    -        var parent = ancestors[ancestors.length - 1],
    -            grandparent = ancestors[ancestors.length - 2];
    -        return (parent.type === "Program" || parent.type === "BlockStatement" &&
    -                (/Function/.test(grandparent.type))) &&
    -                directives(parent).indexOf(node) >= 0;
    -    }
    +        /**
    +         * @param {ASTNode} node - any node
    +         * @returns {boolean} whether the given node structurally represents a directive
    +         */
    +        function looksLikeDirective(node) {
    +            return node.type === "ExpressionStatement" &&
    +                node.expression.type === "Literal" && typeof node.expression.value === "string";
    +        }
     
    -    /**
    -     * 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);
    +        /**
    +         * @param {Function} predicate - ([a] -> Boolean) the function used to make the determination
    +         * @param {a[]} list - the input list
    +         * @returns {a[]} the leading sequence of members in the given list that pass the given predicate
    +         */
    +        function takeWhile(predicate, list) {
    +            for (var i = 0, l = list.length; i < l; ++i) {
    +                if (!predicate(list[i])) {
    +                    break;
    +                }
                 }
    +            return [].slice.call(list, 0, i);
             }
    -        if (allowShortCircuit) {
    -            if (node.type === "LogicalExpression") {
    -                return isValidExpression(node.right);
    -            }
    +
    +        /**
    +         * @param {ASTNode} node - a Program or BlockStatement node
    +         * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
    +         */
    +        function directives(node) {
    +            return takeWhile(looksLikeDirective, node.body);
             }
     
    -        return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) ||
    -            (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0);
    -    }
    +        /**
    +         * @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
    +         */
    +        function isDirective(node, ancestors) {
    +            var parent = ancestors[ancestors.length - 1],
    +                grandparent = ancestors[ancestors.length - 2];
     
    -    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.");
    -            }
    +            return (parent.type === "Program" || parent.type === "BlockStatement" &&
    +                    (/Function/.test(grandparent.type))) &&
    +                    directives(parent).indexOf(node) >= 0;
             }
    -    };
     
    -};
    +        /**
    +         * 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) {
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "allowShortCircuit": {
    -                "type": "boolean"
    -            },
    -            "allowTernary": {
    -                "type": "boolean"
    +                // Recursive check for ternary and logical expressions
    +                if (node.type === "ConditionalExpression") {
    +                    return isValidExpression(node.consequent) && isValidExpression(node.alternate);
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +            if (allowShortCircuit) {
    +                if (node.type === "LogicalExpression") {
    +                    return isValidExpression(node.right);
    +                }
    +            }
    +
    +            return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) ||
    +                (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0);
    +        }
    +
    +        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.");
    +                }
    +            }
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-unused-labels.js b/tools/eslint/lib/rules/no-unused-labels.js
    index 258f97c720506f..77713fc408bca4 100644
    --- a/tools/eslint/lib/rules/no-unused-labels.js
    +++ b/tools/eslint/lib/rules/no-unused-labels.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,71 +9,82 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var scopeInfo = null;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unused labels",
    +            category: "Best Practices",
    +            recommended: true
    +        },
     
    -    /**
    -     * 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
    -        };
    -    }
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var scopeInfo = null;
     
    -    /**
    -     * 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
    -            });
    +        /**
    +         * 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
    +            };
             }
     
    -        scopeInfo = scopeInfo.upper;
    -    }
    +        /**
    +         * 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
    +                });
    +            }
     
    -    /**
    -     * 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;
    +            scopeInfo = scopeInfo.upper;
             }
     
    -        var label = node.label.name;
    -        var info = scopeInfo;
    -        while (info) {
    -            if (info.label === label) {
    -                info.used = true;
    -                break;
    +        /**
    +         * 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;
                 }
    -            info = info.upper;
             }
    -    }
     
    -    return {
    -        "LabeledStatement": enterLabeledScope,
    -        "LabeledStatement:exit": exitLabeledScope,
    -        "BreakStatement": markAsUsed,
    -        "ContinueStatement": markAsUsed
    -    };
    +        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 2d61a7b988efc7..89d43c7bfd681b 100644
    --- a/tools/eslint/lib/rules/no-unused-vars.js
    +++ b/tools/eslint/lib/rules/no-unused-vars.js
    @@ -15,291 +15,328 @@ var lodash = require("lodash");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unused variables",
    +            category: "Variables",
    +            recommended: true
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["all", "local"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            vars: {
    +                                enum: ["all", "local"]
    +                            },
    +                            varsIgnorePattern: {
    +                                type: "string"
    +                            },
    +                            args: {
    +                                enum: ["all", "after-used", "none"]
    +                            },
    +                            argsIgnorePattern: {
    +                                type: "string"
    +                            },
    +                            caughtErrors: {
    +                                enum: ["all", "none"]
    +                            },
    +                            caughtErrorsIgnorePattern: {
    +                                type: "string"
    +                            }
    +                        }
    +                    }
    +                ]
    +            }
    +        ]
    +    },
     
    -    var MESSAGE = "'{{name}}' is defined but never used";
    +    create: function(context) {
     
    -    var config = {
    -        vars: "all",
    -        args: "after-used"
    -    };
    +        var MESSAGE = "'{{name}}' is defined but never used";
     
    -    var firstOption = context.options[0];
    +        var config = {
    +            vars: "all",
    +            args: "after-used",
    +            caughtErrors: "none"
    +        };
     
    -    if (firstOption) {
    -        if (typeof firstOption === "string") {
    -            config.vars = firstOption;
    -        } else {
    -            config.vars = firstOption.vars || config.vars;
    -            config.args = firstOption.args || config.args;
    +        var firstOption = context.options[0];
     
    -            if (firstOption.varsIgnorePattern) {
    -                config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern);
    -            }
    +        if (firstOption) {
    +            if (typeof firstOption === "string") {
    +                config.vars = firstOption;
    +            } else {
    +                config.vars = firstOption.vars || config.vars;
    +                config.args = firstOption.args || config.args;
    +                config.caughtErrors = firstOption.caughtErrors || config.caughtErrors;
     
    -            if (firstOption.argsIgnorePattern) {
    -                config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern);
    +                if (firstOption.varsIgnorePattern) {
    +                    config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern);
    +                }
    +
    +                if (firstOption.argsIgnorePattern) {
    +                    config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern);
    +                }
    +
    +                if (firstOption.caughtErrorsIgnorePattern) {
    +                    config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern);
    +                }
                 }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Determines if a given variable is being exported from a module.
    +         * @param {Variable} variable - EScope variable object.
    +         * @returns {boolean} True if the variable is exported, false if not.
    +         * @private
    +         */
    +        function isExported(variable) {
    +
    +            var definition = variable.defs[0];
     
    -    /**
    -     * Determines if a given variable is being exported from a module.
    -     * @param {Variable} variable - EScope variable object.
    -     * @returns {boolean} True if the variable is exported, false if not.
    -     * @private
    -     */
    -    function isExported(variable) {
    +            if (definition) {
     
    -        var definition = variable.defs[0];
    +                var node = definition.node;
     
    -        if (definition) {
    +                if (node.type === "VariableDeclarator") {
    +                    node = node.parent;
    +                } else if (definition.type === "Parameter") {
    +                    return false;
    +                }
     
    -            var node = definition.node;
    -            if (node.type === "VariableDeclarator") {
    -                node = node.parent;
    -            } else if (definition.type === "Parameter") {
    +                return node.parent.type.indexOf("Export") === 0;
    +            } else {
                     return false;
                 }
    +        }
     
    -            return node.parent.type.indexOf("Export") === 0;
    -        } else {
    -            return false;
    +        /**
    +         * Determines if a reference is a read operation.
    +         * @param {Reference} ref - An escope Reference
    +         * @returns {Boolean} whether the given reference represents a read operation
    +         * @private
    +         */
    +        function isReadRef(ref) {
    +            return ref.isRead();
             }
    -    }
     
    -    /**
    -     * Determines if a reference is a read operation.
    -     * @param {Reference} ref - An escope Reference
    -     * @returns {Boolean} whether the given reference represents a read operation
    -     * @private
    -     */
    -    function isReadRef(ref) {
    -        return ref.isRead();
    -    }
    +        /**
    +         * Determine if an identifier is referencing an enclosing function name.
    +         * @param {Reference} ref - The reference to check.
    +         * @param {ASTNode[]} nodes - The candidate function nodes.
    +         * @returns {boolean} True if it's a self-reference, false if not.
    +         * @private
    +         */
    +        function isSelfReference(ref, nodes) {
    +            var scope = ref.from;
    +
    +            while (scope) {
    +                if (nodes.indexOf(scope.block) >= 0) {
    +                    return true;
    +                }
     
    -    /**
    -     * Determine if an identifier is referencing an enclosing function name.
    -     * @param {Reference} ref - The reference to check.
    -     * @param {ASTNode[]} nodes - The candidate function nodes.
    -     * @returns {boolean} True if it's a self-reference, false if not.
    -     * @private
    -     */
    -    function isSelfReference(ref, nodes) {
    -        var scope = ref.from;
    -
    -        while (scope) {
    -            if (nodes.indexOf(scope.block) >= 0) {
    -                return true;
    +                scope = scope.upper;
                 }
     
    -            scope = scope.upper;
    +            return false;
             }
     
    -        return false;
    -    }
    -
    -    /**
    -     * Determines if the variable is used.
    -     * @param {Variable} variable - The variable to check.
    -     * @param {Reference[]} references - The variable references to check.
    -     * @returns {boolean} True if the variable is used
    -     */
    -    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 variable.references.some(function(ref) {
    -            return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes));
    -        });
    -    }
    +        /**
    +         * Determines if the variable is used.
    +         * @param {Variable} variable - The variable to check.
    +         * @param {Reference[]} references - The variable references to check.
    +         * @returns {boolean} True if the variable is used
    +         */
    +        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 variable.references.some(function(ref) {
    +                return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes));
    +            });
    +        }
     
    -    /**
    -     * Gets an array of variables without read references.
    -     * @param {Scope} scope - an escope Scope object.
    -     * @param {Variable[]} unusedVars - an array that saving result.
    -     * @returns {Variable[]} unused variables of the scope and descendant scopes.
    -     * @private
    -     */
    -    function collectUnusedVariables(scope, unusedVars) {
    -        var variables = scope.variables;
    -        var childScopes = scope.childScopes;
    -        var i, l;
    -
    -        if (scope.type !== "TDZ" && (scope.type !== "global" || config.vars === "all")) {
    -            for (i = 0, l = variables.length; i < l; ++i) {
    -                var variable = variables[i];
    -
    -                // skip a variable of class itself name in the class scope
    -                if (scope.type === "class" && scope.block.id === variable.identifiers[0]) {
    -                    continue;
    -                }
    -                // skip function expression names and variables marked with markVariableAsUsed()
    -                if (scope.functionExpressionScope || variable.eslintUsed) {
    -                    continue;
    -                }
    -                // skip implicit "arguments" variable
    -                if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) {
    -                    continue;
    -                }
    +        /**
    +         * Gets an array of variables without read references.
    +         * @param {Scope} scope - an escope Scope object.
    +         * @param {Variable[]} unusedVars - an array that saving result.
    +         * @returns {Variable[]} unused variables of the scope and descendant scopes.
    +         * @private
    +         */
    +        function collectUnusedVariables(scope, unusedVars) {
    +            var variables = scope.variables;
    +            var childScopes = scope.childScopes;
    +            var i, l;
    +
    +            if (scope.type !== "TDZ" && (scope.type !== "global" || config.vars === "all")) {
    +                for (i = 0, l = variables.length; i < l; ++i) {
    +                    var variable = variables[i];
    +
    +                    // skip a variable of class itself name in the class scope
    +                    if (scope.type === "class" && scope.block.id === variable.identifiers[0]) {
    +                        continue;
    +                    }
     
    -                // explicit global variables don't have definitions.
    -                var def = variable.defs[0];
    -                if (def) {
    -                    var type = def.type;
    +                    // skip function expression names and variables marked with markVariableAsUsed()
    +                    if (scope.functionExpressionScope || variable.eslintUsed) {
    +                        continue;
    +                    }
     
    -                    // skip catch variables
    -                    if (type === "CatchClause") {
    +                    // skip implicit "arguments" variable
    +                    if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) {
                             continue;
                         }
     
    -                    if (type === "Parameter") {
    -                        // skip any setter argument
    -                        if (def.node.parent.type === "Property" && def.node.parent.kind === "set") {
    -                            continue;
    -                        }
    +                    // explicit global variables don't have definitions.
    +                    var def = variable.defs[0];
     
    -                        // if "args" option is "none", skip any parameter
    -                        if (config.args === "none") {
    -                            continue;
    -                        }
    +                    if (def) {
    +                        var type = def.type;
     
    -                        // skip ignored parameters
    -                        if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) {
    -                            continue;
    -                        }
    +                        // skip catch variables
    +                        if (type === "CatchClause") {
    +                            if (config.caughtErrors === "none") {
    +                                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;
    +                            // skip ignored parameters
    +                            if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) {
    +                                continue;
    +                            }
                             }
    -                    } else {
    -                        // skip ignored variables
    -                        if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) {
    -                            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;
    +                            }
                             }
                         }
    -                }
     
    -                if (!isUsedVariable(variable) && !isExported(variable)) {
    -                    unusedVars.push(variable);
    +                    if (!isUsedVariable(variable) && !isExported(variable)) {
    +                        unusedVars.push(variable);
    +                    }
                     }
                 }
    -        }
     
    -        for (i = 0, l = childScopes.length; i < l; ++i) {
    -            collectUnusedVariables(childScopes[i], unusedVars);
    +            for (i = 0, l = childScopes.length; i < l; ++i) {
    +                collectUnusedVariables(childScopes[i], unusedVars);
    +            }
    +
    +            return 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");
     
    -    /**
    -     * 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;
    -    }
    +            // To ignore the first text "global".
    +            namePattern.lastIndex = comment.value.indexOf("global") + 6;
     
    -    /**
    -     * 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;
    -        }
    +            // Search a given variable name.
    +            var match = namePattern.exec(comment.value);
     
    -        return {
    -            line: baseLoc.line + lineInComment,
    -            column: column
    -        };
    -    }
    +            return match ? match.index + 1 : 0;
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "Program:exit": function(programNode) {
    -            var unusedVars = collectUnusedVariables(context.getScope(), []);
    -
    -            for (var i = 0, l = unusedVars.length; i < l; ++i) {
    -                var unusedVar = unusedVars[i];
    -
    -                if (unusedVar.eslintExplicitGlobal) {
    -                    context.report({
    -                        node: programNode,
    -                        loc: getLocation(unusedVar),
    -                        message: MESSAGE,
    -                        data: unusedVar
    -                    });
    -                } else if (unusedVar.defs.length > 0) {
    -                    context.report({
    -                        node: unusedVar.identifiers[0],
    -                        message: MESSAGE,
    -                        data: unusedVar
    -                    });
    -                }
    +        /**
    +         * 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
    +        //--------------------------------------------------------------------------
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "enum": ["all", "local"]
    -            },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "vars": {
    -                        "enum": ["all", "local"]
    -                    },
    -                    "varsIgnorePattern": {
    -                        "type": "string"
    -                    },
    -                    "args": {
    -                        "enum": ["all", "after-used", "none"]
    -                    },
    -                    "argsIgnorePattern": {
    -                        "type": "string"
    +        return {
    +            "Program:exit": function(programNode) {
    +                var unusedVars = collectUnusedVariables(context.getScope(), []);
    +
    +                for (var i = 0, l = unusedVars.length; i < l; ++i) {
    +                    var unusedVar = unusedVars[i];
    +
    +                    if (unusedVar.eslintExplicitGlobal) {
    +                        context.report({
    +                            node: programNode,
    +                            loc: getLocation(unusedVar),
    +                            message: MESSAGE,
    +                            data: unusedVar
    +                        });
    +                    } else if (unusedVar.defs.length > 0) {
    +                        context.report({
    +                            node: unusedVar.identifiers[0],
    +                            message: MESSAGE,
    +                            data: unusedVar
    +                        });
                         }
                     }
                 }
    -        ]
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-use-before-define.js b/tools/eslint/lib/rules/no-use-before-define.js
    index 2590230de98ae2..889e709948259c 100644
    --- a/tools/eslint/lib/rules/no-use-before-define.js
    +++ b/tools/eslint/lib/rules/no-use-before-define.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag use of variables before they are defined
      * @author Ilya Volodin
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -124,112 +123,124 @@ function isInInitializer(variable, reference) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = parseOptions(context.options[0]);
    -
    -    // 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;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow the use of variables before they are defined",
    +            category: "Variables",
    +            recommended: false
    +        },
     
    -    /**
    -     * Finds and validates all variables in a given scope.
    -     * @param {Scope} scope The scope object.
    -     * @returns {void}
    -     * @private
    -     */
    -    function findVariablesInScope(scope) {
    -        scope.references.forEach(function(reference) {
    -            var variable = reference.resolved;
    -
    -            // 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;
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["nofunc"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            functions: {type: "boolean"},
    +                            classes: {type: "boolean"}
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = parseOptions(context.options[0]);
    +
    +        // 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;
    +        }
     
    -            // Reports.
    -            context.report({
    -                node: reference.identifier,
    -                message: "'{{name}}' was used before it was defined",
    -                data: reference.identifier
    +        /**
    +         * Finds and validates all variables in a given scope.
    +         * @param {Scope} scope The scope object.
    +         * @returns {void}
    +         * @private
    +         */
    +        function findVariablesInScope(scope) {
    +            scope.references.forEach(function(reference) {
    +                var variable = reference.resolved;
    +
    +                // 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;
    +                }
    +
    +                // 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.
    -     * @returns {void}
    -     * @private
    -     */
    -    function findVariables() {
    -        var scope = context.getScope();
    -        findVariablesInScope(scope);
    -    }
    +        }
     
    -    var ruleDefinition = {
    -        "Program:exit": function(node) {
    -            var scope = context.getScope(),
    -                ecmaFeatures = context.parserOptions.ecmaFeatures || {};
    +        /**
    +         * Validates variables inside of a node's scope.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function findVariables() {
    +            var scope = context.getScope();
     
                 findVariablesInScope(scope);
    -
    -            // both Node.js and Modules have an extra scope
    -            if (ecmaFeatures.globalReturn || node.sourceType === "module") {
    -                findVariablesInScope(scope.childScopes[0]);
    -            }
             }
    -    };
     
    -    if (context.parserOptions.ecmaVersion >= 6) {
    -        ruleDefinition["BlockStatement:exit"] =
    -            ruleDefinition["SwitchStatement:exit"] = findVariables;
    +        var ruleDefinition = {
    +            "Program:exit": function(node) {
    +                var scope = context.getScope(),
    +                    ecmaFeatures = context.parserOptions.ecmaFeatures || {};
     
    -        ruleDefinition["ArrowFunctionExpression:exit"] = function(node) {
    -            if (node.body.type !== "BlockStatement") {
    -                findVariables(node);
    +                findVariablesInScope(scope);
    +
    +                // both Node.js and Modules have an extra scope
    +                if (ecmaFeatures.globalReturn || node.sourceType === "module") {
    +                    findVariablesInScope(scope.childScopes[0]);
    +                }
                 }
             };
    -    } else {
    -        ruleDefinition["FunctionExpression:exit"] =
    -            ruleDefinition["FunctionDeclaration:exit"] =
    -            ruleDefinition["ArrowFunctionExpression:exit"] = findVariables;
    -    }
     
    -    return ruleDefinition;
    -};
    +        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;
    +        }
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "enum": ["nofunc"]
    -            },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "functions": {"type": "boolean"},
    -                    "classes": {"type": "boolean"}
    -                },
    -                "additionalProperties": false
    -            }
    -        ]
    +        return ruleDefinition;
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-useless-call.js b/tools/eslint/lib/rules/no-useless-call.js
    index fe6afd6d2487cc..eb14f0baf94eb4 100644
    --- a/tools/eslint/lib/rules/no-useless-call.js
    +++ b/tools/eslint/lib/rules/no-useless-call.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -72,25 +71,35 @@ function isValidThisArg(expectedThis, thisArg, context) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    return {
    -        "CallExpression": function(node) {
    -            if (!isCallOrNonVariadicApply(node)) {
    -                return;
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary calls to `.call()` and `.apply()`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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];
    +                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});
    +                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-computed-key.js b/tools/eslint/lib/rules/no-useless-computed-key.js
    new file mode 100644
    index 00000000000000..0894fb7ca41e56
    --- /dev/null
    +++ b/tools/eslint/lib/rules/no-useless-computed-key.js
    @@ -0,0 +1,37 @@
    +/**
    + * @fileoverview Rule to disallow unnecessary computed property keys in object literals
    + * @author Burak Yigit Kaya
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +var MESSAGE_UNNECESSARY_COMPUTED = "Unnecessarily computed property [{{property}}] found.";
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary computed property keys in object literals",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        }
    +    },
    +    create: function(context) {
    +        return {
    +            Property: function(node) {
    +                if (!node.computed) {
    +                    return;
    +                }
    +
    +                var key = node.key,
    +                    nodeType = typeof key.value;
    +
    +                if (key.type === "Literal" && (nodeType === "string" || nodeType === "number")) {
    +                    context.report(node, MESSAGE_UNNECESSARY_COMPUTED, { property: context.getSource(key) });
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-useless-concat.js b/tools/eslint/lib/rules/no-useless-concat.js
    index 6f230a96d3385a..ce9589d4880220 100644
    --- a/tools/eslint/lib/rules/no-useless-concat.js
    +++ b/tools/eslint/lib/rules/no-useless-concat.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -32,6 +30,7 @@ function isConcatenation(node) {
      */
     function getLeft(node) {
         var left = node.left;
    +
         while (isConcatenation(left)) {
             left = left.right;
         }
    @@ -45,6 +44,7 @@ function getLeft(node) {
      */
     function getRight(node) {
         var right = node.right;
    +
         while (isConcatenation(right)) {
             right = right.left;
         }
    @@ -55,35 +55,48 @@ function getRight(node) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    return {
    -        BinaryExpression: function(node) {
    -            // check if not concatenation
    -            if (node.operator !== "+") {
    -                return;
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary concatenation of literals or template literals",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -            // 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);
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        return {
    +            BinaryExpression: function(node) {
    +
    +                // check if not concatenation
    +                if (node.operator !== "+") {
    +                    return;
                     }
     
    -                context.report(
    -                    node,
    -                    operatorToken.loc.start,
    -                    "Unexpected string concatenation of literals.");
    +                // 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
    index 20ca67cbe060db..b91ab4bcae5866 100644
    --- a/tools/eslint/lib/rules/no-useless-constructor.js
    +++ b/tools/eslint/lib/rules/no-useless-constructor.js
    @@ -1,63 +1,182 @@
     /**
      * @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
    +// Helpers
     //------------------------------------------------------------------------------
     
    -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;
    -        }
    +/**
    + * Checks whether a given array of statements is a single call of `super`.
    + *
    + * @param {ASTNode[]} body - An array of statements to check.
    + * @returns {boolean} `true` if the body is a single call of `super`.
    + */
    +function isSingleSuperCall(body) {
    +    return (
    +        body.length === 1 &&
    +        body[0].type === "ExpressionStatement" &&
    +        body[0].expression.type === "CallExpression" &&
    +        body[0].expression.callee.type === "Super"
    +    );
    +}
     
    +/**
    + * Checks whether a given node is a pattern which doesn't have any side effects.
    + * Default parameters and Destructuring parameters can have side effects.
    + *
    + * @param {ASTNode} node - A pattern node.
    + * @returns {boolean} `true` if the node doesn't have any side effects.
    + */
    +function isSimple(node) {
    +    return node.type === "Identifier" || node.type === "RestElement";
    +}
     
    -        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 given array of expressions is `...arguments` or not.
    + * `super(...arguments)` passes all arguments through.
    + *
    + * @param {ASTNode[]} superArgs - An array of expressions to check.
    + * @returns {boolean} `true` if the superArgs is `...arguments`.
    + */
    +function isSpreadArguments(superArgs) {
    +    return (
    +        superArgs.length === 1 &&
    +        superArgs[0].type === "SpreadElement" &&
    +        superArgs[0].argument.type === "Identifier" &&
    +        superArgs[0].argument.name === "arguments"
    +    );
    +}
     
    -    /**
    -     * Checks whether a node is a redundant construtor
    -     * @param {ASTNode} node - node to check
    -     * @returns {void}
    -     */
    -    function checkForConstructor(node) {
    -        if (node.kind !== "constructor") {
    -            return;
    -        }
    +/**
    + * Checks whether given 2 nodes are identifiers which have the same name or not.
    + *
    + * @param {ASTNode} ctorParam - A node to check.
    + * @param {ASTNode} superArg - A node to check.
    + * @returns {boolean} `true` if the nodes are identifiers which have the same
    + *      name.
    + */
    +function isValidIdentifierPair(ctorParam, superArg) {
    +    return (
    +        ctorParam.type === "Identifier" &&
    +        superArg.type === "Identifier" &&
    +        ctorParam.name === superArg.name
    +    );
    +}
    +
    +/**
    + * Checks whether given 2 nodes are a rest/spread pair which has the same values.
    + *
    + * @param {ASTNode} ctorParam - A node to check.
    + * @param {ASTNode} superArg - A node to check.
    + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the
    + *      same values.
    + */
    +function isValidRestSpreadPair(ctorParam, superArg) {
    +    return (
    +        ctorParam.type === "RestElement" &&
    +        superArg.type === "SpreadElement" &&
    +        isValidIdentifierPair(ctorParam.argument, superArg.argument)
    +    );
    +}
     
    -        var body = node.value.body.body;
    +/**
    + * Checks whether given 2 nodes have the same value or not.
    + *
    + * @param {ASTNode} ctorParam - A node to check.
    + * @param {ASTNode} superArg - A node to check.
    + * @returns {boolean} `true` if the nodes have the same value or not.
    + */
    +function isValidPair(ctorParam, superArg) {
    +    return (
    +        isValidIdentifierPair(ctorParam, superArg) ||
    +        isValidRestSpreadPair(ctorParam, superArg)
    +    );
    +}
     
    -        if (!node.parent.parent.superClass && body.length === 0 ||
    -            node.parent.parent.superClass && isRedundantSuperCall(body, node.value.params)) {
    -            context.report(node, "Useless constructor.");
    +/**
    + * Checks whether the parameters of a constructor and the arguments of `super()`
    + * have the same values or not.
    + *
    + * @param {ASTNode} ctorParams - The parameters of a constructor to check.
    + * @param {ASTNode} superArgs - The arguments of `super()` to check.
    + * @returns {boolean} `true` if those have the same values.
    + */
    +function isPassingThrough(ctorParams, superArgs) {
    +    if (ctorParams.length !== superArgs.length) {
    +        return false;
    +    }
    +
    +    for (var i = 0; i < ctorParams.length; ++i) {
    +        if (!isValidPair(ctorParams[i], superArgs[i])) {
    +            return false;
             }
         }
     
    +    return true;
    +}
     
    -    return {
    -        "MethodDefinition": checkForConstructor
    -    };
    -};
    +/**
    + * Checks whether the constructor body is a redundant super call.
    + *
    + * @param {Array} body - constructor body content.
    + * @param {Array} ctorParams - The params to check against super call.
    + * @returns {boolean} true if the construtor body is redundant
    + */
    +function isRedundantSuperCall(body, ctorParams) {
    +    return (
    +        isSingleSuperCall(body) &&
    +        ctorParams.every(isSimple) &&
    +        (
    +            isSpreadArguments(body[0].expression.arguments) ||
    +            isPassingThrough(ctorParams, body[0].expression.arguments)
    +        )
    +    );
    +}
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
     
    -module.exports.schema = [];
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary constructors",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * Checks whether a node is a redundant constructor
    +         * @param {ASTNode} node - node to check
    +         * @returns {void}
    +         */
    +        function checkForConstructor(node) {
    +            if (node.kind !== "constructor") {
    +                return;
    +            }
    +
    +            var body = node.value.body.body;
    +            var ctorParams = node.value.params;
    +            var superClass = node.parent.parent.superClass;
    +
    +            if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) {
    +                context.report({
    +                    node: node,
    +                    message: "Useless constructor."
    +                });
    +            }
    +        }
    +
    +        return {
    +            MethodDefinition: checkForConstructor
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-useless-escape.js b/tools/eslint/lib/rules/no-useless-escape.js
    new file mode 100644
    index 00000000000000..036831fc394f4f
    --- /dev/null
    +++ b/tools/eslint/lib/rules/no-useless-escape.js
    @@ -0,0 +1,130 @@
    +/**
    + * @fileoverview Look for useless escapes in strings and regexes
    + * @author Onur Temizkan
    + */
    +
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
    +
    +var VALID_STRING_ESCAPES = [
    +    "\\",
    +    "n",
    +    "r",
    +    "v",
    +    "t",
    +    "b",
    +    "f",
    +    "u",
    +    "x",
    +    "\n",
    +    "\r"
    +];
    +
    +var VALID_REGEX_ESCAPES = [
    +    "\\",
    +    ".",
    +    "-",
    +    "^",
    +    "$",
    +    "*",
    +    "+",
    +    "?",
    +    "{",
    +    "}",
    +    "[",
    +    "]",
    +    "|",
    +    "(",
    +    ")",
    +    "b",
    +    "B",
    +    "c",
    +    "d",
    +    "D",
    +    "f",
    +    "n",
    +    "r",
    +    "s",
    +    "S",
    +    "t",
    +    "v",
    +    "w",
    +    "W",
    +    "x",
    +    "u"
    +];
    +
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow unnecessary escape characters",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        /**
    +         * Checks if the escape character in given slice is unnecessary.
    +         *
    +         * @private
    +         * @param {string[]} escapes - list of valid escapes
    +         * @param {ASTNode} node - node to validate.
    +         * @param {string} elm - string slice to validate.
    +         * @returns {void}
    +         */
    +        function validate(escapes, node, elm) {
    +            var escapeNotFound = escapes.indexOf(elm[0][1]) === -1;
    +            var isQuoteEscape = elm[0][1] === node.raw[0];
    +
    +            if (escapeNotFound && !isQuoteEscape) {
    +                context.report({
    +                    node: node,
    +                    loc: {
    +                        line: node.loc.start.line,
    +                        column: node.loc.start.column + elm.index
    +                    },
    +                    message: "Unnecessary escape character: " + elm[0]
    +                });
    +            }
    +        }
    +
    +        /**
    +         * Checks if a node has an escape.
    +         *
    +         * @param {ASTNode} node - node to check.
    +         * @returns {void}
    +         */
    +        function check(node) {
    +            var nodeEscapes, match;
    +            var pattern = /\\[^\d]/g;
    +
    +            if (typeof node.value === "string") {
    +
    +                // JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/
    +                if (node.parent.type === "JSXAttribute") {
    +                    return;
    +                }
    +
    +                nodeEscapes = VALID_STRING_ESCAPES;
    +            } else if (node.regex) {
    +                nodeEscapes = VALID_REGEX_ESCAPES;
    +            } else {
    +                return;
    +            }
    +
    +            while ((match = pattern.exec(node.raw))) {
    +                validate(nodeEscapes, node, match);
    +            }
    +        }
    +        return {
    +            Literal: check
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/no-var.js b/tools/eslint/lib/rules/no-var.js
    index 05cb6e99eca58e..2e9948a330e190 100644
    --- a/tools/eslint/lib/rules/no-var.js
    +++ b/tools/eslint/lib/rules/no-var.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to check for the usage of var.
      * @author Jamund Ferguson
    - * @copyright 2014 Jamund Ferguson. All rights reserved.
      */
     
     "use strict";
    @@ -10,17 +9,27 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `let` or `const` instead of `var`",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    return {
    -        "VariableDeclaration": function(node) {
    -            if (node.kind === "var") {
    -                context.report(node, "Unexpected var, use let or const instead.");
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +            VariableDeclaration: function(node) {
    +                if (node.kind === "var") {
    +                    context.report(node, "Unexpected var, use let or const instead.");
    +                }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-void.js b/tools/eslint/lib/rules/no-void.js
    index 858304dd1d526e..4adae20b37bc91 100644
    --- a/tools/eslint/lib/rules/no-void.js
    +++ b/tools/eslint/lib/rules/no-void.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to disallow use of void operator.
      * @author Mike Sidorov
    - * @copyright 2014 Mike Sidorov. All rights reserved.
      */
     "use strict";
     
    @@ -9,20 +8,30 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `void` operators",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        schema: []
    +    },
     
    -    return {
    -        "UnaryExpression": function(node) {
    -            if (node.operator === "void") {
    -                context.report(node, "Expected 'undefined' and instead saw 'void'.");
    +    create: function(context) {
    +
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            UnaryExpression: function(node) {
    +                if (node.operator === "void") {
    +                    context.report(node, "Expected 'undefined' and instead saw 'void'.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-warning-comments.js b/tools/eslint/lib/rules/no-warning-comments.js
    index 881c5646f23304..dadf231f5c39f0 100644
    --- a/tools/eslint/lib/rules/no-warning-comments.js
    +++ b/tools/eslint/lib/rules/no-warning-comments.js
    @@ -11,99 +11,120 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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;
    -
    -    /**
    -     * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified
    -     * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not
    -     * require word boundaries on that side.
    -     *
    -     * @param {String} term A term to convert to a RegExp
    -     * @returns {RegExp} The term converted to a RegExp
    -     */
    -    function convertToRegExp(term) {
    -        var escaped = term.replace(/[-\/\\$\^*+?.()|\[\]{}]/g, "\\$&"),
    -            // If the term ends in a word character (a-z0-9_), ensure a word boundary at the end, so that substrings do
    -            // not get falsely matched. eg "todo" in a string such as "mastodon".
    -            // If the term ends in a non-word character, then \b won't match on the boundary to the next non-word
    -            // character, which would likely be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`.
    -            // In these cases, use no bounding match. Same applies for the prefix, handled below.
    -            suffix = /\w$/.test(term) ? "\\b" : "",
    -            prefix;
    -
    -        if (location === "start") {
    -            // When matching at the start, ignore leading whitespace, and there's no need to worry about word boundaries
    -            prefix = "^\\s*";
    -        } else if (/^\w/.test(term)) {
    -            prefix = "\\b";
    -        } else {
    -            prefix = "";
    -        }
    -
    -        return new RegExp(prefix + escaped + suffix, "i");
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow specified warning terms in comments",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    /**
    -     * Checks the specified comment for matches of the configured warning terms and returns the matches.
    -     * @param {String} comment The comment which is checked.
    -     * @returns {Array} All matched warning terms for this comment.
    -     */
    -    function commentContainsWarningTerm(comment) {
    -        var matches = [];
    -
    -        warningRegExps.forEach(function(regex, index) {
    -            if (regex.test(comment)) {
    -                matches.push(warningTerms[index]);
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    terms: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    location: {
    +                        enum: ["start", "anywhere"]
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var configuration = context.options[0] || {},
    +            warningTerms = configuration.terms || ["todo", "fixme", "xxx"],
    +            location = configuration.location || "start",
    +            selfConfigRegEx = /\bno-warning-comments\b/,
    +            warningRegExps;
    +
    +        /**
    +         * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified
    +         * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not
    +         * require word boundaries on that side.
    +         *
    +         * @param {String} term A term to convert to a RegExp
    +         * @returns {RegExp} The term converted to a RegExp
    +         */
    +        function convertToRegExp(term) {
    +            var escaped = term.replace(/[-\/\\$\^*+?.()|\[\]{}]/g, "\\$&"),
    +                suffix,
    +                prefix;
    +
    +            /*
    +             * If the term ends in a word character (a-z0-9_), ensure a word
    +             * boundary at the end, so that substrings do not get falsely
    +             * matched. eg "todo" in a string such as "mastodon".
    +             * If the term ends in a non-word character, then \b won't match on
    +             * the boundary to the next non-word character, which would likely
    +             * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`.
    +             * In these cases, use no bounding match. Same applies for the
    +             * prefix, handled below.
    +             */
    +            suffix = /\w$/.test(term) ? "\\b" : "";
    +
    +            if (location === "start") {
    +
    +                /*
    +                 * When matching at the start, ignore leading whitespace, and
    +                 * there's no need to worry about word boundaries.
    +                 */
    +                prefix = "^\\s*";
    +            } else if (/^\w/.test(term)) {
    +                prefix = "\\b";
    +            } else {
    +                prefix = "";
                 }
    -        });
     
    -        return matches;
    -    }
    +            return new RegExp(prefix + escaped + suffix, "i");
    +        }
    +
    +        /**
    +         * Checks the specified comment for matches of the configured warning terms and returns the matches.
    +         * @param {String} comment The comment which is checked.
    +         * @returns {Array} All matched warning terms for this comment.
    +         */
    +        function commentContainsWarningTerm(comment) {
    +            var matches = [];
    +
    +            warningRegExps.forEach(function(regex, index) {
    +                if (regex.test(comment)) {
    +                    matches.push(warningTerms[index]);
    +                }
    +            });
     
    -    /**
    -     * Checks the specified node for matching warning comments and reports them.
    -     * @param {ASTNode} node The AST node being checked.
    -     * @returns {void} undefined.
    -     */
    -    function checkComment(node) {
    -        if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
    -            return;
    +            return matches;
             }
     
    -        var matches = commentContainsWarningTerm(node.value);
    +        /**
    +         * Checks the specified node for matching warning comments and reports them.
    +         * @param {ASTNode} node The AST node being checked.
    +         * @returns {void} undefined.
    +         */
    +        function checkComment(node) {
    +            if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
    +                return;
    +            }
     
    -        matches.forEach(function(matchedTerm) {
    -            context.report(node, "Unexpected '" + matchedTerm + "' comment.");
    -        });
    -    }
    +            var matches = commentContainsWarningTerm(node.value);
     
    -    warningRegExps = warningTerms.map(convertToRegExp);
    -    return {
    -        "BlockComment": checkComment,
    -        "LineComment": checkComment
    -    };
    -};
    +            matches.forEach(function(matchedTerm) {
    +                context.report(node, "Unexpected '" + matchedTerm + "' comment.");
    +            });
    +        }
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "terms": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    -                }
    -            },
    -            "location": {
    -                "enum": ["start", "anywhere"]
    -            }
    -        },
    -        "additionalProperties": false
    +        warningRegExps = warningTerms.map(convertToRegExp);
    +        return {
    +            BlockComment: checkComment,
    +            LineComment: checkComment
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/no-whitespace-before-property.js b/tools/eslint/lib/rules/no-whitespace-before-property.js
    index 0910f2fce42212..347c63d934f166 100644
    --- a/tools/eslint/lib/rules/no-whitespace-before-property.js
    +++ b/tools/eslint/lib/rules/no-whitespace-before-property.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -12,70 +10,88 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var sourceCode = context.getSourceCode();
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow whitespace before properties",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +        fixable: "whitespace",
    +        schema: []
    +    },
     
    -    /**
    -     * 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);
    +    create: function(context) {
    +        var sourceCode = context.getSourceCode();
     
    -        while (token.value !== "[") {
    -            token = sourceCode.getTokenBefore(token);
    -        }
    -        return token;
    -    }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * 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)
    +        /**
    +         * 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;
    +        }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        /**
    +         * Reports whitespace before property token
    +         * @param {ASTNode} node - the node to report in the event of an error
    +         * @param {Token} leftToken - the left token
    +         * @param {Token} rightToken - the right token
    +         * @returns {void}
    +         * @private
    +         */
    +        function reportError(node, leftToken, rightToken) {
    +            var replacementText = node.computed ? "" : ".";
     
    -    return {
    -        MemberExpression: function(node) {
    -            var rightToken;
    -            var leftToken;
    +            context.report({
    +                node: node,
    +                message: "Unexpected whitespace before property {{propName}}.",
    +                data: {
    +                    propName: sourceCode.getText(node.property)
    +                },
    +                fix: function(fixer) {
    +                    return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], replacementText);
    +                }
    +            });
    +        }
     
    -            if (!astUtils.isTokenOnSameLine(node.object, node.property)) {
    -                return;
    -            }
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            if (node.computed) {
    -                rightToken = findOpeningBracket(node);
    -                leftToken = sourceCode.getTokenBefore(rightToken);
    -            } else {
    -                rightToken = sourceCode.getFirstToken(node.property);
    -                leftToken = sourceCode.getTokenBefore(rightToken, 1);
    -            }
    +        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);
    +                if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
    +                    reportError(node, leftToken, rightToken);
    +                }
                 }
    -        }
    -    };
    +        };
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/no-with.js b/tools/eslint/lib/rules/no-with.js
    index beec2554db2cd9..df7528fdfa8487 100644
    --- a/tools/eslint/lib/rules/no-with.js
    +++ b/tools/eslint/lib/rules/no-with.js
    @@ -9,14 +9,24 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "disallow `with` statements",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    -        "WithStatement": function(node) {
    -            context.report(node, "Unexpected use of 'with' statement.");
    -        }
    -    };
    +        schema: []
    +    },
     
    -};
    +    create: function(context) {
    +
    +        return {
    +            WithStatement: function(node) {
    +                context.report(node, "Unexpected use of 'with' statement.");
    +            }
    +        };
     
    -module.exports.schema = [];
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/object-curly-spacing.js b/tools/eslint/lib/rules/object-curly-spacing.js
    index 8c300ee9653070..11224bbdd13a0a 100644
    --- a/tools/eslint/lib/rules/object-curly-spacing.js
    +++ b/tools/eslint/lib/rules/object-curly-spacing.js
    @@ -1,12 +1,6 @@
     /**
      * @fileoverview Disallows or enforces spaces inside of object literals.
      * @author Jamund Ferguson
    - * @copyright 2014 Brandyn Bennett. All rights reserved.
    - * @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";
     
    @@ -16,250 +10,277 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = 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;
    -    }
    -
    -    var options = {
    -        spaced: spaced,
    -        arraysInObjectsException: isOptionSet("arraysInObjects"),
    -        objectsInObjectsException: isOptionSet("objectsInObjects")
    -    };
    -
    -    //--------------------------------------------------------------------------
    -    // 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]]);
    -            }
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing inside braces",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -    * 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]]);
    -            }
    -        });
    -    }
    +        fixable: "whitespace",
     
    -    /**
    -    * 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, " ");
    +        schema: [
    +            {
    +                enum: ["always", "never"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    arraysInObjects: {
    +                        type: "boolean"
    +                    },
    +                    objectsInObjects: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -        });
    -    }
    +        ]
    +    },
     
    -    /**
    -    * 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, " ");
    -            }
    -        });
    -    }
    +    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 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,
    -            firstSpaced, lastSpaced;
    -
    -        if (astUtils.isTokenOnSameLine(first, second)) {
    -            firstSpaced = sourceCode.isSpaceBetweenTokens(first, second);
    -            if (options.spaced && !firstSpaced) {
    -                reportRequiredBeginningSpace(node, first);
    -            }
    -            if (!options.spaced && firstSpaced) {
    -                reportNoBeginningSpace(node, first);
    -            }
    +        var options = {
    +            spaced: spaced,
    +            arraysInObjectsException: isOptionSet("arraysInObjects"),
    +            objectsInObjectsException: isOptionSet("objectsInObjects")
    +        };
    +
    +        //--------------------------------------------------------------------------
    +        // 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]]);
    +                }
    +            });
             }
     
    -        if (astUtils.isTokenOnSameLine(penultimate, last)) {
    -            lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last);
    -            if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
    -                reportRequiredEndingSpace(node, last);
    -            }
    -            if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
    -                reportNoEndingSpace(node, last);
    -            }
    +        /**
    +        * 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 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;
    +        /**
    +        * 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, " ");
    +                }
    +            });
             }
     
    -        var first = sourceCode.getFirstToken(node),
    -            last = sourceCode.getLastToken(node),
    -            second = sourceCode.getTokenAfter(first),
    -            penultimate = sourceCode.getTokenBefore(last);
    +        /**
    +        * 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, " ");
    +                }
    +            });
    +        }
     
    -        validateBraceSpacing(node, first, second, penultimate, last);
    -    }
    +        /**
    +         * 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 shouldCheckPenultimate,
    +                penultimateType,
    +                closingCurlyBraceMustBeSpaced,
    +                firstSpaced,
    +                lastSpaced;
    +
    +            if (astUtils.isTokenOnSameLine(first, second)) {
    +                firstSpaced = sourceCode.isSpaceBetweenTokens(first, second);
    +                if (options.spaced && !firstSpaced) {
    +                    reportRequiredBeginningSpace(node, first);
    +                }
    +                if (!options.spaced && firstSpaced) {
    +                    reportNoBeginningSpace(node, first);
    +                }
    +            }
     
    -    /**
    -     * 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;
    +            if (astUtils.isTokenOnSameLine(penultimate, last)) {
    +                shouldCheckPenultimate = (
    +                    options.arraysInObjectsException && penultimate.value === "]" ||
    +                    options.objectsInObjectsException && penultimate.value === "}"
    +                );
    +                penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.start).type;
    +
    +                closingCurlyBraceMustBeSpaced = (
    +                    options.arraysInObjectsException && penultimateType === "ArrayExpression" ||
    +                    options.objectsInObjectsException && penultimateType === "ObjectExpression"
    +                ) ? !options.spaced : options.spaced;
    +
    +                lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last);
    +
    +                if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
    +                    reportRequiredEndingSpace(node, last);
    +                }
    +                if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
    +                    reportNoEndingSpace(node, last);
    +                }
    +            }
             }
     
    -        var firstSpecifier = node.specifiers[0],
    -            lastSpecifier = node.specifiers[node.specifiers.length - 1];
    +        /**
    +         * 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;
    +            }
     
    -        if (lastSpecifier.type !== "ImportSpecifier") {
    -            return;
    -        }
    -        if (firstSpecifier.type !== "ImportSpecifier") {
    -            firstSpecifier = node.specifiers[1];
    +            var first = sourceCode.getFirstToken(node),
    +                last = sourceCode.getLastToken(node),
    +                second = sourceCode.getTokenAfter(first),
    +                penultimate = sourceCode.getTokenBefore(last);
    +
    +            validateBraceSpacing(node, first, second, penultimate, last);
             }
     
    -        var first = sourceCode.getTokenBefore(firstSpecifier),
    -            last = sourceCode.getTokenAfter(lastSpecifier);
    +        /**
    +         * 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;
    +            }
     
    -        // to support a trailing comma.
    -        if (last.value === ",") {
    -            last = sourceCode.getTokenAfter(last);
    -        }
    +            var firstSpecifier = node.specifiers[0],
    +                lastSpecifier = node.specifiers[node.specifiers.length - 1];
     
    -        var second = sourceCode.getTokenAfter(first),
    -            penultimate = sourceCode.getTokenBefore(last);
    +            if (lastSpecifier.type !== "ImportSpecifier") {
    +                return;
    +            }
    +            if (firstSpecifier.type !== "ImportSpecifier") {
    +                firstSpecifier = node.specifiers[1];
    +            }
     
    -        validateBraceSpacing(node, first, second, penultimate, last);
    -    }
    +            var first = sourceCode.getTokenBefore(firstSpecifier),
    +                last = sourceCode.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;
    -        }
    +            // to support a trailing comma.
    +            if (last.value === ",") {
    +                last = sourceCode.getTokenAfter(last);
    +            }
     
    -        var firstSpecifier = node.specifiers[0],
    -            lastSpecifier = node.specifiers[node.specifiers.length - 1],
    -            first = sourceCode.getTokenBefore(firstSpecifier),
    -            last = sourceCode.getTokenAfter(lastSpecifier);
    +            var second = sourceCode.getTokenAfter(first),
    +                penultimate = sourceCode.getTokenBefore(last);
     
    -        // to support a trailing comma.
    -        if (last.value === ",") {
    -            last = sourceCode.getTokenAfter(last);
    +            validateBraceSpacing(node, first, second, penultimate, last);
             }
     
    -        var second = sourceCode.getTokenAfter(first),
    -            penultimate = sourceCode.getTokenBefore(last);
    +        /**
    +         * 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);
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +            // to support a trailing comma.
    +            if (last.value === ",") {
    +                last = sourceCode.getTokenAfter(last);
    +            }
     
    -    return {
    -        // var {x} = y;
    -        ObjectPattern: checkForObject,
    +            var second = sourceCode.getTokenAfter(first),
    +                penultimate = sourceCode.getTokenBefore(last);
     
    -        // var y = {x: 'y'}
    -        ObjectExpression: checkForObject,
    +            validateBraceSpacing(node, first, second, penultimate, last);
    +        }
     
    -        // import {y} from 'x';
    -        ImportDeclaration: checkForImport,
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -        // export {name} from 'yo';
    -        ExportNamedDeclaration: checkForExport
    -    };
    +        return {
     
    -};
    +            // var {x} = y;
    +            ObjectPattern: checkForObject,
    +
    +            // var y = {x: 'y'}
    +            ObjectExpression: checkForObject,
    +
    +            // import {y} from 'x';
    +            ImportDeclaration: checkForImport,
    +
    +            // export {name} from 'yo';
    +            ExportNamedDeclaration: checkForExport
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "arraysInObjects": {
    -                "type": "boolean"
    -            },
    -            "objectsInObjects": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/object-shorthand.js b/tools/eslint/lib/rules/object-shorthand.js
    index e17e48f4cc7039..4c7c066bcdc588 100644
    --- a/tools/eslint/lib/rules/object-shorthand.js
    +++ b/tools/eslint/lib/rules/object-shorthand.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to enforce concise object methods and properties.
      * @author Jamund Ferguson
    - * @copyright 2015 Jamund Ferguson. All rights reserved.
      */
     
     "use strict";
    @@ -16,107 +15,127 @@ 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();
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow method and property shorthand syntax for object literals",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +        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
    +                }
    +            ]
    +        }
    +    },
    +
    +    create: 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();
    +        }
     
    -    return {
    -        "Property": function(node) {
    -            var isConciseProperty = node.method || node.shorthand,
    -                type;
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            // if we're "never" and concise we should warn now
    -            if (APPLY_NEVER && isConciseProperty) {
    -                type = node.method ? "method" : "property";
    -                context.report(node, "Expected longform " + type + " syntax.");
    -            }
    +        return {
    +            Property: function(node) {
    +                var isConciseProperty = node.method || node.shorthand,
    +                    type;
     
    -            // at this point if we're concise or if we're "never" we can leave
    -            if (APPLY_NEVER || isConciseProperty) {
    -                return;
    -            }
    +                // Ignore destructuring assignment
    +                if (node.parent.type === "ObjectPattern") {
    +                    return;
    +                }
     
    -            // getters, setters and computed properties are ignored
    -            if (node.kind === "get" || node.kind === "set" || node.computed) {
    -                return;
    -            }
    +                // if we're "never" and concise we should warn now
    +                if (APPLY_NEVER && isConciseProperty) {
    +                    type = node.method ? "method" : "property";
    +                    context.report(node, "Expected longform " + type + " syntax.");
    +                }
     
    -            if (node.value.type === "FunctionExpression" && !node.value.id && APPLY_TO_METHODS) {
    -                if (IGNORE_CONSTRUCTORS && isConstructor(node.key.name)) {
    +                // at this point if we're concise or if we're "never" we can leave
    +                if (APPLY_NEVER || isConciseProperty) {
                         return;
                     }
     
    -                // {x: function(){}} should be written as {x() {}}
    -                context.report(node, "Expected method shorthand.");
    -            } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) {
    +                // only computed methods can fail the following checks
    +                if (!APPLY_TO_METHODS && node.computed) {
    +                    return;
    +                }
     
    -                // {x: x} should be written as {x}
    -                context.report(node, "Expected property shorthand.");
    -            } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) {
    +                // getters and setters are ignored
    +                if (node.kind === "get" || node.kind === "set") {
    +                    return;
    +                }
     
    -                // {"x": x} should be written as {x}
    -                context.report(node, "Expected property shorthand.");
    -            }
    -        }
    -    };
    +                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.");
    +                } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) {
     
    -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
    +                    // {x: x} should be written as {x}
    +                    context.report(node, "Expected property shorthand.");
    +                } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) {
    +
    +                    // {"x": x} should be written as {x}
    +                    context.report(node, "Expected property shorthand.");
                     }
    -            ],
    -            "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
    index 100648b6583124..f4cdb84b187fa2 100644
    --- a/tools/eslint/lib/rules/one-var-declaration-per-line.js
    +++ b/tools/eslint/lib/rules/one-var-declaration-per-line.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,65 +8,76 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow newlines around `var` declarations",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var ERROR_MESSAGE = "Expected variable declaration to be on a new line.";
    -    var always = context.options[0] === "always";
    +        schema: [
    +            {
    +                enum: ["always", "initializations"]
    +            }
    +        ]
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    +    create: 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;
    +        /**
    +         * 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";
             }
     
    -        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
    -                    });
    -                }
    +        /**
    +         * Checks newlines around variable declarations.
    +         * @private
    +         * @param {ASTNode} node - `VariableDeclaration` node to test
    +         * @returns {void}
    +         */
    +        function checkForNewLine(node) {
    +            if (isForTypeSpecifier(node.parent.type)) {
    +                return;
                 }
    -            prev = current;
    -        });
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +            var declarations = node.declarations;
    +            var prev;
     
    -    return {
    -        "VariableDeclaration": checkForNewLine
    -    };
    +            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 55c81143930337..805cec3654dd0c 100644
    --- a/tools/eslint/lib/rules/one-var.js
    +++ b/tools/eslint/lib/rules/one-var.js
    @@ -1,10 +1,6 @@
     /**
      * @fileoverview A rule to control the use of single variable declarations.
      * @author Ian Christian Myers
    - * @copyright 2015 Ian VanSchooten. All rights reserved.
    - * @copyright 2015 Joey Baker. All rights reserved.
    - * @copyright 2015 Danny Fritz. All rights reserved.
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -13,303 +9,321 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce variables to be declared either together or separately in functions",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var MODE_ALWAYS = "always",
    -        MODE_NEVER = "never";
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["always", "never"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            var: {
    +                                enum: ["always", "never"]
    +                            },
    +                            let: {
    +                                enum: ["always", "never"]
    +                            },
    +                            const: {
    +                                enum: ["always", "never"]
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            initialized: {
    +                                enum: ["always", "never"]
    +                            },
    +                            uninitialized: {
    +                                enum: ["always", "never"]
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
     
    -    var mode = context.options[0] || MODE_ALWAYS;
    +    create: function(context) {
     
    -    var options = {
    -    };
    +        var MODE_ALWAYS = "always",
    +            MODE_NEVER = "never";
     
    -    if (typeof mode === "string") { // simple options configuration with just a string
    -        options.var = { uninitialized: mode, initialized: mode};
    -        options.let = { uninitialized: mode, initialized: mode};
    -        options.const = { uninitialized: mode, initialized: mode};
    -    } else if (typeof mode === "object") { // options configuration is an object
    -        if (mode.hasOwnProperty("var") && typeof mode.var === "string") {
    -            options.var = { uninitialized: mode.var, initialized: mode.var};
    -        }
    -        if (mode.hasOwnProperty("let") && typeof mode.let === "string") {
    -            options.let = { uninitialized: mode.let, initialized: mode.let};
    -        }
    -        if (mode.hasOwnProperty("const") && typeof mode.const === "string") {
    -            options.const = { uninitialized: mode.const, initialized: mode.const};
    -        }
    -        if (mode.hasOwnProperty("uninitialized")) {
    -            if (!options.var) {
    -                options.var = {};
    +        var mode = context.options[0] || MODE_ALWAYS;
    +
    +        var options = {
    +        };
    +
    +        if (typeof mode === "string") { // simple options configuration with just a string
    +            options.var = { uninitialized: mode, initialized: mode};
    +            options.let = { uninitialized: mode, initialized: mode};
    +            options.const = { uninitialized: mode, initialized: mode};
    +        } else if (typeof mode === "object") { // options configuration is an object
    +            if (mode.hasOwnProperty("var") && typeof mode.var === "string") {
    +                options.var = { uninitialized: mode.var, initialized: mode.var};
                 }
    -            if (!options.let) {
    -                options.let = {};
    +            if (mode.hasOwnProperty("let") && typeof mode.let === "string") {
    +                options.let = { uninitialized: mode.let, initialized: mode.let};
                 }
    -            if (!options.const) {
    -                options.const = {};
    +            if (mode.hasOwnProperty("const") && typeof mode.const === "string") {
    +                options.const = { uninitialized: mode.const, initialized: mode.const};
                 }
    -            options.var.uninitialized = mode.uninitialized;
    -            options.let.uninitialized = mode.uninitialized;
    -            options.const.uninitialized = mode.uninitialized;
    -        }
    -        if (mode.hasOwnProperty("initialized")) {
    -            if (!options.var) {
    -                options.var = {};
    -            }
    -            if (!options.let) {
    -                options.let = {};
    +            if (mode.hasOwnProperty("uninitialized")) {
    +                if (!options.var) {
    +                    options.var = {};
    +                }
    +                if (!options.let) {
    +                    options.let = {};
    +                }
    +                if (!options.const) {
    +                    options.const = {};
    +                }
    +                options.var.uninitialized = mode.uninitialized;
    +                options.let.uninitialized = mode.uninitialized;
    +                options.const.uninitialized = mode.uninitialized;
                 }
    -            if (!options.const) {
    -                options.const = {};
    +            if (mode.hasOwnProperty("initialized")) {
    +                if (!options.var) {
    +                    options.var = {};
    +                }
    +                if (!options.let) {
    +                    options.let = {};
    +                }
    +                if (!options.const) {
    +                    options.const = {};
    +                }
    +                options.var.initialized = mode.initialized;
    +                options.let.initialized = mode.initialized;
    +                options.const.initialized = mode.initialized;
                 }
    -            options.var.initialized = mode.initialized;
    -            options.let.initialized = mode.initialized;
    -            options.const.initialized = mode.initialized;
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    var functionStack = [];
    -    var blockStack = [];
    -
    -    /**
    -     * Increments the blockStack counter.
    -     * @returns {void}
    -     * @private
    -     */
    -    function startBlock() {
    -        blockStack.push({
    -            let: {initialized: false, uninitialized: false},
    -            const: {initialized: false, uninitialized: false}
    -        });
    -    }
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
     
    -    /**
    -     * Increments the functionStack counter.
    -     * @returns {void}
    -     * @private
    -     */
    -    function startFunction() {
    -        functionStack.push({initialized: false, uninitialized: false});
    -        startBlock();
    -    }
    +        var functionStack = [];
    +        var blockStack = [];
     
    -    /**
    -     * Decrements the blockStack counter.
    -     * @returns {void}
    -     * @private
    -     */
    -    function endBlock() {
    -        blockStack.pop();
    -    }
    +        /**
    +         * Increments the blockStack counter.
    +         * @returns {void}
    +         * @private
    +         */
    +        function startBlock() {
    +            blockStack.push({
    +                let: {initialized: false, uninitialized: false},
    +                const: {initialized: false, uninitialized: false}
    +            });
    +        }
     
    -    /**
    -     * Decrements the functionStack counter.
    -     * @returns {void}
    -     * @private
    -     */
    -    function endFunction() {
    -        functionStack.pop();
    -        endBlock();
    -    }
    +        /**
    +         * Increments the functionStack counter.
    +         * @returns {void}
    +         * @private
    +         */
    +        function startFunction() {
    +            functionStack.push({initialized: false, uninitialized: false});
    +            startBlock();
    +        }
     
    -    /**
    -     * Records whether initialized or uninitialized variables are defined in current scope.
    -     * @param {string} statementType node.kind, one of: "var", "let", or "const"
    -     * @param {ASTNode[]} declarations List of declarations
    -     * @param {Object} currentScope The scope being investigated
    -     * @returns {void}
    -     * @private
    -     */
    -    function recordTypes(statementType, declarations, currentScope) {
    -        for (var i = 0; i < declarations.length; i++) {
    -            if (declarations[i].init === null) {
    -                if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
    -                    currentScope.uninitialized = true;
    -                }
    -            } else {
    -                if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) {
    -                    currentScope.initialized = true;
    -                }
    -            }
    +        /**
    +         * Decrements the blockStack counter.
    +         * @returns {void}
    +         * @private
    +         */
    +        function endBlock() {
    +            blockStack.pop();
             }
    -    }
     
    -    /**
    -     * Determines the current scope (function or block)
    -     * @param  {string} statementType node.kind, one of: "var", "let", or "const"
    -     * @returns {Object} The scope associated with statementType
    -     */
    -    function getCurrentScope(statementType) {
    -        var currentScope;
    -        if (statementType === "var") {
    -            currentScope = functionStack[functionStack.length - 1];
    -        } else if (statementType === "let") {
    -            currentScope = blockStack[blockStack.length - 1].let;
    -        } else if (statementType === "const") {
    -            currentScope = blockStack[blockStack.length - 1].const;
    +        /**
    +         * Decrements the functionStack counter.
    +         * @returns {void}
    +         * @private
    +         */
    +        function endFunction() {
    +            functionStack.pop();
    +            endBlock();
             }
    -        return currentScope;
    -    }
     
    -    /**
    -     * Counts the number of initialized and uninitialized declarations in a list of declarations
    -     * @param {ASTNode[]} declarations List of declarations
    -     * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
    -     * @private
    -     */
    -    function countDeclarations(declarations) {
    -        var counts = { uninitialized: 0, initialized: 0 };
    -        for (var i = 0; i < declarations.length; i++) {
    -            if (declarations[i].init === null) {
    -                counts.uninitialized++;
    -            } else {
    -                counts.initialized++;
    +        /**
    +         * Records whether initialized or uninitialized variables are defined in current scope.
    +         * @param {string} statementType node.kind, one of: "var", "let", or "const"
    +         * @param {ASTNode[]} declarations List of declarations
    +         * @param {Object} currentScope The scope being investigated
    +         * @returns {void}
    +         * @private
    +         */
    +        function recordTypes(statementType, declarations, currentScope) {
    +            for (var i = 0; i < declarations.length; i++) {
    +                if (declarations[i].init === null) {
    +                    if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
    +                        currentScope.uninitialized = true;
    +                    }
    +                } else {
    +                    if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) {
    +                        currentScope.initialized = true;
    +                    }
    +                }
                 }
             }
    -        return counts;
    -    }
     
    -    /**
    -     * Determines if there is more than one var statement in the current scope.
    -     * @param {string} statementType node.kind, one of: "var", "let", or "const"
    -     * @param {ASTNode[]} declarations List of declarations
    -     * @returns {boolean} Returns true if it is the first var declaration, false if not.
    -     * @private
    -     */
    -    function hasOnlyOneStatement(statementType, declarations) {
    -
    -        var declarationCounts = countDeclarations(declarations);
    -        var currentOptions = options[statementType] || {};
    -        var currentScope = getCurrentScope(statementType);
    -
    -        if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) {
    -            if (currentScope.uninitialized || currentScope.initialized) {
    -                return false;
    +        /**
    +         * Determines the current scope (function or block)
    +         * @param  {string} statementType node.kind, one of: "var", "let", or "const"
    +         * @returns {Object} The scope associated with statementType
    +         */
    +        function getCurrentScope(statementType) {
    +            var currentScope;
    +
    +            if (statementType === "var") {
    +                currentScope = functionStack[functionStack.length - 1];
    +            } else if (statementType === "let") {
    +                currentScope = blockStack[blockStack.length - 1].let;
    +            } else if (statementType === "const") {
    +                currentScope = blockStack[blockStack.length - 1].const;
                 }
    +            return currentScope;
             }
     
    -        if (declarationCounts.uninitialized > 0) {
    -            if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) {
    -                return false;
    +        /**
    +         * Counts the number of initialized and uninitialized declarations in a list of declarations
    +         * @param {ASTNode[]} declarations List of declarations
    +         * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
    +         * @private
    +         */
    +        function countDeclarations(declarations) {
    +            var counts = { uninitialized: 0, initialized: 0 };
    +
    +            for (var i = 0; i < declarations.length; i++) {
    +                if (declarations[i].init === null) {
    +                    counts.uninitialized++;
    +                } else {
    +                    counts.initialized++;
    +                }
                 }
    +            return counts;
             }
    -        if (declarationCounts.initialized > 0) {
    -            if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) {
    -                return false;
    +
    +        /**
    +         * Determines if there is more than one var statement in the current scope.
    +         * @param {string} statementType node.kind, one of: "var", "let", or "const"
    +         * @param {ASTNode[]} declarations List of declarations
    +         * @returns {boolean} Returns true if it is the first var declaration, false if not.
    +         * @private
    +         */
    +        function hasOnlyOneStatement(statementType, declarations) {
    +
    +            var declarationCounts = countDeclarations(declarations);
    +            var currentOptions = options[statementType] || {};
    +            var currentScope = getCurrentScope(statementType);
    +
    +            if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) {
    +                if (currentScope.uninitialized || currentScope.initialized) {
    +                    return false;
    +                }
    +            }
    +
    +            if (declarationCounts.uninitialized > 0) {
    +                if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) {
    +                    return false;
    +                }
    +            }
    +            if (declarationCounts.initialized > 0) {
    +                if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) {
    +                    return false;
    +                }
                 }
    +            recordTypes(statementType, declarations, currentScope);
    +            return true;
             }
    -        recordTypes(statementType, declarations, currentScope);
    -        return true;
    -    }
     
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "Program": startFunction,
    -        "FunctionDeclaration": startFunction,
    -        "FunctionExpression": startFunction,
    -        "ArrowFunctionExpression": startFunction,
    -        "BlockStatement": startBlock,
    -        "ForStatement": startBlock,
    -        "ForInStatement": startBlock,
    -        "ForOfStatement": startBlock,
    -        "SwitchStatement": startBlock,
    -
    -        "VariableDeclaration": function(node) {
    -            var parent = node.parent,
    -                type, declarations, declarationCounts;
    -
    -            type = node.kind;
    -            if (!options[type]) {
    -                return;
    -            }
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
     
    -            declarations = node.declarations;
    -            declarationCounts = countDeclarations(declarations);
    +        return {
    +            Program: startFunction,
    +            FunctionDeclaration: startFunction,
    +            FunctionExpression: startFunction,
    +            ArrowFunctionExpression: startFunction,
    +            BlockStatement: startBlock,
    +            ForStatement: startBlock,
    +            ForInStatement: startBlock,
    +            ForOfStatement: startBlock,
    +            SwitchStatement: startBlock,
     
    -            // always
    -            if (!hasOnlyOneStatement(type, declarations)) {
    -                if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) {
    -                    context.report(node, "Combine this with the previous '" + type + "' statement.");
    -                } else {
    -                    if (options[type].initialized === MODE_ALWAYS) {
    -                        context.report(node, "Combine this with the previous '" + type + "' statement with initialized variables.");
    -                    }
    -                    if (options[type].uninitialized === MODE_ALWAYS) {
    -                        context.report(node, "Combine this with the previous '" + type + "' statement with uninitialized variables.");
    -                    }
    +            VariableDeclaration: function(node) {
    +                var parent = node.parent,
    +                    type, declarations, declarationCounts;
    +
    +                type = node.kind;
    +                if (!options[type]) {
    +                    return;
                     }
    -            }
    -            // never
    -            if (parent.type !== "ForStatement" || parent.init !== node) {
    -                var totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized;
    -                if (totalDeclarations > 1) {
    -                    // both initialized and uninitialized
    -                    if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) {
    -                        context.report(node, "Split '" + type + "' declarations into multiple statements.");
    -                    // initialized
    -                    } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) {
    -                        context.report(node, "Split initialized '" + type + "' declarations into multiple statements.");
    -                    // uninitialized
    -                    } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) {
    -                        context.report(node, "Split uninitialized '" + type + "' declarations into multiple statements.");
    +
    +                declarations = node.declarations;
    +                declarationCounts = countDeclarations(declarations);
    +
    +                // always
    +                if (!hasOnlyOneStatement(type, declarations)) {
    +                    if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) {
    +                        context.report(node, "Combine this with the previous '" + type + "' statement.");
    +                    } else {
    +                        if (options[type].initialized === MODE_ALWAYS) {
    +                            context.report(node, "Combine this with the previous '" + type + "' statement with initialized variables.");
    +                        }
    +                        if (options[type].uninitialized === MODE_ALWAYS) {
    +                            context.report(node, "Combine this with the previous '" + type + "' statement with uninitialized variables.");
    +                        }
                         }
                     }
    -            }
    -        },
     
    -        "ForStatement:exit": endBlock,
    -        "ForOfStatement:exit": endBlock,
    -        "ForInStatement:exit": endBlock,
    -        "SwitchStatement:exit": endBlock,
    -        "BlockStatement:exit": endBlock,
    -        "Program:exit": endFunction,
    -        "FunctionDeclaration:exit": endFunction,
    -        "FunctionExpression:exit": endFunction,
    -        "ArrowFunctionExpression:exit": endFunction
    -    };
    +                // never
    +                if (parent.type !== "ForStatement" || parent.init !== node) {
    +                    var totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized;
     
    -};
    +                    if (totalDeclarations > 1) {
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "enum": ["always", "never"]
    -            },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "var": {
    -                        "enum": ["always", "never"]
    -                    },
    -                    "let": {
    -                        "enum": ["always", "never"]
    -                    },
    -                    "const": {
    -                        "enum": ["always", "never"]
    +                        if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) {
    +
    +                            // both initialized and uninitialized
    +                            context.report(node, "Split '" + type + "' declarations into multiple statements.");
    +                        } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) {
    +
    +                            // initialized
    +                            context.report(node, "Split initialized '" + type + "' declarations into multiple statements.");
    +                        } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) {
    +
    +                            // uninitialized
    +                            context.report(node, "Split uninitialized '" + type + "' declarations into multiple statements.");
    +                        }
                         }
    -                },
    -                "additionalProperties": false
    +                }
                 },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "initialized": {
    -                        "enum": ["always", "never"]
    -                    },
    -                    "uninitialized": {
    -                        "enum": ["always", "never"]
    -                    }
    -                },
    -                "additionalProperties": false
    -            }
    -        ]
    +
    +            "ForStatement:exit": endBlock,
    +            "ForOfStatement:exit": endBlock,
    +            "ForInStatement:exit": endBlock,
    +            "SwitchStatement:exit": endBlock,
    +            "BlockStatement:exit": endBlock,
    +            "Program:exit": endFunction,
    +            "FunctionDeclaration:exit": endFunction,
    +            "FunctionExpression:exit": endFunction,
    +            "ArrowFunctionExpression:exit": endFunction
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/operator-assignment.js b/tools/eslint/lib/rules/operator-assignment.js
    index aa9e032ae2b2e5..7e60c9efd40801 100644
    --- a/tools/eslint/lib/rules/operator-assignment.js
    +++ b/tools/eslint/lib/rules/operator-assignment.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to replace assignment expressions with operator assignment
      * @author Brandon Mills
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     "use strict";
     
    @@ -53,66 +52,82 @@ function same(a, b) {
         switch (a.type) {
             case "Identifier":
                 return a.name === b.name;
    +
             case "Literal":
                 return a.value === b.value;
    +
             case "MemberExpression":
    -            // x[0] = x[0]
    -            // x[y] = x[y]
    -            // x.y = x.y
    +
    +            /*
    +             * x[0] = x[0]
    +             * x[y] = x[y]
    +             * x.y = x.y
    +             */
                 return same(a.object, b.object) && same(a.property, b.property);
    +
             default:
                 return false;
         }
     }
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow assignment operator shorthand where possible",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Ensures that an assignment uses the shorthand form where possible.
    -     * @param   {ASTNode} node An AssignmentExpression node.
    -     * @returns {void}
    -     */
    -    function verify(node) {
    -        var expr, left, operator;
    +        schema: [
    +            {
    +                enum: ["always", "never"]
    +            }
    +        ]
    +    },
     
    -        if (node.operator !== "=" || node.right.type !== "BinaryExpression") {
    -            return;
    -        }
    +    create: function(context) {
     
    -        left = node.left;
    -        expr = node.right;
    -        operator = expr.operator;
    +        /**
    +         * Ensures that an assignment uses the shorthand form where possible.
    +         * @param   {ASTNode} node An AssignmentExpression node.
    +         * @returns {void}
    +         */
    +        function verify(node) {
    +            var expr, left, operator;
     
    -        if (isCommutativeOperatorWithShorthand(operator)) {
    -            if (same(left, expr.left) || same(left, expr.right)) {
    -                context.report(node, "Assignment can be replaced with operator assignment.");
    +            if (node.operator !== "=" || node.right.type !== "BinaryExpression") {
    +                return;
                 }
    -        } else if (isNonCommutativeOperatorWithShorthand(operator)) {
    -            if (same(left, expr.left)) {
    -                context.report(node, "Assignment can be replaced with operator assignment.");
    +
    +            left = node.left;
    +            expr = node.right;
    +            operator = expr.operator;
    +
    +            if (isCommutativeOperatorWithShorthand(operator)) {
    +                if (same(left, expr.left) || same(left, expr.right)) {
    +                    context.report(node, "Assignment can be replaced with operator assignment.");
    +                }
    +            } else if (isNonCommutativeOperatorWithShorthand(operator)) {
    +                if (same(left, expr.left)) {
    +                    context.report(node, "Assignment can be replaced with operator assignment.");
    +                }
                 }
             }
    -    }
     
    -    /**
    -     * Warns if an assignment expression uses operator assignment shorthand.
    -     * @param   {ASTNode} node An AssignmentExpression node.
    -     * @returns {void}
    -     */
    -    function prohibit(node) {
    -        if (node.operator !== "=") {
    -            context.report(node, "Unexpected operator assignment shorthand.");
    +        /**
    +         * Warns if an assignment expression uses operator assignment shorthand.
    +         * @param   {ASTNode} node An AssignmentExpression node.
    +         * @returns {void}
    +         */
    +        function prohibit(node) {
    +            if (node.operator !== "=") {
    +                context.report(node, "Unexpected operator assignment shorthand.");
    +            }
             }
    -    }
     
    -    return {
    -        "AssignmentExpression": context.options[0] !== "never" ? verify : prohibit
    -    };
    +        return {
    +            AssignmentExpression: context.options[0] !== "never" ? verify : prohibit
    +        };
     
    -};
    -
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/operator-linebreak.js b/tools/eslint/lib/rules/operator-linebreak.js
    index aa3c03692839ba..85f90b908feca7 100644
    --- a/tools/eslint/lib/rules/operator-linebreak.js
    +++ b/tools/eslint/lib/rules/operator-linebreak.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
      * @author Benoît Zugmeyer
    - * @copyright 2015 Benoît Zugmeyer. All rights reserved.
      */
     
     "use strict";
    @@ -13,136 +12,146 @@ var lodash = require("lodash"),
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent linebreak style for operators",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var usedDefaultGlobal = !context.options[0];
    -    var globalStyle = context.options[0] || "after";
    -    var options = context.options[1] || {};
    -    var styleOverrides = options.overrides ? lodash.assign({}, options.overrides) : {};
    +        schema: [
    +            {
    +                enum: ["after", "before", "none", null]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    overrides: {
    +                        type: "object",
    +                        properties: {
    +                            anyOf: {
    +                                type: "string",
    +                                enum: ["after", "before", "none", "ignore"]
    +                            }
    +                        }
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    if (usedDefaultGlobal && !styleOverrides["?"]) {
    -        styleOverrides["?"] = "before";
    -    }
    +    create: function(context) {
     
    -    if (usedDefaultGlobal && !styleOverrides[":"]) {
    -        styleOverrides[":"] = "before";
    -    }
    +        var usedDefaultGlobal = !context.options[0];
    +        var globalStyle = context.options[0] || "after";
    +        var options = context.options[1] || {};
    +        var styleOverrides = options.overrides ? lodash.assign({}, options.overrides) : {};
     
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * Checks the operator placement
    -     * @param {ASTNode} node The node to check
    -     * @param {ASTNode} leftSide The node that comes before the operator in `node`
    -     * @private
    -     * @returns {void}
    -     */
    -    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
    -        // parentheses (ex: `(a) + b`), leftToken will be the last token of the expression
    -        // and operatorToken will be the closing parenthesis.
    -        // The leftToken should be the last closing parenthesis, and the operatorToken
    -        // should be the token right after that.
    -        while (operatorToken.value === ")") {
    -            leftToken = operatorToken;
    -            operatorToken = context.getTokenAfter(operatorToken);
    +        if (usedDefaultGlobal && !styleOverrides["?"]) {
    +            styleOverrides["?"] = "before";
             }
     
    -        var rightToken = context.getTokenAfter(operatorToken);
    -        var operator = operatorToken.value;
    -        var operatorStyleOverride = styleOverrides[operator];
    -        var style = operatorStyleOverride || globalStyle;
    +        if (usedDefaultGlobal && !styleOverrides[":"]) {
    +            styleOverrides[":"] = "before";
    +        }
     
    -        // if single line
    -        if (astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
    -                astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * Checks the operator placement
    +         * @param {ASTNode} node The node to check
    +         * @param {ASTNode} leftSide The node that comes before the operator in `node`
    +         * @private
    +         * @returns {void}
    +         */
    +        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
    +            // parentheses (ex: `(a) + b`), leftToken will be the last token of the expression
    +            // and operatorToken will be the closing parenthesis.
    +            // The leftToken should be the last closing parenthesis, and the operatorToken
    +            // should be the token right after that.
    +            while (operatorToken.value === ")") {
    +                leftToken = operatorToken;
    +                operatorToken = context.getTokenAfter(operatorToken);
    +            }
     
    -            return;
    +            var rightToken = context.getTokenAfter(operatorToken);
    +            var operator = operatorToken.value;
    +            var operatorStyleOverride = styleOverrides[operator];
    +            var style = operatorStyleOverride || globalStyle;
     
    -        } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
    -                !astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
    +            // if single line
    +            if (astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
    +                    astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
     
    -            // lone operator
    -            context.report(node, {
    -                line: operatorToken.loc.end.line,
    -                column: operatorToken.loc.end.column
    -            }, "Bad line breaking before and after '" + operator + "'.");
    +                return;
     
    -        } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) {
    +            } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
    +                    !astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
     
    -            context.report(node, {
    -                line: operatorToken.loc.end.line,
    -                column: operatorToken.loc.end.column
    -            }, "'" + operator + "' should be placed at the beginning of the line.");
    +                // lone operator
    +                context.report(node, {
    +                    line: operatorToken.loc.end.line,
    +                    column: operatorToken.loc.end.column
    +                }, "Bad line breaking before and after '" + operator + "'.");
     
    -        } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
    +            } 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 end of the line.");
    +                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 === "none") {
    +            } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
     
    -            context.report(node, {
    -                line: operatorToken.loc.end.line,
    -                column: operatorToken.loc.end.column
    -            }, "There should be no line break before or after '" + operator + "'");
    +                context.report(node, {
    +                    line: operatorToken.loc.end.line,
    +                    column: operatorToken.loc.end.column
    +                }, "'" + operator + "' should be placed at the end of the line.");
     
    -        }
    -    }
    +            } else if (style === "none") {
     
    -    /**
    -     * Validates a binary expression using `validateNode`
    -     * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
    -     * @returns {void}
    -     */
    -    function validateBinaryExpression(node) {
    -        validateNode(node, node.left);
    -    }
    +                context.report(node, {
    +                    line: operatorToken.loc.end.line,
    +                    column: operatorToken.loc.end.column
    +                }, "There should be no line break before or after '" + operator + "'");
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "BinaryExpression": validateBinaryExpression,
    -        "LogicalExpression": validateBinaryExpression,
    -        "AssignmentExpression": validateBinaryExpression,
    -        "VariableDeclarator": function(node) {
    -            if (node.init) {
    -                validateNode(node, node.id);
                 }
    -        },
    -        "ConditionalExpression": function(node) {
    -            validateNode(node, node.test);
    -            validateNode(node, node.consequent);
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "enum": ["after", "before", "none", null]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "overrides": {
    -                "type": "object",
    -                "properties": {
    -                    "anyOf": {
    -                        "type": "string",
    -                        "enum": ["after", "before", "none", "ignore"]
    -                    }
    +        /**
    +         * 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
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            BinaryExpression: validateBinaryExpression,
    +            LogicalExpression: validateBinaryExpression,
    +            AssignmentExpression: validateBinaryExpression,
    +            VariableDeclarator: function(node) {
    +                if (node.init) {
    +                    validateNode(node, node.id);
                     }
    +            },
    +            ConditionalExpression: function(node) {
    +                validateNode(node, node.test);
    +                validateNode(node, node.consequent);
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/padded-blocks.js b/tools/eslint/lib/rules/padded-blocks.js
    index d8edfafa121a5a..39a2b07c8d862c 100644
    --- a/tools/eslint/lib/rules/padded-blocks.js
    +++ b/tools/eslint/lib/rules/padded-blocks.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to ensure blank lines within blocks.
      * @author Mathias Schreck 
    - * @copyright 2014 Mathias Schreck. All rights reserved.
      */
     
     "use strict";
    @@ -10,123 +9,219 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var requirePadding = context.options[0] !== "never";
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow padding within blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["always", "never"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            blocks: {
    +                                enum: ["always", "never"]
    +                            },
    +                            switches: {
    +                                enum: ["always", "never"]
    +                            },
    +                            classes: {
    +                                enum: ["always", "never"]
    +                            }
    +                        },
    +                        additionalProperties: false,
    +                        minProperties: 1
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = {};
    +        var config = context.options[0] || "always";
    +
    +        if (typeof config === "string") {
    +            options.blocks = config === "always";
    +        } else {
    +            if (config.hasOwnProperty("blocks")) {
    +                options.blocks = config.blocks === "always";
    +            }
    +            if (config.hasOwnProperty("switches")) {
    +                options.switches = config.switches === "always";
    +            }
    +            if (config.hasOwnProperty("classes")) {
    +                options.classes = config.classes === "always";
    +            }
    +        }
     
    -    var ALWAYS_MESSAGE = "Block must be padded by blank lines.",
    -        NEVER_MESSAGE = "Block must not be padded by blank lines.";
    +        var 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];
    -    }
    +        var sourceCode = context.getSourceCode();
     
    -    /**
    -     * Checks if the given non empty block node has a blank line before its first child node.
    -     * @param {ASTNode} node The AST node of a BlockStatement.
    -     * @returns {boolean} Whether or not the block starts with a blank line.
    -     */
    -    function isBlockTopPadded(node) {
    -        var blockStart = node.loc.start.line,
    -            first = node.body[0],
    -            firstLine = first.loc.start.line,
    -            expectedFirstLine = blockStart + 2,
    -            leadingComments = (node.body[0].leadingComments || []).slice(),
    -            firstComment;
    -
    -        while (leadingComments.length > 0 &&
    -                leadingComments[0].loc.start.line <= node.loc.start.line) {
    -            leadingComments.shift();
    +        /**
    +         * Gets the open brace token from a given node.
    +         * @param {ASTNode} node - A BlockStatement or SwitchStatement node from which to get the open brace.
    +         * @returns {Token} The token of the open brace.
    +         */
    +        function getOpenBrace(node) {
    +            if (node.type === "SwitchStatement") {
    +                return sourceCode.getTokenBefore(node.cases[0]);
    +            }
    +            return sourceCode.getFirstToken(node);
             }
     
    -        firstComment = leadingComments[0];
    -
    -        if (firstComment && isLocatedBefore(firstComment, first)) {
    -            firstLine = firstComment.loc.start.line;
    +        /**
    +         * Checks if the given parameter is a comment node
    +         * @param {ASTNode|Token} node An AST node or token
    +         * @returns {boolean} True if node is a comment
    +         */
    +        function isComment(node) {
    +            return node.type === "Line" || node.type === "Block";
             }
     
    -        return expectedFirstLine <= firstLine;
    -    }
    -
    -    /**
    -     * Checks if the given non empty block node has a blank line after its last child node.
    -     * @param {ASTNode} node The AST node of a BlockStatement.
    -     * @returns {boolean} Whether or not the block ends with a blank line.
    -     */
    -    function isBlockBottomPadded(node) {
    -        var blockEnd = node.loc.end.line,
    -            last = node.body[node.body.length - 1],
    -            lastToken = context.getLastToken(last),
    -            lastLine = lastToken.loc.end.line,
    -            expectedLastLine = blockEnd - 2,
    -            trailingComments = (node.body[node.body.length - 1].trailingComments || []).slice(),
    -            lastComment;
    -
    -        while (trailingComments.length > 0 &&
    -                trailingComments[trailingComments.length - 1].loc.end.line >= node.loc.end.line) {
    -            trailingComments.pop();
    +        /**
    +         * Checks if the given token has a blank line after it.
    +         * @param {Token} token The token to check.
    +         * @returns {boolean} Whether or not the token is followed by a blank line.
    +         */
    +        function isTokenTopPadded(token) {
    +            var tokenStartLine = token.loc.start.line,
    +                expectedFirstLine = tokenStartLine + 2,
    +                first,
    +                firstLine;
    +
    +            first = token;
    +            do {
    +                first = sourceCode.getTokenOrCommentAfter(first);
    +            } while (isComment(first) && first.loc.start.line === tokenStartLine);
    +
    +            firstLine = first.loc.start.line;
    +            return expectedFirstLine <= firstLine;
             }
     
    -        lastComment = trailingComments[trailingComments.length - 1];
    -
    -        if (lastComment && isLocatedBefore(lastToken, lastComment)) {
    -            lastLine = lastComment.loc.end.line;
    +        /**
    +         * Checks if the given token is preceeded by a blank line.
    +         * @param {Token} token The token to check
    +         * @returns {boolean} Whether or not the token is preceeded by a blank line
    +         */
    +        function isTokenBottomPadded(token) {
    +            var blockEnd = token.loc.end.line,
    +                expectedLastLine = blockEnd - 2,
    +                last,
    +                lastLine;
    +
    +            last = token;
    +            do {
    +                last = sourceCode.getTokenOrCommentBefore(last);
    +            } while (isComment(last) && last.loc.end.line === blockEnd);
    +
    +            lastLine = last.loc.end.line;
    +            return lastLine <= expectedLastLine;
             }
     
    -        return lastLine <= expectedLastLine;
    -    }
    -
    -    /**
    -     * Checks the given BlockStatement node to be padded if the block is not empty.
    -     * @param {ASTNode} node The AST node of a BlockStatement.
    -     * @returns {void} undefined.
    -     */
    -    function checkPadding(node) {
    -        if (node.body.length > 0) {
    -
    -            var blockHasTopPadding = isBlockTopPadded(node),
    -                blockHasBottomPadding = isBlockBottomPadded(node);
    +        /**
    +         * Checks if a node should be padded, according to the rule config.
    +         * @param {ASTNode} node The AST node to check.
    +         * @returns {boolean} True if the node should be padded, false otherwise.
    +         */
    +        function requirePaddingFor(node) {
    +            switch (node.type) {
    +                case "BlockStatement":
    +                    return options.blocks;
    +                case "SwitchStatement":
    +                    return options.switches;
    +                case "ClassBody":
    +                    return options.classes;
    +
    +                /* istanbul ignore next */
    +                default:
    +                    throw new Error("unreachable");
    +            }
    +        }
     
    -            if (requirePadding) {
    +        /**
    +         * Checks the given BlockStatement node to be padded if the block is not empty.
    +         * @param {ASTNode} node The AST node of a BlockStatement.
    +         * @returns {void} undefined.
    +         */
    +        function checkPadding(node) {
    +            var openBrace = getOpenBrace(node),
    +                closeBrace = sourceCode.getLastToken(node),
    +                blockHasTopPadding = isTokenTopPadded(openBrace),
    +                blockHasBottomPadding = isTokenBottomPadded(closeBrace);
    +
    +            if (requirePaddingFor(node)) {
                     if (!blockHasTopPadding) {
    -                    context.report(node, ALWAYS_MESSAGE);
    +                    context.report({
    +                        node: node,
    +                        loc: { line: openBrace.loc.start.line, column: openBrace.loc.start.column },
    +                        message: ALWAYS_MESSAGE
    +                    });
                     }
                     if (!blockHasBottomPadding) {
                         context.report({
                             node: node,
    -                        loc: {line: node.loc.end.line, column: node.loc.end.column - 1 },
    +                        loc: {line: closeBrace.loc.end.line, column: closeBrace.loc.end.column - 1 },
                             message: ALWAYS_MESSAGE
                         });
                     }
                 } else {
                     if (blockHasTopPadding) {
    -                    context.report(node, NEVER_MESSAGE);
    +                    context.report({
    +                        node: node,
    +                        loc: { line: openBrace.loc.start.line, column: openBrace.loc.start.column },
    +                        message: NEVER_MESSAGE
    +                    });
                     }
     
                     if (blockHasBottomPadding) {
                         context.report({
                             node: node,
    -                        loc: {line: node.loc.end.line, column: node.loc.end.column - 1 },
    +                        loc: {line: closeBrace.loc.end.line, column: closeBrace.loc.end.column - 1 },
                             message: NEVER_MESSAGE
                         });
                     }
                 }
             }
    -    }
     
    -    return {
    -        "BlockStatement": checkPadding
    -    };
    +        var rule = {};
     
    -};
    +        if (options.hasOwnProperty("switches")) {
    +            rule.SwitchStatement = function(node) {
    +                if (node.cases.length === 0) {
    +                    return;
    +                }
    +                checkPadding(node);
    +            };
    +        }
    +
    +        if (options.hasOwnProperty("blocks")) {
    +            rule.BlockStatement = function(node) {
    +                if (node.body.length === 0) {
    +                    return;
    +                }
    +                checkPadding(node);
    +            };
    +        }
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
    +        if (options.hasOwnProperty("classes")) {
    +            rule.ClassBody = function(node) {
    +                if (node.body.length === 0) {
    +                    return;
    +                }
    +                checkPadding(node);
    +            };
    +        }
    +
    +        return rule;
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/prefer-arrow-callback.js b/tools/eslint/lib/rules/prefer-arrow-callback.js
    index f7f26ca2581b99..4c4c2e6f2b10b6 100644
    --- a/tools/eslint/lib/rules/prefer-arrow-callback.js
    +++ b/tools/eslint/lib/rules/prefer-arrow-callback.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to suggest using arrow functions as callbacks.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -27,10 +26,6 @@ function isFunctionName(variable) {
      * @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;
     }
     
    @@ -41,11 +36,17 @@ function checkMetaProperty(node, metaName, propertyName) {
      */
     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.
    +
    +            /*
    +             * 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;
             }
         }
    @@ -64,9 +65,12 @@ function getVariableOfArguments(scope) {
     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;
    @@ -115,92 +119,136 @@ function getCallbackInfo(node) {
     // 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 = [];
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require arrow functions as callbacks",
    +            category: "ECMAScript 6",
    +            recommended: false
             },
     
    -        // If there are below, it cannot replace with arrow functions merely.
    -        ThisExpression: function() {
    -            var info = stack[stack.length - 1];
    -            if (info) {
    -                info.this = true;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    allowNamedFunctions: {
    +                        type: "boolean"
    +                    },
    +                    allowUnboundThis: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -        },
    -        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;
    -            }
    -        },
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +
    +        var allowUnboundThis = options.allowUnboundThis !== false;  // default to true
    +        var allowNamedFunctions = options.allowNamedFunctions;
    +
    +        /*
    +         * {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});
    +        }
     
    -        // To skip nested scopes.
    -        FunctionDeclaration: enterScope,
    -        "FunctionDeclaration:exit": exitScope,
    +        /**
    +         * 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();
    +        }
     
    -        // Main.
    -        FunctionExpression: enterScope,
    -        "FunctionExpression:exit": function(node) {
    -            var scopeInfo = exitScope();
    +        return {
     
    -            // Skip generators.
    -            if (node.generator) {
    -                return;
    -            }
    +            // Reset internal state.
    +            Program: function() {
    +                stack = [];
    +            },
     
    -            // Skip recursive functions.
    -            var nameVar = context.getDeclaredVariables(node)[0];
    -            if (isFunctionName(nameVar) && nameVar.references.length > 0) {
    -                return;
    -            }
    +            // If there are below, it cannot replace with arrow functions merely.
    +            ThisExpression: function() {
    +                var info = stack[stack.length - 1];
     
    -            // Skip if it's using arguments.
    -            var variable = getVariableOfArguments(context.getScope());
    -            if (variable && variable.references.length > 0) {
    -                return;
    -            }
    +                if (info) {
    +                    info.this = true;
    +                }
    +            },
    +
    +            Super: function() {
    +                var info = stack[stack.length - 1];
     
    -            // 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.");
    +                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 named function expressions
    +                if (allowNamedFunctions && node.id && node.id.name) {
    +                    return;
    +                }
    +
    +                // 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 &&
    +                    (!allowUnboundThis || !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 a866a6d20cc193..668453520fc29d 100644
    --- a/tools/eslint/lib/rules/prefer-const.js
    +++ b/tools/eslint/lib/rules/prefer-const.js
    @@ -1,224 +1,277 @@
     /**
    - * @fileoverview A rule to suggest using of const declaration for variables that are never modified after declared.
    + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
     
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var Map = require("es6-map");
    +
     //------------------------------------------------------------------------------
     // Helpers
     //------------------------------------------------------------------------------
     
    -var 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)/;
    +var PATTERN_TYPE = /^(?:.+?Pattern|RestElement|Property)$/;
    +var DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/;
    +var DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/;
    +
    +/**
    + * Adds multiple items to the tail of an array.
    + *
    + * @param {any[]} array - A destination to add.
    + * @param {any[]} values - Items to be added.
    + * @returns {void}
    + */
    +var pushAll = Function.apply.bind(Array.prototype.push);
    +
    +/**
    + * Checks whether a given node is located at `ForStatement.init` or not.
    + *
    + * @param {ASTNode} node - A node to check.
    + * @returns {boolean} `true` if the node is located at `ForStatement.init`.
    + */
    +function isInitOfForStatement(node) {
    +    return node.parent.type === "ForStatement" && node.parent.init === node;
    +}
    +
    +/**
    + * Checks whether a given Identifier node becomes a VariableDeclaration or not.
    + *
    + * @param {ASTNode} identifier - An Identifier node to check.
    + * @returns {boolean} `true` if the node can become a VariableDeclaration.
    + */
    +function canBecomeVariableDeclaration(identifier) {
    +    var node = identifier.parent;
    +
    +    while (PATTERN_TYPE.test(node.type)) {
    +        node = node.parent;
    +    }
    +
    +    return (
    +        node.type === "VariableDeclarator" ||
    +        (
    +            node.type === "AssignmentExpression" &&
    +            node.parent.type === "ExpressionStatement" &&
    +            DECLARATION_HOST_TYPE.test(node.parent.parent.type)
    +        )
    +    );
    +}
     
     /**
    - * Gets a write reference from a given variable if the variable is modified only
    - * once.
    + * Gets the WriteReference of a given variable if the variable should be
    + * declared as const.
      *
      * @param {escope.Variable} variable - A variable to get.
    - * @returns {escope.Reference|null} A write reference or null.
    + * @returns {escope.Reference|null} The singular WriteReference or null.
      */
    -function getWriteReferenceIfOnce(variable) {
    -    var retv = null;
    +function getWriteReferenceIfShouldBeConst(variable) {
    +    if (variable.eslintUsed) {
    +        return null;
    +    }
     
    +    // Finds the singular WriteReference.
    +    var retv = null;
         var references = variable.references;
    +
         for (var i = 0; i < references.length; ++i) {
             var reference = references[i];
     
             if (reference.isWrite()) {
    -            if (retv && !(retv.init && reference.init)) {
    -                // This variable is modified two or more times.
    +            var isReassigned = Boolean(
    +                retv && retv.identifier !== reference.identifier
    +            );
    +
    +            if (isReassigned) {
                     return null;
                 }
                 retv = reference;
             }
         }
     
    -    return retv;
    +    // Checks the writer is located in the same scope and can be modified to
    +    // const.
    +    var isSameScopeAndCanBecomeVariableDeclaration = Boolean(
    +        retv &&
    +        retv.from === variable.scope &&
    +        canBecomeVariableDeclaration(retv.identifier)
    +    );
    +
    +    return isSameScopeAndCanBecomeVariableDeclaration ? retv : null;
     }
     
     /**
    - * Checks whether or not a given reference is in a loop condition or a
    - * for-loop's updater.
    + * Gets the VariableDeclarator/AssignmentExpression node that a given reference
    + * belongs to.
    + * This is used to detect a mix of reassigned and never reassigned in a
    + * destructuring.
      *
    - * @param {escope.Reference} reference - A reference to check.
    - * @returns {boolean} `true` if the reference is in a loop condition or a
    - *      for-loop's updater.
    + * @param {escope.Reference} reference - A reference to get.
    + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
    + *      null.
      */
    -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;
    -        }
    +function getDestructuringHost(reference) {
    +    if (!reference.isWrite()) {
    +        return null;
    +    }
    +    var node = reference.identifier.parent;
     
    -        node = parent;
    -        parent = parent.parent;
    +    while (PATTERN_TYPE.test(node.type)) {
    +        node = node.parent;
         }
     
    -    return false;
    +    if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
    +        return null;
    +    }
    +    return node;
     }
     
     /**
    - * 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.
    + * Groups by the VariableDeclarator/AssignmentExpression node that each
    + * reference of given variables belongs to.
    + * This is used to detect a mix of reassigned and never reassigned in a
    + * destructuring.
      *
    - * @param {escope.Reference} writer - A reference to get.
    - * @returns {number} The end position of the reference.
    + * @param {escope.Variable[]} variables - Variables to group by destructuring.
    + * @returns {Map} Grouped references.
      */
    -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;
    -        }
    -    }
    +function groupByDestructuring(variables) {
    +    var writersMap = new Map();
     
    -    return end;
    -}
    +    for (var i = 0; i < variables.length; ++i) {
    +        var variable = variables[i];
    +        var references = variable.references;
    +        var writer = getWriteReferenceIfShouldBeConst(variable);
    +        var prevId = null;
     
    -/**
    - * 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];
    +        for (var j = 0; j < references.length; ++j) {
    +            var reference = references[j];
    +            var id = reference.identifier;
    +
    +            // Avoid counting a reference twice or more for default values of
    +            // destructuring.
    +            if (id === prevId) {
    +                continue;
    +            }
    +            prevId = id;
    +
    +            // Add the writer into the destructuring group.
    +            var group = getDestructuringHost(reference);
     
    -    return function(reference) {
    -        if (!reference.isRead()) {
    -            return true;
    +            if (group) {
    +                if (writersMap.has(group)) {
    +                    writersMap.get(group).push(writer);
    +                } else {
    +                    writersMap.set(group, [writer]);
    +                }
    +            }
             }
    +    }
     
    -        var range = reference.identifier.range;
    -        return start <= range[0] && range[1] <= end;
    -    };
    +    return writersMap;
     }
     
     //------------------------------------------------------------------------------
     // 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.
    -     * @returns {void}
    -     */
    -    function checkForVariables(scope) {
    -        // Skip the TDZ type.
    -        if (scope.type === "TDZ") {
    -            return;
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `const` declarations for variables that are never reassigned after declared",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -        var variables = scope.variables;
    -        for (var i = 0; i < variables.length; ++i) {
    -            var variable = variables[i];
    -            var def = variable.defs[0];
    -            var declaration = def && def.parent;
    -            var statement = declaration && declaration.parent;
    -            var references = variable.references;
    -            var identifier = variable.identifiers[0];
    -
    -            // 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;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    destructuring: {enum: ["any", "all"]}
    +                },
    +                additionalProperties: false
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = context.options[0] || {};
    +        var checkingMixedDestructuring = options.destructuring !== "all";
    +        var variables = null;
    +
    +        /**
    +         * Reports a given reference.
    +         *
    +         * @param {escope.Reference} reference - A reference to report.
    +         * @returns {void}
    +         */
    +        function report(reference) {
    +            var id = reference.identifier;
    +
    +            context.report({
    +                node: id,
    +                message: "'{{name}}' is never reassigned, use 'const' instead.",
    +                data: id
    +            });
    +        }
     
    -            // 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({
    -                    node: identifier,
    -                    message: "'{{name}}' is never modified, use 'const' instead.",
    -                    data: identifier
    -                });
    +        /**
    +         * Reports a given variable if the variable should be declared as const.
    +         *
    +         * @param {escope.Variable} variable - A variable to report.
    +         * @returns {void}
    +         */
    +        function checkVariable(variable) {
    +            var writer = getWriteReferenceIfShouldBeConst(variable);
    +
    +            if (writer) {
    +                report(writer);
                 }
             }
    -    }
     
    -    /**
    -     * Adds multiple items to the tail of an array.
    -     * @param {any[]} array - A destination to add.
    -     * @param {any[]} values - Items to be added.
    -     * @returns {void}
    -     */
    -    var pushAll = Function.apply.bind(Array.prototype.push);
    -
    -    return {
    -        "Program:exit": function() {
    -            var stack = [context.getScope()];
    -            while (stack.length) {
    -                var scope = stack.pop();
    -                pushAll(stack, scope.childScopes);
    -
    -                checkForVariables(scope);
    +        /**
    +         * Reports given references if all of the reference should be declared as
    +         * const.
    +         *
    +         * The argument 'writers' is an array of references.
    +         * This reference is the result of
    +         * 'getWriteReferenceIfShouldBeConst(variable)', so it's nullable.
    +         * In simple declaration or assignment cases, the length of the array is 1.
    +         * In destructuring cases, the length of the array can be 2 or more.
    +         *
    +         * @param {(escope.Reference|null)[]} writers - References which are grouped
    +         *      by destructuring to report.
    +         * @returns {void}
    +         */
    +        function checkGroup(writers) {
    +            if (writers.every(Boolean)) {
    +                writers.forEach(report);
                 }
             }
    -    };
     
    -};
    +        return {
    +            Program: function() {
    +                variables = [];
    +            },
    +
    +            "Program:exit": function() {
    +                if (checkingMixedDestructuring) {
    +                    variables.forEach(checkVariable);
    +                } else {
    +                    groupByDestructuring(variables).forEach(checkGroup);
    +                }
     
    -module.exports.schema = [];
    +                variables = null;
    +            },
    +
    +            VariableDeclaration: function(node) {
    +                if (node.kind === "let" && !isInitOfForStatement(node)) {
    +                    pushAll(variables, context.getDeclaredVariables(node));
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/prefer-reflect.js b/tools/eslint/lib/rules/prefer-reflect.js
    index 4d320614bb0d2d..38bb093ba6f509 100644
    --- a/tools/eslint/lib/rules/prefer-reflect.js
    +++ b/tools/eslint/lib/rules/prefer-reflect.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods
      * @author Keith Cirkel 
    - * @copyright 2015 Keith Cirkel. All rights reserved.
      */
     "use strict";
     
    @@ -9,92 +8,104 @@
     // 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"
    -    };
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `Reflect` methods where applicable",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    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"
    -    };
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "array",
    +                        items: {
    +                            enum: [
    +                                "apply",
    +                                "call",
    +                                "delete",
    +                                "defineProperty",
    +                                "getOwnPropertyDescriptor",
    +                                "getPrototypeOf",
    +                                "setPrototypeOf",
    +                                "isExtensible",
    +                                "getOwnPropertyNames",
    +                                "preventExtensions"
    +                            ]
    +                        },
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    var exceptions = (context.options[0] || {}).exceptions || [];
    +    create: 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"
    +        };
     
    -    /**
    -     * 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
    -        });
    -    }
    +        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"
    +        };
     
    -    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");
    -            }
    +        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;
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "array",
    -                "items": {
    -                    "enum": [
    -                        "apply",
    -                        "call",
    -                        "delete",
    -                        "defineProperty",
    -                        "getOwnPropertyDescriptor",
    -                        "getPrototypeOf",
    -                        "setPrototypeOf",
    -                        "isExtensible",
    -                        "getOwnPropertyNames",
    -                        "preventExtensions"
    -                    ]
    -                },
    -                "uniqueItems": true
    +                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");
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/prefer-rest-params.js b/tools/eslint/lib/rules/prefer-rest-params.js
    index 8f904d9b6fde9c..0ce1d8a1220b28 100644
    --- a/tools/eslint/lib/rules/prefer-rest-params.js
    +++ b/tools/eslint/lib/rules/prefer-rest-params.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
    - * See LICENSE file in root directory for full license.
      */
     
     "use strict";
    @@ -18,9 +16,12 @@
      */
     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;
    @@ -35,37 +36,48 @@ function getVariableOfArguments(scope) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require rest parameters instead of `arguments`",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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'."
    -        });
    -    }
    +        schema: []
    +    },
    +
    +    create: function(context) {
     
    -    /**
    -     * Reports references of the implicit `arguments` variable if exist.
    -     *
    -     * @returns {void}
    -     */
    -    function checkForArguments() {
    -        var argumentsVar = getVariableOfArguments(context.getScope());
    -        if (argumentsVar) {
    -            argumentsVar.references.forEach(report);
    +        /**
    +         * 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'."
    +            });
             }
    -    }
     
    -    return {
    -        FunctionDeclaration: checkForArguments,
    -        FunctionExpression: checkForArguments
    -    };
    -};
    +        /**
    +         * Reports references of the implicit `arguments` variable if exist.
    +         *
    +         * @returns {void}
    +         */
    +        function checkForArguments() {
    +            var argumentsVar = getVariableOfArguments(context.getScope());
    +
    +            if (argumentsVar) {
    +                argumentsVar.references.forEach(report);
    +            }
    +        }
     
    -module.exports.schema = [];
    +        return {
    +            FunctionDeclaration: checkForArguments,
    +            FunctionExpression: checkForArguments
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/prefer-spread.js b/tools/eslint/lib/rules/prefer-spread.js
    index de0cbbe5320498..79c7eb0243bd45 100644
    --- a/tools/eslint/lib/rules/prefer-spread.js
    +++ b/tools/eslint/lib/rules/prefer-spread.js
    @@ -1,7 +1,6 @@
     /**
      * @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";
    @@ -71,22 +70,32 @@ function isValidThisArg(expectedThis, thisArg, context) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    return {
    -        "CallExpression": function(node) {
    -            if (!isVariadicApplyCalling(node)) {
    -                return;
    -            }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require spread operators instead of `.apply()`",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: 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];
    +                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()'.");
    +                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
    index 7cb4e03e79c4d8..0165aaecd65d8c 100644
    --- a/tools/eslint/lib/rules/prefer-template.js
    +++ b/tools/eslint/lib/rules/prefer-template.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to suggest using template literals instead of string concatenation.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -44,6 +43,7 @@ function getTopConcatBinaryExpression(node) {
      */
     function hasNonStringLiteral(node) {
         if (isConcatenation(node)) {
    +
             // `left` is deeper than `right` normally.
             return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left);
         }
    @@ -54,43 +54,53 @@ function hasNonStringLiteral(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;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require template literals instead of string concatenation",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -        if (hasNonStringLiteral(topBinaryExpr)) {
    -            context.report(
    -                topBinaryExpr,
    -                "Unexpected string concatenation.");
    +        schema: []
    +    },
    +
    +    create: 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);
    -        },
    +        return {
    +            Program: function() {
    +                done = Object.create(null);
    +            },
     
    -        Literal: checkForStringConcat,
    -        TemplateLiteral: checkForStringConcat
    -    };
    +            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 7f3e293f69ab8c..1fd2e74a5a34c4 100644
    --- a/tools/eslint/lib/rules/quote-props.js
    +++ b/tools/eslint/lib/rules/quote-props.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -17,206 +15,217 @@ var espree = require("espree"),
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    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));
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require quotes around object literal property names",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Ensures that a property's key is quoted only when necessary
    -     * @param   {ASTNode} node Property AST node
    -     * @returns {void}
    -     */
    -    function checkUnnecessaryQuotes(node) {
    -        var key = node.key,
    -            isKeywordToken,
    -            tokens;
    -
    -        if (node.method || node.computed || node.shorthand) {
    -            return;
    +        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
    +                }
    +            ]
             }
    +    },
     
    -        if (key.type === "Literal" && typeof key.value === "string") {
    -            try {
    -                tokens = espree.tokenize(key.value);
    -            } catch (e) {
    -                return;
    -            }
    +    create: function(context) {
     
    -            if (tokens.length !== 1) {
    -                return;
    -            }
    +        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,
     
    -            isKeywordToken = isKeyword(tokens[0].value);
    +            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.";
     
    -            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});
    +        /**
    +         * 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;
             }
    -    }
     
    -    /**
    -     * Ensures that a property's key is quoted
    -     * @param   {ASTNode} node Property AST node
    -     * @returns {void}
    -     */
    -    function checkOmittedQuotes(node) {
    -        var key = node.key;
    -
    -        if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) {
    -            context.report(node, MESSAGE_UNQUOTED, {
    -                property: key.name || key.value
    -            });
    +        /**
    +         * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary)
    +         * @param   {string} rawKey The raw key value from the source
    +         * @param   {espreeTokens} tokens The espree-tokenized node key
    +         * @param   {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked
    +         * @returns {boolean} Whether or not a key has redundant quotes.
    +         * @private
    +         */
    +        function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) {
    +            return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length &&
    +                (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 ||
    +                (tokens[0].type === "Numeric" && !skipNumberLiterals && "" + +tokens[0].value === tokens[0].value));
             }
    -    }
     
    -    /**
    -     * Ensures that 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,
    +        /**
    +         * Ensures that a property's key is quoted only when necessary
    +         * @param   {ASTNode} node Property AST node
    +         * @returns {void}
    +         */
    +        function checkUnnecessaryQuotes(node) {
    +            var key = node.key,
    +                isKeywordToken,
                     tokens;
     
    -            if (!key || property.method || property.computed || property.shorthand) {
    +            if (node.method || node.computed || node.shorthand) {
                     return;
                 }
     
                 if (key.type === "Literal" && typeof key.value === "string") {
    +                try {
    +                    tokens = espree.tokenize(key.value);
    +                } catch (e) {
    +                    return;
    +                }
     
    -                quotes = true;
    +                if (tokens.length !== 1) {
    +                    return;
    +                }
     
    -                if (checkQuotesRedundancy) {
    -                    try {
    -                        tokens = espree.tokenize(key.value);
    -                    } catch (e) {
    -                        necessaryQuotes = true;
    -                        return;
    -                    }
    +                isKeywordToken = isKeyword(tokens[0].value);
     
    -                    necessaryQuotes = necessaryQuotes || !areQuotesRedundant(tokens) || KEYWORDS && isKeyword(tokens[0].value);
    +                if (isKeywordToken && KEYWORDS) {
    +                    return;
                     }
    -            } 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 (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) {
    +                    context.report(node, MESSAGE_UNNECESSARY, {property: key.value});
    +                }
    +            } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) {
    +                context.report(node, MESSAGE_RESERVED, {property: key.name});
    +            } else if (NUMBERS && key.type === "Literal" && typeof key.value === "number") {
    +                context.report(node, MESSAGE_NUMERIC, {property: key.value});
                 }
    -        });
    -
    -        if (checkQuotesRedundancy && quotes && !necessaryQuotes) {
    -            context.report(node, "Properties shouldn't be quoted as all quotes are redundant.");
             }
    -    }
     
    -    return {
    -        "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);
    +        /**
    +         * Ensures that a property's key is quoted
    +         * @param   {ASTNode} node Property AST node
    +         * @returns {void}
    +         */
    +        function checkOmittedQuotes(node) {
    +            var key = node.key;
    +
    +            if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) {
    +                context.report(node, MESSAGE_UNQUOTED, {
    +                    property: key.name || key.value
    +                });
                 }
             }
    -    };
    -
    -};
     
    -module.exports.schema = {
    -    "anyOf": [
    -        {
    -            "type": "array",
    -            "items": [
    -                {
    -                    "enum": ["always", "as-needed", "consistent", "consistent-as-needed"]
    +        /**
    +         * 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;
                     }
    -            ],
    -            "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"
    +
    +                if (key.type === "Literal" && typeof key.value === "string") {
    +
    +                    quotes = true;
    +
    +                    if (checkQuotesRedundancy) {
    +                        try {
    +                            tokens = espree.tokenize(key.value);
    +                        } catch (e) {
    +                            necessaryQuotes = true;
    +                            return;
                             }
    -                    },
    -                    "additionalProperties": false
    +
    +                        necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value);
    +                    }
    +                } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) {
    +                    necessaryQuotes = true;
    +                    context.report(node, "Properties should be quoted as '{{property}}' is a reserved word.", {property: key.name});
    +                } else {
    +                    lackOfQuotes = true;
    +                }
    +
    +                if (quotes && lackOfQuotes) {
    +                    context.report(node, "Inconsistently quoted property '{{key}}' found.", {
    +                        key: key.name || key.value
    +                    });
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 2
    +            });
    +
    +            if (checkQuotesRedundancy && quotes && !necessaryQuotes) {
    +                context.report(node, "Properties shouldn't be quoted as all quotes are redundant.");
    +            }
             }
    -    ]
    +
    +        return {
    +            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);
    +                }
    +            }
    +        };
    +
    +    }
     };
    diff --git a/tools/eslint/lib/rules/quotes.js b/tools/eslint/lib/rules/quotes.js
    index 10a349da797dfd..d4e9203811cf7f 100644
    --- a/tools/eslint/lib/rules/quotes.js
    +++ b/tools/eslint/lib/rules/quotes.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -18,22 +16,23 @@ var astUtils = require("../ast-utils");
     //------------------------------------------------------------------------------
     
     var QUOTE_SETTINGS = {
    -    "double": {
    +    double: {
             quote: "\"",
             alternateQuote: "'",
             description: "doublequote"
         },
    -    "single": {
    +    single: {
             quote: "'",
             alternateQuote: "\"",
             description: "singlequote"
         },
    -    "backtick": {
    +    backtick: {
             quote: "`",
             alternateQuote: "\"",
             description: "backtick"
         }
     };
    +
     /**
      * Switches quoting of javascript string between ' " and `
      * escaping and unescaping as necessary.
    @@ -48,6 +47,7 @@ QUOTE_SETTINGS.single.convert =
     QUOTE_SETTINGS.backtick.convert = function(str) {
         var newQuote = this.quote;
         var oldQuote = str[0];
    +
         if (newQuote === oldQuote) {
             return str;
         }
    @@ -72,152 +72,189 @@ var AVOID_ESCAPE = "avoid-escape",
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    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.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {boolean} True if the node is a JSX node, false if not.
    -     * @private
    -     */
    -    function isJSXElement(node) {
    -        return node.type.indexOf("JSX") === 0;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce the consistent use of either backticks, double, or single quotes",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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"
    -        );
    -    }
    +        fixable: "code",
     
    -    /**
    -     * 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;
    +        schema: [
    +            {
    +                enum: ["single", "double", "backtick"]
    +            },
    +            {
    +                anyOf: [
    +                    {
    +                        enum: ["avoid-escape"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            avoidEscape: {
    +                                type: "boolean"
    +                            },
    +                            allowTemplateLiterals: {
    +                                type: "boolean"
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var quoteOption = context.options[0],
    +            settings = QUOTE_SETTINGS[quoteOption || "double"],
    +            options = context.options[1],
    +            avoidEscape = options && options.avoidEscape === true,
    +            allowTemplateLiterals = options && options.allowTemplateLiterals === true,
    +            sourceCode = context.getSourceCode();
    +
    +        // deprecated
    +        if (options === AVOID_ESCAPE) {
    +            avoidEscape = true;
    +        }
    +
    +        /**
    +         * Determines if a given node is part of JSX syntax.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {boolean} True if the node is a JSX node, false if not.
    +         * @private
    +         */
    +        function isJSXElement(node) {
    +            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"
    +            );
             }
     
    -        // Check the node is at a prologue.
    -        for (var i = 0; i < block.body.length; ++i) {
    -            var statement = block.body[i];
    +        /**
    +         * 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 (statement === node.parent) {
    -                return true;
    +            if (block.type !== "Program" && (block.type !== "BlockStatement" || !FUNCTION_TYPE.test(block.parent.type))) {
    +                return false;
                 }
    -            if (!isDirective(statement)) {
    -                break;
    +
    +            // 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;
             }
     
    -        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;
     
    -    /**
    -     * 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;
    +            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 {
    +        return {
    +
    +            Literal: function(node) {
    +                var val = node.value,
    +                    rawVal = node.raw,
    +                    isValid;
     
    -        "Literal": function(node) {
    -            var val = node.value,
    -                rawVal = node.raw,
    -                isValid;
    +                if (settings && typeof val === "string") {
    +                    isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) ||
    +                        isJSXElement(node.parent) ||
    +                        astUtils.isSurroundedBy(rawVal, settings.quote);
     
    -            if (settings && typeof val === "string") {
    -                isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) ||
    -                    isJSXElement(node.parent) ||
    -                    astUtils.isSurroundedBy(rawVal, settings.quote);
    +                    if (!isValid && avoidEscape) {
    +                        isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0;
    +                    }
     
    -                if (!isValid && avoidEscape) {
    -                    isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0;
    +                    if (!isValid) {
    +                        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 (allowTemplateLiterals || quoteOption === "backtick" || node.parent.type === "TaggedTemplateExpression") {
    +                    return;
                     }
     
    -                if (!isValid) {
    +                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(node.raw));
    +                            return fixer.replaceText(node, settings.convert(sourceCode.getText(node)));
                             }
                         });
                     }
                 }
    -        },
    +        };
     
    -        "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)));
    -                    }
    -                });
    -            }
    -        }
    -    };
    -
    -};
    -
    -module.exports.schema = [
    -    {
    -        "enum": ["single", "double", "backtick"]
    -    },
    -    {
    -        "enum": ["avoid-escape"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/radix.js b/tools/eslint/lib/rules/radix.js
    index 9ec5231fddad1b..05a1c130a9f4df 100644
    --- a/tools/eslint/lib/rules/radix.js
    +++ b/tools/eslint/lib/rules/radix.js
    @@ -6,71 +6,166 @@
     "use strict";
     
     //------------------------------------------------------------------------------
    -// Rule Definition
    +// Requirements
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +var astUtils = require("../ast-utils");
     
    -    var MODE_ALWAYS = "always",
    -        MODE_AS_NEEDED = "as-needed";
    +//------------------------------------------------------------------------------
    +// Helpers
    +//------------------------------------------------------------------------------
     
    -    var mode = context.options[0] || MODE_ALWAYS;
    +var MODE_ALWAYS = "always",
    +    MODE_AS_NEEDED = "as-needed";
    +
    +/**
    + * Checks whether a given variable is shadowed or not.
    + *
    + * @param {escope.Variable} variable - A variable to check.
    + * @returns {boolean} `true` if the variable is shadowed.
    + */
    +function isShadowed(variable) {
    +    return variable.defs.length >= 1;
    +}
    +
    +/**
    + * Checks whether a given node is a MemberExpression of `parseInt` method or not.
    + *
    + * @param {ASTNode} node - A node to check.
    + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt`
    + *      method.
    + */
    +function isParseIntMethod(node) {
    +    return (
    +        node.type === "MemberExpression" &&
    +        !node.computed &&
    +        node.property.type === "Identifier" &&
    +        node.property.name === "parseInt"
    +    );
    +}
     
    -    return {
    -        "CallExpression": function(node) {
    +/**
    + * Checks whether a given node is a valid value of radix or not.
    + *
    + * The following values are invalid.
    + *
    + * - A literal except numbers.
    + * - undefined.
    + *
    + * @param {ASTNode} radix - A node of radix to check.
    + * @returns {boolean} `true` if the node is valid.
    + */
    +function isValidRadix(radix) {
    +    return !(
    +        (radix.type === "Literal" && typeof radix.value !== "number") ||
    +        (radix.type === "Identifier" && radix.name === "undefined")
    +    );
    +}
    +
    +/**
    + * Checks whether a given node is a default value of radix or not.
    + *
    + * @param {ASTNode} radix - A node of radix to check.
    + * @returns {boolean} `true` if the node is the literal node of `10`.
    + */
    +function isDefaultRadix(radix) {
    +    return radix.type === "Literal" && radix.value === 10;
    +}
    +
    +//------------------------------------------------------------------------------
    +// Rule Definition
    +//------------------------------------------------------------------------------
     
    -            var radix;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce the consistent use of the radix argument when using `parseInt()`",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -            if (!(node.callee.name === "parseInt" || (
    -                    node.callee.type === "MemberExpression" &&
    -                    node.callee.object.name === "Number" &&
    -                    node.callee.property.name === "parseInt"
    -                )
    -            )) {
    -                return;
    +        schema: [
    +            {
    +                enum: ["always", "as-needed"]
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var mode = context.options[0] || MODE_ALWAYS;
    +
    +        /**
    +         * Checks the arguments of a given CallExpression node and reports it if it
    +         * offends this rule.
    +         *
    +         * @param {ASTNode} node - A CallExpression node to check.
    +         * @returns {void}
    +         */
    +        function checkArguments(node) {
    +            var args = node.arguments;
     
    -            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];
    -
    -                // don't allow non-numeric literals or undefined
    -                if (radix &&
    -                    ((radix.type === "Literal" && typeof radix.value !== "number") ||
    -                    (radix.type === "Identifier" && radix.name === "undefined"))
    -                ) {
    +            switch (args.length) {
    +                case 0:
                         context.report({
                             node: node,
    -                        message: "Invalid radix parameter."
    +                        message: "Missing parameters."
                         });
    -                }
    -            }
    +                    break;
     
    +                case 1:
    +                    if (mode === MODE_ALWAYS) {
    +                        context.report({
    +                            node: node,
    +                            message: "Missing radix parameter."
    +                        });
    +                    }
    +                    break;
    +
    +                default:
    +                    if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) {
    +                        context.report({
    +                            node: node,
    +                            message: "Redundant radix parameter."
    +                        });
    +                    } else if (!isValidRadix(args[1])) {
    +                        context.report({
    +                            node: node,
    +                            message: "Invalid radix parameter."
    +                        });
    +                    }
    +                    break;
    +            }
             }
    -    };
     
    -};
    +        return {
    +            "Program:exit": function() {
    +                var scope = context.getScope();
    +                var variable;
    +
    +                // Check `parseInt()`
    +                variable = astUtils.getVariableByName(scope, "parseInt");
    +                if (!isShadowed(variable)) {
    +                    variable.references.forEach(function(reference) {
    +                        var node = reference.identifier;
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "as-needed"]
    +                        if (astUtils.isCallee(node)) {
    +                            checkArguments(node.parent);
    +                        }
    +                    });
    +                }
    +
    +                // Check `Number.parseInt()`
    +                variable = astUtils.getVariableByName(scope, "Number");
    +                if (!isShadowed(variable)) {
    +                    variable.references.forEach(function(reference) {
    +                        var node = reference.identifier.parent;
    +
    +                        if (isParseIntMethod(node) && astUtils.isCallee(node)) {
    +                            checkArguments(node.parent);
    +                        }
    +                    });
    +                }
    +            }
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/require-jsdoc.js b/tools/eslint/lib/rules/require-jsdoc.js
    index bac4475e9efa1b..083e79b1f55ccb 100644
    --- a/tools/eslint/lib/rules/require-jsdoc.js
    +++ b/tools/eslint/lib/rules/require-jsdoc.js
    @@ -1,97 +1,106 @@
     /**
      * @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 || {});
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require JSDoc comments",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * Report the error message
    -     * @param {ASTNode} node node to report
    -     * @returns {void}
    -     */
    -    function report(node) {
    -        context.report(node, "Missing JSDoc comment.");
    -    }
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    require: {
    +                        type: "object",
    +                        properties: {
    +                            ClassDeclaration: {
    +                                type: "boolean"
    +                            },
    +                            MethodDefinition: {
    +                                type: "boolean"
    +                            },
    +                            FunctionDeclaration: {
    +                                type: "boolean"
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -    /**
    -     * 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);
    +    create: 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 || {});
     
    -            if (!jsdocComment) {
    -                report(node);
    -            }
    +        /**
    +         * 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 or not.
    -     * @param {ASTNode} node node to examine
    -     * @returns {void}
    -     */
    -    function checkJsDoc(node) {
    -        var jsdocComment = source.getJSDocComment(node);
    +        /**
    +         * 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);
    +                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);
    +        /**
    +         * 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);
                 }
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "require": {
    -                "type": "object",
    -                "properties": {
    -                    "ClassDeclaration": {
    -                        "type": "boolean"
    -                    },
    -                    "MethodDefinition": {
    -                        "type": "boolean"
    -                    },
    -                    "FunctionDeclaration": {
    -                        "type": "boolean"
    -                    }
    -                },
    -                "additionalProperties": false
    +        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);
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/require-yield.js b/tools/eslint/lib/rules/require-yield.js
    index 56d301a4458631..441d354ed80f4e 100644
    --- a/tools/eslint/lib/rules/require-yield.js
    +++ b/tools/eslint/lib/rules/require-yield.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag the generator functions that does not have yield.
      * @author Toru Nagashima
    - * @copyright 2015 Toru Nagashima. All rights reserved.
      */
     
     "use strict";
    @@ -10,53 +9,65 @@
     // 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);
    -        }
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require generator functions to contain `yield`",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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;
    -        }
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var stack = [];
     
    -        var countYield = stack.pop();
    -        if (countYield === 0 && node.body.body.length > 0) {
    -            context.report(
    -                node,
    -                "This generator function does not have 'yield'.");
    +        /**
    +         * 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);
    +            }
             }
    -    }
     
    -    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;
    +        /**
    +         * 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'.");
                 }
             }
    -    };
    -};
     
    -module.exports.schema = [];
    +        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;
    +                }
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/semi-spacing.js b/tools/eslint/lib/rules/semi-spacing.js
    index 879e1848b7242f..ea43e9243dfb7a 100644
    --- a/tools/eslint/lib/rules/semi-spacing.js
    +++ b/tools/eslint/lib/rules/semi-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Validates spacing before and after semicolon
      * @author Mathias Schreck
    - * @copyright 2015 Mathias Schreck
      */
     
     "use strict";
    @@ -12,192 +11,212 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before and after semicolons",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    before: {
    +                        type: "boolean"
    +                    },
    +                    after: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
     
    -    var config = context.options[0],
    -        requireSpaceBefore = false,
    -        requireSpaceAfter = true,
    -        sourceCode = context.getSourceCode();
    +        var config = context.options[0],
    +            requireSpaceBefore = false,
    +            requireSpaceAfter = true,
    +            sourceCode = context.getSourceCode();
     
    -    if (typeof config === "object") {
    -        if (config.hasOwnProperty("before")) {
    -            requireSpaceBefore = config.before;
    +        if (typeof config === "object") {
    +            if (config.hasOwnProperty("before")) {
    +                requireSpaceBefore = config.before;
    +            }
    +            if (config.hasOwnProperty("after")) {
    +                requireSpaceAfter = config.after;
    +            }
             }
    -        if (config.hasOwnProperty("after")) {
    -            requireSpaceAfter = config.after;
    +
    +        /**
    +         * 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 tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token);
             }
    -    }
     
    -    /**
    -     * 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 tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token);
    -    }
    +        /**
    +         * Checks if a given token has trailing whitespace.
    +         * @param {Object} token The token to check.
    +         * @returns {boolean} True if the given token has trailing space, false if not.
    +         */
    +        function hasTrailingSpace(token) {
    +            var tokenAfter = context.getTokenAfter(token);
     
    -    /**
    -     * Checks if a given token has trailing whitespace.
    -     * @param {Object} token The token to check.
    -     * @returns {boolean} True if the given token has trailing space, false if not.
    -     */
    -    function hasTrailingSpace(token) {
    -        var tokenAfter = context.getTokenAfter(token);
    -        return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter);
    -    }
    +            return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter);
    +        }
     
    -    /**
    -     * Checks if the given token is the last token in its line.
    -     * @param {Token} token The token to check.
    -     * @returns {boolean} Whether or not the token is the last in its line.
    -     */
    -    function isLastTokenInCurrentLine(token) {
    -        var tokenAfter = context.getTokenAfter(token);
    -        return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter));
    -    }
    +        /**
    +         * Checks if the given token is the last token in its line.
    +         * @param {Token} token The token to check.
    +         * @returns {boolean} Whether or not the token is the last in its line.
    +         */
    +        function isLastTokenInCurrentLine(token) {
    +            var tokenAfter = context.getTokenAfter(token);
     
    -    /**
    -     * 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));
    -    }
    +            return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter));
    +        }
     
    -    /**
    -     * 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 === ")")
    -        );
    -    }
    +        /**
    +         * 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);
     
    -    /**
    -     * 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 === ";";
    -    }
    +            return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore));
    +        }
     
    -    /**
    -     * Reports if the given token has invalid spacing.
    -     * @param {Token} token The semicolon token to check.
    -     * @param {ASTNode} node The corresponding node of the token.
    -     * @returns {void}
    -     */
    -    function checkSemicolonSpacing(token, node) {
    -        var location;
    -
    -        if (isSemicolon(token)) {
    -            location = token.loc.start;
    -
    -            if (hasLeadingSpace(token)) {
    -                if (!requireSpaceBefore) {
    -                    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: node,
    -                        loc: location,
    -                        message: "Missing whitespace before semicolon.",
    -                        fix: function(fixer) {
    -                            return fixer.insertTextBefore(token, " ");
    -                        }
    -                    });
    -                }
    -            }
    +        /**
    +         * 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 === ")")
    +            );
    +        }
    +
    +        /**
    +         * 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 invalid spacing.
    +         * @param {Token} token The semicolon token to check.
    +         * @param {ASTNode} node The corresponding node of the token.
    +         * @returns {void}
    +         */
    +        function checkSemicolonSpacing(token, node) {
    +            var location;
    +
    +            if (isSemicolon(token)) {
    +                location = token.loc.start;
     
    -            if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) {
    -                if (hasTrailingSpace(token)) {
    -                    if (!requireSpaceAfter) {
    +                if (hasLeadingSpace(token)) {
    +                    if (!requireSpaceBefore) {
                             context.report({
                                 node: node,
                                 loc: location,
    -                            message: "Unexpected whitespace after semicolon.",
    +                            message: "Unexpected whitespace before semicolon.",
                                 fix: function(fixer) {
    -                                var tokenAfter = context.getTokenAfter(token);
    -                                return fixer.removeRange([token.range[1], tokenAfter.range[0]]);
    +                                var tokenBefore = context.getTokenBefore(token);
    +
    +                                return fixer.removeRange([tokenBefore.range[1], token.range[0]]);
                                 }
                             });
                         }
                     } else {
    -                    if (requireSpaceAfter) {
    +                    if (requireSpaceBefore) {
                             context.report({
                                 node: node,
                                 loc: location,
    -                            message: "Missing whitespace after semicolon.",
    +                            message: "Missing whitespace before semicolon.",
                                 fix: function(fixer) {
    -                                return fixer.insertTextAfter(token, " ");
    +                                return fixer.insertTextBefore(token, " ");
                                 }
                             });
                         }
                     }
    +
    +                if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) {
    +                    if (hasTrailingSpace(token)) {
    +                        if (!requireSpaceAfter) {
    +                            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: node,
    +                                loc: location,
    +                                message: "Missing whitespace after semicolon.",
    +                                fix: function(fixer) {
    +                                    return fixer.insertTextAfter(token, " ");
    +                                }
    +                            });
    +                        }
    +                    }
    +                }
                 }
             }
    -    }
    -
    -    /**
    -     * Checks the spacing of 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);
    -        checkSemicolonSpacing(token, node);
    -    }
     
    -    return {
    -        "VariableDeclaration": checkNode,
    -        "ExpressionStatement": checkNode,
    -        "BreakStatement": checkNode,
    -        "ContinueStatement": checkNode,
    -        "DebuggerStatement": checkNode,
    -        "ReturnStatement": checkNode,
    -        "ThrowStatement": checkNode,
    -        "ForStatement": function(node) {
    -            if (node.init) {
    -                checkSemicolonSpacing(context.getTokenAfter(node.init), node);
    -            }
    +        /**
    +         * Checks the spacing of 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);
     
    -            if (node.test) {
    -                checkSemicolonSpacing(context.getTokenAfter(node.test), node);
    -            }
    +            checkSemicolonSpacing(token, node);
             }
    -    };
    -};
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "before": {
    -                "type": "boolean"
    -            },
    -            "after": {
    -                "type": "boolean"
    +        return {
    +            VariableDeclaration: checkNode,
    +            ExpressionStatement: checkNode,
    +            BreakStatement: checkNode,
    +            ContinueStatement: checkNode,
    +            DebuggerStatement: checkNode,
    +            ReturnStatement: checkNode,
    +            ThrowStatement: checkNode,
    +            ForStatement: function(node) {
    +                if (node.init) {
    +                    checkSemicolonSpacing(context.getTokenAfter(node.init), node);
    +                }
    +
    +                if (node.test) {
    +                    checkSemicolonSpacing(context.getTokenAfter(node.test), node);
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/semi.js b/tools/eslint/lib/rules/semi.js
    index c7a7fe3ec377c7..e386084faf2317 100644
    --- a/tools/eslint/lib/rules/semi.js
    +++ b/tools/eslint/lib/rules/semi.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,205 +8,219 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+-
    -    var options = context.options[1];
    -    var never = context.options[0] === "never",
    -        exceptOneLine = options && options.omitLastInOneLineBlock === true,
    -        sourceCode = context.getSourceCode();
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * 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, 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);
    -            };
    -        }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow semicolons instead of ASI",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -        context.report({
    -            node: node,
    -            loc: loc,
    -            message: message,
    -            fix: fix
    -        });
    +        fixable: "code",
     
    -    }
    +        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
    +                }
    +            ]
    +        }
    +    },
    +
    +    create: function(context) {
    +
    +        var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+-
    +        var options = context.options[1];
    +        var never = context.options[0] === "never",
    +            exceptOneLine = options && options.omitLastInOneLineBlock === true,
    +            sourceCode = context.getSourceCode();
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * 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, 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);
    +                };
    +            }
     
    -    /**
    -     * Checks whether a token is a semicolon punctuator.
    -     * @param {Token} token The token.
    -     * @returns {boolean} True if token is a semicolon punctuator.
    -     */
    -    function isSemicolon(token) {
    -        return (token.type === "Punctuator" && token.value === ";");
    -    }
    +            context.report({
    +                node: node,
    +                loc: loc,
    +                message: message,
    +                fix: fix
    +            });
     
    -    /**
    -     * Check if a semicolon is unnecessary, only true if:
    -     *   - next token is on a new line and is not one of the opt-out tokens
    -     *   - next token is a valid statement divider
    -     * @param {Token} lastToken last token of current node.
    -     * @returns {boolean} whether the semicolon is unnecessary.
    -     */
    -    function isUnnecessarySemicolon(lastToken) {
    -        var isDivider, isOptOutToken, lastTokenLine, nextToken, nextTokenLine;
    -
    -        if (!isSemicolon(lastToken)) {
    -            return false;
             }
     
    -        nextToken = context.getTokenAfter(lastToken);
    -
    -        if (!nextToken) {
    -            return true;
    +        /**
    +         * Checks whether a token is a semicolon punctuator.
    +         * @param {Token} token The token.
    +         * @returns {boolean} True if token is a semicolon punctuator.
    +         */
    +        function isSemicolon(token) {
    +            return (token.type === "Punctuator" && token.value === ";");
             }
     
    -        lastTokenLine = lastToken.loc.end.line;
    -        nextTokenLine = nextToken.loc.start.line;
    -        isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value);
    -        isDivider = (nextToken.value === "}" || nextToken.value === ";");
    +        /**
    +         * Check if a semicolon is unnecessary, only true if:
    +         *   - next token is on a new line and is not one of the opt-out tokens
    +         *   - next token is a valid statement divider
    +         * @param {Token} lastToken last token of current node.
    +         * @returns {boolean} whether the semicolon is unnecessary.
    +         */
    +        function isUnnecessarySemicolon(lastToken) {
    +            var isDivider, isOptOutToken, lastTokenLine, nextToken, nextTokenLine;
     
    -        return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider;
    -    }
    +            if (!isSemicolon(lastToken)) {
    +                return false;
    +            }
    +
    +            nextToken = context.getTokenAfter(lastToken);
    +
    +            if (!nextToken) {
    +                return true;
    +            }
     
    -    /**
    -     * 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;
    +            lastTokenLine = lastToken.loc.end.line;
    +            nextTokenLine = nextToken.loc.start.line;
    +            isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value);
    +            isDivider = (nextToken.value === "}" || nextToken.value === ";");
    +
    +            return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider;
             }
     
    -        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 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);
     
    -    /**
    -     * Checks a node to see if it's followed by a semicolon.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     */
    -    function checkForSemicolon(node) {
    -        var lastToken = context.getLastToken(node);
    -
    -        if (never) {
    -            if (isUnnecessarySemicolon(lastToken)) {
    -                report(node, true);
    +            if (!nextToken || nextToken.value !== "}") {
    +                return false;
                 }
    -        } else {
    -            if (!isSemicolon(lastToken)) {
    -                if (!exceptOneLine || !isOneLinerBlock(node)) {
    -                    report(node);
    +
    +            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.
    +         * @returns {void}
    +         */
    +        function checkForSemicolon(node) {
    +            var lastToken = context.getLastToken(node);
    +
    +            if (never) {
    +                if (isUnnecessarySemicolon(lastToken)) {
    +                    report(node, true);
                     }
                 } else {
    -                if (exceptOneLine && isOneLinerBlock(node)) {
    -                    report(node, true);
    +                if (!isSemicolon(lastToken)) {
    +                    if (!exceptOneLine || !isOneLinerBlock(node)) {
    +                        report(node);
    +                    }
    +                } else {
    +                    if (exceptOneLine && isOneLinerBlock(node)) {
    +                        report(node, true);
    +                    }
                     }
                 }
             }
    -    }
    -
    -    /**
    -     * Checks to see if there's a semicolon after a variable declaration.
    -     * @param {ASTNode} node The node to check.
    -     * @returns {void}
    -     */
    -    function checkForSemicolonForVariableDeclaration(node) {
    -        var ancestors = context.getAncestors(),
    -            parentIndex = ancestors.length - 1,
    -            parent = ancestors[parentIndex];
    -
    -        if ((parent.type !== "ForStatement" || parent.init !== node) &&
    -            (!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node)
    -        ) {
    -            checkForSemicolon(node);
    -        }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "VariableDeclaration": checkForSemicolonForVariableDeclaration,
    -        "ExpressionStatement": checkForSemicolon,
    -        "ReturnStatement": checkForSemicolon,
    -        "ThrowStatement": checkForSemicolon,
    -        "DoWhileStatement": checkForSemicolon,
    -        "DebuggerStatement": checkForSemicolon,
    -        "BreakStatement": checkForSemicolon,
    -        "ContinueStatement": checkForSemicolon,
    -        "ImportDeclaration": checkForSemicolon,
    -        "ExportAllDeclaration": checkForSemicolon,
    -        "ExportNamedDeclaration": function(node) {
    -            if (!node.declaration) {
    -                checkForSemicolon(node);
    -            }
    -        },
    -        "ExportDefaultDeclaration": function(node) {
    -            if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) {
    +        /**
    +         * Checks to see if there's a semicolon after a variable declaration.
    +         * @param {ASTNode} node The node to check.
    +         * @returns {void}
    +         */
    +        function checkForSemicolonForVariableDeclaration(node) {
    +            var ancestors = context.getAncestors(),
    +                parentIndex = ancestors.length - 1,
    +                parent = ancestors[parentIndex];
    +
    +            if ((parent.type !== "ForStatement" || parent.init !== node) &&
    +                (!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node)
    +            ) {
                     checkForSemicolon(node);
                 }
             }
    -    };
     
    -};
    -
    -module.exports.schema = {
    -    "anyOf": [
    -        {
    -            "type": "array",
    -            "items": [
    -                {
    -                    "enum": ["never"]
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            VariableDeclaration: checkForSemicolonForVariableDeclaration,
    +            ExpressionStatement: checkForSemicolon,
    +            ReturnStatement: checkForSemicolon,
    +            ThrowStatement: checkForSemicolon,
    +            DoWhileStatement: checkForSemicolon,
    +            DebuggerStatement: checkForSemicolon,
    +            BreakStatement: checkForSemicolon,
    +            ContinueStatement: checkForSemicolon,
    +            ImportDeclaration: checkForSemicolon,
    +            ExportAllDeclaration: checkForSemicolon,
    +            ExportNamedDeclaration: function(node) {
    +                if (!node.declaration) {
    +                    checkForSemicolon(node);
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 1
    -        },
    -        {
    -            "type": "array",
    -            "items": [
    -                {
    -                    "enum": ["always"]
    -                },
    -                {
    -                    "type": "object",
    -                    "properties": {
    -                        "omitLastInOneLineBlock": {"type": "boolean"}
    -                    },
    -                    "additionalProperties": false
    +            },
    +            ExportDefaultDeclaration: function(node) {
    +                if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) {
    +                    checkForSemicolon(node);
                     }
    -            ],
    -            "minItems": 0,
    -            "maxItems": 2
    -        }
    -    ]
    +            }
    +        };
    +
    +    }
     };
    diff --git a/tools/eslint/lib/rules/sort-imports.js b/tools/eslint/lib/rules/sort-imports.js
    index d74648ddb4a476..18b34f86a09659 100644
    --- a/tools/eslint/lib/rules/sort-imports.js
    +++ b/tools/eslint/lib/rules/sort-imports.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -11,149 +9,167 @@
     // 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";
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce sorted import declarations within modules",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        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
    +            }
    +        ]
    +    },
    +
    +    create: 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 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;
    +        /**
    +         * 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();
    -                }
    +        return {
    +            ImportDeclaration: function(node) {
    +                if (previousDeclaration) {
    +                    var currentLocalMemberName = getFirstLocalMemberName(node),
    +                        currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node),
    +                        previousLocalMemberName = getFirstLocalMemberName(previousDeclaration),
    +                        previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration);
     
    -                // 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]
    -                            }
    -                        });
    +                    if (ignoreCase) {
    +                        previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase();
    +                        currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase();
                         }
    -                } else {
    -                    if (previousLocalMemberName &&
    -                        currentLocalMemberName &&
    -                        currentLocalMemberName < previousLocalMemberName
    -                    ) {
    -                        context.report({
    -                            node: node,
    -                            message: "Imports should be sorted alphabetically."
    -                        });
    +
    +                    // 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;
    +                // Multiple members of an import declaration should also be sorted alphabetically.
    +                if (!ignoreMemberSort && node.specifiers.length > 1) {
    +                    var previousSpecifier = null;
    +                    var previousSpecifierName = null;
     
    -                    if (ignoreCase) {
    -                        currentSpecifierName = currentSpecifierName.toLowerCase();
    -                        previousSpecifierName = previousSpecifierName.toLowerCase();
    -                    }
    +                    for (var i = 0; i < node.specifiers.length; ++i) {
    +                        var currentSpecifier = node.specifiers[i];
     
    -                    if (currentSpecifierName < previousSpecifierName) {
    -                        context.report({
    -                            node: currentSpecifier,
    -                            message: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.",
    -                            data: {
    -                                memberName: currentSpecifier.local.name
    -                            }
    -                        });
    -                    }
    +                        if (currentSpecifier.type !== "ImportSpecifier") {
    +                            continue;
    +                        }
     
    -                    return currentSpecifier;
    -                }, node.specifiers[0]);
    -            }
    +                        var currentSpecifierName = currentSpecifier.local.name;
     
    -            previousDeclaration = node;
    -        }
    -    };
    -};
    +                        if (ignoreCase) {
    +                            currentSpecifierName = currentSpecifierName.toLowerCase();
    +                        }
     
    -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"
    +                        if (previousSpecifier && currentSpecifierName < previousSpecifierName) {
    +                            context.report({
    +                                node: currentSpecifier,
    +                                message: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.",
    +                                data: {
    +                                    memberName: currentSpecifier.local.name
    +                                }
    +                            });
    +                        }
    +
    +                        previousSpecifier = currentSpecifier;
    +                        previousSpecifierName = currentSpecifierName;
    +                    }
    +                }
    +
    +                previousDeclaration = node;
                 }
    -        },
    -        "additionalProperties": false
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/sort-vars.js b/tools/eslint/lib/rules/sort-vars.js
    index 9aa85c8cbd09e2..8a7b0e710a7524 100644
    --- a/tools/eslint/lib/rules/sort-vars.js
    +++ b/tools/eslint/lib/rules/sort-vars.js
    @@ -9,45 +9,55 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var configuration = context.options[0] || {},
    -        ignoreCase = configuration.ignoreCase || false;
    -
    -    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;
    -
    -                if (ignoreCase) {
    -                    lastVariableName = lastVariableName.toLowerCase();
    -                    currenVariableName = currenVariableName.toLowerCase();
    -                }
    -
    -                if (currenVariableName < lastVariableName) {
    -                    context.report(decl, "Variables within the same declaration block should be sorted alphabetically");
    -                    return memo;
    -                } else {
    -                    return decl;
    -                }
    -            }, node.declarations[0]);
    -        }
    -    };
    -};
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require variables within the same declaration block to be sorted",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "ignoreCase": {
    -                "type": "boolean"
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    ignoreCase: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
                 }
    -        },
    -        "additionalProperties": false
    +        ]
    +    },
    +
    +    create: function(context) {
    +
    +        var configuration = context.options[0] || {},
    +            ignoreCase = configuration.ignoreCase || false;
    +
    +        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;
    +
    +                    if (ignoreCase) {
    +                        lastVariableName = lastVariableName.toLowerCase();
    +                        currenVariableName = currenVariableName.toLowerCase();
    +                    }
    +
    +                    if (currenVariableName < lastVariableName) {
    +                        context.report(decl, "Variables within the same declaration block should be sorted alphabetically");
    +                        return memo;
    +                    } else {
    +                        return decl;
    +                    }
    +                }, node.declarations[0]);
    +            }
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/space-before-blocks.js b/tools/eslint/lib/rules/space-before-blocks.js
    index c7fbec83316172..7fb9d5cddcc9c5 100644
    --- a/tools/eslint/lib/rules/space-before-blocks.js
    +++ b/tools/eslint/lib/rules/space-before-blocks.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A rule to ensure whitespace before blocks.
      * @author Mathias Schreck 
    - * @copyright 2014 Mathias Schreck. All rights reserved.
      */
     
     "use strict";
    @@ -12,129 +11,141 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var config = context.options[0],
    -        sourceCode = context.getSourceCode(),
    -        checkFunctions = true,
    -        checkKeywords = true,
    -        checkClasses = true;
    -
    -    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;
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before blocks",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -     * 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 isConflicted(token) {
    -        return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword";
    -    }
    +        fixable: "whitespace",
     
    -    /**
    -     * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line.
    -     * @param {ASTNode|Token} node The AST node of a BlockStatement.
    -     * @returns {void} undefined.
    -     */
    -    function checkPrecedingSpace(node) {
    -        var precedingToken = context.getTokenBefore(node),
    -            hasSpace,
    -            parent,
    -            requireSpace;
    -
    -        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;
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["always", "never"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            keywords: {
    +                                enum: ["always", "never"]
    +                            },
    +                            functions: {
    +                                enum: ["always", "never"]
    +                            },
    +                            classes: {
    +                                enum: ["always", "never"]
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
                 }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var config = context.options[0],
    +            sourceCode = context.getSourceCode(),
    +            checkFunctions = true,
    +            checkKeywords = true,
    +            checkClasses = true;
     
    -            if (requireSpace) {
    -                if (!hasSpace) {
    -                    context.report({
    -                        node: node,
    -                        message: "Missing space before opening brace.",
    -                        fix: function(fixer) {
    -                            return fixer.insertTextBefore(node, " ");
    -                        }
    -                    });
    +        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;
    +        }
    +
    +        /**
    +         * 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 isConflicted(token) {
    +            return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword";
    +        }
    +
    +        /**
    +         * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line.
    +         * @param {ASTNode|Token} node The AST node of a BlockStatement.
    +         * @returns {void} undefined.
    +         */
    +        function checkPrecedingSpace(node) {
    +            var precedingToken = context.getTokenBefore(node),
    +                hasSpace,
    +                parent,
    +                requireSpace;
    +
    +            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;
                     }
    -            } else {
    -                if (hasSpace) {
    -                    context.report({
    -                        node: node,
    -                        message: "Unexpected space before opening brace.",
    -                        fix: function(fixer) {
    -                            return fixer.removeRange([precedingToken.range[1], node.range[0]]);
    -                        }
    -                    });
    +
    +                if (requireSpace) {
    +                    if (!hasSpace) {
    +                        context.report({
    +                            node: node,
    +                            message: "Missing space before opening brace.",
    +                            fix: function(fixer) {
    +                                return fixer.insertTextBefore(node, " ");
    +                            }
    +                        });
    +                    }
    +                } else {
    +                    if (hasSpace) {
    +                        context.report({
    +                            node: node,
    +                            message: "Unexpected space before opening brace.",
    +                            fix: function(fixer) {
    +                                return fixer.removeRange([precedingToken.range[1], node.range[0]]);
    +                            }
    +                        });
    +                    }
                     }
                 }
             }
    -    }
     
    -    /**
    -     * Checks if the CaseBlock of an given SwitchStatement node has a preceding space.
    -     * @param {ASTNode} node The node of a SwitchStatement.
    -     * @returns {void} undefined.
    -     */
    -    function checkSpaceBeforeCaseBlock(node) {
    -        var cases = node.cases,
    -            firstCase,
    -            openingBrace;
    -
    -        if (cases.length > 0) {
    -            firstCase = cases[0];
    -            openingBrace = context.getTokenBefore(firstCase);
    -        } else {
    -            openingBrace = context.getLastToken(node, 1);
    -        }
    +        /**
    +         * Checks if the CaseBlock of an given SwitchStatement node has a preceding space.
    +         * @param {ASTNode} node The node of a SwitchStatement.
    +         * @returns {void} undefined.
    +         */
    +        function checkSpaceBeforeCaseBlock(node) {
    +            var cases = node.cases,
    +                firstCase,
    +                openingBrace;
     
    -        checkPrecedingSpace(openingBrace);
    -    }
    +            if (cases.length > 0) {
    +                firstCase = cases[0];
    +                openingBrace = context.getTokenBefore(firstCase);
    +            } else {
    +                openingBrace = context.getLastToken(node, 1);
    +            }
     
    -    return {
    -        "BlockStatement": checkPrecedingSpace,
    -        "ClassBody": checkPrecedingSpace,
    -        "SwitchStatement": checkSpaceBeforeCaseBlock
    -    };
    +            checkPrecedingSpace(openingBrace);
    +        }
     
    -};
    +        return {
    +            BlockStatement: checkPrecedingSpace,
    +            ClassBody: checkPrecedingSpace,
    +            SwitchStatement: checkSpaceBeforeCaseBlock
    +        };
     
    -module.exports.schema = [
    -    {
    -        "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 b96acb6678c42e..d96cb4a6085021 100644
    --- a/tools/eslint/lib/rules/space-before-function-paren.js
    +++ b/tools/eslint/lib/rules/space-before-function-paren.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -10,115 +8,135 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before `function` definition opening parenthesis",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var configuration = context.options[0],
    -        sourceCode = context.getSourceCode(),
    -        requireAnonymousFunctionSpacing = true,
    -        requireNamedFunctionSpacing = true;
    +        fixable: "whitespace",
     
    -    if (typeof configuration === "object") {
    -        requireAnonymousFunctionSpacing = configuration.anonymous !== "never";
    -        requireNamedFunctionSpacing = configuration.named !== "never";
    -    } else if (configuration === "never") {
    -        requireAnonymousFunctionSpacing = false;
    -        requireNamedFunctionSpacing = false;
    -    }
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["always", "never"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            anonymous: {
    +                                enum: ["always", "never", "ignore"]
    +                            },
    +                            named: {
    +                                enum: ["always", "never", "ignore"]
    +                            }
    +                        },
    +                        additionalProperties: false
    +                    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
     
    -    /**
    -     * 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;
    +        var configuration = context.options[0],
    +            sourceCode = context.getSourceCode(),
    +            requireAnonymousFunctionSpacing = true,
    +            forbidAnonymousFunctionSpacing = false,
    +            requireNamedFunctionSpacing = true,
    +            forbidNamedFunctionSpacing = false;
     
    -        if (node.id) {
    -            return true;
    +        if (typeof configuration === "object") {
    +            requireAnonymousFunctionSpacing = (
    +                !configuration.anonymous || configuration.anonymous === "always");
    +            forbidAnonymousFunctionSpacing = configuration.anonymous === "never";
    +            requireNamedFunctionSpacing = (
    +                !configuration.named || configuration.named === "always");
    +            forbidNamedFunctionSpacing = configuration.named === "never";
    +        } else if (configuration === "never") {
    +            requireAnonymousFunctionSpacing = false;
    +            forbidAnonymousFunctionSpacing = true;
    +            requireNamedFunctionSpacing = false;
    +            forbidNamedFunctionSpacing = true;
             }
     
    -        parent = node.parent;
    -        return parent.type === "MethodDefinition" ||
    -            (parent.type === "Property" &&
    -                (
    -                    parent.kind === "get" ||
    -                    parent.kind === "set" ||
    -                    parent.method
    -                )
    -            );
    -    }
    +        /**
    +         * 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;
     
    -    /**
    -     * Validates the spacing before function parentheses.
    -     * @param {ASTNode} node The node to be validated.
    -     * @returns {void}
    -     */
    -    function validateSpacingBeforeParentheses(node) {
    -        var isNamed = isNamedFunction(node),
    -            leftToken,
    -            rightToken,
    -            location;
    +            if (node.id) {
    +                return true;
    +            }
     
    -        if (node.generator && !isNamed) {
    -            return;
    +            parent = node.parent;
    +            return parent.type === "MethodDefinition" ||
    +                (parent.type === "Property" &&
    +                    (
    +                        parent.kind === "get" ||
    +                        parent.kind === "set" ||
    +                        parent.method
    +                    )
    +                );
             }
     
    -        rightToken = sourceCode.getFirstToken(node);
    -        while (rightToken.value !== "(") {
    -            rightToken = sourceCode.getTokenAfter(rightToken);
    -        }
    -        leftToken = context.getTokenBefore(rightToken);
    -        location = leftToken.loc.end;
    +        /**
    +         * Validates the spacing before function parentheses.
    +         * @param {ASTNode} node The node to be validated.
    +         * @returns {void}
    +         */
    +        function validateSpacingBeforeParentheses(node) {
    +            var isNamed = isNamedFunction(node),
    +                leftToken,
    +                rightToken,
    +                location;
     
    -        if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
    -            if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) {
    -                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: node,
    -                    loc: location,
    -                    message: "Missing space before function parentheses.",
    -                    fix: function(fixer) {
    -                        return fixer.insertTextAfter(leftToken, " ");
    -                    }
    -                });
    +            if (node.generator && !isNamed) {
    +                return;
                 }
    -        }
    -    }
     
    -    return {
    -        "FunctionDeclaration": validateSpacingBeforeParentheses,
    -        "FunctionExpression": validateSpacingBeforeParentheses
    -    };
    -};
    +            rightToken = sourceCode.getFirstToken(node);
    +            while (rightToken.value !== "(") {
    +                rightToken = sourceCode.getTokenAfter(rightToken);
    +            }
    +            leftToken = context.getTokenBefore(rightToken);
    +            location = leftToken.loc.end;
     
    -module.exports.schema = [
    -    {
    -        "oneOf": [
    -            {
    -                "enum": ["always", "never"]
    -            },
    -            {
    -                "type": "object",
    -                "properties": {
    -                    "anonymous": {
    -                        "enum": ["always", "never"]
    -                    },
    -                    "named": {
    -                        "enum": ["always", "never"]
    -                    }
    -                },
    -                "additionalProperties": false
    +            if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
    +                if ((isNamed && forbidNamedFunctionSpacing) || (!isNamed && forbidAnonymousFunctionSpacing)) {
    +                    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: node,
    +                        loc: location,
    +                        message: "Missing space before function parentheses.",
    +                        fix: function(fixer) {
    +                            return fixer.insertTextAfter(leftToken, " ");
    +                        }
    +                    });
    +                }
                 }
    -        ]
    +        }
    +
    +        return {
    +            FunctionDeclaration: validateSpacingBeforeParentheses,
    +            FunctionExpression: validateSpacingBeforeParentheses
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/space-in-parens.js b/tools/eslint/lib/rules/space-in-parens.js
    index 68e03a1077aa79..11361aec1202f3 100644
    --- a/tools/eslint/lib/rules/space-in-parens.js
    +++ b/tools/eslint/lib/rules/space-in-parens.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Disallows or enforces spaces inside of parentheses.
      * @author Jonathan Rajavuori
    - * @copyright 2014 David Clark. All rights reserved.
    - * @copyright 2014 Jonathan Rajavuori. All rights reserved.
      */
     "use strict";
     
    @@ -12,257 +10,272 @@ var astUtils = require("../ast-utils");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing inside parentheses",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    var MISSING_SPACE_MESSAGE = "There must be a space inside this paren.",
    -        REJECTED_SPACE_MESSAGE = "There should be no spaces inside this paren.",
    -        ALWAYS = context.options[0] === "always",
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                enum: ["always", "never"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "array",
    +                        items: {
    +                            enum: ["{}", "[]", "()", "empty"]
    +                        },
    +                        uniqueItems: true
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -        exceptionsArrayOptions = (context.options.length === 2) ? context.options[1].exceptions : [],
    -        options = {},
    -        exceptions;
    +    create: function(context) {
     
    -    if (exceptionsArrayOptions.length) {
    -        options.braceException = exceptionsArrayOptions.indexOf("{}") !== -1;
    -        options.bracketException = exceptionsArrayOptions.indexOf("[]") !== -1;
    -        options.parenException = exceptionsArrayOptions.indexOf("()") !== -1;
    -        options.empty = exceptionsArrayOptions.indexOf("empty") !== -1;
    -    }
    +        var MISSING_SPACE_MESSAGE = "There must be a space inside this paren.",
    +            REJECTED_SPACE_MESSAGE = "There should be no spaces inside this paren.",
    +            ALWAYS = context.options[0] === "always",
     
    -    /**
    -     * Produces an object with the opener and closer exception values
    -     * @param {Object} opts The exception options
    -     * @returns {Object} `openers` and `closers` exception values
    -     * @private
    -     */
    -    function getExceptions() {
    -        var openers = [],
    -            closers = [];
    -        if (options.braceException) {
    -            openers.push("{");
    -            closers.push("}");
    -        }
    -
    -        if (options.bracketException) {
    -            openers.push("[");
    -            closers.push("]");
    -        }
    +            exceptionsArrayOptions = (context.options.length === 2) ? context.options[1].exceptions : [],
    +            options = {},
    +            exceptions;
     
    -        if (options.parenException) {
    -            openers.push("(");
    -            closers.push(")");
    +        if (exceptionsArrayOptions.length) {
    +            options.braceException = exceptionsArrayOptions.indexOf("{}") !== -1;
    +            options.bracketException = exceptionsArrayOptions.indexOf("[]") !== -1;
    +            options.parenException = exceptionsArrayOptions.indexOf("()") !== -1;
    +            options.empty = exceptionsArrayOptions.indexOf("empty") !== -1;
             }
     
    -        if (options.empty) {
    -            openers.push(")");
    -            closers.push("(");
    -        }
    -
    -        return {
    -            openers: openers,
    -            closers: closers
    -        };
    -    }
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -    var sourceCode = context.getSourceCode();
    -
    -    /**
    -     * 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 isOpenerException(token) {
    -        return token.type === "Punctuator" && exceptions.openers.indexOf(token.value) >= 0;
    -    }
    -
    -    /**
    -     * 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 isCloserException(token) {
    -        return token.type === "Punctuator" && exceptions.closers.indexOf(token.value) >= 0;
    -    }
    +        /**
    +         * Produces an object with the opener and closer exception values
    +         * @param {Object} opts The exception options
    +         * @returns {Object} `openers` and `closers` exception values
    +         * @private
    +         */
    +        function getExceptions() {
    +            var openers = [],
    +                closers = [];
    +
    +            if (options.braceException) {
    +                openers.push("{");
    +                closers.push("}");
    +            }
     
    -    /**
    -     * 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 shouldOpenerHaveSpace(left, right) {
    -        if (sourceCode.isSpaceBetweenTokens(left, right)) {
    -            return false;
    -        }
    +            if (options.bracketException) {
    +                openers.push("[");
    +                closers.push("]");
    +            }
     
    -        if (ALWAYS) {
    -            if (right.type === "Punctuator" && right.value === ")") {
    -                return false;
    +            if (options.parenException) {
    +                openers.push("(");
    +                closers.push(")");
                 }
    -            return !isOpenerException(right);
    -        } else {
    -            return isOpenerException(right);
    -        }
    -    }
     
    -    /**
    -     * 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;
    -        }
    +            if (options.empty) {
    +                openers.push(")");
    +                closers.push("(");
    +            }
     
    -        if (sourceCode.isSpaceBetweenTokens(left, right)) {
    -            return false;
    +            return {
    +                openers: openers,
    +                closers: closers
    +            };
             }
     
    -        if (ALWAYS) {
    -            return !isCloserException(left);
    -        } else {
    -            return isCloserException(left);
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +        var sourceCode = context.getSourceCode();
    +
    +        /**
    +         * 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 isOpenerException(token) {
    +            return token.type === "Punctuator" && exceptions.openers.indexOf(token.value) >= 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;
    +        /**
    +         * 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 isCloserException(token) {
    +            return token.type === "Punctuator" && exceptions.closers.indexOf(token.value) >= 0;
             }
     
    -        if (!astUtils.isTokenOnSameLine(left, right)) {
    -            return false;
    -        }
    +        /**
    +         * 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 shouldOpenerHaveSpace(left, right) {
    +            if (sourceCode.isSpaceBetweenTokens(left, right)) {
    +                return false;
    +            }
     
    -        if (!sourceCode.isSpaceBetweenTokens(left, right)) {
    -            return false;
    +            if (ALWAYS) {
    +                if (right.type === "Punctuator" && right.value === ")") {
    +                    return false;
    +                }
    +                return !isOpenerException(right);
    +            } else {
    +                return isOpenerException(right);
    +            }
             }
     
    -        if (ALWAYS) {
    -            return isOpenerException(right);
    -        } else {
    -            return !isOpenerException(right);
    -        }
    -    }
    +        /**
    +         * 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;
    +            }
     
    -    /**
    -     * 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;
    -        }
    +            if (sourceCode.isSpaceBetweenTokens(left, right)) {
    +                return false;
    +            }
     
    -        if (!astUtils.isTokenOnSameLine(left, right)) {
    -            return false;
    +            if (ALWAYS) {
    +                return !isCloserException(left);
    +            } else {
    +                return isCloserException(left);
    +            }
             }
     
    -        if (!sourceCode.isSpaceBetweenTokens(left, right)) {
    -            return false;
    -        }
    +        /**
    +         * 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;
    +            }
     
    -        if (ALWAYS) {
    -            return isCloserException(left);
    -        } else {
    -            return !isCloserException(left);
    -        }
    -    }
    +            if (!astUtils.isTokenOnSameLine(left, right)) {
    +                return false;
    +            }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +            if (!sourceCode.isSpaceBetweenTokens(left, right)) {
    +                return false;
    +            }
     
    -    return {
    -        "Program": function checkParenSpaces(node) {
    -            var tokens, prevToken, nextToken;
    -            exceptions = getExceptions();
    -            tokens = sourceCode.tokensAndComments;
    +            if (ALWAYS) {
    +                return isOpenerException(right);
    +            } else {
    +                return !isOpenerException(right);
    +            }
    +        }
     
    -            tokens.forEach(function(token, i) {
    -                prevToken = tokens[i - 1];
    -                nextToken = tokens[i + 1];
    +        /**
    +         * 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;
    +            }
     
    -                if (token.type !== "Punctuator") {
    -                    return;
    -                }
    +            if (!astUtils.isTokenOnSameLine(left, right)) {
    +                return false;
    +            }
     
    -                if (token.value !== "(" && token.value !== ")") {
    -                    return;
    -                }
    +            if (!sourceCode.isSpaceBetweenTokens(left, right)) {
    +                return false;
    +            }
     
    -                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]]);
    -                        }
    -                    });
    -                }
    -            });
    +            if (ALWAYS) {
    +                return isCloserException(left);
    +            } else {
    +                return !isCloserException(left);
    +            }
             }
    -    };
     
    -};
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "array",
    -                "items": {
    -                    "enum": ["{}", "[]", "()", "empty"]
    -                },
    -                "uniqueItems": true
    +        return {
    +            Program: function checkParenSpaces(node) {
    +                var tokens, prevToken, nextToken;
    +
    +                exceptions = getExceptions();
    +                tokens = sourceCode.tokensAndComments;
    +
    +                tokens.forEach(function(token, i) {
    +                    prevToken = tokens[i - 1];
    +                    nextToken = tokens[i + 1];
    +
    +                    if (token.type !== "Punctuator") {
    +                        return;
    +                    }
    +
    +                    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]]);
    +                            }
    +                        });
    +                    }
    +                });
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/space-infix-ops.js b/tools/eslint/lib/rules/space-infix-ops.js
    index 8d696e65b9f6e5..862ff66fb5e6ae 100644
    --- a/tools/eslint/lib/rules/space-infix-ops.js
    +++ b/tools/eslint/lib/rules/space-infix-ops.js
    @@ -8,139 +8,153 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var int32Hint = context.options[0] ? context.options[0].int32Hint === true : false;
    -
    -    var OPERATORS = [
    -        "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", "<=", ">", ">=", "in",
    -        "instanceof", "==", "!=", "===", "!==", "&", "^", "|", "&&", "||", "=",
    -        "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "^=", "|=",
    -        "?", ":", ","
    -    ];
    -
    -    /**
    -     * Returns the first token which violates the rule
    -     * @param {ASTNode} left - The left node of the main node
    -     * @param {ASTNode} right - The right node of the main node
    -     * @returns {object} The violator token or null
    -     * @private
    -     */
    -    function getFirstNonSpacedToken(left, right) {
    -        var op, tokens = context.getTokensBetween(left, right, 1);
    -        for (var i = 1, l = tokens.length - 1; i < l; ++i) {
    -            op = tokens[i];
    -            if (
    -                op.type === "Punctuator" &&
    -                OPERATORS.indexOf(op.value) >= 0 &&
    -                (tokens[i - 1].range[1] >= op.range[0] || op.range[1] >= tokens[i + 1].range[0])
    -            ) {
    -                return op;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require spacing around operators",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    int32Hint: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var int32Hint = context.options[0] ? context.options[0].int32Hint === true : false;
    +
    +        var OPERATORS = [
    +            "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", "<=", ">", ">=", "in",
    +            "instanceof", "==", "!=", "===", "!==", "&", "^", "|", "&&", "||", "=",
    +            "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "^=", "|=",
    +            "?", ":", ",", "**"
    +        ];
    +
    +        /**
    +         * Returns the first token which violates the rule
    +         * @param {ASTNode} left - The left node of the main node
    +         * @param {ASTNode} right - The right node of the main node
    +         * @returns {object} The violator token or null
    +         * @private
    +         */
    +        function getFirstNonSpacedToken(left, right) {
    +            var op,
    +                tokens = context.getTokensBetween(left, right, 1);
    +
    +            for (var i = 1, l = tokens.length - 1; i < l; ++i) {
    +                op = tokens[i];
    +                if (
    +                    op.type === "Punctuator" &&
    +                    OPERATORS.indexOf(op.value) >= 0 &&
    +                    (tokens[i - 1].range[1] >= op.range[0] || op.range[1] >= tokens[i + 1].range[0])
    +                ) {
    +                    return op;
    +                }
                 }
    +            return null;
             }
    -        return null;
    -    }
     
    -    /**
    -     * Reports an AST node as a rule violation
    -     * @param {ASTNode} mainNode - The node to report
    -     * @param {object} culpritToken - The token which has a problem
    -     * @returns {void}
    -     * @private
    -     */
    -    function report(mainNode, culpritToken) {
    -        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 = " ";
    +        /**
    +         * Reports an AST node as a rule violation
    +         * @param {ASTNode} mainNode - The node to report
    +         * @param {object} culpritToken - The token which has a problem
    +         * @returns {void}
    +         * @private
    +         */
    +        function report(mainNode, culpritToken) {
    +            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);
                     }
    +            });
    +        }
     
    -                fixString += culpritToken.value;
    +        /**
    +         * 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);
     
    -                if (afterToken.range[0] - culpritToken.range[1] === 0) {
    -                    fixString += " ";
    +            if (nonSpacedNode) {
    +                if (!(int32Hint && context.getSource(node).substr(-2) === "|0")) {
    +                    report(node, nonSpacedNode);
                     }
    -
    -                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);
    -
    -        if (nonSpacedNode) {
    -            if (!(int32Hint && context.getSource(node).substr(-2) === "|0")) {
    -                report(node, nonSpacedNode);
                 }
             }
    -    }
     
    -    /**
    -     * 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);
    -
    -        if (nonSpacedConsequesntNode) {
    -            report(node, nonSpacedConsequesntNode);
    -        } else if (nonSpacedAlternateNode) {
    -            report(node, nonSpacedAlternateNode);
    +        /**
    +         * 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);
    +
    +            if (nonSpacedConsequesntNode) {
    +                report(node, nonSpacedConsequesntNode);
    +            } else if (nonSpacedAlternateNode) {
    +                report(node, nonSpacedAlternateNode);
    +            }
             }
    -    }
     
    -    /**
    -     * Check if the node is a variable
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkVar(node) {
    -        var nonSpacedNode;
    -
    -        if (node.init) {
    -            nonSpacedNode = getFirstNonSpacedToken(node.id, node.init);
    -            if (nonSpacedNode) {
    -                report(node, nonSpacedNode);
    +        /**
    +         * Check if the node is a variable
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkVar(node) {
    +            var nonSpacedNode;
    +
    +            if (node.init) {
    +                nonSpacedNode = getFirstNonSpacedToken(node.id, node.init);
    +                if (nonSpacedNode) {
    +                    report(node, nonSpacedNode);
    +                }
                 }
             }
    -    }
     
    -    return {
    -        "AssignmentExpression": checkBinary,
    -        "AssignmentPattern": checkBinary,
    -        "BinaryExpression": checkBinary,
    -        "LogicalExpression": checkBinary,
    -        "ConditionalExpression": checkConditional,
    -        "VariableDeclarator": checkVar
    -    };
    +        return {
    +            AssignmentExpression: checkBinary,
    +            AssignmentPattern: checkBinary,
    +            BinaryExpression: checkBinary,
    +            LogicalExpression: checkBinary,
    +            ConditionalExpression: checkConditional,
    +            VariableDeclarator: checkVar
    +        };
     
    -};
    -
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "int32Hint": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/space-unary-ops.js b/tools/eslint/lib/rules/space-unary-ops.js
    index 843f34625af129..0bb92af1e68d6c 100644
    --- a/tools/eslint/lib/rules/space-unary-ops.js
    +++ b/tools/eslint/lib/rules/space-unary-ops.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview This rule shoud require or disallow spaces before or after unary operations.
      * @author Marcin Kumorek
    - * @copyright 2014 Marcin Kumorek. All rights reserved.
      */
     "use strict";
     
    @@ -9,44 +8,93 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var options = context.options && Array.isArray(context.options) && context.options[0] || { words: true, nonwords: false };
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -    * Check if the node is the first "!" in a "!!" convert to Boolean expression
    -    * @param {ASTnode} node AST node
    -    * @returns {boolean} Whether or not the node is first "!" in "!!"
    -    */
    -    function isFirstBangInBangBangExpression(node) {
    -        return node && node.type === "UnaryExpression" && node.argument.operator === "!" &&
    -            node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing before or after unary operators",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -    /**
    -    * Check if the node's child argument is an "ObjectExpression"
    -    * @param {ASTnode} node AST node
    -    * @returns {boolean} Whether or not the argument's type is "ObjectExpression"
    -    */
    -    function isArgumentObjectExpression(node) {
    -        return node.argument && node.argument.type && node.argument.type === "ObjectExpression";
    -    }
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    words: {
    +                        type: "boolean"
    +                    },
    +                    nonwords: {
    +                        type: "boolean"
    +                    },
    +                    overrides: {
    +                        type: "object",
    +                        additionalProperties: {
    +                            type: "boolean"
    +                        }
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: function(context) {
    +        var options = context.options && Array.isArray(context.options) && context.options[0] || { words: true, nonwords: false };
     
    -    /**
    -    * Check Unary Word Operators for spaces after the word operator
    -    * @param {ASTnode} node AST node
    -    * @param {object} firstToken first token from the AST node
    -    * @param {object} secondToken second token from the AST node
    -    * @param {string} word The word to be used for reporting
    -    * @returns {void}
    -    */
    -    function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) {
    -        word = word || firstToken.value;
    -
    -        if (options.words) {
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +        * Check if the node is the first "!" in a "!!" convert to Boolean expression
    +        * @param {ASTnode} node AST node
    +        * @returns {boolean} Whether or not the node is first "!" in "!!"
    +        */
    +        function isFirstBangInBangBangExpression(node) {
    +            return node && node.type === "UnaryExpression" && node.argument.operator === "!" &&
    +                node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!";
    +        }
    +
    +        /**
    +        * Check if the node's child argument is an "ObjectExpression"
    +        * @param {ASTnode} node AST node
    +        * @returns {boolean} Whether or not the argument's type is "ObjectExpression"
    +        */
    +        function isArgumentObjectExpression(node) {
    +            return node.argument && node.argument.type && node.argument.type === "ObjectExpression";
    +        }
    +
    +        /**
    +        * Checks if an override exists for a given operator.
    +        * @param {ASTnode} node AST node
    +        * @param {string} operator Operator
    +        * @returns {boolean} Whether or not an override has been provided for the operator
    +        */
    +        function overrideExistsForOperator(node, operator) {
    +            return options.overrides && options.overrides.hasOwnProperty(operator);
    +        }
    +
    +        /**
    +        * Gets the value that the override was set to for this operator
    +        * @param {ASTnode} node AST node
    +        * @param {string} operator Operator
    +        * @returns {boolean} Whether or not an override enforces a space with this operator
    +        */
    +        function overrideEnforcesSpaces(node, operator) {
    +            return options.overrides[operator];
    +        }
    +
    +        /**
    +        * Verify Unary Word Operator has spaces after the word operator
    +        * @param {ASTnode} node AST node
    +        * @param {object} firstToken first token from the AST node
    +        * @param {object} secondToken second token from the AST node
    +        * @param {string} word The word to be used for reporting
    +        * @returns {void}
    +        */
    +        function verifyWordHasSpaces(node, firstToken, secondToken, word) {
                 if (secondToken.range[0] === firstToken.range[1]) {
                     context.report({
                         node: node,
    @@ -58,35 +106,76 @@ module.exports = function(context) {
                 }
             }
     
    -        if (!options.words && isArgumentObjectExpression(node)) {
    -            if (secondToken.range[0] > firstToken.range[1]) {
    -                context.report({
    -                    node: node,
    -                    message: "Unexpected space after unary word operator '" + word + "'.",
    -                    fix: function(fixer) {
    -                        return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
    -                    }
    -                });
    +        /**
    +        * Verify Unary Word Operator doesn't have spaces after the word operator
    +        * @param {ASTnode} node AST node
    +        * @param {object} firstToken first token from the AST node
    +        * @param {object} secondToken second token from the AST node
    +        * @param {string} word The word to be used for reporting
    +        * @returns {void}
    +        */
    +        function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) {
    +            if (isArgumentObjectExpression(node)) {
    +                if (secondToken.range[0] > firstToken.range[1]) {
    +                    context.report({
    +                        node: node,
    +                        message: "Unexpected space after unary word operator '" + word + "'.",
    +                        fix: function(fixer) {
    +                            return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
    +                        }
    +                    });
    +                }
                 }
             }
    -    }
     
    -    /**
    -    * Checks UnaryExpression, UpdateExpression and NewExpression for spaces before and after the operator
    -    * @param {ASTnode} node AST node
    -    * @returns {void}
    -    */
    -    function checkForSpaces(node) {
    -        var tokens = context.getFirstTokens(node, 2),
    -            firstToken = tokens[0],
    -            secondToken = tokens[1];
    -
    -        if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") {
    -            checkUnaryWordOperatorForSpaces(node, firstToken, secondToken);
    -            return;
    +        /**
    +        * Check Unary Word Operators for spaces after the word operator
    +        * @param {ASTnode} node AST node
    +        * @param {object} firstToken first token from the AST node
    +        * @param {object} secondToken second token from the AST node
    +        * @param {string} word The word to be used for reporting
    +        * @returns {void}
    +        */
    +        function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) {
    +            word = word || firstToken.value;
    +
    +            if (overrideExistsForOperator(node, word)) {
    +                if (overrideEnforcesSpaces(node, word)) {
    +                    verifyWordHasSpaces(node, firstToken, secondToken, word);
    +                } else {
    +                    verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
    +                }
    +            } else if (options.words) {
    +                verifyWordHasSpaces(node, firstToken, secondToken, word);
    +            } else {
    +                verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
    +            }
    +        }
    +
    +        /**
    +        * Verifies YieldExpressions satisfy spacing requirements
    +        * @param {ASTnode} node AST node
    +        * @returns {void}
    +        */
    +        function checkForSpacesAfterYield(node) {
    +            var tokens = context.getFirstTokens(node, 3),
    +                word = "yield";
    +
    +            if (!node.argument || node.delegate) {
    +                return;
    +            }
    +
    +            checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
             }
     
    -        if (options.nonwords) {
    +        /**
    +        * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator
    +        * @param {ASTnode} node AST node
    +        * @param {object} firstToken First token in the expression
    +        * @param {object} secondToken Second token in the expression
    +        * @returns {void}
    +        */
    +        function verifyNonWordsHaveSpaces(node, firstToken, secondToken) {
                 if (node.prefix) {
                     if (isFirstBangInBangBangExpression(node)) {
                         return;
    @@ -111,7 +200,16 @@ module.exports = function(context) {
                         });
                     }
                 }
    -        } else {
    +        }
    +
    +        /**
    +        * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator
    +        * @param {ASTnode} node AST node
    +        * @param {object} firstToken First token in the expression
    +        * @param {object} secondToken Second token in the expression
    +        * @returns {void}
    +        */
    +        function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
                 if (node.prefix) {
                     if (secondToken.range[0] > firstToken.range[1]) {
                         context.report({
    @@ -134,41 +232,47 @@ module.exports = function(context) {
                     }
                 }
             }
    -    }
    -
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
     
    -    return {
    -        "UnaryExpression": checkForSpaces,
    -        "UpdateExpression": checkForSpaces,
    -        "NewExpression": checkForSpaces,
    -        "YieldExpression": function(node) {
    -            var tokens = context.getFirstTokens(node, 3),
    -                word = "yield";
    +        /**
    +        * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements
    +        * @param {ASTnode} node AST node
    +        * @returns {void}
    +        */
    +        function checkForSpaces(node) {
    +            var tokens = context.getFirstTokens(node, 2),
    +                firstToken = tokens[0],
    +                secondToken = tokens[1];
     
    -            if (!node.argument || node.delegate) {
    +            if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") {
    +                checkUnaryWordOperatorForSpaces(node, firstToken, secondToken);
                     return;
                 }
     
    -            checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
    +            var operator = node.prefix ? tokens[0].value : tokens[1].value;
    +
    +            if (overrideExistsForOperator(node, operator)) {
    +                if (overrideEnforcesSpaces(node, operator)) {
    +                    verifyNonWordsHaveSpaces(node, firstToken, secondToken);
    +                } else {
    +                    verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
    +                }
    +            } else if (options.nonwords) {
    +                verifyNonWordsHaveSpaces(node, firstToken, secondToken);
    +            } else {
    +                verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
    +            }
             }
    -    };
     
    -};
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            UnaryExpression: checkForSpaces,
    +            UpdateExpression: checkForSpaces,
    +            NewExpression: checkForSpaces,
    +            YieldExpression: checkForSpacesAfterYield
    +        };
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "words": {
    -                "type": "boolean"
    -            },
    -            "nonwords": {
    -                "type": "boolean"
    -            }
    -        },
    -        "additionalProperties": false
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/spaced-comment.js b/tools/eslint/lib/rules/spaced-comment.js
    index 2ee693ed808560..149862024c2b3c 100644
    --- a/tools/eslint/lib/rules/spaced-comment.js
    +++ b/tools/eslint/lib/rules/spaced-comment.js
    @@ -1,9 +1,6 @@
     /**
      * @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";
     
    @@ -20,6 +17,7 @@ var lodash = require("lodash");
      */
     function escape(s) {
         var isOneChar = s.length === 1;
    +
         s = lodash.escapeRegExp(s);
         return isOneChar ? s : "(?:" + s + ")";
     }
    @@ -65,43 +63,57 @@ function parseMarkersOption(markers) {
     function createAlwaysStylePattern(markers, exceptions) {
         var pattern = "^";
     
    -    // A marker or nothing.
    -    //   ["*"]            ==> "\*?"
    -    //   ["*", "!"]       ==> "(?:\*|!)?"
    -    //   ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
    +    /*
    +     * 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.
     
    -    // 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)
    +    /*
    +     * 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);
     }
     
    @@ -117,6 +129,7 @@ function createAlwaysStylePattern(markers, exceptions) {
      */
     function createNeverStylePattern(markers) {
         var pattern = "^(" + markers.map(escape).join("|") + ")?[ \t]+";
    +
         return new RegExp(pattern);
     }
     
    @@ -124,160 +137,178 @@ function createNeverStylePattern(markers) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    // Unless the first option is never, require a space
    -    var requireSpace = context.options[0] !== "never";
    -
    -    // Parse the second options.
    -    // If markers don't include `"*"`, it's added automatically for JSDoc comments.
    -    var config = context.options[1] || {};
    -    var styleRules = ["block", "line"].reduce(function(rule, type) {
    -        var markers = parseMarkersOption(config[type] && config[type].markers || config.markers);
    -        var exceptions = config[type] && config[type].exceptions || config.exceptions || [];
    -
    -        // Create RegExp object for valid patterns.
    -        rule[type] = {
    -            regex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers),
    -            hasExceptions: exceptions.length > 0,
    -            markers: new RegExp("^(" + markers.map(escape).join("|") + ")")
    -        };
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce consistent spacing after the `//` or `/*` in a comment",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
     
    -        return rule;
    -    }, {});
    +        fixable: "whitespace",
     
    -    /**
    -     * Reports a spacing error with an appropriate message.
    -     * @param {ASTNode} node - A comment node to check.
    -     * @param {string} message - An error message to report
    -     * @param {Array} match - An array of match results for markers.
    -     * @returns {void}
    -     */
    -    function report(node, message, match) {
    -        var type = node.type.toLowerCase(),
    -            commentIdentifier = type === "block" ? "/*" : "//";
    -
    -        context.report({
    -            node: node,
    -            fix: function(fixer) {
    -                var start = node.range[0],
    -                    end = start + 2;
    -
    -                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] : ""));
    -                }
    +        schema: [
    +            {
    +                enum: ["always", "never"]
                 },
    -            message: message
    -        });
    -    }
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptions: {
    +                        type: "array",
    +                        items: {
    +                            type: "string"
    +                        }
    +                    },
    +                    markers: {
    +                        type: "array",
    +                        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
    +            }
    +        ]
    +    },
     
    -    /**
    -     * Reports a given comment if it's invalid.
    -     * @param {ASTNode} node - a comment node to check.
    -     * @returns {void}
    -     */
    -    function checkCommentForSpace(node) {
    -        var type = node.type.toLowerCase(),
    -            rule = styleRules[type],
    -            commentIdentifier = type === "block" ? "/*" : "//";
    -
    -        // Ignores empty comments.
    -        if (node.value.length === 0) {
    -            return;
    -        }
    +    create: function(context) {
     
    -        // 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);
    -                }
    -            }
    -        }
    -    }
    +        // Unless the first option is never, require a space
    +        var requireSpace = context.options[0] !== "never";
     
    -    return {
    +        /*
    +         * 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 || [];
     
    -        "LineComment": checkCommentForSpace,
    -        "BlockComment": checkCommentForSpace
    +            // Create RegExp object for valid patterns.
    +            rule[type] = {
    +                regex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers),
    +                hasExceptions: exceptions.length > 0,
    +                markers: new RegExp("^(" + markers.map(escape).join("|") + ")")
    +            };
     
    -    };
    -};
    +            return rule;
    +        }, {});
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptions": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    -                }
    -            },
    -            "markers": {
    -                "type": "array",
    -                "items": {
    -                    "type": "string"
    -                }
    -            },
    -            "line": {
    -                "type": "object",
    -                "properties": {
    -                    "exceptions": {
    -                        "type": "array",
    -                        "items": {
    -                            "type": "string"
    -                        }
    -                    },
    -                    "markers": {
    -                        "type": "array",
    -                        "items": {
    -                            "type": "string"
    +        /**
    +         * Reports a spacing error with an appropriate message.
    +         * @param {ASTNode} node - A comment node to check.
    +         * @param {string} message - An error message to report
    +         * @param {Array} match - An array of match results for markers.
    +         * @returns {void}
    +         */
    +        function report(node, message, match) {
    +            var type = node.type.toLowerCase(),
    +                commentIdentifier = type === "block" ? "/*" : "//";
    +
    +            context.report({
    +                node: node,
    +                fix: function(fixer) {
    +                    var start = node.range[0],
    +                        end = start + 2;
    +
    +                    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] : ""));
                         }
                     },
    -                "additionalProperties": false
    -            },
    -            "block": {
    -                "type": "object",
    -                "properties": {
    -                    "exceptions": {
    -                        "type": "array",
    -                        "items": {
    -                            "type": "string"
    -                        }
    -                    },
    -                    "markers": {
    -                        "type": "array",
    -                        "items": {
    -                            "type": "string"
    -                        }
    +                message: message
    +            });
    +        }
    +
    +        /**
    +         * Reports a given comment if it's invalid.
    +         * @param {ASTNode} node - a comment node to check.
    +         * @returns {void}
    +         */
    +        function checkCommentForSpace(node) {
    +            var type = node.type.toLowerCase(),
    +                rule = styleRules[type],
    +                commentIdentifier = type === "block" ? "/*" : "//";
    +
    +            // Ignores empty comments.
    +            if (node.value.length === 0) {
    +                return;
    +            }
    +
    +            // Checks.
    +            if (requireSpace) {
    +                if (!rule.regex.test(node.value)) {
    +                    var hasMarker = rule.markers.exec(node.value);
    +                    var marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier;
    +
    +                    if (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);
                         }
    -                },
    -                "additionalProperties": false
    +                }
    +            } 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);
    +                    }
    +                }
                 }
    -        },
    -        "additionalProperties": false
    +        }
    +
    +        return {
    +
    +            LineComment: checkCommentForSpace,
    +            BlockComment: checkCommentForSpace
    +
    +        };
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/strict.js b/tools/eslint/lib/rules/strict.js
    index 120ad87e64ec13..4097a327931781 100644
    --- a/tools/eslint/lib/rules/strict.js
    +++ b/tools/eslint/lib/rules/strict.js
    @@ -1,9 +1,6 @@
     /**
      * @fileoverview Rule to control usage of strict mode directives.
      * @author Brandon Mills
    - * @copyright 2015 Brandon Mills. All rights reserved.
    - * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2013 Ian Christian Myers. All rights reserved.
      */
     
     "use strict";
    @@ -60,154 +57,165 @@ function getUseStrictDirectives(statements) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var mode = context.options[0] || "safe",
    -        ecmaFeatures = context.parserOptions.ecmaFeatures || {},
    -        scopes = [],
    -        classScopes = [],
    -        rule;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow strict mode directives",
    +            category: "Strict Mode",
    +            recommended: false
    +        },
     
    -    if (ecmaFeatures.impliedStrict) {
    -        mode = "implied";
    -    } else if (mode === "safe") {
    -        mode = ecmaFeatures.globalReturn ? "global" : "function";
    -    }
    +        schema: [
    +            {
    +                enum: ["never", "global", "function", "safe"]
    +            }
    +        ]
    +    },
     
    -    /**
    -     * 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 reportSlice(nodes, start, end, message) {
    -        var i;
    -
    -        for (i = start; i < end; i++) {
    -            context.report(nodes[i], message);
    -        }
    -    }
    +    create: function(context) {
     
    -    /**
    -     * Report all nodes in an array with a given message.
    -     * @param {ASTNode[]} nodes Nodes.
    -     * @param {string} message Message to display.
    -     * @returns {void}
    -     */
    -    function reportAll(nodes, message) {
    -        reportSlice(nodes, 0, nodes.length, message);
    -    }
    +        var mode = context.options[0] || "safe",
    +            ecmaFeatures = context.parserOptions.ecmaFeatures || {},
    +            scopes = [],
    +            classScopes = [],
    +            rule;
     
    -    /**
    -     * 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}
    -     */
    -    function reportAllExceptFirst(nodes, message) {
    -        reportSlice(nodes, 1, nodes.length, message);
    -    }
    +        if (ecmaFeatures.impliedStrict) {
    +            mode = "implied";
    +        } else if (mode === "safe") {
    +            mode = ecmaFeatures.globalReturn ? "global" : "function";
    +        }
     
    -    /**
    -     * 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 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) {
    -                context.report(useStrictDirectives[0], messages.unnecessary);
    -            } else if (isInClass) {
    -                context.report(useStrictDirectives[0], messages.unnecessaryInClasses);
    +        /**
    +         * 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 reportSlice(nodes, start, end, message) {
    +            var i;
    +
    +            for (i = start; i < end; i++) {
    +                context.report(nodes[i], message);
                 }
    +        }
     
    -            reportAllExceptFirst(useStrictDirectives, messages.multiple);
    -        } else if (isParentGlobal) {
    -            context.report(node, messages.function);
    +        /**
    +         * Report all nodes in an array with a given message.
    +         * @param {ASTNode[]} nodes Nodes.
    +         * @param {string} message Message to display.
    +         * @returns {void}
    +         */
    +        function reportAll(nodes, message) {
    +            reportSlice(nodes, 0, nodes.length, message);
             }
     
    -        scopes.push(isParentStrict || isStrict);
    -    }
    +        /**
    +         * 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}
    +         */
    +        function reportAllExceptFirst(nodes, message) {
    +            reportSlice(nodes, 1, nodes.length, message);
    +        }
     
    -    /**
    -     * Exiting a function in 'function' mode pops its scope off the stack.
    -     * @returns {void}
    -     */
    -    function exitFunctionInFunctionMode() {
    -        scopes.pop();
    -    }
    +        /**
    +         * 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 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) {
    +                    context.report(useStrictDirectives[0], messages.unnecessary);
    +                } else if (isInClass) {
    +                    context.report(useStrictDirectives[0], messages.unnecessaryInClasses);
    +                }
     
    -    /**
    -     * 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) : [];
    +                reportAllExceptFirst(useStrictDirectives, messages.multiple);
    +            } else if (isParentGlobal) {
    +                context.report(node, messages.function);
    +            }
     
    -        if (mode === "function") {
    -            enterFunctionInFunctionMode(node, useStrictDirectives);
    -        } else {
    -            reportAll(useStrictDirectives, messages[mode]);
    +            scopes.push(isParentStrict || isStrict);
             }
    -    }
     
    -    rule = {
    -        "Program": function(node) {
    -            var useStrictDirectives = getUseStrictDirectives(node.body);
    -
    -            if (node.sourceType === "module") {
    -                mode = "module";
    -            }
    +        /**
    +         * Exiting a function in 'function' mode pops its scope off the stack.
    +         * @returns {void}
    +         */
    +        function exitFunctionInFunctionMode() {
    +            scopes.pop();
    +        }
     
    -            if (mode === "global") {
    -                if (node.body.length > 0 && useStrictDirectives.length === 0) {
    -                    context.report(node, messages.global);
    -                }
    -                reportAllExceptFirst(useStrictDirectives, messages.multiple);
    +        /**
    +         * 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]);
                 }
    -        },
    -        "FunctionDeclaration": enterFunction,
    -        "FunctionExpression": enterFunction,
    -        "ArrowFunctionExpression": enterFunction
    -    };
    -
    -    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
    -        });
    -    }
    +        rule = {
    +            Program: function(node) {
    +                var useStrictDirectives = getUseStrictDirectives(node.body);
     
    -    return rule;
    -};
    +                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,
    +            ArrowFunctionExpression: enterFunction
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["never", "global", "function", "safe"]
    +        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;
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/template-curly-spacing.js b/tools/eslint/lib/rules/template-curly-spacing.js
    index 972e2daa28f0ec..144a03536907a0 100644
    --- a/tools/eslint/lib/rules/template-curly-spacing.js
    +++ b/tools/eslint/lib/rules/template-curly-spacing.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -24,79 +22,94 @@ 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, " ");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow spacing around embedded expressions of template strings",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
    +
    +        fixable: "whitespace",
    +
    +        schema: [
    +            {enum: ["always", "never"]}
    +        ]
    +    },
    +
    +    create: 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]
    +                        ]);
                         }
    -                    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, " ");
    +        /**
    +         * 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 fixer.removeRange([
    -                        token.range[1],
    -                        nextToken.range[0]
    -                    ]);
    -                }
    -            });
    +                });
    +            }
             }
    -    }
     
    -    return {
    -        TemplateElement: function(node) {
    -            var token = sourceCode.getFirstToken(node);
    -            checkSpacingBefore(token);
    -            checkSpacingAfter(token);
    -        }
    -    };
    -};
    +        return {
    +            TemplateElement: function(node) {
    +                var token = sourceCode.getFirstToken(node);
     
    -module.exports.schema = [
    -    {enum: ["always", "never"]}
    -];
    +                checkSpacingBefore(token);
    +                checkSpacingAfter(token);
    +            }
    +        };
    +    }
    +};
    diff --git a/tools/eslint/lib/rules/use-isnan.js b/tools/eslint/lib/rules/use-isnan.js
    index 7d65f9c0d85921..10f7b71c8bd42b 100644
    --- a/tools/eslint/lib/rules/use-isnan.js
    +++ b/tools/eslint/lib/rules/use-isnan.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to flag comparisons to the value NaN
      * @author James Allardice
    - * @copyright 2014 Jordan Harband. All rights reserved.
    - * @copyright 2013 James Allardice. All rights reserved.
      */
     
     "use strict";
    @@ -11,16 +9,26 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require calls to `isNaN()` when checking for `NaN`",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    return {
    -        "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.");
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +            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.");
    +                }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/valid-jsdoc.js b/tools/eslint/lib/rules/valid-jsdoc.js
    index d2a1dccde64017..e7d6fdeadf8813 100644
    --- a/tools/eslint/lib/rules/valid-jsdoc.js
    +++ b/tools/eslint/lib/rules/valid-jsdoc.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Validates JSDoc comments are syntactically correct
      * @author Nicholas C. Zakas
    - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
      */
     "use strict";
     
    @@ -15,360 +14,383 @@ var doctrine = require("doctrine");
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -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,
    -        requireReturnType = options.requireReturnType !== false,
    -        preferType = options.preferType || {},
    -        checkPreferType = Object.keys(preferType).length !== 0;
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    // 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(node) {
    -        fns.push({
    -            returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") ||
    -                isTypeClass(node)
    -        });
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce valid JSDoc comments",
    +            category: "Possible Errors",
    +            recommended: false
    +        },
     
    -    /**
    -     * Indicate that return has been found in the current function.
    -     * @param {ASTNode} node The return node.
    -     * @returns {void}
    -     * @private
    -     */
    -    function addReturn(node) {
    -        var functionState = fns[fns.length - 1];
    -
    -        if (functionState && node.argument !== null) {
    -            functionState.returnPresent = true;
    +        schema: [
    +            {
    +                type: "object",
    +                properties: {
    +                    prefer: {
    +                        type: "object",
    +                        additionalProperties: {
    +                            type: "string"
    +                        }
    +                    },
    +                    preferType: {
    +                        type: "object",
    +                        additionalProperties: {
    +                            type: "string"
    +                        }
    +                    },
    +                    requireReturn: {
    +                        type: "boolean"
    +                    },
    +                    requireParamDescription: {
    +                        type: "boolean"
    +                    },
    +                    requireReturnDescription: {
    +                        type: "boolean"
    +                    },
    +                    matchDescription: {
    +                        type: "string"
    +                    },
    +                    requireReturnType: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
    +
    +    create: 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,
    +            requireReturnType = options.requireReturnType !== false,
    +            preferType = options.preferType || {},
    +            checkPreferType = Object.keys(preferType).length !== 0;
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        // 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";
             }
    -    }
     
    -    /**
    -     * 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;
    +        /**
    +         * When parsing a new function, store it in our function stack.
    +         * @param {ASTNode} node A function node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function startFunction(node) {
    +            fns.push({
    +                returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") ||
    +                    isTypeClass(node)
    +            });
             }
     
    -        expectedType = preferType[currentType];
    -
    -        return {
    -            currentType: currentType,
    -            expectedType: expectedType
    -        };
    -    }
    +        /**
    +         * Indicate that return has been found in the current function.
    +         * @param {ASTNode} node The return node.
    +         * @returns {void}
    +         * @private
    +         */
    +        function addReturn(node) {
    +            var functionState = fns[fns.length - 1];
    +
    +            if (functionState && node.argument !== null) {
    +                functionState.returnPresent = true;
    +            }
    +        }
     
    -    /**
    -     * 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;
    +        /**
    +         * 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";
             }
     
    -        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));
    +        /**
    +         * 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"; // {*}
             }
     
    -        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));
    +        /**
    +         * Extract the current and expected type based on the input type object
    +         * @param {Object} type JSDoc tag
    +         * @returns {Object} current and expected type object
    +         * @private
    +         */
    +        function getCurrentExpectedTypes(type) {
    +            var currentType;
    +            var expectedType;
    +
    +            if (type.name) {
    +                currentType = type.name;
    +            } else if (type.expression) {
    +                currentType = type.expression.name;
                 }
    -        });
    -
    -        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.
    -     * @returns {void}
    -     * @private
    -     */
    -    function checkJSDoc(node) {
    -        var jsdocNode = sourceCode.getJSDocComment(node),
    -            functionData = fns.pop(),
    -            hasReturns = false,
    -            hasConstructor = false,
    -            isInterface = false,
    -            isOverride = false,
    -            params = Object.create(null),
    -            jsdoc;
    -
    -        // make sure only to validate JSDoc comments
    -        if (jsdocNode) {
    -
    -            try {
    -                jsdoc = doctrine.parse(jsdocNode.value, {
    -                    strict: true,
    -                    unwrap: true,
    -                    sloppy: true
    -                });
    -            } catch (ex) {
    +            expectedType = currentType && preferType[currentType];
     
    -                if (/braces/i.test(ex.message)) {
    -                    context.report(jsdocNode, "JSDoc type missing brace.");
    -                } else {
    -                    context.report(jsdocNode, "JSDoc syntax error.");
    -                }
    +            return {
    +                currentType: currentType,
    +                expectedType: expectedType
    +            };
    +        }
     
    +        /**
    +         * Check if return tag type is void or undefined
    +         * @param {Object} jsdocNode JSDoc node
    +         * @param {Object} type JSDoc tag
    +         * @returns {void}
    +         * @private
    +         */
    +        function validateType(jsdocNode, type) {
    +            if (!type || !canTypeBeValidated(type.type)) {
                     return;
                 }
     
    -            jsdoc.tags.forEach(function(tag) {
    -
    -                switch (tag.title.toLowerCase()) {
    +            var typesToCheck = [];
    +            var elements = [];
    +
    +            switch (type.type) {
    +                case "TypeApplication":  // {Array.}
    +                    elements = type.applications[0].type === "UnionType" ? type.applications[0].elements : type.applications;
    +                    typesToCheck.push(getCurrentExpectedTypes(type));
    +                    break;
    +                case "RecordType":  // {{20:String}}
    +                    elements = type.fields;
    +                    break;
    +                case "UnionType":  // {String|number|Test}
    +                case "ArrayType":  // {[String, number, Test]}
    +                    elements = type.elements;
    +                    break;
    +                case "FieldType":  // Array.<{count: number, votes: number}>
    +                    typesToCheck.push(getCurrentExpectedTypes(type.value));
    +                    break;
    +                default:
    +                    typesToCheck.push(getCurrentExpectedTypes(type));
    +            }
     
    -                    case "param":
    -                    case "arg":
    -                    case "argument":
    -                        if (!tag.type) {
    -                            context.report(jsdocNode, "Missing JSDoc parameter type for '{{name}}'.", { name: tag.name });
    +            elements.forEach(validateType.bind(null, jsdocNode));
    +
    +            typesToCheck.forEach(function(typeToCheck) {
    +                if (typeToCheck.expectedType &&
    +                    typeToCheck.expectedType !== typeToCheck.currentType) {
    +                    context.report({
    +                        node: jsdocNode,
    +                        message: "Use '{{expectedType}}' instead of '{{currentType}}'.",
    +                        data: {
    +                            currentType: typeToCheck.currentType,
    +                            expectedType: typeToCheck.expectedType
                             }
    +                    });
    +                }
    +            });
    +        }
     
    -                        if (!tag.description && requireParamDescription) {
    -                            context.report(jsdocNode, "Missing JSDoc parameter description for '{{name}}'.", { name: tag.name });
    -                        }
    +        /**
    +         * Validate the JSDoc node and output warnings if anything is wrong.
    +         * @param {ASTNode} node The AST node to check.
    +         * @returns {void}
    +         * @private
    +         */
    +        function checkJSDoc(node) {
    +            var jsdocNode = sourceCode.getJSDocComment(node),
    +                functionData = fns.pop(),
    +                hasReturns = false,
    +                hasConstructor = false,
    +                isInterface = false,
    +                isOverride = false,
    +                isAbstract = false,
    +                params = Object.create(null),
    +                jsdoc;
    +
    +            // make sure only to validate JSDoc comments
    +            if (jsdocNode) {
    +
    +                try {
    +                    jsdoc = doctrine.parse(jsdocNode.value, {
    +                        strict: true,
    +                        unwrap: true,
    +                        sloppy: true
    +                    });
    +                } catch (ex) {
    +
    +                    if (/braces/i.test(ex.message)) {
    +                        context.report(jsdocNode, "JSDoc type missing brace.");
    +                    } else {
    +                        context.report(jsdocNode, "JSDoc syntax error.");
    +                    }
     
    -                        if (params[tag.name]) {
    -                            context.report(jsdocNode, "Duplicate JSDoc parameter '{{name}}'.", { name: tag.name });
    -                        } else if (tag.name.indexOf(".") === -1) {
    -                            params[tag.name] = 1;
    -                        }
    -                        break;
    +                    return;
    +                }
    +
    +                jsdoc.tags.forEach(function(tag) {
     
    -                    case "return":
    -                    case "returns":
    -                        hasReturns = true;
    +                    switch (tag.title.toLowerCase()) {
     
    -                        if (!requireReturn && !functionData.returnPresent && (tag.type === null || !isValidReturnType(tag))) {
    -                            context.report(jsdocNode, "Unexpected @" + tag.title + " tag; function has no return statement.");
    -                        } else {
    -                            if (requireReturnType && !tag.type) {
    -                                context.report(jsdocNode, "Missing JSDoc return type.");
    +                        case "param":
    +                        case "arg":
    +                        case "argument":
    +                            if (!tag.type) {
    +                                context.report(jsdocNode, "Missing JSDoc parameter type for '{{name}}'.", { name: tag.name });
                                 }
     
    -                            if (!isValidReturnType(tag) && !tag.description && requireReturnDescription) {
    -                                context.report(jsdocNode, "Missing JSDoc return description.");
    +                            if (!tag.description && requireParamDescription) {
    +                                context.report(jsdocNode, "Missing JSDoc parameter description for '{{name}}'.", { name: tag.name });
                                 }
    -                        }
     
    -                        break;
    +                            if (params[tag.name]) {
    +                                context.report(jsdocNode, "Duplicate JSDoc parameter '{{name}}'.", { name: tag.name });
    +                            } else if (tag.name.indexOf(".") === -1) {
    +                                params[tag.name] = 1;
    +                            }
    +                            break;
    +
    +                        case "return":
    +                        case "returns":
    +                            hasReturns = true;
    +
    +                            if (!requireReturn && !functionData.returnPresent && (tag.type === null || !isValidReturnType(tag)) && !isAbstract) {
    +                                context.report(jsdocNode, "Unexpected @" + tag.title + " tag; function has no return statement.");
    +                            } else {
    +                                if (requireReturnType && !tag.type) {
    +                                    context.report(jsdocNode, "Missing JSDoc return type.");
    +                                }
    +
    +                                if (!isValidReturnType(tag) && !tag.description && requireReturnDescription) {
    +                                    context.report(jsdocNode, "Missing JSDoc return description.");
    +                                }
    +                            }
     
    -                    case "constructor":
    -                    case "class":
    -                        hasConstructor = true;
    -                        break;
    +                            break;
     
    -                    case "override":
    -                    case "inheritdoc":
    -                        isOverride = true;
    -                        break;
    +                        case "constructor":
    +                        case "class":
    +                            hasConstructor = true;
    +                            break;
     
    -                    case "interface":
    -                        isInterface = true;
    -                        break;
    +                        case "override":
    +                        case "inheritdoc":
    +                            isOverride = true;
    +                            break;
     
    -                    // no default
    -                }
    +                        case "abstract":
    +                        case "virtual":
    +                            isAbstract = true;
    +                            break;
     
    -                // check tag preferences
    -                if (prefer.hasOwnProperty(tag.title) && tag.title !== prefer[tag.title]) {
    -                    context.report(jsdocNode, "Use @{{name}} instead.", { name: prefer[tag.title] });
    -                }
    +                        case "interface":
    +                            isInterface = true;
    +                            break;
     
    -                // validate the types
    -                if (checkPreferType) {
    -                    validateTagType(tag, jsdocNode);
    -                }
    -            });
    +                        // no default
    +                    }
     
    -            // check for functions missing @returns
    -            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 @" + (prefer.returns || "returns") + " for function.");
    -                }
    -            }
    +                    // check tag preferences
    +                    if (prefer.hasOwnProperty(tag.title) && tag.title !== prefer[tag.title]) {
    +                        context.report(jsdocNode, "Use @{{name}} instead.", { name: prefer[tag.title] });
    +                    }
     
    -            // check the parameters
    -            var jsdocParams = Object.keys(params);
    -
    -            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
    -                            });
    -                        }
    +                    // validate the types
    +                    if (checkPreferType && tag.type) {
    +                        validateType(jsdocNode, tag.type);
                         }
                     });
    -            }
    -
    -            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.");
    +                // check for functions missing @returns
    +                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 @" + (prefer.returns || "returns") + " for function.");
    +                    }
                     }
    -            }
    -
    -        }
     
    -    }
    +                // check the parameters
    +                var jsdocParams = Object.keys(params);
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "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
    -    };
    +                if (node.params) {
    +                    node.params.forEach(function(param, i) {
    +                        var name = param.name;
     
    -};
    +                        if (param.type === "AssignmentPattern") {
    +                            name = param.left.name;
    +                        }
     
    -module.exports.schema = [
    -    {
    -        "type": "object",
    -        "properties": {
    -            "prefer": {
    -                "type": "object",
    -                "additionalProperties": {
    -                    "type": "string"
    +                        // TODO(nzakas): Figure out logical things to do with destructured, default, rest params
    +                        if (param.type === "Identifier" || param.type === "AssignmentPattern") {
    +                            if (jsdocParams[i] && (name !== jsdocParams[i])) {
    +                                context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", {
    +                                    name: name,
    +                                    jsdocName: jsdocParams[i]
    +                                });
    +                            } else if (!params[name] && !isOverride) {
    +                                context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", {
    +                                    name: name
    +                                });
    +                            }
    +                        }
    +                    });
                     }
    -            },
    -            "preferType": {
    -                "type": "object",
    -                "additionalProperties": {
    -                    "type": "string"
    +
    +                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.");
    +                    }
                     }
    -            },
    -            "requireReturn": {
    -                "type": "boolean"
    -            },
    -            "requireParamDescription": {
    -                "type": "boolean"
    -            },
    -            "requireReturnDescription": {
    -                "type": "boolean"
    -            },
    -            "matchDescription": {
    -                "type": "string"
    -            },
    -            "requireReturnType": {
    -                "type": "boolean"
    +
                 }
    -        },
    -        "additionalProperties": false
    +
    +        }
    +
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            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
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/valid-typeof.js b/tools/eslint/lib/rules/valid-typeof.js
    index d67a46bf3dd7ce..289375a88bac3b 100644
    --- a/tools/eslint/lib/rules/valid-typeof.js
    +++ b/tools/eslint/lib/rules/valid-typeof.js
    @@ -8,35 +8,45 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "enforce comparing `typeof` expressions against valid strings",
    +            category: "Possible Errors",
    +            recommended: true
    +        },
     
    -    var VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function"],
    -        OPERATORS = ["==", "===", "!=", "!=="];
    +        schema: []
    +    },
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    +    create: function(context) {
     
    -    return {
    +        var VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function"],
    +            OPERATORS = ["==", "===", "!=", "!=="];
     
    -        "UnaryExpression": function(node) {
    -            var parent, sibling;
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
     
    -            if (node.operator === "typeof") {
    -                parent = context.getAncestors().pop();
    +        return {
     
    -                if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) {
    -                    sibling = parent.left === node ? parent.right : parent.left;
    +            UnaryExpression: function(node) {
    +                var parent, sibling;
     
    -                    if (sibling.type === "Literal" && VALID_TYPES.indexOf(sibling.value) === -1) {
    -                        context.report(sibling, "Invalid typeof comparison value");
    +                if (node.operator === "typeof") {
    +                    parent = context.getAncestors().pop();
    +
    +                    if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) {
    +                        sibling = parent.left === node ? parent.right : parent.left;
    +
    +                        if (sibling.type === "Literal" && VALID_TYPES.indexOf(sibling.value) === -1) {
    +                            context.report(sibling, "Invalid typeof comparison value");
    +                        }
                         }
                     }
                 }
    -        }
     
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/vars-on-top.js b/tools/eslint/lib/rules/vars-on-top.js
    index b142e3b56a7106..b44f77eb3fa695 100644
    --- a/tools/eslint/lib/rules/vars-on-top.js
    +++ b/tools/eslint/lib/rules/vars-on-top.js
    @@ -2,8 +2,6 @@
      * @fileoverview Rule to enforce var declarations are only at the top of a function.
      * @author Danny Fritz
      * @author Gyandeep Singh
    - * @copyright 2014 Danny Fritz. All rights reserved.
    - * @copyright 2014 Gyandeep Singh. All rights reserved.
      */
     "use strict";
     
    @@ -11,107 +9,126 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var errorMessage = "All 'var' declarations must be at the top of the function scope.";
    -
    -    //--------------------------------------------------------------------------
    -    // Helpers
    -    //--------------------------------------------------------------------------
    -
    -    /**
    -     * @param {ASTNode} node - any node
    -     * @returns {Boolean} whether the given node structurally represents a directive
    -     */
    -    function looksLikeDirective(node) {
    -        return node.type === "ExpressionStatement" &&
    -            node.expression.type === "Literal" && typeof node.expression.value === "string";
    -    }
    -
    -    /**
    -     * Check to see if its a ES6 import declaration
    -     * @param {ASTNode} node - any node
    -     * @returns {Boolean} whether the given node represents a import declaration
    -     */
    -    function looksLikeImport(node) {
    -        return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" ||
    -            node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require `var` declarations be placed at the top of their containing scope",
    +            category: "Best Practices",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +        var errorMessage = "All 'var' declarations must be at the top of the function scope.";
    +
    +        //--------------------------------------------------------------------------
    +        // Helpers
    +        //--------------------------------------------------------------------------
    +
    +        /**
    +         * @param {ASTNode} node - any node
    +         * @returns {Boolean} whether the given node structurally represents a directive
    +         */
    +        function looksLikeDirective(node) {
    +            return node.type === "ExpressionStatement" &&
    +                node.expression.type === "Literal" && typeof node.expression.value === "string";
    +        }
     
    -    /**
    -     * Checks whether this variable is on top of the block body
    -     * @param {ASTNode} node - The node to check
    -     * @param {ASTNode[]} statements - collection of ASTNodes for the parent node block
    -     * @returns {Boolean} True if var is on top otherwise false
    -     */
    -    function isVarOnTop(node, statements) {
    -        var i = 0, l = statements.length;
    -
    -        // skip over directives
    -        for (; i < l; ++i) {
    -            if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) {
    -                break;
    -            }
    +        /**
    +         * Check to see if its a ES6 import declaration
    +         * @param {ASTNode} node - any node
    +         * @returns {Boolean} whether the given node represents a import declaration
    +         */
    +        function looksLikeImport(node) {
    +            return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" ||
    +                node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier";
             }
     
    -        for (; i < l; ++i) {
    -            if (statements[i].type !== "VariableDeclaration") {
    -                return false;
    +        /**
    +         * Checks whether this variable is on top of the block body
    +         * @param {ASTNode} node - The node to check
    +         * @param {ASTNode[]} statements - collection of ASTNodes for the parent node block
    +         * @returns {Boolean} True if var is on top otherwise false
    +         */
    +        function isVarOnTop(node, statements) {
    +            var i = 0,
    +                l = statements.length;
    +
    +            // skip over directives
    +            for (; i < l; ++i) {
    +                if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) {
    +                    break;
    +                }
                 }
    -            if (statements[i] === node) {
    -                return true;
    +
    +            for (; i < l; ++i) {
    +                if (statements[i].type !== "VariableDeclaration" &&
    +                        (statements[i].type !== "ExportNamedDeclaration" ||
    +                        statements[i].declaration.type !== "VariableDeclaration")) {
    +                    return false;
    +                }
    +                if (statements[i] === node) {
    +                    return true;
    +                }
                 }
    -        }
     
    -        return false;
    -    }
    +            return false;
    +        }
     
    -    /**
    -     * Checks whether variable is on top at the global level
    -     * @param {ASTNode} node - The node to check
    -     * @param {ASTNode} parent - Parent of the node
    -     * @returns {void}
    -     */
    -    function globalVarCheck(node, parent) {
    -        if (!isVarOnTop(node, parent.body)) {
    -            context.report(node, errorMessage);
    +        /**
    +         * Checks whether variable is on top at the global level
    +         * @param {ASTNode} node - The node to check
    +         * @param {ASTNode} parent - Parent of the node
    +         * @returns {void}
    +         */
    +        function globalVarCheck(node, parent) {
    +            if (!isVarOnTop(node, parent.body)) {
    +                context.report(node, errorMessage);
    +            }
             }
    -    }
     
    -    /**
    -     * Checks whether variable is on top at functional block scope level
    -     * @param {ASTNode} node - The node to check
    -     * @param {ASTNode} parent - Parent of the node
    -     * @param {ASTNode} grandParent - Parent of the node's parent
    -     * @returns {void}
    -     */
    -    function blockScopeVarCheck(node, parent, grandParent) {
    -        if (!(/Function/.test(grandParent.type) &&
    -                parent.type === "BlockStatement" &&
    -                isVarOnTop(node, parent.body))) {
    -            context.report(node, errorMessage);
    +        /**
    +         * Checks whether variable is on top at functional block scope level
    +         * @param {ASTNode} node - The node to check
    +         * @param {ASTNode} parent - Parent of the node
    +         * @param {ASTNode} grandParent - Parent of the node's parent
    +         * @returns {void}
    +         */
    +        function blockScopeVarCheck(node, parent, grandParent) {
    +            if (!(/Function/.test(grandParent.type) &&
    +                    parent.type === "BlockStatement" &&
    +                    isVarOnTop(node, parent.body))) {
    +                context.report(node, errorMessage);
    +            }
             }
    -    }
     
    -    //--------------------------------------------------------------------------
    -    // Public API
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "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
    -                    globalVarCheck(node, parent);
    -                } else {
    -                    blockScopeVarCheck(node, parent, grandParent);
    +        //--------------------------------------------------------------------------
    +        // Public API
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            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 === "ExportNamedDeclaration") {
    +                        node = parent;
    +                        parent = grandParent;
    +                        grandParent = ancestors.pop();
    +                    }
    +
    +                    if (parent.type === "Program") { // That means its a global variable
    +                        globalVarCheck(node, parent);
    +                    } else {
    +                        blockScopeVarCheck(node, parent, grandParent);
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/wrap-iife.js b/tools/eslint/lib/rules/wrap-iife.js
    index 87d4d5ed696655..1dd1a0c5af84d1 100644
    --- a/tools/eslint/lib/rules/wrap-iife.js
    +++ b/tools/eslint/lib/rules/wrap-iife.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to flag when IIFE is not wrapped in parens
      * @author Ilya Volodin
    - * @copyright 2013 Ilya Volodin. All rights reserved.
      */
     
     "use strict";
    @@ -10,45 +9,56 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    var style = context.options[0] || "outside";
    -
    -    /**
    -     * Check if the node is wrapped in ()
    -     * @param {ASTNode} node node to evaluate
    -     * @returns {boolean} True if it is wrapped
    -     * @private
    -     */
    -    function wrapped(node) {
    -        var previousToken = context.getTokenBefore(node),
    -            nextToken = context.getTokenAfter(node);
    -        return previousToken && previousToken.value === "(" &&
    -            nextToken && nextToken.value === ")";
    -    }
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require parentheses around immediate `function` invocations",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -    return {
    +        schema: [
    +            {
    +                enum: ["outside", "inside", "any"]
    +            }
    +        ]
    +    },
     
    -        "CallExpression": function(node) {
    -            if (node.callee.type === "FunctionExpression") {
    -                var callExpressionWrapped = wrapped(node),
    -                    functionExpressionWrapped = wrapped(node.callee);
    +    create: function(context) {
     
    -                if (!callExpressionWrapped && !functionExpressionWrapped) {
    -                    context.report(node, "Wrap an immediate function invocation in parentheses.");
    -                } else if (style === "inside" && !functionExpressionWrapped) {
    -                    context.report(node, "Wrap only the function expression in parens.");
    -                } else if (style === "outside" && !callExpressionWrapped) {
    -                    context.report(node, "Move the invocation into the parens that contain the function.");
    -                }
    -            }
    +        var style = context.options[0] || "outside";
    +
    +        /**
    +         * Check if the node is wrapped in ()
    +         * @param {ASTNode} node node to evaluate
    +         * @returns {boolean} True if it is wrapped
    +         * @private
    +         */
    +        function wrapped(node) {
    +            var previousToken = context.getTokenBefore(node),
    +                nextToken = context.getTokenAfter(node);
    +
    +            return previousToken && previousToken.value === "(" &&
    +                nextToken && nextToken.value === ")";
             }
    -    };
     
    -};
    +        return {
    +
    +            CallExpression: function(node) {
    +                if (node.callee.type === "FunctionExpression") {
    +                    var callExpressionWrapped = wrapped(node),
    +                        functionExpressionWrapped = wrapped(node.callee);
    +
    +                    if (!callExpressionWrapped && !functionExpressionWrapped) {
    +                        context.report(node, "Wrap an immediate function invocation in parentheses.");
    +                    } else if (style === "inside" && !functionExpressionWrapped) {
    +                        context.report(node, "Wrap only the function expression in parens.");
    +                    } else if (style === "outside" && !callExpressionWrapped) {
    +                        context.report(node, "Move the invocation into the parens that contain the function.");
    +                    }
    +                }
    +            }
    +        };
     
    -module.exports.schema = [
    -    {
    -        "enum": ["outside", "inside", "any"]
         }
    -];
    +};
    diff --git a/tools/eslint/lib/rules/wrap-regex.js b/tools/eslint/lib/rules/wrap-regex.js
    index f2625cc2b98187..96df3304c8b627 100644
    --- a/tools/eslint/lib/rules/wrap-regex.js
    +++ b/tools/eslint/lib/rules/wrap-regex.js
    @@ -9,30 +9,40 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    return {
    -
    -        "Literal": function(node) {
    -            var token = context.getFirstToken(node),
    -                nodeType = token.type,
    -                source,
    -                grandparent,
    -                ancestors;
    -
    -            if (nodeType === "RegularExpression") {
    -                source = context.getTokenBefore(node);
    -                ancestors = context.getAncestors();
    -                grandparent = ancestors[ancestors.length - 1];
    -
    -                if (grandparent.type === "MemberExpression" && grandparent.object === node &&
    -                    (!source || source.value !== "(")) {
    -                    context.report(node, "Wrap the regexp literal in parens to disambiguate the slash.");
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require parenthesis around regex literals",
    +            category: "Stylistic Issues",
    +            recommended: false
    +        },
    +
    +        schema: []
    +    },
    +
    +    create: function(context) {
    +
    +        return {
    +
    +            Literal: function(node) {
    +                var token = context.getFirstToken(node),
    +                    nodeType = token.type,
    +                    source,
    +                    grandparent,
    +                    ancestors;
    +
    +                if (nodeType === "RegularExpression") {
    +                    source = context.getTokenBefore(node);
    +                    ancestors = context.getAncestors();
    +                    grandparent = ancestors[ancestors.length - 1];
    +
    +                    if (grandparent.type === "MemberExpression" && grandparent.object === node &&
    +                        (!source || source.value !== "(")) {
    +                        context.report(node, "Wrap the regexp literal in parens to disambiguate the slash.");
    +                    }
                     }
                 }
    -        }
    -    };
    +        };
     
    +    }
     };
    -
    -module.exports.schema = [];
    diff --git a/tools/eslint/lib/rules/yield-star-spacing.js b/tools/eslint/lib/rules/yield-star-spacing.js
    index 2ddfe5ce1471aa..e2911b7200524c 100644
    --- a/tools/eslint/lib/rules/yield-star-spacing.js
    +++ b/tools/eslint/lib/rules/yield-star-spacing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Rule to check the spacing around the * in yield* expressions.
      * @author Bryan Smith
    - * @copyright 2015 Bryan Smith. All rights reserved.
      */
     
     "use strict";
    @@ -10,92 +9,105 @@
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -    var sourceCode = context.getSourceCode();
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow spacing around the `*` in `yield*` expressions",
    +            category: "ECMAScript 6",
    +            recommended: false
    +        },
     
    -    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]));
    +        fixable: "whitespace",
     
    -    /**
    -     * 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, " ");
    +        schema: [
    +            {
    +                oneOf: [
    +                    {
    +                        enum: ["before", "after", "both", "neither"]
    +                    },
    +                    {
    +                        type: "object",
    +                        properties: {
    +                            before: {type: "boolean"},
    +                            after: {type: "boolean"}
    +                        },
    +                        additionalProperties: false
                         }
    -                    return fixer.removeRange([leftToken.range[1], rightToken.range[0]]);
    -                }
    -            });
    -        }
    -    }
    +                ]
    +            }
    +        ]
    +    },
    +
    +    create: 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 + " *.";
     
    -    /**
    -     * 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;
    +                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]]);
    +                    }
    +                });
    +            }
             }
     
    -        var tokens = sourceCode.getFirstTokens(node, 3);
    -        var yieldToken = tokens[0];
    -        var starToken = tokens[1];
    -        var nextToken = tokens[2];
    +        /**
    +         * 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;
    +            }
     
    -        checkSpacing("before", yieldToken, starToken);
    -        checkSpacing("after", starToken, nextToken);
    -    }
    +            var tokens = sourceCode.getFirstTokens(node, 3);
    +            var yieldToken = tokens[0];
    +            var starToken = tokens[1];
    +            var nextToken = tokens[2];
     
    -    return {
    -        "YieldExpression": checkExpression
    -    };
    +            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 57ac261b95a790..ce2709ec9a4c39 100644
    --- a/tools/eslint/lib/rules/yoda.js
    +++ b/tools/eslint/lib/rules/yoda.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Rule to require or disallow yoda comparisons
      * @author Nicholas C. Zakas
    - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     "use strict";
     
    @@ -96,15 +94,20 @@ function same(a, b) {
         switch (a.type) {
             case "Identifier":
                 return a.name === b.name;
    +
             case "Literal":
                 return a.value === b.value;
    +
             case "MemberExpression":
    +
                 // x[0] = x[0]
                 // x[y] = x[y]
                 // x.y = x.y
                 return same(a.object, b.object) && same(a.property, b.property);
    +
             case "ThisExpression":
                 return true;
    +
             default:
                 return false;
         }
    @@ -114,129 +117,139 @@ function same(a, b) {
     // Rule Definition
     //------------------------------------------------------------------------------
     
    -module.exports = function(context) {
    -
    -    // Default to "never" (!always) if no option
    -    var always = (context.options[0] === "always");
    -    var exceptRange = (context.options[1] && context.options[1].exceptRange);
    -    var onlyEquality = (context.options[1] && context.options[1].onlyEquality);
    -
    -    /**
    -     * Determines whether node represents a range test.
    -     * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside"
    -     * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and
    -     * both operators must be `<` or `<=`. Finally, the literal on the left side
    -     * must be less than or equal to the literal on the right side so that the
    -     * test makes any sense.
    -     * @param {ASTNode} node LogicalExpression node to test.
    -     * @returns {Boolean} Whether node is a range test.
    -     */
    -    function isRangeTest(node) {
    -        var left = node.left,
    -            right = node.right;
    +module.exports = {
    +    meta: {
    +        docs: {
    +            description: "require or disallow \"Yoda\" conditions",
    +            category: "Best Practices",
    +            recommended: false
    +        },
     
    -        /**
    -         * Determines whether node is of the form `0 <= x && x < 1`.
    -         * @returns {Boolean} Whether node is a "between" range test.
    -         */
    -        function isBetweenTest() {
    -            var leftLiteral, rightLiteral;
    -
    -            return (node.operator === "&&" &&
    -                (leftLiteral = getNormalizedLiteral(left.left)) &&
    -                (rightLiteral = getNormalizedLiteral(right.right)) &&
    -                leftLiteral.value <= rightLiteral.value &&
    -                same(left.right, right.left));
    -        }
    +        schema: [
    +            {
    +                enum: ["always", "never"]
    +            },
    +            {
    +                type: "object",
    +                properties: {
    +                    exceptRange: {
    +                        type: "boolean"
    +                    },
    +                    onlyEquality: {
    +                        type: "boolean"
    +                    }
    +                },
    +                additionalProperties: false
    +            }
    +        ]
    +    },
     
    -        /**
    -         * Determines whether node is of the form `x < 0 || 1 <= x`.
    -         * @returns {Boolean} Whether node is an "outside" range test.
    -         */
    -        function isOutsideTest() {
    -            var leftLiteral, rightLiteral;
    -
    -            return (node.operator === "||" &&
    -                (leftLiteral = getNormalizedLiteral(left.right)) &&
    -                (rightLiteral = getNormalizedLiteral(right.left)) &&
    -                leftLiteral.value <= rightLiteral.value &&
    -                same(left.left, right.right));
    -        }
    +    create: function(context) {
    +
    +        // Default to "never" (!always) if no option
    +        var always = (context.options[0] === "always");
    +        var exceptRange = (context.options[1] && context.options[1].exceptRange);
    +        var onlyEquality = (context.options[1] && context.options[1].onlyEquality);
     
             /**
    -         * Determines whether node is wrapped in parentheses.
    -         * @returns {Boolean} Whether node is preceded immediately by an open
    -         *                    paren token and followed immediately by a close
    -         *                    paren token.
    +         * Determines whether node represents a range test.
    +         * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside"
    +         * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and
    +         * both operators must be `<` or `<=`. Finally, the literal on the left side
    +         * must be less than or equal to the literal on the right side so that the
    +         * test makes any sense.
    +         * @param {ASTNode} node LogicalExpression node to test.
    +         * @returns {Boolean} Whether node is a range test.
              */
    -        function isParenWrapped() {
    -            var tokenBefore, tokenAfter;
    -
    -            return ((tokenBefore = context.getTokenBefore(node)) &&
    -                tokenBefore.value === "(" &&
    -                (tokenAfter = context.getTokenAfter(node)) &&
    -                tokenAfter.value === ")");
    -        }
    -
    -        return (node.type === "LogicalExpression" &&
    -            left.type === "BinaryExpression" &&
    -            right.type === "BinaryExpression" &&
    -            isRangeTestOperator(left.operator) &&
    -            isRangeTestOperator(right.operator) &&
    -            (isBetweenTest() || isOutsideTest()) &&
    -            isParenWrapped());
    -    }
    +        function isRangeTest(node) {
    +            var left = node.left,
    +                right = node.right;
    +
    +            /**
    +             * Determines whether node is of the form `0 <= x && x < 1`.
    +             * @returns {Boolean} Whether node is a "between" range test.
    +             */
    +            function isBetweenTest() {
    +                var leftLiteral, rightLiteral;
    +
    +                return (node.operator === "&&" &&
    +                    (leftLiteral = getNormalizedLiteral(left.left)) &&
    +                    (rightLiteral = getNormalizedLiteral(right.right)) &&
    +                    leftLiteral.value <= rightLiteral.value &&
    +                    same(left.right, right.left));
    +            }
     
    -    //--------------------------------------------------------------------------
    -    // Public
    -    //--------------------------------------------------------------------------
    -
    -    return {
    -        "BinaryExpression": always ? function(node) {
    -
    -            // 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()))
    -            ) {
    -                context.report(node, "Expected literal to be on the left side of " + node.operator + ".");
    +            /**
    +             * Determines whether node is of the form `x < 0 || 1 <= x`.
    +             * @returns {Boolean} Whether node is an "outside" range test.
    +             */
    +            function isOutsideTest() {
    +                var leftLiteral, rightLiteral;
    +
    +                return (node.operator === "||" &&
    +                    (leftLiteral = getNormalizedLiteral(left.right)) &&
    +                    (rightLiteral = getNormalizedLiteral(right.left)) &&
    +                    leftLiteral.value <= rightLiteral.value &&
    +                    same(left.left, right.right));
                 }
     
    -        } : function(node) {
    -
    -            // 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()))
    -            ) {
    -                context.report(node, "Expected literal to be on the right side of " + node.operator + ".");
    +            /**
    +             * Determines whether node is wrapped in parentheses.
    +             * @returns {Boolean} Whether node is preceded immediately by an open
    +             *                    paren token and followed immediately by a close
    +             *                    paren token.
    +             */
    +            function isParenWrapped() {
    +                var tokenBefore, tokenAfter;
    +
    +                return ((tokenBefore = context.getTokenBefore(node)) &&
    +                    tokenBefore.value === "(" &&
    +                    (tokenAfter = context.getTokenAfter(node)) &&
    +                    tokenAfter.value === ")");
                 }
     
    +            return (node.type === "LogicalExpression" &&
    +                left.type === "BinaryExpression" &&
    +                right.type === "BinaryExpression" &&
    +                isRangeTestOperator(left.operator) &&
    +                isRangeTestOperator(right.operator) &&
    +                (isBetweenTest() || isOutsideTest()) &&
    +                isParenWrapped());
             }
    -    };
     
    -};
    +        //--------------------------------------------------------------------------
    +        // Public
    +        //--------------------------------------------------------------------------
    +
    +        return {
    +            BinaryExpression: always ? function(node) {
    +
    +                // 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()))
    +                ) {
    +                    context.report(node, "Expected literal to be on the left side of " + node.operator + ".");
    +                }
    +
    +            } : function(node) {
    +
    +                // 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()))
    +                ) {
    +                    context.report(node, "Expected literal to be on the right side of " + node.operator + ".");
    +                }
     
    -module.exports.schema = [
    -    {
    -        "enum": ["always", "never"]
    -    },
    -    {
    -        "type": "object",
    -        "properties": {
    -            "exceptRange": {
    -                "type": "boolean"
    -            },
    -            "onlyEquality": {
    -                "type": "boolean"
                 }
    -        },
    -        "additionalProperties": false
    +        };
    +
         }
    -];
    +};
    diff --git a/tools/eslint/lib/testers/event-generator-tester.js b/tools/eslint/lib/testers/event-generator-tester.js
    index 3aec32057f3346..00b2d03307a883 100644
    --- a/tools/eslint/lib/testers/event-generator-tester.js
    +++ b/tools/eslint/lib/testers/event-generator-tester.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -19,6 +17,7 @@ var assert = require("assert");
     //------------------------------------------------------------------------------
     
     module.exports = {
    +
         /**
          * Overrideable `describe` function to test.
          * @param {string} text - A description.
    diff --git a/tools/eslint/lib/testers/rule-tester.js b/tools/eslint/lib/testers/rule-tester.js
    index b8e3cbdc1cbfb0..4485e0d5fcc7f8 100644
    --- a/tools/eslint/lib/testers/rule-tester.js
    +++ b/tools/eslint/lib/testers/rule-tester.js
    @@ -1,10 +1,6 @@
     /**
      * @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";
     
    @@ -57,12 +53,18 @@ var lodash = require("lodash"),
     //------------------------------------------------------------------------------
     // Private Members
     //------------------------------------------------------------------------------
    -// testerDefaultConfig must not be modified as it allows to reset the tester to
    -// the initial default configuration
    +
    +/*
    + * 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
    +
    +/*
    + * List every parameters possible on a test case that are not related to eslint
    + * configuration
    + */
     var RuleTesterParameters = [
         "code",
         "filename",
    @@ -89,6 +91,7 @@ function cloneDeeplyExcludesParent(x) {
             }
     
             var retv = {};
    +
             for (var key in x) {
                 if (key !== "parent" && hasOwnProperty(x, key)) {
                     retv[key] = cloneDeeplyExcludesParent(x[key]);
    @@ -139,8 +142,8 @@ function RuleTester(testerConfig) {
          * @type {Object}
          */
         this.testerConfig = lodash.merge(
    -        // we have to clone because merge uses the object on the left for
    -        // recipient
    +
    +        // we have to clone because merge uses the first argument for recipient
             lodash.cloneDeep(defaultConfig),
             testerConfig
         );
    @@ -228,9 +231,11 @@ RuleTester.prototype = {
                     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(
    @@ -245,6 +250,7 @@ RuleTester.prototype = {
     
                 if (item.options) {
                     var options = item.options.concat();
    +
                     options.unshift(1);
                     config.rules[ruleName] = options;
                 } else {
    @@ -269,8 +275,11 @@ RuleTester.prototype = {
     
                 validator.validate(config, "rule-tester");
     
    -            // Setup AST getters.
    -            // To check whether or not AST was not modified in verify.
    +            /*
    +             * Setup AST getters.
    +             * The goal is to check whether or not AST was modified when
    +             * running the rule under test.
    +             */
                 eslint.reset();
                 eslint.on("Program", function(node) {
                     beforeAST = cloneDeeplyExcludesParent(node);
    @@ -282,9 +291,11 @@ RuleTester.prototype = {
     
                 // 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);
    @@ -350,6 +361,9 @@ RuleTester.prototype = {
              * @private
              */
             function testInvalidTemplate(ruleName, item) {
    +            assert.ok(item.errors || item.errors === 0,
    +                "Did not specify errors for an invalid test of " + ruleName);
    +
                 var result = runRuleForItem(ruleName, item);
                 var messages = result.messages;
     
    @@ -368,13 +382,16 @@ RuleTester.prototype = {
                         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.
     
    +                        // 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.
     
    +                        /*
    +                         * 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);
                             }
    @@ -391,6 +408,7 @@ RuleTester.prototype = {
                                 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.");
                         }
    @@ -398,6 +416,7 @@ RuleTester.prototype = {
     
                     if (item.hasOwnProperty("output")) {
                         var fixResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
    +
                         assert.equal(fixResult.output, item.output, "Output is incorrect.");
                     }
     
    @@ -410,8 +429,10 @@ RuleTester.prototype = {
                 );
             }
     
    -        // this creates a mocha test suite and pipes all supplied info
    -        // through one of the templates above.
    +        /*
    +         * 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) {
    diff --git a/tools/eslint/lib/timing.js b/tools/eslint/lib/timing.js
    index 3af3a43c58e9e7..6dfffc19d979eb 100644
    --- a/tools/eslint/lib/timing.js
    +++ b/tools/eslint/lib/timing.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview Tracks performance of individual rules.
      * @author Brandon Mills
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     
     "use strict";
    @@ -57,6 +56,7 @@ function display(data) {
         var rows = Object.keys(data)
             .map(function(key) {
                 var time = data[key];
    +
                 total += time;
                 return [key, time];
             })
    @@ -73,8 +73,12 @@ function display(data) {
         rows.unshift(HEADERS);
     
         var widths = [];
    +
         rows.forEach(function(row) {
    -        var len = row.length, i, n;
    +        var len = row.length,
    +            i,
    +            n;
    +
             for (i = 0; i < len; i++) {
                 n = row[i].length;
                 if (!widths[i] || n > widths[i]) {
    @@ -88,6 +92,7 @@ function display(data) {
                 return ALIGN[index](cell, widths[index]);
             }).join(" | ");
         });
    +
         table.splice(1, 0, widths.map(function(w, index) {
             if (index !== 0 && index !== widths.length - 1) {
                 w++;
    @@ -96,7 +101,7 @@ function display(data) {
             return ALIGN[index](":", w + 1, "-");
         }).join("|"));
     
    -    console.log(table.join("\n"));
    +    console.log(table.join("\n"));      // eslint-disable-line no-console
     }
     
     /* istanbul ignore next */
    @@ -118,6 +123,7 @@ module.exports = (function() {
     
             return function() {
                 var t = process.hrtime();
    +
                 fn.apply(null, Array.prototype.slice.call(arguments));
                 t = process.hrtime(t);
                 data[key] += t[0] * 1e3 + t[1] / 1e6;
    diff --git a/tools/eslint/lib/token-store.js b/tools/eslint/lib/token-store.js
    index 6a0149414236b7..0262b69a521107 100644
    --- a/tools/eslint/lib/token-store.js
    +++ b/tools/eslint/lib/token-store.js
    @@ -1,8 +1,6 @@
     /**
      * @fileoverview Object to handle access and retrieval of tokens.
      * @author Brandon Mills
    - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
    - * @copyright 2014 Brandon Mills. All rights reserved.
      */
     "use strict";
     
    @@ -76,6 +74,7 @@ module.exports = function(tokens) {
          */
         api.getTokensBefore = function(node, beforeCount) {
             var first = starts[node.range[0]];
    +
             return get(first - (beforeCount || 0), first);
         };
     
    @@ -100,6 +99,7 @@ module.exports = function(tokens) {
          */
         api.getTokensAfter = function(node, afterCount) {
             var start = lastTokenIndex(node) + 1;
    +
             return get(start, start + (afterCount || 0));
         };
     
    @@ -136,6 +136,7 @@ module.exports = function(tokens) {
          */
         api.getFirstTokens = function(node, count) {
             var first = starts[node.range[0]];
    +
             return get(
                 first,
                 Math.min(lastTokenIndex(node) + 1, first + (count || 0))
    @@ -160,6 +161,7 @@ module.exports = function(tokens) {
          */
         api.getLastTokens = function(node, count) {
             var last = lastTokenIndex(node) + 1;
    +
             return get(Math.max(starts[node.range[0]], last - (count || 0)), last);
         };
     
    diff --git a/tools/eslint/lib/util.js b/tools/eslint/lib/util.js
    deleted file mode 100644
    index 44d6a7d0cfdcd2..00000000000000
    --- a/tools/eslint/lib/util.js
    +++ /dev/null
    @@ -1,22 +0,0 @@
    -/**
    - * @fileoverview Common utilities.
    - */
    -"use strict";
    -
    -//------------------------------------------------------------------------------
    -// Constants
    -//------------------------------------------------------------------------------
    -
    -/**
    - * 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.
    - */
    -function getLast(xs) {
    -    var length = xs.length;
    -    return (length === 0 ? null : xs[length - 1]);
    -}
    -
    -module.exports = {
    -    getLast: getLast
    -};
    diff --git a/tools/eslint/lib/util/comment-event-generator.js b/tools/eslint/lib/util/comment-event-generator.js
    index fb56ee1c05141a..2989f4ee26ae39 100644
    --- a/tools/eslint/lib/util/comment-event-generator.js
    +++ b/tools/eslint/lib/util/comment-event-generator.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -24,6 +22,7 @@ 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 {
    diff --git a/tools/eslint/lib/util/estraverse.js b/tools/eslint/lib/util/estraverse.js
    deleted file mode 100644
    index d2e0d9a8f10217..00000000000000
    --- a/tools/eslint/lib/util/estraverse.js
    +++ /dev/null
    @@ -1,55 +0,0 @@
    -/**
    - * @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
    index 68e64cba64260d..dadefbd9665eb4 100644
    --- a/tools/eslint/lib/util/glob-util.js
    +++ b/tools/eslint/lib/util/glob-util.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -12,9 +10,11 @@
     
     var debug = require("debug"),
         fs = require("fs"),
    +    path = require("path"),
         glob = require("glob"),
         shell = require("shelljs"),
     
    +    pathUtil = require("./path-util"),
         IgnoredPaths = require("../ignored-paths");
     
     debug = debug("eslint:glob-util");
    @@ -33,12 +33,21 @@ debug = debug("eslint:glob-util");
      *
      * Also makes sure all path separators are POSIX style for `glob` compatibility.
      *
    - * @param {string[]} extensions An array of accepted extensions
    + * @param {object}   [options]                    An options object
    + * @param {string[]} [options.extensions=[".js"]] An array of accepted extensions
    + * @param {string}   [options.cwd=process.cwd()]  The cwd to use to resolve relative pathnames
      * @returns {Function} A function that takes a pathname and returns a glob that
      *                     matches all files with the provided extensions if
      *                     pathname is a directory.
      */
    -function processPath(extensions) {
    +function processPath(options) {
    +    var cwd = (options && options.cwd) || process.cwd();
    +    var extensions = (options && options.extensions) || [".js"];
    +
    +    extensions = extensions.map(function(ext) {
    +        return ext.charAt(0) === "." ? ext.substr(1) : ext;
    +    });
    +
         var suffix = "/**";
     
         if (extensions.length === 1) {
    @@ -56,12 +65,13 @@ function processPath(extensions) {
          */
         return function(pathname) {
             var newPath = pathname;
    +        var resolvedPath = path.resolve(cwd, pathname);
     
    -        if (shell.test("-d", pathname)) {
    +        if (shell.test("-d", resolvedPath)) {
                 newPath = pathname.replace(/[\/\\]$/, "") + suffix;
             }
     
    -        return newPath.replace(/\\/g, "/").replace(/^\.\//, "");
    +        return pathUtil.convertPathToPosix(newPath);
         };
     }
     
    @@ -70,19 +80,15 @@ function processPath(extensions) {
     //------------------------------------------------------------------------------
     
     /**
    - * Resolves the patterns into glob-based patterns for easier handling.
    + * Resolves any directory 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.
    + * @param   {Object} options       An options object.
    + * @returns {string[]} The equivalent glob patterns and filepath strings.
      */
    -function resolveFileGlobPatterns(patterns, extensions) {
    -    extensions = extensions || [".js"];
    +function resolveFileGlobPatterns(patterns, options) {
     
    -    extensions = extensions.map(function(ext) {
    -        return ext.charAt(0) === "." ? ext.substr(1) : ext;
    -    });
    +    var processPathExtensions = processPath(options);
     
    -    var processPathExtensions = processPath(extensions);
         return patterns.map(processPathExtensions);
     }
     
    @@ -92,6 +98,7 @@ function resolveFileGlobPatterns(patterns, extensions) {
      *
      * @param   {string[]} globPatterns            Glob patterns.
      * @param   {Object}   [options]               An options object.
    + * @param   {string}   [options.cwd]           CWD (considered for relative filenames)
      * @param   {boolean}  [options.ignore]        False disables use of .eslintignore.
      * @param   {string}   [options.ignorePath]    The ignore file to use instead of .eslintignore.
      * @param   {string}   [options.ignorePattern] A pattern of files to ignore.
    @@ -99,46 +106,63 @@ function resolveFileGlobPatterns(patterns, extensions) {
      */
     function listFilesToProcess(globPatterns, options) {
         var ignoredPaths,
    -        ignoredPathsList,
             files = [],
             added = {},
    -        globOptions,
    -        rulesKey = "_rules";
    +        globOptions;
    +
    +    var cwd = (options && options.cwd) || process.cwd();
     
         /**
          * Executes the linter on a file defined by the `filename`. Skips
          * unsupported file extensions and any files that are already linted.
          * @param {string} filename The file to be processed
    +     * @param {boolean} shouldWarnIgnored Whether or not a report should be made if
    +     *                                    the file is ignored
          * @returns {void}
          */
    -    function addFile(filename) {
    -        if (ignoredPaths.contains(filename)) {
    -            return;
    +    function addFile(filename, shouldWarnIgnored) {
    +        var ignored = false;
    +        var isSilentlyIgnored;
    +
    +        if (options.ignore !== false) {
    +            if (ignoredPaths.contains(filename, "default")) {
    +                isSilentlyIgnored = true;
    +            }
    +            if (ignoredPaths.contains(filename, "custom")) {
    +                if (shouldWarnIgnored) {
    +                    ignored = true;
    +                } else {
    +                    isSilentlyIgnored = true;
    +                }
    +            }
    +            if (isSilentlyIgnored && !ignored) {
    +                return;
    +            }
             }
    -        filename = fs.realpathSync(filename);
             if (added[filename]) {
                 return;
             }
    -        files.push(filename);
    +        files.push({filename: filename, ignored: ignored});
             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
    +        cwd: cwd
         };
     
         debug("Creating list of files to process.");
         globPatterns.forEach(function(pattern) {
    -        if (shell.test("-f", pattern)) {
    -            addFile(pattern);
    +        var file = path.resolve(cwd, pattern);
    +
    +        if (shell.test("-f", file)) {
    +            addFile(fs.realpathSync(file), !shell.test("-d", file));
             } else {
    -            glob.sync(pattern, globOptions).forEach(addFile);
    +            glob.sync(pattern, globOptions).forEach(function(globMatch) {
    +                addFile(path.resolve(cwd, globMatch), false);
    +            });
             }
         });
     
    diff --git a/tools/eslint/lib/util/hash.js b/tools/eslint/lib/util/hash.js
    new file mode 100644
    index 00000000000000..9f3b734c278e73
    --- /dev/null
    +++ b/tools/eslint/lib/util/hash.js
    @@ -0,0 +1,35 @@
    +/**
    + * @fileoverview Defining the hashing function in one place.
    + * @author Michael Ficarra
    + */
    +
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var murmur = require("imurmurhash");
    +
    +//------------------------------------------------------------------------------
    +// Helpers
    +//------------------------------------------------------------------------------
    +
    +//------------------------------------------------------------------------------
    +// Private
    +//------------------------------------------------------------------------------
    +
    +/**
    + * hash the given string
    + * @param  {string} str the string to hash
    + * @returns {string}    the hash
    + */
    +function hash(str) {
    +    return murmur(str).result().toString(36);
    +}
    +
    +//------------------------------------------------------------------------------
    +// Public Interface
    +//------------------------------------------------------------------------------
    +
    +module.exports = hash;
    diff --git a/tools/eslint/lib/util/keywords.js b/tools/eslint/lib/util/keywords.js
    index dde29c6b76c06a..3fbb77771df5c9 100644
    --- a/tools/eslint/lib/util/keywords.js
    +++ b/tools/eslint/lib/util/keywords.js
    @@ -1,7 +1,6 @@
     /**
      * @fileoverview A shared list of ES3 keywords.
      * @author Josh Perez
    - * @copyright 2015 Jose Roberto Vidal. All rights reserved.
      */
     "use strict";
     
    diff --git a/tools/eslint/lib/util/module-resolver.js b/tools/eslint/lib/util/module-resolver.js
    new file mode 100644
    index 00000000000000..251292280dd3d8
    --- /dev/null
    +++ b/tools/eslint/lib/util/module-resolver.js
    @@ -0,0 +1,88 @@
    +/**
    + * @fileoverview Implements the Node.js require.resolve algorithm
    + * @author Nicholas C. Zakas
    + */
    +
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var lodash = require("lodash"),
    +    Module = require("module");
    +
    +//------------------------------------------------------------------------------
    +// Private
    +//------------------------------------------------------------------------------
    +
    +var DEFAULT_OPTIONS = {
    +
    +    /*
    +     * module.paths is an array of paths to search for resolving things relative
    +     * to this file. Module.globalPaths contains all of the special Node.js
    +     * directories that can also be searched for modules.
    +     *
    +     * Need to check for existence of module.paths because Jest seems not to
    +     * include it. See https://github.com/eslint/eslint/issues/5791.
    +     */
    +    lookupPaths: module.paths ? module.paths.concat(Module.globalPaths) : Module.globalPaths.concat()
    +};
    +
    +/**
    + * Resolves modules based on a set of options.
    + * @param {Object} options The options for resolving modules.
    + * @param {string[]} options.lookupPaths An array of paths to include in the
    + *      lookup with the highest priority paths coming first.
    + * @constructor
    + */
    +function ModuleResolver(options) {
    +    options = options || {};
    +
    +    this.options = lodash.assign({}, DEFAULT_OPTIONS, options);
    +}
    +
    +ModuleResolver.prototype = {
    +
    +    /**
    +     * Resolves the file location of a given module relative to the configured
    +     * lookup paths.
    +     * @param {string} name The module name to resolve.
    +     * @param {string} extraLookupPath An extra path to look into for the module.
    +     *      This path is used with the highest priority.
    +     * @returns {string} The resolved file path for the module.
    +     * @throws {Error} If the module cannot be resolved.
    +     */
    +    resolve: function(name, extraLookupPath) {
    +
    +        /*
    +         * First, clone the lookup paths so we're not messing things up for
    +         * subsequent calls to this function. Then, move the extraLookupPath to the
    +         * top of the lookup paths list so it will be searched first.
    +         */
    +        var lookupPaths = this.options.lookupPaths.concat();
    +
    +        lookupPaths.unshift(extraLookupPath);
    +
    +        /**
    +         * Module._findPath is an internal method to Node.js, then one they use to
    +         * lookup file paths when require() is called. So, we are hooking into the
    +         * exact same logic that Node.js uses.
    +         */
    +        var result = Module._findPath(name, lookupPaths);   // eslint-disable-line no-underscore-dangle
    +
    +        if (!result) {
    +            throw new Error("Cannot find module '" + name + "'");
    +        }
    +
    +        return result;
    +
    +    }
    +
    +};
    +
    +//------------------------------------------------------------------------------
    +// Public API
    +//------------------------------------------------------------------------------
    +
    +module.exports = ModuleResolver;
    diff --git a/tools/eslint/lib/util/node-event-generator.js b/tools/eslint/lib/util/node-event-generator.js
    index 002bd29dfe3ed0..92253f6ca23b6e 100644
    --- a/tools/eslint/lib/util/node-event-generator.js
    +++ b/tools/eslint/lib/util/node-event-generator.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    diff --git a/tools/eslint/lib/util/npm-util.js b/tools/eslint/lib/util/npm-util.js
    index fc9d3a6c7006ef..fd081307fd3cd5 100644
    --- a/tools/eslint/lib/util/npm-util.js
    +++ b/tools/eslint/lib/util/npm-util.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -28,8 +26,10 @@ var fs = require("fs"),
      */
     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;
    @@ -69,10 +69,12 @@ function installSyncSaveDev(packages) {
     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));
         }
    diff --git a/tools/eslint/lib/util/path-util.js b/tools/eslint/lib/util/path-util.js
    new file mode 100644
    index 00000000000000..ddc0b60625acaa
    --- /dev/null
    +++ b/tools/eslint/lib/util/path-util.js
    @@ -0,0 +1,75 @@
    +/**
    + * @fileoverview Common helpers for operations on filenames and paths
    + * @author Ian VanSchooten
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var path = require("path"),
    +    isAbsolute = require("path-is-absolute");
    +
    +//------------------------------------------------------------------------------
    +// Private
    +//------------------------------------------------------------------------------
    +
    +/**
    + * Replace Windows with posix style paths
    + *
    + * @param {string} filepath   Path to convert
    + * @returns {string}          Converted filepath
    + */
    +function convertPathToPosix(filepath) {
    +    var normalizedFilepath = path.normalize(filepath);
    +    var posixFilepath = normalizedFilepath.replace(/\\/g, "/");
    +
    +    return posixFilepath;
    +}
    +
    +/**
    + * Converts an absolute filepath to a relative path from a given base path
    + *
    + * For example, if the filepath is `/my/awesome/project/foo.bar`,
    + * and the base directory is `/my/awesome/project/`,
    + * then this function should return `foo.bar`.
    + *
    + * path.relative() does something similar, but it requires a baseDir (`from` argument).
    + * This function makes it optional and just removes a leading slash if the baseDir is not given.
    + *
    + * It does not take into account symlinks (for now).
    + *
    + * @param {string} filepath  Path to convert to relative path.  If already relative,
    + *                           it will be assumed to be relative to process.cwd(),
    + *                           converted to absolute, and then processed.
    + * @param {string} [baseDir] Absolute base directory to resolve the filepath from.
    + *                           If not provided, all this function will do is remove
    + *                           a leading slash.
    + * @returns {string} Relative filepath
    + */
    +function getRelativePath(filepath, baseDir) {
    +    var relativePath;
    +
    +    if (!isAbsolute(filepath)) {
    +        filepath = path.resolve(filepath);
    +    }
    +    if (baseDir) {
    +        if (!isAbsolute(baseDir)) {
    +            throw new Error("baseDir should be an absolute path");
    +        }
    +        relativePath = path.relative(baseDir, filepath);
    +    } else {
    +        relativePath = filepath.replace(/^\//, "");
    +    }
    +    return relativePath;
    +}
    +
    +//------------------------------------------------------------------------------
    +// Public Interface
    +//------------------------------------------------------------------------------
    +
    +module.exports = {
    +    convertPathToPosix: convertPathToPosix,
    +    getRelativePath: getRelativePath
    +};
    diff --git a/tools/eslint/lib/util/rule-fixer.js b/tools/eslint/lib/util/rule-fixer.js
    index 0f9ef9adf3c73f..91f1033e4260af 100644
    --- a/tools/eslint/lib/util/rule-fixer.js
    +++ b/tools/eslint/lib/util/rule-fixer.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    diff --git a/tools/eslint/lib/util/source-code-fixer.js b/tools/eslint/lib/util/source-code-fixer.js
    index da7a1f98d05b6d..e8c440d7c21e39 100644
    --- a/tools/eslint/lib/util/source-code-fixer.js
    +++ b/tools/eslint/lib/util/source-code-fixer.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -105,11 +103,14 @@ SourceCodeFixer.applyFixes = function(sourceCode, messages) {
     
                 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);
    diff --git a/tools/eslint/lib/util/source-code-util.js b/tools/eslint/lib/util/source-code-util.js
    index 3a5396fdc0e87a..e51c1c124c798f 100644
    --- a/tools/eslint/lib/util/source-code-util.js
    +++ b/tools/eslint/lib/util/source-code-util.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
    @@ -36,11 +34,14 @@ function getSourceCodeOfFile(filename, options) {
         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;
     }
     
    @@ -84,14 +85,17 @@ function getSourceCodeOfFiles(patterns, options, cb) {
             opts = lodash.assign({}, defaultOptions, options);
         }
         debug("constructed options:", opts);
    +    patterns = globUtil.resolveFileGlobPatterns(patterns, opts);
     
    -    patterns = globUtil.resolveFileGlobPatterns(patterns, opts.extensions);
    -    filenames = globUtil.listFilesToProcess(patterns, opts);
    +    filenames = globUtil.listFilesToProcess(patterns, opts).reduce(function(files, fileInfo) {
    +        return !fileInfo.ignored ? files.concat(fileInfo.filename) : files;
    +    }, []);
         if (filenames.length === 0) {
             debug("Did not find any files matching pattern(s): " + patterns);
         }
         filenames.forEach(function(filename) {
             var sourceCode = getSourceCodeOfFile(filename, opts);
    +
             if (sourceCode) {
                 debug("got sourceCode of", filename);
                 sourceCodes[filename] = sourceCode;
    diff --git a/tools/eslint/lib/util/source-code.js b/tools/eslint/lib/util/source-code.js
    index 9dd0a451203a87..adf4df93a6b3ae 100644
    --- a/tools/eslint/lib/util/source-code.js
    +++ b/tools/eslint/lib/util/source-code.js
    @@ -1,8 +1,6 @@
     /**
      * @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";
     
    @@ -12,7 +10,7 @@
     
     var lodash = require("lodash"),
         createTokenStore = require("../token-store.js"),
    -    estraverse = require("./estraverse");
    +    Traverser = require("./traverser");
     
     //------------------------------------------------------------------------------
     // Private
    @@ -126,11 +124,13 @@ function SourceCode(text, ast) {
     
         // 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;
     
    @@ -261,10 +261,11 @@ SourceCode.prototype = {
          * @returns {ASTNode} The node if found or null if not found.
          */
         getNodeByRangeIndex: function(index) {
    -        var result = null;
    -        var resultParent = null;
    +        var result = null,
    +            resultParent = null,
    +            traverser = new Traverser();
     
    -        estraverse.traverse(this.ast, {
    +        traverser.traverse(this.ast, {
                 enter: function(node, parent) {
                     if (node.range[0] <= index && index < node.range[1]) {
                         result = node;
    @@ -294,6 +295,7 @@ SourceCode.prototype = {
          */
         isSpaceBetweenTokens: function(first, second) {
             var text = this.text.slice(first.range[1], second.range[0]);
    +
             return /\s/.test(text.replace(/\/\*.*?\*\//g, ""));
         }
     };
    diff --git a/tools/eslint/lib/util/traverser.js b/tools/eslint/lib/util/traverser.js
    new file mode 100644
    index 00000000000000..03a1c376e153fd
    --- /dev/null
    +++ b/tools/eslint/lib/util/traverser.js
    @@ -0,0 +1,56 @@
    +/**
    + * @fileoverview Wrapper around estraverse
    + * @author Nicholas C. Zakas
    + */
    +"use strict";
    +
    +//------------------------------------------------------------------------------
    +// Requirements
    +//------------------------------------------------------------------------------
    +
    +var estraverse = require("estraverse");
    +
    +//------------------------------------------------------------------------------
    +// Helpers
    +//------------------------------------------------------------------------------
    +
    +var KEY_BLACKLIST = [
    +    "parent",
    +    "leadingComments",
    +    "trailingComments"
    +];
    +
    +/**
    + * Wrapper around an estraverse controller that ensures the correct keys
    + * are visited.
    + * @constructor
    + */
    +function Traverser() {
    +
    +    var controller = Object.create(new estraverse.Controller()),
    +        originalTraverse = controller.traverse;
    +
    +    // intercept call to traverse() and add the fallback key to the visitor
    +    controller.traverse = function(node, visitor) {
    +        visitor.fallback = Traverser.getKeys;
    +        return originalTraverse.call(this, node, visitor);
    +    };
    +
    +    return controller;
    +}
    +
    +/**
    + * Calculates the keys to use for traversal.
    + * @param {ASTNode} node The node to read keys from.
    + * @returns {string[]} An array of keys to visit on the node.
    + * @private
    + */
    +Traverser.getKeys = function(node) {
    +    return Object.keys(node).filter(function(key) {
    +        return KEY_BLACKLIST.indexOf(key) === -1;
    +    });
    +};
    +
    +module.exports = Traverser;
    +
    +
    diff --git a/tools/eslint/messages/plugin-missing.txt b/tools/eslint/messages/plugin-missing.txt
    new file mode 100644
    index 00000000000000..56679528c9bc3f
    --- /dev/null
    +++ b/tools/eslint/messages/plugin-missing.txt
    @@ -0,0 +1,9 @@
    +ESLint couldn't find the plugin "eslint-plugin-<%- pluginName %>". This can happen for a couple different reasons:
    +
    +1. If ESLint is installed globally, then make sure eslint-plugin-<%- pluginName %> is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
    +
    +2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    +
    +    npm i eslint-plugin-<%- pluginName %>@latest --save-dev
    +
    +If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
    diff --git a/tools/eslint/node_modules/.bin/eslint b/tools/eslint/node_modules/.bin/eslint
    new file mode 120000
    index 00000000000000..810e4bcb32af34
    --- /dev/null
    +++ b/tools/eslint/node_modules/.bin/eslint
    @@ -0,0 +1 @@
    +../eslint/bin/eslint.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
    deleted file mode 100644
    index c14d5c67b407d8..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/.editorconfig
    +++ /dev/null
    @@ -1,7 +0,0 @@
    -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
    deleted file mode 100644
    index fcadb2cf97913f..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/.gitattributes
    +++ /dev/null
    @@ -1 +0,0 @@
    -* text eol=lf
    diff --git a/tools/eslint/node_modules/acorn-jsx/.npmignore b/tools/eslint/node_modules/acorn-jsx/.npmignore
    deleted file mode 100644
    index 07e6e472cc75fa..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/.npmignore
    +++ /dev/null
    @@ -1 +0,0 @@
    -/node_modules
    diff --git a/tools/eslint/node_modules/acorn-jsx/.travis.yml b/tools/eslint/node_modules/acorn-jsx/.travis.yml
    deleted file mode 100644
    index ffb9f710ac283a..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/.travis.yml
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -language: node_js
    -node_js: '0.10'
    diff --git a/tools/eslint/node_modules/acorn-jsx/README.md b/tools/eslint/node_modules/acorn-jsx/README.md
    index 6b3826d3fcbdb5..cd9674c0b38b03 100644
    --- a/tools/eslint/node_modules/acorn-jsx/README.md
    +++ b/tools/eslint/node_modules/acorn-jsx/README.md
    @@ -37,6 +37,28 @@ var ast = acorn.parse(code, {
     });
     ```
     
    +Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in ``, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:
    +
    +```javascript
    +var ast = acorn.parse(code, {
    +  plugins: {
    +    jsx: { allowNamespacedObjects: true }
    +  }
    +});
    +```
    +
    +Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
    +
    +```javascript
    +var ast = acorn.parse(code, {
    +  plugins: {
    +    jsx: { allowNamespaces: false }
    +  }
    +});
    +```
    +
    +Note that by default `allowNamespaces` is enabled for spec compliancy.
    +
     ## License
     
     This plugin is issued under the [MIT license](./LICENSE).
    diff --git a/tools/eslint/node_modules/acorn-jsx/inject.js b/tools/eslint/node_modules/acorn-jsx/inject.js
    index bfe0358097d3d2..2bc4e9fd3986f3 100644
    --- a/tools/eslint/node_modules/acorn-jsx/inject.js
    +++ b/tools/eslint/node_modules/acorn-jsx/inject.js
    @@ -198,7 +198,7 @@ module.exports = function(acorn) {
       pp.jsx_parseNamespacedName = function() {
         var startPos = this.start, startLoc = this.startLoc;
         var name = this.jsx_parseIdentifier();
    -    if (!this.eat(tt.colon)) return name;
    +    if (!this.options.plugins.jsx.allowNamespaces || !this.eat(tt.colon)) return name;
         var node = this.startNodeAt(startPos, startLoc);
         node.namespace = name;
         node.name = this.jsx_parseIdentifier();
    @@ -211,6 +211,9 @@ module.exports = function(acorn) {
       pp.jsx_parseElementName = function() {
         var startPos = this.start, startLoc = this.startLoc;
         var node = this.jsx_parseNamespacedName();
    +    if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !this.options.plugins.jsx.allowNamespacedObjects) {
    +      this.unexpected();
    +    }
         while (this.eat(tt.dot)) {
           var newNode = this.startNodeAt(startPos, startLoc);
           newNode.object = node;
    @@ -356,7 +359,20 @@ module.exports = function(acorn) {
         return this.jsx_parseElementAt(startPos, startLoc);
       };
     
    -  acorn.plugins.jsx = function(instance) {
    +  acorn.plugins.jsx = function(instance, opts) {
    +    if (!opts) {
    +      return;
    +    }
    +
    +    if (typeof opts !== 'object') {
    +      opts = {};
    +    }
    +
    +    instance.options.plugins.jsx = {
    +      allowNamespaces: opts.allowNamespaces !== false,
    +      allowNamespacedObjects: !!opts.allowNamespacedObjects
    +    };
    +
         instance.extend('parseExprAtom', function(inner) {
           return function(refShortHandDefaultPos) {
             if (this.type === tt.jsxText)
    diff --git a/tools/eslint/node_modules/acorn-jsx/package.json b/tools/eslint/node_modules/acorn-jsx/package.json
    index 5d5856fee0c529..413b066166ef5e 100644
    --- a/tools/eslint/node_modules/acorn-jsx/package.json
    +++ b/tools/eslint/node_modules/acorn-jsx/package.json
    @@ -1,43 +1,47 @@
     {
       "_args": [
         [
    -      "acorn-jsx@^2.0.1",
    -      "/Users/trott/test/node_modules/eslint/node_modules/espree"
    +      "acorn-jsx@^3.0.0",
    +      "/Users/trott/io.js/tools/node_modules/espree"
         ]
       ],
    -  "_from": "acorn-jsx@>=2.0.1 <3.0.0",
    -  "_id": "acorn-jsx@2.0.1",
    +  "_from": "acorn-jsx@>=3.0.0 <4.0.0",
    +  "_id": "acorn-jsx@3.0.0",
       "_inCache": true,
       "_installable": true,
    -  "_location": "/eslint/acorn-jsx",
    -  "_nodeVersion": "4.0.0",
    +  "_location": "/acorn-jsx",
    +  "_nodeVersion": "5.7.1",
    +  "_npmOperationalInternal": {
    +    "host": "packages-13-west.internal.npmjs.com",
    +    "tmp": "tmp/acorn-jsx-3.0.0.tgz_1457985965089_0.5892153568565845"
    +  },
       "_npmUser": {
         "email": "me@rreverser.com",
         "name": "rreverser"
       },
    -  "_npmVersion": "3.2.2",
    +  "_npmVersion": "3.6.0",
       "_phantomChildren": {},
       "_requested": {
         "name": "acorn-jsx",
    -    "raw": "acorn-jsx@^2.0.1",
    -    "rawSpec": "^2.0.1",
    +    "raw": "acorn-jsx@^3.0.0",
    +    "rawSpec": "^3.0.0",
         "scope": null,
    -    "spec": ">=2.0.1 <3.0.0",
    +    "spec": ">=3.0.0 <4.0.0",
         "type": "range"
       },
       "_requiredBy": [
    -    "/eslint/espree"
    +    "/espree"
       ],
    -  "_resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-2.0.1.tgz",
    -  "_shasum": "0edf9878a5866bca625f52955a1ed9e7d8c5117e",
    +  "_resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.0.tgz",
    +  "_shasum": "c17ca956693571ca3ea70aed415008116cfbd4ad",
       "_shrinkwrap": null,
    -  "_spec": "acorn-jsx@^2.0.1",
    -  "_where": "/Users/trott/test/node_modules/eslint/node_modules/espree",
    +  "_spec": "acorn-jsx@^3.0.0",
    +  "_where": "/Users/trott/io.js/tools/node_modules/espree",
       "bugs": {
         "url": "https://github.com/RReverser/acorn-jsx/issues"
       },
       "dependencies": {
    -    "acorn": "^2.0.1"
    +    "acorn": "^3.0.4"
       },
       "description": "Alternative, faster React.js JSX parser",
       "devDependencies": {
    @@ -46,17 +50,12 @@
       },
       "directories": {},
       "dist": {
    -    "shasum": "0edf9878a5866bca625f52955a1ed9e7d8c5117e",
    -    "tarball": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-2.0.1.tgz"
    +    "shasum": "c17ca956693571ca3ea70aed415008116cfbd4ad",
    +    "tarball": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.0.tgz"
       },
    -  "gitHead": "cdc624d83767518d174a7873054ff9f2984eb83c",
    +  "gitHead": "2b52a0d62820ea12bd95c0a07942cb39afffa349",
       "homepage": "https://github.com/RReverser/acorn-jsx",
    -  "licenses": [
    -    {
    -      "type": "MIT",
    -      "url": "https://raw.githubusercontent.com/RReverser/acorn-jsx/master/LICENSE"
    -    }
    -  ],
    +  "license": "MIT",
       "maintainers": [
         {
           "email": "me@rreverser.com",
    @@ -73,5 +72,5 @@
       "scripts": {
         "test": "node test/run.js"
       },
    -  "version": "2.0.1"
    +  "version": "3.0.0"
     }
    diff --git a/tools/eslint/node_modules/acorn-jsx/test/driver.js b/tools/eslint/node_modules/acorn-jsx/test/driver.js
    deleted file mode 100644
    index 01ec6c619a121b..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/test/driver.js
    +++ /dev/null
    @@ -1,107 +0,0 @@
    -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
    deleted file mode 100644
    index eda0a768a7f663..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/test/run.js
    +++ /dev/null
    @@ -1,70 +0,0 @@
    -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
    deleted file mode 100644
    index 48e6a1d5460bda..00000000000000
    --- a/tools/eslint/node_modules/acorn-jsx/test/tests-jsx.js
    +++ /dev/null
    @@ -1,3719 +0,0 @@
    -// 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/.editorconfig b/tools/eslint/node_modules/acorn/.editorconfig deleted file mode 100644 index c14d5c67b407d8..00000000000000 --- a/tools/eslint/node_modules/acorn/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index fcadb2cf97913f..00000000000000 --- a/tools/eslint/node_modules/acorn/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text eol=lf diff --git a/tools/eslint/node_modules/acorn/.npmignore b/tools/eslint/node_modules/acorn/.npmignore deleted file mode 100644 index ecba2911d26e11..00000000000000 --- a/tools/eslint/node_modules/acorn/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/.tern-port -/test -/local diff --git a/tools/eslint/node_modules/acorn/.travis.yml b/tools/eslint/node_modules/acorn/.travis.yml deleted file mode 100644 index f50c379b624d45..00000000000000 --- a/tools/eslint/node_modules/acorn/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -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 index 0e8f48b695eaa7..cac3f48160d84b 100644 --- a/tools/eslint/node_modules/acorn/AUTHORS +++ b/tools/eslint/node_modules/acorn/AUTHORS @@ -3,6 +3,7 @@ List of Acorn contributors. Updated before every release. Adrian Rakovsky Alistair Braidwood Andres Suarez +Angelo Aparajita Fishman Arian Stolwijk Artem Govorov @@ -10,34 +11,44 @@ Brandon Mills Charles Hughes Conrad Irwin David Bonnet +Domenico Matteo ForbesLindesay Forbes Lindesay Gilad Peleg impinball Ingvar Stepanyan +Jackson Ray Hamilton Jesse McCarthy Jiaxing Wang Joel Kemp Johannes Herr +Jordan Klassen Jürg Lehni keeyipchan +Keheliya Gallaba Kevin Kwok krator Marijn Haverbeke Martin Carlberg Mathias Bynens Mathieu 'p01' Henri +Matthew Bastien Max Schaefer Max Zerzouri Mihai Bazon Mike Rennie +Nicholas C. Zakas Nick Fitzgerald Oskar Schöldström Paul Harper Peter Rust PlNG +Prayag Verma +ReadmeCritic r-e-d +Richard Gibson Rich Harris Sebastian McKenzie Timothy Gu +Toru Nagashima zsjforcn diff --git a/tools/eslint/node_modules/acorn/LICENSE b/tools/eslint/node_modules/acorn/LICENSE index d4c7fc583804df..a35ebf44fd859e 100644 --- a/tools/eslint/node_modules/acorn/LICENSE +++ b/tools/eslint/node_modules/acorn/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2012-2014 by various contributors (see AUTHORS) +Copyright (C) 2012-2016 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 diff --git a/tools/eslint/node_modules/acorn/README.md b/tools/eslint/node_modules/acorn/README.md index 12680abf6b3cc7..5f50c5f929da6a 100644 --- a/tools/eslint/node_modules/acorn/README.md +++ b/tools/eslint/node_modules/acorn/README.md @@ -1,7 +1,7 @@ # 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) +[![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. @@ -62,8 +62,12 @@ 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. + either 3, 5, 6, or 7. This influences support for strict mode, the set + of reserved words, and support for new syntax features. Default is 6. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript 7 features are being + implemented by Acorn. That means that most of the draft standard is + not yet being parsed. - **sourceType**: Indicate the mode the code should be parsed in. Can be either `"script"` or `"module"`. @@ -165,7 +169,8 @@ object referring to that same position. choose. - **directSourceFile**: Like `sourceFile`, but a `sourceFile` property - will be added directly to the nodes, rather than the `loc` object. + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. - **preserveParens**: If this option is `true`, parenthesized expressions are represented by (non-standard) `ParenthesizedExpression` nodes @@ -304,7 +309,7 @@ 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 +- `--ecma3|--ecma5|--ecma6|--ecma7`: Sets the ECMAScript version to parse. Default is version 5. - `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. diff --git a/tools/eslint/node_modules/acorn/bin/acorn b/tools/eslint/node_modules/acorn/bin/acorn index db079096d3749a..63b7615e359ab7 100755 --- a/tools/eslint/node_modules/acorn/bin/acorn +++ b/tools/eslint/node_modules/acorn/bin/acorn @@ -20,14 +20,14 @@ 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("usage: " + (0, _path.basename)(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7]"); 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); + 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 == "--ecma7") options.ecmaVersion = 7;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) { diff --git a/tools/eslint/node_modules/acorn/bin/generate-identifier-regex.js b/tools/eslint/node_modules/acorn/bin/generate-identifier-regex.js index 0d7c50fc384ee5..e9f355103234da 100644 --- a/tools/eslint/node_modules/acorn/bin/generate-identifier-regex.js +++ b/tools/eslint/node_modules/acorn/bin/generate-identifier-regex.js @@ -1,12 +1,18 @@ -// Note: run `npm install unicode-7.0.0` first. - // Which Unicode version should be used? -var version = '7.0.0'; +var version = '8.0.0'; var start = require('unicode-' + version + '/properties/ID_Start/code-points') .filter(function(ch) { return ch > 127; }); +var last = -1; var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/properties/ID_Continue/code-points') - .filter(function(ch) { return ch > 127 && start.indexOf(ch) == -1; })); + .filter(function(ch) { return ch > 127 && search(start, ch, last + 1) == -1; })); + +function search(arr, ch, starting) { + for (var i = starting; arr[i] <= ch && i < arr.length; last = i++) + if (arr[i] === ch) + return i; + return -1; +} function pad(str, width) { while (str.length < width) str = "0" + str; @@ -41,7 +47,7 @@ function generate(chars) { 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) + ";"); +console.log("let nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\""); +console.log("let nonASCIIidentifierChars = \"" + contData.nonASCII + "\""); +console.log("const astralIdentifierStartCodes = " + JSON.stringify(startData.astral)); +console.log("const astralIdentifierCodes = " + JSON.stringify(contData.astral)); diff --git a/tools/eslint/node_modules/acorn/dist/acorn.js b/tools/eslint/node_modules/acorn/dist/acorn.js index 9419f862ae779e..79174768657e84 100644 --- a/tools/eslint/node_modules/acorn/dist/acorn.js +++ b/tools/eslint/node_modules/acorn/dist/acorn.js @@ -45,7 +45,7 @@ pp.checkPropClash = function (prop, propHash) { if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); propHash.proto = true; } return; @@ -54,7 +54,7 @@ pp.checkPropClash = function (prop, propHash) { 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"); + if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) this.raiseRecoverable(key.start, "Redefinition of property"); } else { other = propHash[name] = { init: false, @@ -97,7 +97,7 @@ pp.parseExpression = function (noIn, refDestructuringErrors) { // operators like `+=`. pp.parseMaybeAssign = function (noIn, refDestructuringErrors, afterLeftParse) { - if (this.type == _tokentype.types._yield && this.inGenerator) return this.parseYield(); + if (this.inGenerator && this.isContextual("yield")) return this.parseYield(); var validateDestructuring = false; if (!refDestructuringErrors) { @@ -148,7 +148,7 @@ pp.parseMaybeConditional = function (noIn, refDestructuringErrors) { pp.parseExprOps = function (noIn, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors); + var expr = this.parseMaybeUnary(refDestructuringErrors, false); if (this.checkExpressionErrors(refDestructuringErrors)) return expr; return this.parseExprOp(expr, startPos, startLoc, -1, noIn); }; @@ -163,49 +163,58 @@ 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; + var logical = this.type === _tokentype.types.logicalOR || this.type === _tokentype.types.logicalAND; + var op = this.value; 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"); + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); } } return left; }; +pp.buildBinary = function (startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); +}; + // Parse unary operators, both prefix and postfix. -pp.parseMaybeUnary = function (refDestructuringErrors) { +pp.parseMaybeUnary = function (refDestructuringErrors, sawUnary) { + var startPos = this.start, + startLoc = this.startLoc, + expr = undefined; 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(); + node.argument = this.parseMaybeUnary(null, true); 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"); + if (update) this.checkLVal(node.argument);else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") this.raiseRecoverable(node.start, "Deleting local variable in strict mode");else sawUnary = true; + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + 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; + + if (!sawUnary && this.eat(_tokentype.types.starstar)) return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false);else return expr; }; // Parse call, dot, and `[]`-subscript expressions. @@ -261,15 +270,13 @@ pp.parseExprAtom = function (refDestructuringErrors) { 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; @@ -299,10 +306,6 @@ pp.parseExprAtom = function (refDestructuringErrors) { 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"); @@ -350,10 +353,6 @@ pp.parseParenAndDistinguishExpression = function (canBeArrow) { 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 = [], @@ -430,8 +429,8 @@ pp.parseNew = function () { 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"); + if (node.property.name !== "target") this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); + if (!this.inFunction) this.raiseRecoverable(node.start, "new.target can only be used in functions"); return this.finishNode(node, "MetaProperty"); } var startPos = this.start, @@ -514,7 +513,7 @@ pp.parsePropertyValue = function (prop, isPattern, isGenerator, startPos, startL 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)) { + } 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); @@ -522,13 +521,13 @@ pp.parsePropertyValue = function (prop, isPattern, isGenerator, startPos, startL 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 === "get") this.raiseRecoverable(start, "getter should have no params");else this.raiseRecoverable(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"); + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") this.raiseRecoverable(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); + if (this.keywords.test(prop.key.name) || (this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name) || this.inGenerator && prop.key.name == "yield") this.raiseRecoverable(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; @@ -567,21 +566,27 @@ pp.initFunction = function (node) { // Parse object or class method. pp.parseMethod = function (isGenerator) { - var node = this.startNode(); + var node = this.startNode(), + oldInGen = this.inGenerator; + this.inGenerator = isGenerator; 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); + this.inGenerator = oldInGen; return this.finishNode(node, "FunctionExpression"); }; // Parse arrow function expression with given parameters. pp.parseArrowExpression = function (node, params) { + var oldInGen = this.inGenerator; + this.inGenerator = false; this.initFunction(node); node.params = this.toAssignableList(params, true); this.parseFunctionBody(node, true); + this.inGenerator = oldInGen; return this.finishNode(node, "ArrowFunctionExpression"); }; @@ -597,12 +602,11 @@ pp.parseFunctionBody = function (node, isArrowFunction) { // 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 = []; + this.inFunction = true;this.labels = []; node.body = this.parseBlock(true); node.expression = false; - this.inFunction = oldInFunc;this.inGenerator = oldInGen;this.labels = oldLabels; + this.inFunction = oldInFunc;this.labels = oldLabels; } // If this is a strict mode function, verify that argument names @@ -641,14 +645,16 @@ pp.parseExprList = function (close, allowTrailingComma, allowEmpty, refDestructu 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); + if (allowEmpty && this.type === _tokentype.types.comma) elt = null;else if (this.type === _tokentype.types.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (this.type === _tokentype.types.comma && refDestructuringErrors && !refDestructuringErrors.trailingComma) { + refDestructuringErrors.trailingComma = this.lastTokStart; + } + } else elt = this.parseMaybeAssign(false, refDestructuringErrors); elts.push(elt); } return elts; @@ -662,7 +668,8 @@ 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"); + 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.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved"); + if (!liberal && this.inGenerator && this.value === "yield") this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator"); node.name = this.value; } else if (liberal && this.type.keyword) { node.name = this.type.keyword; @@ -688,38 +695,7 @@ pp.parseYield = function () { 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"; @@ -731,6 +707,7 @@ 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", + 7: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" }; @@ -742,7 +719,7 @@ var ecma5AndLessKeywords = "break case catch continue debugger default do else f var keywords = { 5: ecma5AndLessKeywords, - 6: ecma5AndLessKeywords + " let const class extends export import yield super" + 6: ecma5AndLessKeywords + " const class extends export import super" }; exports.keywords = keywords; @@ -754,8 +731,8 @@ exports.keywords = keywords; // code point above 128. // Generated by `bin/generate-identifier-regex.js`. -var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"; -var nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_"; +var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"; +var nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_"; var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); @@ -766,9 +743,9 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // >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]; +// generated by bin/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, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 287, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 449, 56, 1288, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 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, 3, 5761, 10591, 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, 10, 2, 4, 9, 83, 11, 168, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 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, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 3617, 6, 792618, 239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is @@ -891,7 +868,7 @@ var _whitespace = _dereq_("./whitespace"); exports.isNewLine = _whitespace.isNewLine; exports.lineBreak = _whitespace.lineBreak; exports.lineBreakG = _whitespace.lineBreakG; -var version = "2.7.0"; +var version = "3.1.0"; exports.version = version; // The main exported interface (under `self.acorn` when in the @@ -945,6 +922,8 @@ pp.raise = function (pos, message) { throw err; }; +pp.raiseRecoverable = pp.raise; + pp.curPosition = function () { if (this.options.locations) { return new _locutil.Position(this.curLine, this.pos - this.lineStart); @@ -1155,6 +1134,7 @@ pp.parseBindingList = function (close, allowEmpty, allowTrailingComma, allowNonI var rest = this.parseRest(allowNonIdent); this.parseBindingListItem(rest); elts.push(rest); + if (this.type === _tokentype.types.comma) this.raise(this.start, "Comma is not permitted after the rest element"); this.expect(close); break; } else { @@ -1187,15 +1167,15 @@ pp.parseMaybeDefault = function (startPos, startLoc, left) { 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 (this.strict && this.reservedWordsStrictBind.test(expr.name)) this.raiseRecoverable(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"); + if (_util.has(checkClashes, expr.name)) this.raiseRecoverable(expr.start, "Argument name clash"); checkClashes[expr.name] = true; } break; case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); break; case "ObjectPattern": @@ -1301,8 +1281,8 @@ 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, + // setters and other features. The default is 6. + ecmaVersion: 6, // Source type ("script" or "module") for different semantics sourceType: "script", // `onInsertedSemicolon` can be a callback that will be called @@ -1506,7 +1486,7 @@ pp.unexpected = function (pos) { 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"); + if (pos) this.raise(pos, "Comma is not permitted after the rest element"); }; pp.checkExpressionErrors = function (refDestructuringErrors, andThrow) { @@ -1650,6 +1630,8 @@ var _state = _dereq_("./state"); var _whitespace = _dereq_("./whitespace"); +var _identifier = _dereq_("./identifier"); + var pp = _state.Parser.prototype; // ### Statement parsing @@ -1680,6 +1662,21 @@ pp.parseTopLevel = function (node) { var loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; +pp.isLet = function () { + if (this.type !== _tokentype.types.name || this.options.ecmaVersion < 6 || this.value != "let") return false; + _whitespace.skipWhiteSpace.lastIndex = this.pos; + var skip = _whitespace.skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, + nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh == 123) return true; // '{' and '[' + if (_identifier.isIdentifierStart(nextCh, true)) { + for (var pos = next + 1; _identifier.isIdentifierChar(this.input.charCodeAt(pos, true)); ++pos) {} + var ident = this.input.slice(next, pos); + if (!this.isKeyword(ident)) return true; + } + return false; +}; + // Parse a single statement. // // If expecting a statement and finding a slash operator, parse a @@ -1689,7 +1686,13 @@ var loopLabel = { kind: "loop" }, pp.parseStatement = function (declaration, topLevel) { var starttype = this.type, - node = this.startNode(); + node = this.startNode(), + kind = undefined; + + if (this.isLet()) { + starttype = _tokentype.types._var; + kind = "let"; + } // Most types of statements are recognized by the keyword they // start with. Many are trivial to parse, some require a bit of @@ -1720,10 +1723,10 @@ pp.parseStatement = function (declaration, topLevel) { 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._const:case _tokentype.types._var: + kind = kind || this.value; + if (!declaration && kind != "var") this.unexpected(); + return this.parseVarStatement(node, kind); case _tokentype.types._while: return this.parseWhileStatement(node); case _tokentype.types._with: @@ -1803,13 +1806,14 @@ pp.parseForStatement = function (node) { 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 isLet = this.isLet(); + if (this.type === _tokentype.types._var || this.type === _tokentype.types._const || isLet) { var _init = this.startNode(), - varKind = this.type; + kind = isLet ? "let" : this.value; this.next(); - this.parseVar(_init, true, varKind); + this.parseVar(_init, true, kind); 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); + if ((this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && _init.declarations.length === 1 && !(kind !== "var" && _init.declarations[0].init)) return this.parseForIn(node, _init); return this.parseFor(node, _init); } var refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }; @@ -1873,7 +1877,7 @@ pp.parseSwitchStatement = function (node) { if (isCase) { cur.test = this.parseExpression(); } else { - if (sawDefault) this.raise(this.lastTokStart, "Multiple default clauses"); + if (sawDefault) this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); sawDefault = true; cur.test = null; } @@ -2030,13 +2034,13 @@ pp.parseForIn = function (node, init) { pp.parseVar = function (node, isFor, kind) { node.declarations = []; - node.kind = kind.keyword; + node.kind = kind; 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"))) { + } else if (kind === "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"); @@ -2060,9 +2064,12 @@ pp.parseVarId = function (decl) { pp.parseFunction = function (node, isStatement, allowExpressionBody) { this.initFunction(node); if (this.options.ecmaVersion >= 6) node.generator = this.eat(_tokentype.types.star); + var oldInGen = this.inGenerator; + this.inGenerator = node.generator; if (isStatement || this.type === _tokentype.types.name) node.id = this.parseIdent(); this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody); + this.inGenerator = oldInGen; return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); }; @@ -2117,7 +2124,7 @@ pp.parseClass = function (node, isStatement) { 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 === "get") this.raiseRecoverable(start, "getter should have no params");else this.raiseRecoverable(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"); } @@ -2152,9 +2159,10 @@ pp.parseExport = function (node) { } if (this.eat(_tokentype.types._default)) { // export default ... + var parens = this.type == _tokentype.types.parenL; var expr = this.parseMaybeAssign(); var needsSemi = true; - if (expr.type == "FunctionExpression" || expr.type == "ClassExpression") { + if (!parens && (expr.type == "FunctionExpression" || expr.type == "ClassExpression")) { needsSemi = false; if (expr.id) { expr.type = expr.type == "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; @@ -2191,7 +2199,7 @@ pp.parseExport = function (node) { }; pp.shouldParseExportStatement = function () { - return this.type.keyword; + return this.type.keyword || this.isLet(); }; // Parses a comma-separated list of module exports. @@ -2276,7 +2284,7 @@ pp.parseImportSpecifiers = function () { return nodes; }; -},{"./state":10,"./tokentype":14,"./whitespace":16}],12:[function(_dereq_,module,exports){ +},{"./identifier":2,"./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 @@ -2377,8 +2385,8 @@ _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); +_tokentype.types._function.updateContext = function (prevType) { + if (prevType.beforeExpr && prevType !== _tokentype.types.semi && prevType !== _tokentype.types._else && (prevType !== _tokentype.types.colon || this.curContext() !== types.b_stat)) this.context.push(types.f_expr); this.exprAllowed = false; }; @@ -2629,11 +2637,21 @@ pp.readToken_slash = function () { return this.finishOp(_tokentype.types.slash, 1); }; -pp.readToken_mult_modulo = function (code) { +pp.readToken_mult_modulo_exp = 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); + var size = 1; + var tokentype = code === 42 ? _tokentype.types.star : _tokentype.types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && next === 42) { + ++size; + tokentype = _tokentype.types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) return this.finishOp(_tokentype.types.assign, size + 1); + return this.finishOp(tokentype, size); }; pp.readToken_pipe_amp = function (code) { @@ -2683,7 +2701,7 @@ pp.readToken_lt_gt = function (code) { this.skipSpace(); return this.nextToken(); } - if (next === 61) size = this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2; + if (next === 61) size = 2; return this.finishOp(_tokentype.types.relational, size); }; @@ -2765,7 +2783,7 @@ pp.getTokenFromCode = function (code) { case 37:case 42: // '%*' - return this.readToken_mult_modulo(code); + return this.readToken_mult_modulo_exp(code); case 124:case 38: // '|&' @@ -3243,7 +3261,8 @@ var types = { plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), - slash: binop("/", 10) + slash: binop("/", 10), + starstar: new TokenType("**", { beforeExpr: true }) }; exports.types = types; @@ -3277,7 +3296,6 @@ kw("switch"); kw("throw", beforeExpr); kw("try"); kw("var"); -kw("let"); kw("const"); kw("while", { isLoop: true }); kw("with"); @@ -3288,7 +3306,6 @@ kw("class"); kw("extends", beforeExpr); kw("export"); kw("import"); -kw("yield", { beforeExpr: true, startsExpr: true }); kw("null", startsExpr); kw("true", startsExpr); kw("false", startsExpr); @@ -3334,7 +3351,10 @@ function isNewLine(code) { } var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + exports.nonASCIIwhitespace = nonASCIIwhitespace; +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +exports.skipWhiteSpace = skipWhiteSpace; },{}]},{},[3])(3) }); \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn/dist/acorn_loose.js b/tools/eslint/node_modules/acorn/dist/acorn_loose.js index d18e6aae4d74dc..6528651d310f3f 100644 --- a/tools/eslint/node_modules/acorn/dist/acorn_loose.js +++ b/tools/eslint/node_modules/acorn/dist/acorn_loose.js @@ -52,6 +52,19 @@ lp.parseParenExpression = function () { }; lp.parseMaybeAssign = function (noIn) { + if (this.toks.isContextual("yield")) { + var node = this.startNode(); + this.next(); + if (this.semicolon() || this.canInsertSemicolon() || this.tok.type != _.tokTypes.star && !this.tok.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(_.tokTypes.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression"); + } + var start = this.storeCurrentPos(); var left = this.parseMaybeConditional(noIn); if (this.tok.type.isAssign) { @@ -82,7 +95,7 @@ lp.parseExprOps = function (noIn) { var start = this.storeCurrentPos(); var indent = this.curIndent, line = this.curLineStart; - return this.parseExprOp(this.parseMaybeUnary(noIn), start, -1, noIn, indent, line); + return this.parseExprOp(this.parseMaybeUnary(false), start, -1, noIn, indent, line); }; lp.parseExprOp = function (left, start, minPrec, noIn, indent, line) { @@ -98,7 +111,7 @@ lp.parseExprOp = function (left, start, minPrec, noIn, indent, line) { node.right = this.dummyIdent(); } else { var rightStart = this.storeCurrentPos(); - node.right = this.parseExprOp(this.parseMaybeUnary(noIn), rightStart, prec, noIn, indent, line); + node.right = this.parseExprOp(this.parseMaybeUnary(false), rightStart, prec, noIn, indent, line); } this.finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression"); return this.parseExprOp(node, start, minPrec, noIn, indent, line); @@ -107,32 +120,44 @@ lp.parseExprOp = function (left, start, minPrec, noIn, indent, line) { return left; }; -lp.parseMaybeUnary = function (noIn) { +lp.parseMaybeUnary = function (sawUnary) { + var start = this.storeCurrentPos(), + expr = undefined; if (this.tok.type.prefix) { var node = this.startNode(), update = this.tok.type === _.tokTypes.incDec; + if (!update) sawUnary = true; node.operator = this.tok.value; node.prefix = true; this.next(); - node.argument = this.parseMaybeUnary(noIn); + node.argument = this.parseMaybeUnary(true); if (update) node.argument = this.checkLVal(node.argument); - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else if (this.tok.type === _.tokTypes.ellipsis) { var node = this.startNode(); this.next(); - node.argument = this.parseMaybeUnary(noIn); - return this.finishNode(node, "SpreadElement"); + node.argument = this.parseMaybeUnary(sawUnary); + expr = this.finishNode(node, "SpreadElement"); + } else { + expr = this.parseExprSubscripts(); + while (this.tok.type.postfix && !this.canInsertSemicolon()) { + var node = this.startNodeAt(start); + node.operator = this.tok.value; + node.prefix = false; + node.argument = this.checkLVal(expr); + this.next(); + expr = this.finishNode(node, "UpdateExpression"); + } } - var start = this.storeCurrentPos(); - var expr = this.parseExprSubscripts(); - while (this.tok.type.postfix && !this.canInsertSemicolon()) { + + if (!sawUnary && this.eat(_.tokTypes.starstar)) { var node = this.startNodeAt(start); - node.operator = this.tok.value; - node.prefix = false; - node.argument = this.checkLVal(expr); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); + node.operator = "**"; + node.left = expr; + node.right = this.parseMaybeUnary(false); + return this.finishNode(node, "BinaryExpression"); } + return expr; }; @@ -251,18 +276,6 @@ lp.parseExprAtom = function () { case _.tokTypes._new: return this.parseNew(); - case _.tokTypes._yield: - node = this.startNode(); - this.next(); - if (this.semicolon() || this.canInsertSemicolon() || this.tok.type != _.tokTypes.star && !this.tok.type.startsExpr) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(_.tokTypes.star); - node.argument = this.parseMaybeAssign(); - } - return this.finishNode(node, "YieldExpression"); - case _.tokTypes.backQuote: return this.parseTemplate(); @@ -317,6 +330,7 @@ lp.parseTemplate = function () { curElt = this.startNode(); curElt.value = { cooked: '', raw: '' }; curElt.tail = true; + this.finishNode(curElt, "TemplateElement"); } node.quasis.push(curElt); } @@ -355,7 +369,7 @@ lp.parseObj = function () { prop.kind = "init"; prop.method = true; prop.value = this.parseMethod(isGenerator); - } else if (this.options.ecmaVersion >= 5 && prop.key.type === "Identifier" && !prop.computed && (prop.key.name === "get" || prop.key.name === "set") && (this.tok.type != _.tokTypes.comma && this.tok.type != _.tokTypes.braceR)) { + } else if (this.options.ecmaVersion >= 5 && prop.key.type === "Identifier" && !prop.computed && (prop.key.name === "get" || prop.key.name === "set") && this.tok.type != _.tokTypes.comma && this.tok.type != _.tokTypes.braceR) { prop.kind = prop.key.name; this.parsePropertyName(prop); prop.value = this.parseMethod(false); @@ -784,7 +798,13 @@ lp.parseTopLevel = function () { lp.parseStatement = function () { var starttype = this.tok.type, - node = this.startNode(); + node = this.startNode(), + kind = undefined; + + if (this.toks.isLet()) { + starttype = _.tokTypes._var; + kind = "let"; + } switch (starttype) { case _.tokTypes._break:case _.tokTypes._continue: @@ -815,8 +835,9 @@ lp.parseStatement = function () { this.pushCx(); this.expect(_.tokTypes.parenL); if (this.tok.type === _.tokTypes.semi) return this.parseFor(node, null); - if (this.tok.type === _.tokTypes._var || this.tok.type === _.tokTypes._let || this.tok.type === _.tokTypes._const) { - var _init = this.parseVar(true); + var isLet = this.toks.isLet(); + if (isLet || this.tok.type === _.tokTypes._var || this.tok.type === _.tokTypes._const) { + var _init = this.parseVar(true, isLet ? "let" : this.tok.value); if (_init.declarations.length === 1 && (this.tok.type === _.tokTypes._in || this.isContextual("of"))) { return this.parseForIn(node, _init); } @@ -901,9 +922,8 @@ lp.parseStatement = function () { return this.finishNode(node, "TryStatement"); case _.tokTypes._var: - case _.tokTypes._let: case _.tokTypes._const: - return this.parseVar(); + return this.parseVar(false, kind || this.tok.value); case _.tokTypes._while: this.next(); @@ -986,9 +1006,9 @@ lp.parseForIn = function (node, init) { return this.finishNode(node, type); }; -lp.parseVar = function (noIn) { +lp.parseVar = function (noIn, kind) { var node = this.startNode(); - node.kind = this.tok.type.keyword; + node.kind = kind; this.next(); node.declarations = []; do { @@ -1032,7 +1052,7 @@ lp.parseClass = function (isStatement) { if (_parseutil.isDummy(method.key)) { if (_parseutil.isDummy(this.parseMaybeAssign())) this.next();this.eat(_.tokTypes.comma);continue; } - if (method.key.type === "Identifier" && !method.computed && method.key.name === "static" && (this.tok.type != _.tokTypes.parenL && this.tok.type != _.tokTypes.braceL)) { + if (method.key.type === "Identifier" && !method.computed && method.key.name === "static" && this.tok.type != _.tokTypes.parenL && this.tok.type != _.tokTypes.braceL) { method["static"] = true; isGenerator = this.eat(_.tokTypes.star); this.parsePropertyName(method); @@ -1097,7 +1117,7 @@ lp.parseExport = function () { this.semicolon(); return this.finishNode(node, "ExportDefaultDeclaration"); } - if (this.tok.type.keyword) { + if (this.tok.type.keyword || this.toks.isLet()) { node.declaration = this.parseStatement(); node.specifiers = []; node.source = null; diff --git a/tools/eslint/node_modules/acorn/dist/walk.js b/tools/eslint/node_modules/acorn/dist/walk.js index 9429e0b34fb2c4..6c97891b927a7f 100644 --- a/tools/eslint/node_modules/acorn/dist/walk.js +++ b/tools/eslint/node_modules/acorn/dist/walk.js @@ -216,12 +216,13 @@ base.ThrowStatement = base.SpreadElement = function (node, st, c) { }; base.TryStatement = function (node, st, c) { c(node.block, st, "Statement"); - if (node.handler) { - c(node.handler.param, st, "Pattern"); - c(node.handler.body, st, "ScopeBody"); - } + if (node.handler) c(node.handler, st); if (node.finalizer) c(node.finalizer, st, "Statement"); }; +base.CatchClause = function (node, st, c) { + c(node.param, st, "Pattern"); + c(node.body, st, "ScopeBody"); +}; base.WhileStatement = base.DoWhileStatement = function (node, st, c) { c(node.test, st, "Expression"); c(node.body, st, "Statement"); @@ -367,11 +368,6 @@ base.MethodDefinition = base.Property = function (node, st, c) { if (node.computed) c(node.key, st, "Expression"); c(node.value, st, "Expression"); }; -base.ComprehensionExpression = function (node, st, c) { - for (var i = 0; i < node.blocks.length; i++) { - c(node.blocks[i].right, st, "Expression"); - }c(node.body, st, "Expression"); -}; },{}]},{},[1])(1) }); \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn/package.json b/tools/eslint/node_modules/acorn/package.json index aa915637cbf482..7687200401a6ae 100644 --- a/tools/eslint/node_modules/acorn/package.json +++ b/tools/eslint/node_modules/acorn/package.json @@ -1,39 +1,43 @@ { "_args": [ [ - "acorn@^2.7.0", - "/Users/trott/test/node_modules/eslint/node_modules/espree" + "acorn@^3.1.0", + "/Users/trott/io.js/tools/node_modules/espree" ] ], - "_from": "acorn@>=2.7.0 <3.0.0", - "_id": "acorn@2.7.0", + "_from": "acorn@>=3.1.0 <4.0.0", + "_id": "acorn@3.1.0", "_inCache": true, "_installable": true, - "_location": "/eslint/acorn", - "_nodeVersion": "4.2.2", + "_location": "/acorn", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/acorn-3.1.0.tgz_1460967388002_0.5425194606650621" + }, "_npmUser": { "email": "marijnh@gmail.com", "name": "marijn" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { "name": "acorn", - "raw": "acorn@^2.7.0", - "rawSpec": "^2.7.0", + "raw": "acorn@^3.1.0", + "rawSpec": "^3.1.0", "scope": null, - "spec": ">=2.7.0 <3.0.0", + "spec": ">=3.1.0 <4.0.0", "type": "range" }, "_requiredBy": [ - "/eslint/acorn-jsx", - "/eslint/espree" + "/acorn-jsx", + "/espree" ], - "_resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", - "_shasum": "ab6e7d9d886aaca8b085bc3312b79a198433f0e7", + "_resolved": "https://registry.npmjs.org/acorn/-/acorn-3.1.0.tgz", + "_shasum": "e79a281c23983ccc079471a849866067e7f0c693", "_shrinkwrap": null, - "_spec": "acorn@^2.7.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/espree", + "_spec": "acorn@^3.1.0", + "_where": "/Users/trott/io.js/tools/node_modules/espree", "bin": { "acorn": "./bin/acorn" }, @@ -53,6 +57,9 @@ { "name": "Andres Suarez" }, + { + "name": "Angelo" + }, { "name": "Aparajita Fishman" }, @@ -74,6 +81,9 @@ { "name": "David Bonnet" }, + { + "name": "Domenico Matteo" + }, { "name": "ForbesLindesay" }, @@ -89,6 +99,9 @@ { "name": "Ingvar Stepanyan" }, + { + "name": "Jackson Ray Hamilton" + }, { "name": "Jesse McCarthy" }, @@ -101,12 +114,18 @@ { "name": "Johannes Herr" }, + { + "name": "Jordan Klassen" + }, { "name": "Jürg Lehni" }, { "name": "keeyipchan" }, + { + "name": "Keheliya Gallaba" + }, { "name": "Kevin Kwok" }, @@ -125,6 +144,9 @@ { "name": "Mathieu 'p01' Henri" }, + { + "name": "Matthew Bastien" + }, { "name": "Max Schaefer" }, @@ -137,6 +159,9 @@ { "name": "Mike Rennie" }, + { + "name": "Nicholas C. Zakas" + }, { "name": "Nick Fitzgerald" }, @@ -152,9 +177,18 @@ { "name": "PlNG" }, + { + "name": "Prayag Verma" + }, + { + "name": "ReadmeCritic" + }, { "name": "r-e-d" }, + { + "name": "Richard Gibson" + }, { "name": "Rich Harris" }, @@ -164,6 +198,9 @@ { "name": "Timothy Gu" }, + { + "name": "Toru Nagashima" + }, { "name": "zsjforcn" } @@ -175,17 +212,17 @@ "babelify": "^6.1.2", "browserify": "^10.2.4", "browserify-derequire": "^0.9.4", - "unicode-7.0.0": "~0.1.5" + "unicode-8.0.0": "^0.1.5" }, "directories": {}, "dist": { - "shasum": "ab6e7d9d886aaca8b085bc3312b79a198433f0e7", - "tarball": "http://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz" + "shasum": "e79a281c23983ccc079471a849866067e7f0c693", + "tarball": "https://registry.npmjs.org/acorn/-/acorn-3.1.0.tgz" }, "engines": { "node": ">=0.4.0" }, - "gitHead": "1405436064bff087f14af55a763396aa5c0ca148", + "gitHead": "3c5ef61cc55dc887cbb807fa8d6917d6af85af51", "homepage": "https://github.com/ternjs/acorn", "license": "MIT", "main": "dist/acorn.js", @@ -210,5 +247,5 @@ "prepublish": "node bin/build-acorn.js", "test": "node test/run.js" }, - "version": "2.7.0" + "version": "3.1.0" } diff --git a/tools/eslint/node_modules/acorn/src/bin/acorn.js b/tools/eslint/node_modules/acorn/src/bin/acorn.js index 71a5dffcd8c746..4d7ce83a3546a0 100644 --- a/tools/eslint/node_modules/acorn/src/bin/acorn.js +++ b/tools/eslint/node_modules/acorn/src/bin/acorn.js @@ -9,7 +9,7 @@ const options = {} function help(status) { const print = (status == 0) ? console.log : console.error - print("usage: " + basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6]") + print("usage: " + basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7]") print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]") process.exit(status) } @@ -21,6 +21,7 @@ for (let i = 2; i < process.argv.length; ++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 == "--ecma7") options.ecmaVersion = 7 else if (arg == "--locations") options.locations = true else if (arg == "--allow-hash-bang") options.allowHashBang = true else if (arg == "--silent") silent = true diff --git a/tools/eslint/node_modules/acorn/src/expression.js b/tools/eslint/node_modules/acorn/src/expression.js index 5f5b8a3623012a..31781453f1586c 100644 --- a/tools/eslint/node_modules/acorn/src/expression.js +++ b/tools/eslint/node_modules/acorn/src/expression.js @@ -38,7 +38,7 @@ pp.checkPropClash = function(prop, propHash) { let {kind} = prop if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property") propHash.proto = true } return @@ -48,7 +48,7 @@ pp.checkPropClash = function(prop, propHash) { if (other) { let isGetSet = kind !== "init" if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) - this.raise(key.start, "Redefinition of property") + this.raiseRecoverable(key.start, "Redefinition of property") } else { other = propHash[name] = { init: false, @@ -90,7 +90,7 @@ pp.parseExpression = function(noIn, refDestructuringErrors) { // operators like `+=`. pp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { - if (this.type == tt._yield && this.inGenerator) return this.parseYield() + if (this.inGenerator && this.isContextual("yield")) return this.parseYield() let validateDestructuring = false if (!refDestructuringErrors) { @@ -139,7 +139,7 @@ pp.parseMaybeConditional = function(noIn, refDestructuringErrors) { pp.parseExprOps = function(noIn, refDestructuringErrors) { let startPos = this.start, startLoc = this.startLoc - let expr = this.parseMaybeUnary(refDestructuringErrors) + let expr = this.parseMaybeUnary(refDestructuringErrors, false) if (this.checkExpressionErrors(refDestructuringErrors)) return expr return this.parseExprOp(expr, startPos, startLoc, -1, noIn) } @@ -154,49 +154,61 @@ pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { let prec = this.type.binop if (prec != null && (!noIn || this.type !== tt._in)) { if (prec > minPrec) { - let node = this.startNodeAt(leftStartPos, leftStartLoc) - node.left = left - node.operator = this.value - let op = this.type + let logical = this.type === tt.logicalOR || this.type === tt.logicalAND + let op = this.value this.next() let startPos = this.start, startLoc = this.startLoc - node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn) - this.finishNode(node, (op === tt.logicalOR || op === tt.logicalAND) ? "LogicalExpression" : "BinaryExpression") + let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn) + let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical) return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) } } return left } +pp.buildBinary = function(startPos, startLoc, left, right, op, logical) { + let node = this.startNodeAt(startPos, startLoc) + node.left = left + node.operator = op + node.right = right + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") +} + // Parse unary operators, both prefix and postfix. -pp.parseMaybeUnary = function(refDestructuringErrors) { +pp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + let startPos = this.start, startLoc = this.startLoc, expr if (this.type.prefix) { let node = this.startNode(), update = this.type === tt.incDec node.operator = this.value node.prefix = true this.next() - node.argument = this.parseMaybeUnary() + node.argument = this.parseMaybeUnary(null, true) 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") - } - let startPos = this.start, startLoc = this.startLoc - let expr = this.parseExprSubscripts(refDestructuringErrors) - if (this.checkExpressionErrors(refDestructuringErrors)) return expr - while (this.type.postfix && !this.canInsertSemicolon()) { - let 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") + this.raiseRecoverable(node.start, "Deleting local variable in strict mode") + else sawUnary = true + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") + } else { + expr = this.parseExprSubscripts(refDestructuringErrors) + if (this.checkExpressionErrors(refDestructuringErrors)) return expr + while (this.type.postfix && !this.canInsertSemicolon()) { + let 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 + + if (!sawUnary && this.eat(tt.starstar)) + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) + else + return expr } // Parse call, dot, and `[]`-subscript expressions. @@ -204,7 +216,7 @@ pp.parseMaybeUnary = function(refDestructuringErrors) { pp.parseExprSubscripts = function(refDestructuringErrors) { let startPos = this.start, startLoc = this.startLoc let expr = this.parseExprAtom(refDestructuringErrors) - let skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + let skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")" if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr return this.parseSubscripts(expr, startPos, startLoc) } @@ -251,15 +263,13 @@ pp.parseExprAtom = function(refDestructuringErrors) { case tt._super: if (!this.inFunction) this.raise(this.start, "'super' outside of function or class") + case tt._this: let type = this.type === tt._this ? "ThisExpression" : "Super" node = this.startNode() this.next() return this.finishNode(node, type) - case tt._yield: - if (this.inGenerator) this.unexpected() - case tt.name: let startPos = this.start, startLoc = this.startLoc let id = this.parseIdent(this.type !== tt.name) @@ -289,10 +299,6 @@ pp.parseExprAtom = function(refDestructuringErrors) { case tt.bracketL: node = this.startNode() this.next() - // check whether this is array comprehension or regular array - if (this.options.ecmaVersion >= 7 && this.type === tt._for) { - return this.parseComprehension(node, false) - } node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors) return this.finishNode(node, "ArrayExpression") @@ -338,10 +344,6 @@ pp.parseParenAndDistinguishExpression = function(canBeArrow) { if (this.options.ecmaVersion >= 6) { this.next() - if (this.options.ecmaVersion >= 7 && this.type === tt._for) { - return this.parseComprehension(this.startNodeAt(startPos, startLoc), true) - } - let innerStartPos = this.start, innerStartLoc = this.startLoc let exprList = [], first = true let refDestructuringErrors = {shorthandAssign: 0, trailingComma: 0}, spreadStart, innerParenStart @@ -414,9 +416,9 @@ pp.parseNew = function() { 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") + this.raiseRecoverable(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") + this.raiseRecoverable(node.start, "new.target can only be used in functions") return this.finishNode(node, "MetaProperty") } let startPos = this.start, startLoc = this.startLoc @@ -506,18 +508,19 @@ pp.parsePropertyValue = function(prop, isPattern, isGenerator, startPos, startLo if (prop.value.params.length !== paramCount) { let start = prop.value.start if (prop.kind === "get") - this.raise(start, "getter should have no params"); + this.raiseRecoverable(start, "getter should have no params") else - this.raise(start, "setter should have exactly one param") + this.raiseRecoverable(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") + this.raiseRecoverable(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) + (this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name) || + (this.inGenerator && prop.key.name == "yield")) + this.raiseRecoverable(prop.key.start, "Binding " + prop.key.name) prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) } else if (this.type === tt.eq && refDestructuringErrors) { if (!refDestructuringErrors.shorthandAssign) @@ -557,22 +560,27 @@ pp.initFunction = function(node) { // Parse object or class method. pp.parseMethod = function(isGenerator) { - let node = this.startNode() + let node = this.startNode(), oldInGen = this.inGenerator + this.inGenerator = isGenerator this.initFunction(node) this.expect(tt.parenL) node.params = this.parseBindingList(tt.parenR, false, false) if (this.options.ecmaVersion >= 6) node.generator = isGenerator this.parseFunctionBody(node, false) + this.inGenerator = oldInGen return this.finishNode(node, "FunctionExpression") } // Parse arrow function expression with given parameters. pp.parseArrowExpression = function(node, params) { + let oldInGen = this.inGenerator + this.inGenerator = false this.initFunction(node) node.params = this.toAssignableList(params, true) this.parseFunctionBody(node, true) + this.inGenerator = oldInGen return this.finishNode(node, "ArrowFunctionExpression") } @@ -587,11 +595,11 @@ pp.parseFunctionBody = function(node, isArrowFunction) { } else { // Start a new scope with regard to labels and the `inFunction` // flag (restore them to their old value afterwards). - let oldInFunc = this.inFunction, oldInGen = this.inGenerator, oldLabels = this.labels - this.inFunction = true; this.inGenerator = node.generator; this.labels = [] + let oldInFunc = this.inFunction, oldLabels = this.labels + this.inFunction = true; this.labels = [] node.body = this.parseBlock(true) node.expression = false - this.inFunction = oldInFunc; this.inGenerator = oldInGen; this.labels = oldLabels + this.inFunction = oldInFunc; this.labels = oldLabels } // If this is a strict mode function, verify that argument names @@ -602,10 +610,10 @@ pp.parseFunctionBody = function(node, isArrowFunction) { this.strict = true if (node.id) this.checkLVal(node.id, true) - this.checkParams(node); + this.checkParams(node) this.strict = oldStrict } else if (isArrowFunction) { - this.checkParams(node); + this.checkParams(node) } } @@ -613,10 +621,10 @@ pp.parseFunctionBody = function(node, isArrowFunction) { // or "arguments" and duplicate parameters. pp.checkParams = function(node) { - let nameHash = {}; + let nameHash = {} for (let 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 @@ -629,18 +637,18 @@ pp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructur while (!this.eat(close)) { if (!first) { this.expect(tt.comma) - if (this.type === close && refDestructuringErrors && !refDestructuringErrors.trailingComma) { - refDestructuringErrors.trailingComma = this.lastTokStart - } if (allowTrailingComma && this.afterTrailingComma(close)) break } else first = false let elt if (allowEmpty && this.type === tt.comma) elt = null - else if (this.type === tt.ellipsis) + else if (this.type === tt.ellipsis) { elt = this.parseSpread(refDestructuringErrors) - else + if (this.type === tt.comma && refDestructuringErrors && !refDestructuringErrors.trailingComma) { + refDestructuringErrors.trailingComma = this.lastTokStart + } + } else elt = this.parseMaybeAssign(false, refDestructuringErrors) elts.push(elt) } @@ -658,7 +666,9 @@ pp.parseIdent = function(liberal) { 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") + this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved") + if (!liberal && this.inGenerator && this.value === "yield") + this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator") node.name = this.value } else if (liberal && this.type.keyword) { node.name = this.type.keyword @@ -683,25 +693,3 @@ pp.parseYield = function() { } return this.finishNode(node, "YieldExpression") } - -// Parses array and generator comprehensions. - -pp.parseComprehension = function(node, isGenerator) { - node.blocks = [] - while (this.type === tt._for) { - let block = this.startNode() - this.next() - this.expect(tt.parenL) - block.left = this.parseBindingAtom() - this.checkLVal(block.left, true) - this.expectContextual("of") - block.right = this.parseExpression() - this.expect(tt.parenR) - node.blocks.push(this.finishNode(block, "ComprehensionBlock")) - } - node.filter = this.eat(tt._if) ? this.parseParenExpression() : null - node.body = this.parseExpression() - this.expect(isGenerator ? tt.parenR : tt.bracketR) - node.generator = isGenerator - return this.finishNode(node, "ComprehensionExpression") -} diff --git a/tools/eslint/node_modules/acorn/src/identifier.js b/tools/eslint/node_modules/acorn/src/identifier.js index 59ead4388e186f..0be50dc40bee0b 100644 --- a/tools/eslint/node_modules/acorn/src/identifier.js +++ b/tools/eslint/node_modules/acorn/src/identifier.js @@ -1,18 +1,10 @@ -// 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 export const 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", + 7: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" } @@ -23,7 +15,7 @@ var ecma5AndLessKeywords = "break case catch continue debugger default do else f export const keywords = { 5: ecma5AndLessKeywords, - 6: ecma5AndLessKeywords + " let const class extends export import yield super" + 6: ecma5AndLessKeywords + " const class extends export import super" } // ## Character categories @@ -34,8 +26,8 @@ export const keywords = { // code point above 128. // Generated by `bin/generate-identifier-regex.js`. -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\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" -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2d\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b4\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ad\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc" +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]") const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]") @@ -46,9 +38,9 @@ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null // >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] +// generated by bin/generate-identifier-regex.js +const 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,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,287,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,1288,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,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,3,5761,10591,541] +const astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,168,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,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,513,54,5,49,9,0,15,0,23,4,2,14,3617,6,792618,239] // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is diff --git a/tools/eslint/node_modules/acorn/src/index.js b/tools/eslint/node_modules/acorn/src/index.js index 8215f1b8182b53..a585dea5bfaaad 100644 --- a/tools/eslint/node_modules/acorn/src/index.js +++ b/tools/eslint/node_modules/acorn/src/index.js @@ -36,7 +36,7 @@ export {isIdentifierChar, isIdentifierStart} from "./identifier" export {Token} from "./tokenize" export {isNewLine, lineBreak, lineBreakG} from "./whitespace" -export const version = "2.7.0" +export const version = "3.1.0" // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/tools/eslint/node_modules/acorn/src/location.js b/tools/eslint/node_modules/acorn/src/location.js index 4625dc38899025..99e71234cc4125 100644 --- a/tools/eslint/node_modules/acorn/src/location.js +++ b/tools/eslint/node_modules/acorn/src/location.js @@ -17,6 +17,8 @@ pp.raise = function(pos, message) { throw err } +pp.raiseRecoverable = pp.raise + pp.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) diff --git a/tools/eslint/node_modules/acorn/src/loose/expression.js b/tools/eslint/node_modules/acorn/src/loose/expression.js index f3712c0eee4d29..5bff0d1a1a7337 100644 --- a/tools/eslint/node_modules/acorn/src/loose/expression.js +++ b/tools/eslint/node_modules/acorn/src/loose/expression.js @@ -42,6 +42,19 @@ lp.parseParenExpression = function() { } lp.parseMaybeAssign = function(noIn) { + if (this.toks.isContextual("yield")) { + let node = this.startNode() + this.next() + if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tt.star && !this.tok.type.startsExpr)) { + node.delegate = false + node.argument = null + } else { + node.delegate = this.eat(tt.star) + node.argument = this.parseMaybeAssign() + } + return this.finishNode(node, "YieldExpression") + } + let start = this.storeCurrentPos() let left = this.parseMaybeConditional(noIn) if (this.tok.type.isAssign) { @@ -71,7 +84,7 @@ lp.parseMaybeConditional = function(noIn) { lp.parseExprOps = function(noIn) { let start = this.storeCurrentPos() let indent = this.curIndent, line = this.curLineStart - return this.parseExprOp(this.parseMaybeUnary(noIn), start, -1, noIn, indent, line) + return this.parseExprOp(this.parseMaybeUnary(false), start, -1, noIn, indent, line) } lp.parseExprOp = function(left, start, minPrec, noIn, indent, line) { @@ -87,7 +100,7 @@ lp.parseExprOp = function(left, start, minPrec, noIn, indent, line) { node.right = this.dummyIdent() } else { let rightStart = this.storeCurrentPos() - node.right = this.parseExprOp(this.parseMaybeUnary(noIn), rightStart, prec, noIn, indent, line) + node.right = this.parseExprOp(this.parseMaybeUnary(false), rightStart, prec, noIn, indent, line) } this.finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression") return this.parseExprOp(node, start, minPrec, noIn, indent, line) @@ -96,31 +109,42 @@ lp.parseExprOp = function(left, start, minPrec, noIn, indent, line) { return left } -lp.parseMaybeUnary = function(noIn) { +lp.parseMaybeUnary = function(sawUnary) { + let start = this.storeCurrentPos(), expr if (this.tok.type.prefix) { let node = this.startNode(), update = this.tok.type === tt.incDec + if (!update) sawUnary = true node.operator = this.tok.value node.prefix = true this.next() - node.argument = this.parseMaybeUnary(noIn) + node.argument = this.parseMaybeUnary(true) if (update) node.argument = this.checkLVal(node.argument) - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") } else if (this.tok.type === tt.ellipsis) { let node = this.startNode() this.next() - node.argument = this.parseMaybeUnary(noIn) - return this.finishNode(node, "SpreadElement") + node.argument = this.parseMaybeUnary(sawUnary) + expr = this.finishNode(node, "SpreadElement") + } else { + expr = this.parseExprSubscripts() + while (this.tok.type.postfix && !this.canInsertSemicolon()) { + let node = this.startNodeAt(start) + node.operator = this.tok.value + node.prefix = false + node.argument = this.checkLVal(expr) + this.next() + expr = this.finishNode(node, "UpdateExpression") + } } - let start = this.storeCurrentPos() - let expr = this.parseExprSubscripts() - while (this.tok.type.postfix && !this.canInsertSemicolon()) { + + if (!sawUnary && this.eat(tt.starstar)) { let node = this.startNodeAt(start) - node.operator = this.tok.value - node.prefix = false - node.argument = this.checkLVal(expr) - this.next() - expr = this.finishNode(node, "UpdateExpression") + node.operator = "**" + node.left = expr + node.right = this.parseMaybeUnary(false) + return this.finishNode(node, "BinaryExpression") } + return expr } @@ -245,18 +269,6 @@ lp.parseExprAtom = function() { case tt._new: return this.parseNew() - case tt._yield: - node = this.startNode() - this.next() - if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tt.star && !this.tok.type.startsExpr)) { - node.delegate = false - node.argument = null - } else { - node.delegate = this.eat(tt.star) - node.argument = this.parseMaybeAssign() - } - return this.finishNode(node, "YieldExpression") - case tt.backQuote: return this.parseTemplate() @@ -309,6 +321,7 @@ lp.parseTemplate = function() { curElt = this.startNode() curElt.value = {cooked: '', raw: ''} curElt.tail = true + this.finishNode(curElt, "TemplateElement") } node.quasis.push(curElt) } @@ -475,7 +488,7 @@ lp.parseArrowExpression = function(node, params) { lp.parseExprList = function(close, allowEmpty) { this.pushCx() let indent = this.curIndent, line = this.curLineStart, elts = [] - this.next(); // Opening bracket + this.next() // Opening bracket while (!this.closes(close, indent + 1, line)) { if (this.eat(tt.comma)) { elts.push(allowEmpty ? null : this.dummyIdent()) diff --git a/tools/eslint/node_modules/acorn/src/loose/state.js b/tools/eslint/node_modules/acorn/src/loose/state.js index de33831b2e7b4b..4f48cd96638b77 100644 --- a/tools/eslint/node_modules/acorn/src/loose/state.js +++ b/tools/eslint/node_modules/acorn/src/loose/state.js @@ -13,8 +13,8 @@ export class LooseParser { let here = this.toks.curPosition() this.tok.loc = new SourceLocation(this.toks, here, here) } - this.ahead = []; // Tokens ahead - this.context = []; // Indentation contexted + this.ahead = [] // Tokens ahead + this.context = [] // Indentation contexted this.curIndent = 0 this.curLineStart = 0 this.nextLineStart = this.lineEnd(this.curLineStart) + 1 diff --git a/tools/eslint/node_modules/acorn/src/loose/statement.js b/tools/eslint/node_modules/acorn/src/loose/statement.js index cffec9ee8367b2..5f0858ec394526 100644 --- a/tools/eslint/node_modules/acorn/src/loose/statement.js +++ b/tools/eslint/node_modules/acorn/src/loose/statement.js @@ -16,7 +16,12 @@ lp.parseTopLevel = function() { } lp.parseStatement = function() { - let starttype = this.tok.type, node = this.startNode() + let starttype = this.tok.type, node = this.startNode(), kind + + if (this.toks.isLet()) { + starttype = tt._var + kind = "let" + } switch (starttype) { case tt._break: case tt._continue: @@ -47,8 +52,9 @@ lp.parseStatement = function() { this.pushCx() this.expect(tt.parenL) if (this.tok.type === tt.semi) return this.parseFor(node, null) - if (this.tok.type === tt._var || this.tok.type === tt._let || this.tok.type === tt._const) { - let init = this.parseVar(true) + let isLet = this.toks.isLet() + if (isLet || this.tok.type === tt._var || this.tok.type === tt._const) { + let init = this.parseVar(true, isLet ? "let" : this.tok.value) if (init.declarations.length === 1 && (this.tok.type === tt._in || this.isContextual("of"))) { return this.parseForIn(node, init) } @@ -133,9 +139,8 @@ lp.parseStatement = function() { return this.finishNode(node, "TryStatement") case tt._var: - case tt._let: case tt._const: - return this.parseVar() + return this.parseVar(false, kind || this.tok.value) case tt._while: this.next() @@ -218,9 +223,9 @@ lp.parseForIn = function(node, init) { return this.finishNode(node, type) } -lp.parseVar = function(noIn) { +lp.parseVar = function(noIn, kind) { let node = this.startNode() - node.kind = this.tok.type.keyword + node.kind = kind this.next() node.declarations = [] do { @@ -329,7 +334,7 @@ lp.parseExport = function() { this.semicolon() return this.finishNode(node, "ExportDefaultDeclaration") } - if (this.tok.type.keyword) { + if (this.tok.type.keyword || this.toks.isLet()) { node.declaration = this.parseStatement() node.specifiers = [] node.source = null diff --git a/tools/eslint/node_modules/acorn/src/lval.js b/tools/eslint/node_modules/acorn/src/lval.js index 1e2508ef9e089d..2a390c4777a5e5 100644 --- a/tools/eslint/node_modules/acorn/src/lval.js +++ b/tools/eslint/node_modules/acorn/src/lval.js @@ -36,13 +36,13 @@ pp.toAssignable = function(node, isBinding) { // falls through to AssignmentPattern } else { this.raise(node.left.end, "Only '=' operator can be used for specifying default value.") - break; + break } case "AssignmentPattern": if (node.right.type === "YieldExpression") this.raise(node.right.start, "Yield expression cannot be a default value") - break; + break case "ParenthesizedExpression": node.expression = this.toAssignable(node.expression, isBinding) @@ -76,7 +76,7 @@ pp.toAssignableList = function(exprList, isBinding) { } if (isBinding && last.type === "RestElement" && last.argument.type !== "Identifier") - this.unexpected(last.argument.start); + this.unexpected(last.argument.start) } for (let i = 0; i < end; i++) { let elt = exprList[i] @@ -140,6 +140,7 @@ pp.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowNonId let rest = this.parseRest(allowNonIdent) this.parseBindingListItem(rest) elts.push(rest) + if (this.type === tt.comma) this.raise(this.start, "Comma is not permitted after the rest element") this.expect(close) break } else { @@ -173,16 +174,16 @@ 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") + this.raiseRecoverable(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode") if (checkClashes) { if (has(checkClashes, expr.name)) - this.raise(expr.start, "Argument name clash") + this.raiseRecoverable(expr.start, "Argument name clash") checkClashes[expr.name] = true } break case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") + if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") break case "ObjectPattern": diff --git a/tools/eslint/node_modules/acorn/src/options.js b/tools/eslint/node_modules/acorn/src/options.js index 293ea86755ea32..3a1b0df3ade1da 100644 --- a/tools/eslint/node_modules/acorn/src/options.js +++ b/tools/eslint/node_modules/acorn/src/options.js @@ -8,8 +8,8 @@ export const 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, + // setters and other features. The default is 6. + ecmaVersion: 6, // Source type ("script" or "module") for different semantics sourceType: "script", // `onInsertedSemicolon` can be a callback that will be called @@ -118,3 +118,4 @@ function pushComment(options, array) { array.push(comment) } } + diff --git a/tools/eslint/node_modules/acorn/src/parseutil.js b/tools/eslint/node_modules/acorn/src/parseutil.js index 9c71c485cd8189..8efe8515383703 100644 --- a/tools/eslint/node_modules/acorn/src/parseutil.js +++ b/tools/eslint/node_modules/acorn/src/parseutil.js @@ -92,7 +92,7 @@ pp.unexpected = function(pos) { pp.checkPatternErrors = function(refDestructuringErrors, andThrow) { let pos = refDestructuringErrors && refDestructuringErrors.trailingComma if (!andThrow) return !!pos - if (pos) this.raise(pos, "Trailing comma is not permitted in destructuring patterns") + if (pos) this.raise(pos, "Comma is not permitted after the rest element") } pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { diff --git a/tools/eslint/node_modules/acorn/src/state.js b/tools/eslint/node_modules/acorn/src/state.js index 3a0d5ffb953c0d..bddad5f73027f6 100644 --- a/tools/eslint/node_modules/acorn/src/state.js +++ b/tools/eslint/node_modules/acorn/src/state.js @@ -26,7 +26,7 @@ export class Parser { // 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; + this.containsEsc = false // Load plugins this.loadPlugins(options.plugins) diff --git a/tools/eslint/node_modules/acorn/src/statement.js b/tools/eslint/node_modules/acorn/src/statement.js index 7ade79f2e36865..6d3f8e621a036b 100644 --- a/tools/eslint/node_modules/acorn/src/statement.js +++ b/tools/eslint/node_modules/acorn/src/statement.js @@ -1,6 +1,7 @@ import {types as tt} from "./tokentype" import {Parser} from "./state" -import {lineBreak} from "./whitespace" +import {lineBreak, skipWhiteSpace} from "./whitespace" +import {isIdentifierStart, isIdentifierChar} from "./identifier" const pp = Parser.prototype @@ -31,6 +32,20 @@ pp.parseTopLevel = function(node) { const loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"} +pp.isLet = function() { + if (this.type !== tt.name || this.options.ecmaVersion < 6 || this.value != "let") return false + skipWhiteSpace.lastIndex = this.pos + let skip = skipWhiteSpace.exec(this.input) + let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next) + if (nextCh === 91 || nextCh == 123) return true // '{' and '[' + if (isIdentifierStart(nextCh, true)) { + for (var pos = next + 1; isIdentifierChar(this.input.charCodeAt(pos, true)); ++pos) {} + let ident = this.input.slice(next, pos) + if (!this.isKeyword(ident)) return true + } + return false +} + // Parse a single statement. // // If expecting a statement and finding a slash operator, parse a @@ -39,7 +54,12 @@ const loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"} // does not help. pp.parseStatement = function(declaration, topLevel) { - let starttype = this.type, node = this.startNode() + let starttype = this.type, node = this.startNode(), kind + + if (this.isLet()) { + starttype = tt._var + kind = "let" + } // Most types of statements are recognized by the keyword they // start with. Many are trivial to parse, some require a bit of @@ -61,8 +81,10 @@ pp.parseStatement = function(declaration, topLevel) { case tt._switch: return this.parseSwitchStatement(node) case tt._throw: return this.parseThrowStatement(node) case tt._try: return this.parseTryStatement(node) - case tt._let: case tt._const: if (!declaration) this.unexpected() // NOTE: falls through to _var - case tt._var: return this.parseVarStatement(node, starttype) + case tt._const: case tt._var: + kind = kind || this.value + if (!declaration && kind != "var") this.unexpected() + return this.parseVarStatement(node, kind) case tt._while: return this.parseWhileStatement(node) case tt._with: return this.parseWithStatement(node) case tt.braceL: return this.parseBlock() @@ -146,13 +168,14 @@ pp.parseForStatement = function(node) { this.labels.push(loopLabel) this.expect(tt.parenL) if (this.type === tt.semi) return this.parseFor(node, null) - if (this.type === tt._var || this.type === tt._let || this.type === tt._const) { - let init = this.startNode(), varKind = this.type + let isLet = this.isLet() + if (this.type === tt._var || this.type === tt._const || isLet) { + let init = this.startNode(), kind = isLet ? "let" : this.value this.next() - this.parseVar(init, true, varKind) + this.parseVar(init, true, kind) this.finishNode(init, "VariableDeclaration") if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1 && - !(varKind !== tt._var && init.declarations[0].init)) + !(kind !== "var" && init.declarations[0].init)) return this.parseForIn(node, init) return this.parseFor(node, init) } @@ -217,7 +240,7 @@ pp.parseSwitchStatement = function(node) { if (isCase) { cur.test = this.parseExpression() } else { - if (sawDefault) this.raise(this.lastTokStart, "Multiple default clauses") + if (sawDefault) this.raiseRecoverable(this.lastTokStart, "Multiple default clauses") sawDefault = true cur.test = null } @@ -302,9 +325,9 @@ pp.parseLabeledStatement = function(node, maybeName, expr) { for (let i = this.labels.length - 1; i >= 0; i--) { let label = this.labels[i] if (label.statementStart == node.start) { - label.statementStart = this.start; - label.kind = kind; - } else break; + label.statementStart = this.start + label.kind = kind + } else break } this.labels.push({name: maybeName, kind: kind, statementStart: this.start}) node.body = this.parseStatement(true) @@ -374,13 +397,13 @@ pp.parseForIn = function(node, init) { pp.parseVar = function(node, isFor, kind) { node.declarations = [] - node.kind = kind.keyword + node.kind = kind for (;;) { let decl = this.startNode() this.parseVarId(decl) if (this.eat(tt.eq)) { decl.init = this.parseMaybeAssign(isFor) - } else if (kind === tt._const && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + } else if (kind === "const" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected() } else if (decl.id.type != "Identifier" && !(isFor && (this.type === tt._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") @@ -405,10 +428,13 @@ pp.parseFunction = function(node, isStatement, allowExpressionBody) { this.initFunction(node) if (this.options.ecmaVersion >= 6) node.generator = this.eat(tt.star) + var oldInGen = this.inGenerator + this.inGenerator = node.generator if (isStatement || this.type === tt.name) node.id = this.parseIdent() this.parseFunctionParams(node) this.parseFunctionBody(node, allowExpressionBody) + this.inGenerator = oldInGen return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") } @@ -464,9 +490,9 @@ pp.parseClass = function(node, isStatement) { if (method.value.params.length !== paramCount) { let start = method.value.start if (method.kind === "get") - this.raise(start, "getter should have no params"); + this.raiseRecoverable(start, "getter should have no params") else - this.raise(start, "setter should have exactly one param") + this.raiseRecoverable(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") @@ -501,10 +527,11 @@ pp.parseExport = function(node) { return this.finishNode(node, "ExportAllDeclaration") } if (this.eat(tt._default)) { // export default ... + let parens = this.type == tt.parenL let expr = this.parseMaybeAssign() let needsSemi = true - if (expr.type == "FunctionExpression" || - expr.type == "ClassExpression") { + if (!parens && (expr.type == "FunctionExpression" || + expr.type == "ClassExpression")) { needsSemi = false if (expr.id) { expr.type = expr.type == "FunctionExpression" @@ -542,7 +569,7 @@ pp.parseExport = function(node) { } pp.shouldParseExportStatement = function() { - return this.type.keyword + return this.type.keyword || this.isLet() } // Parses a comma-separated list of module exports. diff --git a/tools/eslint/node_modules/acorn/src/tokencontext.js b/tools/eslint/node_modules/acorn/src/tokencontext.js index c76fc9de6f1ac4..0d144e7c6c5a0f 100644 --- a/tools/eslint/node_modules/acorn/src/tokencontext.js +++ b/tools/eslint/node_modules/acorn/src/tokencontext.js @@ -94,8 +94,9 @@ tt.incDec.updateContext = function() { // tokExprAllowed stays unchanged } -tt._function.updateContext = function() { - if (this.curContext() !== types.b_stat) +tt._function.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else && + (prevType !== tt.colon || this.curContext() !== types.b_stat)) this.context.push(types.f_expr) this.exprAllowed = false } diff --git a/tools/eslint/node_modules/acorn/src/tokenize.js b/tools/eslint/node_modules/acorn/src/tokenize.js index 1b2bd95d0c17ad..70acdb5540b849 100644 --- a/tools/eslint/node_modules/acorn/src/tokenize.js +++ b/tools/eslint/node_modules/acorn/src/tokenize.js @@ -223,15 +223,25 @@ pp.readToken_dot = function() { pp.readToken_slash = function() { // '/' let next = this.input.charCodeAt(this.pos + 1) - if (this.exprAllowed) {++this.pos; return this.readRegexp();} + if (this.exprAllowed) {++this.pos; return this.readRegexp()} if (next === 61) return this.finishOp(tt.assign, 2) return this.finishOp(tt.slash, 1) } -pp.readToken_mult_modulo = function(code) { // '%*' +pp.readToken_mult_modulo_exp = function(code) { // '%*' let next = this.input.charCodeAt(this.pos + 1) - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(code === 42 ? tt.star : tt.modulo, 1) + let size = 1 + let tokentype = code === 42 ? tt.star : tt.modulo + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && next === 42) { + ++size + tokentype = tt.starstar + next = this.input.charCodeAt(this.pos + 2) + } + + if (next === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tokentype, size) } pp.readToken_pipe_amp = function(code) { // '|&' @@ -279,8 +289,7 @@ pp.readToken_lt_gt = function(code) { // '<>' this.skipSpace() return this.nextToken() } - if (next === 61) - size = this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2 + if (next === 61) size = 2 return this.finishOp(tt.relational, size) } @@ -320,10 +329,10 @@ pp.getTokenFromCode = function(code) { case 48: // '0' let next = this.input.charCodeAt(this.pos + 1) - if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number + if (next === 120 || next === 88) return this.readRadixNumber(16) // '0x', '0X' - hex number if (this.options.ecmaVersion >= 6) { - if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number - if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number + if (next === 111 || next === 79) return this.readRadixNumber(8) // '0o', '0O' - octal number + if (next === 98 || next === 66) return this.readRadixNumber(2) // '0b', '0B' - binary number } // Anything else beginning with a digit is an integer, octal // number, or float. @@ -343,7 +352,7 @@ pp.getTokenFromCode = function(code) { return this.readToken_slash() case 37: case 42: // '%*' - return this.readToken_mult_modulo(code) + return this.readToken_mult_modulo_exp(code) case 124: case 38: // '|&' return this.readToken_pipe_amp(code) @@ -378,7 +387,7 @@ pp.finishOp = function(type, size) { function tryCreateRegexp(src, flags, throwErrorAt, parser) { try { - return new RegExp(src, flags); + return new RegExp(src, flags) } catch (e) { if (throwErrorAt !== undefined) { if (e instanceof SyntaxError) parser.raise(throwErrorAt, "Error parsing regular expression: " + e.message) @@ -387,7 +396,7 @@ function tryCreateRegexp(src, flags, throwErrorAt, parser) { } } -var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u"); +var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u") pp.readRegexp = function() { let escaped, inClass, start = this.pos @@ -426,7 +435,7 @@ pp.readRegexp = function() { code = Number("0x" + code) if (code > 0x10FFFF) this.raise(start + offset + 3, "Code point out of bounds") return "x" - }); + }) tmp = tmp.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x") } } @@ -435,7 +444,7 @@ pp.readRegexp = function() { // Rhino's regular expression parser is flaky and throws uncatchable exceptions, // so don't do detection if we are running under Rhino if (!isRhino) { - tryCreateRegexp(tmp, undefined, start, this); + tryCreateRegexp(tmp, undefined, start, this) // Get a regular expression object for this pattern-flag pair, or `null` in // case the current environment doesn't support the flags it uses. value = tryCreateRegexp(content, mods) @@ -451,9 +460,9 @@ pp.readInt = function(radix, len) { let start = this.pos, total = 0 for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { let code = this.input.charCodeAt(this.pos), val - if (code >= 97) val = code - 97 + 10; // a - else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 + if (code >= 97) val = code - 97 + 10 // a + else if (code >= 65) val = code - 65 + 10 // A + else if (code >= 48 && code <= 57) val = code - 48 // 0-9 else val = Infinity if (val >= radix) break ++this.pos @@ -465,7 +474,7 @@ pp.readInt = function(radix, len) { } pp.readRadixNumber = function(radix) { - this.pos += 2; // 0x + this.pos += 2 // 0x let val = this.readInt(radix) if (val == null) this.raise(this.start + 2, "Expected number in radix " + radix) if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number") @@ -486,7 +495,7 @@ pp.readNumber = function(startsWithDot) { } if (next === 69 || next === 101) { // 'eE' next = this.input.charCodeAt(++this.pos) - if (next === 43 || next === 45) ++this.pos; // '+-' + if (next === 43 || next === 45) ++this.pos // '+-' if (this.readInt(10) === null) this.raise(start, "Invalid number") isFloat = true } @@ -572,13 +581,13 @@ pp.readTmplToken = function() { ++this.pos switch (ch) { case 13: - if (this.input.charCodeAt(this.pos) === 10) ++this.pos; + if (this.input.charCodeAt(this.pos) === 10) ++this.pos case 10: - out += "\n"; - break; + out += "\n" + break default: - out += String.fromCharCode(ch); - break; + out += String.fromCharCode(ch) + break } if (this.options.locations) { ++this.curLine @@ -597,15 +606,15 @@ pp.readEscapedChar = function(inTemplate) { let ch = this.input.charCodeAt(++this.pos) ++this.pos switch (ch) { - case 110: return "\n"; // 'n' -> '\n' - case 114: return "\r"; // 'r' -> '\r' - case 120: return String.fromCharCode(this.readHexChar(2)); // 'x' - case 117: return codePointToString(this.readCodePoint()); // 'u' - case 116: return "\t"; // 't' -> '\t' - case 98: return "\b"; // 'b' -> '\b' - case 118: return "\u000b"; // 'v' -> '\u000b' - case 102: return "\f"; // 'f' -> '\f' - case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos; // '\r\n' + case 110: return "\n" // 'n' -> '\n' + case 114: return "\r" // 'r' -> '\r' + case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' + case 117: return codePointToString(this.readCodePoint()) // 'u' + case 116: return "\t" // 't' -> '\t' + case 98: return "\b" // 'b' -> '\b' + case 118: return "\u000b" // 'v' -> '\u000b' + case 102: return "\f" // 'f' -> '\f' + case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos // '\r\n' case 10: // ' \n' if (this.options.locations) { this.lineStart = this.pos; ++this.curLine } return "" diff --git a/tools/eslint/node_modules/acorn/src/tokentype.js b/tools/eslint/node_modules/acorn/src/tokentype.js index e4efd2bac2a41e..283741ad729655 100644 --- a/tools/eslint/node_modules/acorn/src/tokentype.js +++ b/tools/eslint/node_modules/acorn/src/tokentype.js @@ -95,7 +95,8 @@ export const types = { plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), modulo: binop("%", 10), star: binop("*", 10), - slash: binop("/", 10) + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}) } // Map keyword names to token types. @@ -125,7 +126,6 @@ kw("switch") kw("throw", beforeExpr) kw("try") kw("var") -kw("let") kw("const") kw("while", {isLoop: true}) kw("with") @@ -136,7 +136,6 @@ kw("class") kw("extends", beforeExpr) kw("export") kw("import") -kw("yield", {beforeExpr: true, startsExpr: true}) kw("null", startsExpr) kw("true", startsExpr) kw("false", startsExpr) diff --git a/tools/eslint/node_modules/acorn/src/walk/index.js b/tools/eslint/node_modules/acorn/src/walk/index.js index 9f45a0c8c7cb1b..2fe58bf77228ab 100644 --- a/tools/eslint/node_modules/acorn/src/walk/index.js +++ b/tools/eslint/node_modules/acorn/src/walk/index.js @@ -191,12 +191,13 @@ base.ThrowStatement = base.SpreadElement = (node, st, c) => c(node.argument, st, "Expression") base.TryStatement = (node, st, c) => { c(node.block, st, "Statement") - if (node.handler) { - c(node.handler.param, st, "Pattern") - c(node.handler.body, st, "ScopeBody") - } + if (node.handler) c(node.handler, st) if (node.finalizer) c(node.finalizer, st, "Statement") } +base.CatchClause = (node, st, c) => { + c(node.param, st, "Pattern") + c(node.body, st, "ScopeBody") +} base.WhileStatement = base.DoWhileStatement = (node, st, c) => { c(node.test, st, "Expression") c(node.body, st, "Statement") @@ -333,8 +334,3 @@ base.MethodDefinition = base.Property = (node, st, c) => { if (node.computed) c(node.key, st, "Expression") c(node.value, st, "Expression") } -base.ComprehensionExpression = (node, st, c) => { - for (let i = 0; i < node.blocks.length; i++) - c(node.blocks[i].right, st, "Expression") - c(node.body, st, "Expression") -} diff --git a/tools/eslint/node_modules/acorn/src/whitespace.js b/tools/eslint/node_modules/acorn/src/whitespace.js index 627aa78d41ea6e..ee1214a2180438 100644 --- a/tools/eslint/node_modules/acorn/src/whitespace.js +++ b/tools/eslint/node_modules/acorn/src/whitespace.js @@ -9,3 +9,5 @@ export function isNewLine(code) { } export const nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/ + +export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g diff --git a/tools/eslint/node_modules/ansi-escapes/index.js b/tools/eslint/node_modules/ansi-escapes/index.js index 6bc26c82a2812f..7f61fc3565c053 100644 --- a/tools/eslint/node_modules/ansi-escapes/index.js +++ b/tools/eslint/node_modules/ansi-escapes/index.js @@ -76,4 +76,31 @@ x.eraseScreen = ESC + '2J'; x.scrollUp = ESC + 'S'; x.scrollDown = ESC + 'T'; +x.clearScreen = '\u001bc'; x.beep = '\u0007'; + +x.image = function (buf, opts) { + opts = opts || {}; + + var ret = '\u001b]1337;File=inline=1'; + + if (opts.width) { + ret += ';width=' + opts.width; + } + + if (opts.height) { + ret += ';height=' + opts.height; + } + + if (opts.preserveAspectRatio === false) { + ret += ';preserveAspectRatio=0'; + } + + return ret + ':' + buf.toString('base64') + '\u0007'; +}; + +x.iTerm = {}; + +x.iTerm.setCwd = function (cwd) { + return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007'; +}; diff --git a/tools/eslint/node_modules/ansi-escapes/package.json b/tools/eslint/node_modules/ansi-escapes/package.json index 9ef72e9bbb363f..bc1e21eb89faf6 100644 --- a/tools/eslint/node_modules/ansi-escapes/package.json +++ b/tools/eslint/node_modules/ansi-escapes/package.json @@ -2,20 +2,24 @@ "_args": [ [ "ansi-escapes@^1.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "ansi-escapes@>=1.1.0 <2.0.0", - "_id": "ansi-escapes@1.1.1", + "_id": "ansi-escapes@1.4.0", "_inCache": true, "_installable": true, - "_location": "/eslint/ansi-escapes", - "_nodeVersion": "4.2.4", + "_location": "/ansi-escapes", + "_nodeVersion": "4.4.2", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/ansi-escapes-1.4.0.tgz_1460925437568_0.228597579523921" + }, "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" }, - "_npmVersion": "2.14.12", + "_npmVersion": "2.15.0", "_phantomChildren": {}, "_requested": { "name": "ansi-escapes", @@ -26,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/inquirer" ], - "_resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.1.1.tgz", - "_shasum": "cc9c0b193ac4c2b99a19f9b9fbc18ff5edd1d0a8", + "_resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "_shasum": "d3a8a83b319aa67793662b13e761c7911422306e", "_shrinkwrap": null, "_spec": "ansi-escapes@^1.1.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -49,8 +53,8 @@ }, "directories": {}, "dist": { - "shasum": "cc9c0b193ac4c2b99a19f9b9fbc18ff5edd1d0a8", - "tarball": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.1.1.tgz" + "shasum": "d3a8a83b319aa67793662b13e761c7911422306e", + "tarball": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz" }, "engines": { "node": ">=0.10.0" @@ -58,8 +62,8 @@ "files": [ "index.js" ], - "gitHead": "3dff027c48a59a377ed44b6d942b1b4f007c326f", - "homepage": "https://github.com/sindresorhus/ansi-escapes", + "gitHead": "763a11847148479dd315c2b9f81b001c94740415", + "homepage": "https://github.com/sindresorhus/ansi-escapes#readme", "keywords": [ "ansi", "terminal", @@ -81,7 +85,9 @@ "control", "code", "codes", - "cursor" + "cursor", + "iterm", + "iterm2" ], "license": "MIT", "maintainers": [ @@ -100,5 +106,5 @@ "scripts": { "test": "xo && ava" }, - "version": "1.1.1" + "version": "1.4.0" } diff --git a/tools/eslint/node_modules/ansi-escapes/readme.md b/tools/eslint/node_modules/ansi-escapes/readme.md index 54762b7f240f8f..c1254e9ab6167b 100644 --- a/tools/eslint/node_modules/ansi-escapes/readme.md +++ b/tools/eslint/node_modules/ansi-escapes/readme.md @@ -13,7 +13,7 @@ $ npm install --save ansi-escapes ## Usage ```js -var ansiEscapes = require('ansi-escapes'); +const ansiEscapes = require('ansi-escapes'); // moves the cursor two rows up and to the left process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft); @@ -117,10 +117,54 @@ Scroll display up one line. Scroll display down one line. +### clearScreen + +Clear the terminal screen. + ### beep Output a beeping sound. +### image(input, [options]) + +Display an image. + +*Currently only supported on iTerm >=2.9.* + +See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module. + +#### input + +Type: `buffer` + +Buffer of an image. Usually read in with `fs.readFile()`. + +#### options + +##### width +##### height + +Type: `string` `number` + +The width and height are given as a number followed by a unit, or the word "auto". + +- `N`: N character cells. +- `Npx`: N pixels. +- `N%`: N percent of the session's width or height. +- `auto`: The image's inherent size will be used to determine an appropriate dimension. + +##### preserveAspectRatio + +Type: `boolean`
    +Default: `true` + +### iTerm.setCwd([path]) + +Type: `string`
    +Default: `process.cwd()` + +[Inform iTerm](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click). + ## Related @@ -129,4 +173,4 @@ Output a beeping sound. ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/eslint/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/ansi-regex/package.json index c527d390346b88..81c4facdb722f5 100644 --- a/tools/eslint/node_modules/ansi-regex/package.json +++ b/tools/eslint/node_modules/ansi-regex/package.json @@ -2,14 +2,14 @@ "_args": [ [ "ansi-regex@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/has-ansi" + "/Users/trott/io.js/tools/node_modules/has-ansi" ] ], "_from": "ansi-regex@>=2.0.0 <3.0.0", "_id": "ansi-regex@2.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/ansi-regex", + "_location": "/ansi-regex", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,15 +26,15 @@ "type": "range" }, "_requiredBy": [ - "/eslint/has-ansi", - "/eslint/inquirer", - "/eslint/strip-ansi" + "/has-ansi", + "/inquirer", + "/strip-ansi" ], "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", "_shrinkwrap": null, "_spec": "ansi-regex@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/has-ansi", + "_where": "/Users/trott/io.js/tools/node_modules/has-ansi", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/ansi-styles/package.json b/tools/eslint/node_modules/ansi-styles/package.json index 43e729a566bbe4..6d9a31236b596c 100644 --- a/tools/eslint/node_modules/ansi-styles/package.json +++ b/tools/eslint/node_modules/ansi-styles/package.json @@ -1,38 +1,42 @@ { "_args": [ [ - "ansi-styles@^2.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/chalk" + "ansi-styles@^2.2.1", + "/Users/trott/io.js/tools/node_modules/chalk" ] ], - "_from": "ansi-styles@>=2.1.0 <3.0.0", - "_id": "ansi-styles@2.1.0", + "_from": "ansi-styles@>=2.2.1 <3.0.0", + "_id": "ansi-styles@2.2.1", "_inCache": true, "_installable": true, - "_location": "/eslint/ansi-styles", - "_nodeVersion": "0.12.4", + "_location": "/ansi-styles", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" + }, "_npmUser": { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, - "_npmVersion": "2.10.1", + "_npmVersion": "3.8.3", "_phantomChildren": {}, "_requested": { "name": "ansi-styles", - "raw": "ansi-styles@^2.1.0", - "rawSpec": "^2.1.0", + "raw": "ansi-styles@^2.2.1", + "rawSpec": "^2.2.1", "scope": null, - "spec": ">=2.1.0 <3.0.0", + "spec": ">=2.2.1 <3.0.0", "type": "range" }, "_requiredBy": [ - "/eslint/chalk" + "/chalk" ], - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", - "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", "_shrinkwrap": null, - "_spec": "ansi-styles@^2.1.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/chalk", + "_spec": "ansi-styles@^2.2.1", + "_where": "/Users/trott/io.js/tools/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -48,8 +52,8 @@ }, "directories": {}, "dist": { - "shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -57,8 +61,8 @@ "files": [ "index.js" ], - "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", - "homepage": "https://github.com/chalk/ansi-styles", + "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", + "homepage": "https://github.com/chalk/ansi-styles#readme", "keywords": [ "ansi", "styles", @@ -86,10 +90,6 @@ { "email": "sindresorhus@gmail.com", "name": "sindresorhus" - }, - { - "email": "jappelman@xebia.com", - "name": "jbnicolai" } ], "name": "ansi-styles", @@ -102,5 +102,5 @@ "scripts": { "test": "mocha" }, - "version": "2.1.0" + "version": "2.2.1" } diff --git a/tools/eslint/node_modules/argparse/CHANGELOG.md b/tools/eslint/node_modules/argparse/CHANGELOG.md deleted file mode 100644 index 1ab14f08efa33a..00000000000000 --- a/tools/eslint/node_modules/argparse/CHANGELOG.md +++ /dev/null @@ -1,161 +0,0 @@ -1.0.6 / 2016-02-06 ------------------- - -- Maintenance: moved to eslint & updated CS. - - -1.0.5 / 2016-02-05 ------------------- - -- Removed lodash dependency to significantly reduce install size. - Thanks to @mourner. - - -1.0.4 / 2016-01-17 ------------------- - -- Maintenance: lodash update to 4.0.0. - - -1.0.3 / 2015-10-27 ------------------- - -- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. - - -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/argparse/README.md b/tools/eslint/node_modules/argparse/README.md index 1f84bf293de65f..2d0bcab435c25c 100644 --- a/tools/eslint/node_modules/argparse/README.md +++ b/tools/eslint/node_modules/argparse/README.md @@ -42,6 +42,12 @@ parser.addArgument( help: 'bar foo' } ); +parser.addArgument( + '--baz', + { + help: 'baz bar' + } +); var args = parser.parseArgs(); console.dir(args); ``` @@ -50,7 +56,7 @@ Display help: ``` $ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] +usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] Argparse example @@ -59,13 +65,14 @@ Optional arguments: -v, --version Show program's version number and exit. -f FOO, --foo FOO foo bar -b BAR, --bar BAR bar foo + --baz BAZ baz bar ``` Parse arguments: ``` -$ ./test.js -f=3 --bar=4 -{ foo: '3', bar: '4' } +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } ``` More [examples](https://github.com/nodeca/argparse/tree/master/examples). @@ -105,12 +112,15 @@ addArgument() method ==================== ``` -ArgumentParser.addArgument([names or flags], {options}) +ArgumentParser.addArgument(name or flag or [name] 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. +- ```name or flag or [name] or [flags...]``` - Either a positional name + (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array + of a single positional name (e.g., `['foo']`), or an array of options + (e.g., `['-f', '--foo']`). Options: @@ -239,3 +249,5 @@ 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/argparse/lib/action_container.js b/tools/eslint/node_modules/argparse/lib/action_container.js index 93a47b2936b055..86aa017ae6d59c 100644 --- a/tools/eslint/node_modules/argparse/lib/action_container.js +++ b/tools/eslint/node_modules/argparse/lib/action_container.js @@ -165,19 +165,23 @@ ActionContainer.prototype.getDefault = function (dest) { /** * ActionContainer#addArgument(args, options) -> Object - * - args (Array): array of argument keys + * - args (String|Array): argument key, or array of argument keys * - options (Object): action objects see [[Action.new]] * * #### Examples - * - addArgument([-f, --foo], {action:'store', defaultValue=1, ...}) - * - addArgument(['bar'], action: 'store', nargs:1, ...}) + * - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... }) + * - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... }) + * - addArgument('--baz', { action: 'store', nargs: 1, ... }) **/ ActionContainer.prototype.addArgument = function (args, options) { args = args; options = options || {}; + if (typeof args === 'string') { + args = [ args ]; + } if (!Array.isArray(args)) { - throw new TypeError('addArgument first argument should be an array'); + throw new TypeError('addArgument first argument should be a string or an array'); } if (typeof options !== 'object' || Array.isArray(options)) { throw new TypeError('addArgument second argument should be a hash'); diff --git a/tools/eslint/node_modules/argparse/lib/argument/exclusive.js b/tools/eslint/node_modules/argparse/lib/argument/exclusive.js index deaca28b8303dc..8287e00d0464f3 100644 --- a/tools/eslint/node_modules/argparse/lib/argument/exclusive.js +++ b/tools/eslint/node_modules/argparse/lib/argument/exclusive.js @@ -51,3 +51,4 @@ MutuallyExclusiveGroup.prototype._removeAction = function (action) { this._container._removeAction(action); this._groupActions.remove(action); }; + diff --git a/tools/eslint/node_modules/argparse/lib/argument/group.js b/tools/eslint/node_modules/argparse/lib/argument/group.js index ad7693869bc4e5..58b271f2fec8d0 100644 --- a/tools/eslint/node_modules/argparse/lib/argument/group.js +++ b/tools/eslint/node_modules/argparse/lib/argument/group.js @@ -72,3 +72,4 @@ ArgumentGroup.prototype._removeAction = function (action) { this._groupActions.splice(actionIndex, 1); } }; + diff --git a/tools/eslint/node_modules/argparse/package.json b/tools/eslint/node_modules/argparse/package.json index 8d3efc9619d8c8..33e96d24a7ecf8 100644 --- a/tools/eslint/node_modules/argparse/package.json +++ b/tools/eslint/node_modules/argparse/package.json @@ -1,19 +1,19 @@ { "_args": [ [ - "argparse@^1.0.2", - "/Users/trott/test/node_modules/eslint/node_modules/js-yaml" + "argparse@^1.0.7", + "/Users/trott/io.js/tools/node_modules/js-yaml" ] ], - "_from": "argparse@>=1.0.2 <2.0.0", - "_id": "argparse@1.0.6", + "_from": "argparse@>=1.0.7 <2.0.0", + "_id": "argparse@1.0.7", "_inCache": true, "_installable": true, - "_location": "/eslint/argparse", - "_nodeVersion": "4.2.6", + "_location": "/argparse", + "_nodeVersion": "4.3.0", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/argparse-1.0.6.tgz_1454752276282_0.7111219766084105" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/argparse-1.0.7.tgz_1458226887302_0.8524546672124416" }, "_npmUser": { "email": "vitaly@rcdesign.ru", @@ -23,20 +23,20 @@ "_phantomChildren": {}, "_requested": { "name": "argparse", - "raw": "argparse@^1.0.2", - "rawSpec": "^1.0.2", + "raw": "argparse@^1.0.7", + "rawSpec": "^1.0.7", "scope": null, - "spec": ">=1.0.2 <2.0.0", + "spec": ">=1.0.7 <2.0.0", "type": "range" }, "_requiredBy": [ - "/eslint/js-yaml" + "/js-yaml" ], - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.6.tgz", - "_shasum": "ada3c46ade64695906efbb7a0a337f619abb4694", + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.7.tgz", + "_shasum": "c289506480557810f14a8bc62d7a06f63ed7f951", "_shrinkwrap": null, - "_spec": "argparse@^1.0.2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/js-yaml", + "_spec": "argparse@^1.0.7", + "_where": "/Users/trott/io.js/tools/node_modules/js-yaml", "bugs": { "url": "https://github.com/nodeca/argparse/issues" }, @@ -60,14 +60,14 @@ }, "directories": {}, "dist": { - "shasum": "ada3c46ade64695906efbb7a0a337f619abb4694", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.6.tgz" + "shasum": "c289506480557810f14a8bc62d7a06f63ed7f951", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.7.tgz" }, "files": [ "index.js", "lib/" ], - "gitHead": "f8810fdae9ab4eb68283ba4c5f62baeaf0c0719d", + "gitHead": "2d243d3062affb01f49f5f00e8ca8464a15e9374", "homepage": "https://github.com/nodeca/argparse", "keywords": [ "cli", @@ -93,5 +93,5 @@ "scripts": { "test": "make test" }, - "version": "1.0.6" + "version": "1.0.7" } diff --git a/tools/eslint/node_modules/array-union/package.json b/tools/eslint/node_modules/array-union/package.json index 25e47e1ac1b706..f76c439198038b 100644 --- a/tools/eslint/node_modules/array-union/package.json +++ b/tools/eslint/node_modules/array-union/package.json @@ -2,14 +2,14 @@ "_args": [ [ "array-union@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/globby" + "/Users/trott/io.js/tools/node_modules/globby" ] ], "_from": "array-union@>=1.0.1 <2.0.0", "_id": "array-union@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/array-union", + "_location": "/array-union", "_nodeVersion": "0.10.32", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/globby" + "/globby" ], "_resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.1.tgz", "_shasum": "4d410fc8395cb247637124bade9e3f547d5d55f2", "_shrinkwrap": null, "_spec": "array-union@^1.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/globby", + "_where": "/Users/trott/io.js/tools/node_modules/globby", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/array-uniq/package.json b/tools/eslint/node_modules/array-uniq/package.json index b5aa3bb7c9a8ed..80b68be6d40f93 100644 --- a/tools/eslint/node_modules/array-uniq/package.json +++ b/tools/eslint/node_modules/array-uniq/package.json @@ -2,14 +2,14 @@ "_args": [ [ "array-uniq@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/array-union" + "/Users/trott/io.js/tools/node_modules/array-union" ] ], "_from": "array-uniq@>=1.0.1 <2.0.0", "_id": "array-uniq@1.0.2", "_inCache": true, "_installable": true, - "_location": "/eslint/array-uniq", + "_location": "/array-uniq", "_nodeVersion": "0.10.32", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/array-union" + "/array-union" ], "_resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz", "_shasum": "5fcc373920775723cfd64d65c64bef53bf9eba6d", "_shrinkwrap": null, "_spec": "array-uniq@^1.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/array-union", + "_where": "/Users/trott/io.js/tools/node_modules/array-union", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/arrify/package.json b/tools/eslint/node_modules/arrify/package.json index 62c5ee6f25d963..6f90371fbfccc0 100644 --- a/tools/eslint/node_modules/arrify/package.json +++ b/tools/eslint/node_modules/arrify/package.json @@ -2,14 +2,14 @@ "_args": [ [ "arrify@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/globby" + "/Users/trott/io.js/tools/node_modules/globby" ] ], "_from": "arrify@>=1.0.0 <2.0.0", "_id": "arrify@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/arrify", + "_location": "/arrify", "_nodeVersion": "4.2.1", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/globby" + "/globby" ], "_resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "_shasum": "898508da2226f380df904728456849c1501a4b0d", "_shrinkwrap": null, "_spec": "arrify@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/globby", + "_where": "/Users/trott/io.js/tools/node_modules/globby", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/balanced-match/.npmignore b/tools/eslint/node_modules/balanced-match/.npmignore deleted file mode 100644 index fd4f2b066b339e..00000000000000 --- a/tools/eslint/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/tools/eslint/node_modules/balanced-match/.travis.yml b/tools/eslint/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/tools/eslint/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/tools/eslint/node_modules/balanced-match/Makefile b/tools/eslint/node_modules/balanced-match/Makefile index dd2730cfde0cab..fa5da71a6d0d34 100644 --- a/tools/eslint/node_modules/balanced-match/Makefile +++ b/tools/eslint/node_modules/balanced-match/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test/*.js .PHONY: test + diff --git a/tools/eslint/node_modules/balanced-match/example.js b/tools/eslint/node_modules/balanced-match/example.js index 9ce76f480a4321..c02ad348e69aec 100644 --- a/tools/eslint/node_modules/balanced-match/example.js +++ b/tools/eslint/node_modules/balanced-match/example.js @@ -2,3 +2,4 @@ var balanced = require('./'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); + diff --git a/tools/eslint/node_modules/balanced-match/package.json b/tools/eslint/node_modules/balanced-match/package.json index 5aa84bb72f7000..1291ffa1b32da3 100644 --- a/tools/eslint/node_modules/balanced-match/package.json +++ b/tools/eslint/node_modules/balanced-match/package.json @@ -2,14 +2,14 @@ "_args": [ [ "balanced-match@^0.3.0", - "/Users/trott/test/node_modules/eslint/node_modules/brace-expansion" + "/Users/trott/io.js/tools/node_modules/brace-expansion" ] ], "_from": "balanced-match@>=0.3.0 <0.4.0", "_id": "balanced-match@0.3.0", "_inCache": true, "_installable": true, - "_location": "/eslint/balanced-match", + "_location": "/balanced-match", "_nodeVersion": "4.2.1", "_npmUser": { "email": "julian@juliangruber.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/brace-expansion" + "/brace-expansion" ], "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", "_shrinkwrap": null, "_spec": "balanced-match@^0.3.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/brace-expansion", + "_where": "/Users/trott/io.js/tools/node_modules/brace-expansion", "author": { "email": "mail@juliangruber.com", "name": "Julian Gruber", @@ -49,7 +49,7 @@ "directories": {}, "dist": { "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" }, "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", "homepage": "https://github.com/juliangruber/balanced-match", diff --git a/tools/eslint/node_modules/balanced-match/test/balanced.js b/tools/eslint/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3f2a3240..00000000000000 --- a/tools/eslint/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/tools/eslint/node_modules/bluebird/README.md b/tools/eslint/node_modules/bluebird/README.md index db48f777112f2f..3772161e7d4b1c 100644 --- a/tools/eslint/node_modules/bluebird/README.md +++ b/tools/eslint/node_modules/bluebird/README.md @@ -23,13 +23,13 @@ The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is * ## Thanks -Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. +Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. # License The MIT License (MIT) -Copyright (c) 2013-2015 Petka Antonov +Copyright (c) 2013-2016 Petka Antonov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -48,3 +48,4 @@ 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/bluebird/js/browser/bluebird.core.js b/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.js index 0589f08b3fcfcb..9f7ff2edc549ce 100644 --- a/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.js +++ b/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.js @@ -1,18 +1,18 @@ /* @preserve * The MIT License (MIT) - * + * * Copyright (c) 2013-2015 Petka Antonov - * + * * 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 @@ -20,10 +20,10 @@ * 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. - * + * */ /** - * bluebird build version 3.3.1 + * bluebird build version 3.3.5 * Features enabled: core * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ @@ -36,6 +36,7 @@ var Queue = _dereq_("./queue"); var util = _dereq_("./util"); function Async() { + this._customScheduler = false; this._isTickUsed = false; this._lateQueue = new Queue(16); this._normalQueue = new Queue(16); @@ -48,6 +49,17 @@ function Async() { this._schedule = schedule; } +Async.prototype.setScheduler = function(fn) { + var prev = this._schedule; + this._schedule = fn; + this._customScheduler = true; + return prev; +}; + +Async.prototype.hasCustomScheduler = function() { + return this._customScheduler; +}; + Async.prototype.enableTrampoline = function() { this._trampolineEnabled = true; }; @@ -65,7 +77,8 @@ Async.prototype.haveItemsQueued = function () { Async.prototype.fatalError = function(e, isNode) { if (isNode) { - process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e)); + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + + "\n"); process.exit(2); } else { this.throwLater(e); @@ -900,6 +913,7 @@ function checkForgottenReturns(returnValue, promiseCreated, name, promise, if (returnValue === undefined && promiseCreated !== null && wForgottenReturn) { if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; if (name) name = name + " "; var msg = "a promise was created in a " + name + @@ -2196,9 +2210,7 @@ Promise.setScheduler = function(fn) { if (typeof fn !== "function") { throw new TypeError("expecting a function but got " + util.classString(fn)); } - var prev = async._schedule; - async._schedule = fn; - return prev; + return async.setScheduler(fn); }; Promise.prototype._then = function ( @@ -2307,6 +2319,7 @@ Promise.prototype._setCancelled = function() { }; Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; this._bitField = this._bitField | 134217728; }; @@ -2413,6 +2426,12 @@ Promise.prototype._resolveCallback = function(value, shouldBind) { if (shouldBind) this._propagateFrom(maybePromise, 2); var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + var bitField = promise._bitField; if (((bitField & 50397184) === 0)) { var len = this._length(); @@ -2489,9 +2508,8 @@ Promise.prototype._settlePromiseFromHandler = function ( if (x === NEXT_FILTER) { promise._reject(value); - } else if (x === errorObj || x === promise) { - var err = x === promise ? makeSelfResolutionError() : x.e; - promise._rejectCallback(err, false); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); } else { debug.checkForgottenReturns(x, promiseCreated, "", promise, this); promise._resolveCallback(x); @@ -2626,11 +2644,7 @@ Promise.prototype._reject = function (reason) { } if ((bitField & 65535) > 0) { - if (((bitField & 134217728) !== 0)) { - this._settlePromises(); - } else { - async.settlePromises(this); - } + async.settlePromises(this); } else { this._ensurePossibleRejectionHandled(); } @@ -2710,28 +2724,28 @@ _dereq_("./synchronous_inspection")(Promise); _dereq_("./join")( Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug); Promise.Promise = Promise; - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - debug.setBounds(Async.firstLineError, util.lastLineError); - return Promise; + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; }; @@ -3020,12 +3034,18 @@ var schedule; var noAsyncScheduler = function() { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); }; +var NativePromise = util.getNativePromise(); if (util.isNode && typeof MutationObserver === "undefined") { var GlobalSetImmediate = global.setImmediate; var ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; } else if ((typeof MutationObserver !== "undefined") && !(typeof window !== "undefined" && window.navigator && @@ -3037,23 +3057,23 @@ if (util.isNode && typeof MutationObserver === "undefined") { var div2 = document.createElement("div"); var o2 = new MutationObserver(function() { div.classList.toggle("foo"); - toggleScheduled = false; + toggleScheduled = false; }); o2.observe(div2, opts); var scheduleToggle = function() { if (toggleScheduled) return; - toggleScheduled = true; - div2.classList.toggle("foo"); - }; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; - return function schedule(fn) { - var o = new MutationObserver(function() { - o.disconnect(); - fn(); - }); - o.observe(div, opts); - scheduleToggle(); + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); }; })(); } else if (typeof setImmediate !== "undefined") { @@ -3568,6 +3588,17 @@ function env(key, def) { return isNode ? process.env[key] : def; } +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + var ret = { isClass: isClass, isIdentifier: isIdentifier, @@ -3599,7 +3630,8 @@ var ret = { typeof chrome.loadTimes === "function", isNode: isNode, env: env, - global: globalObject + global: globalObject, + getNativePromise: getNativePromise }; ret.isRecentNode = ret.isNode && (function() { var version = process.versions.node.split(".").map(Number); diff --git a/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.min.js b/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.min.js index 4366921157a85a..f3d1bb05b50330 100644 --- a/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.min.js +++ b/tools/eslint/node_modules/bluebird/js/browser/bluebird.core.min.js @@ -1,18 +1,18 @@ /* @preserve * The MIT License (MIT) - * + * * Copyright (c) 2013-2015 Petka Antonov - * + * * 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 @@ -20,12 +20,12 @@ * 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. - * + * */ /** - * bluebird build version 3.3.1 + * bluebird build version 3.3.5 * Features enabled: core * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=s},{"./queue":17,"./schedule":18,"./util":21}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function a(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function s(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function f(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function h(){this._trace=new P(this._peekContext())}function _(t,e){if(B(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=w(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&$){if(void 0!==i&&i._returnedNonUndefined())return;n&&(n+=" ");var o="a promise was created in a "+n+"handler but was not returned from it";r._warn(o,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(rt.warnings){var i,o=new U(t);if(n)r._attachExtraTrace(o);else if(rt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var a=w(o);o.stack=a.message+"\n"+a.stack.join("\n")}Y("warning",o)||E(o,"",!0)}}function g(t,e){for(var n=0;n=0;--s)if(r[s]===o){a=s;break}for(var s=a;s>=0;--s){var c=r[s];if(e[i]!==c)break;e.pop(),i--}e=r}}function C(t){for(var e=[],n=0;n0&&(e=e.slice(n)),e}function w(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?k(t):[" (No stack trace)"],{message:n,stack:C(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof L?L(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function j(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?Y(t,n,r)||i||E(n,"Unhandled rejection "):Y(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+T(e)+">, no stack trace)"}function T(t){var e=41;return t.lengtha||0>s||!n||!r||n!==r||a>=s||(tt=function(t){if(D.test(t))return!0;var e=R(t);return e&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}function P(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);nt(this,P),e>32&&this.uncycle()}var S,A,L,N=e._getDomain,I=e._async,U=t("./errors").Warning,H=t("./util"),B=H.canAttachTrace,D=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,V=null,Q=null,q=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),M=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),W=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),$=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(M||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",S,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=N();A="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=N();S="function"==typeof t?null===e?t:e.bind(t):void 0};var z=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!rt.longStackTraces&&O()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;rt.longStackTraces=!0,z=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),rt.longStackTraces=!1},e.prototype._captureStackTrace=h,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return rt.longStackTraces&&O()};var X=function(){try{var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),K=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),J={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},Y=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=X(t,J[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&z()),"warnings"in t){var n=t.warnings;rt.warnings=!!n,$=rt.warnings,H.isObject(n)&&"wForgottenReturn"in n&&($=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!rt.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=s,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=o,Z=u,rt.cancellation=!0}"monitoring"in t&&(t.monitoring&&!rt.monitoring?(rt.monitoring=!0,e.prototype._fireEvent=Y):!t.monitoring&&rt.monitoring&&(rt.monitoring=!1,e.prototype._fireEvent=i))},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var Z=p,tt=function(){return!1},et=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(P,Error),n.CapturedTrace=P,P.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},P.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=w(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(C(i.stack.split("\n"))),i=i._parent;b(r),m(r),H.notEnumerableProp(t,"stack",g(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var nt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,V=t,Q=e;var n=Error.captureStackTrace;return tt=function(t){return D.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return V=/@/,Q=e,q=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(V=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(L=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?L=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(L=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var rt={warnings:M,longStackTraces:!1,cancellation:!1,monitoring:!1};return W&&e.longStackTraces(),{longStackTraces:function(){return rt.longStackTraces},warnings:function(){return rt.warnings},cancellation:function(){return rt.cancellation},monitoring:function(){return rt.monitoring},propagateFromFunction:function(){return Z},boundValueFunction:function(){return f},checkForgottenReturns:d,setBounds:x,warn:y,deprecated:v,CapturedTrace:P,fireDomEvent:X,fireGlobalEvent:K}}},{"./errors":9,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(v){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return c.call(this,this.promise._target()._settledValue())}function s(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var f=n(l,r);if(f instanceof e){if(null!=this.cancelPromise){if(f.isCancelled()){var h=new u("late cancellation observer");return r._attachExtraTrace(h),p.e=h,p}f.isPending()&&f._attachCancellationCallback(new i(this))}return f._then(a,s,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util");o.canEvaluate,o.tryCatch,o.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=s(t).apply(this,arguments),a=r._popContext();return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else c=s(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return u("expecting an object but got "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(j.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new w(this).promise()},r.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(m);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=x(t)(O(e,n));return i===R&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new w(t).promise()},r.cast=function(t){var e=k(t);return e instanceof r||(e=new r(m),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+f.classString(t));var e=d._schedule;return d._schedule=t,e},r.prototype._then=function(t,e,n,i,o){var a=void 0!==o,c=a?o:new r(m),l=this._target(),u=l._bitField;a||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,c));var p=s();if(0!==(50397184&u)){ -var f,h,_=l._settlePromiseCtx;0!==(33554432&u)?(h=l._rejectionHandler0,f=t):0!==(16777216&u)?(h=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,h=new g("late cancellation observer"),l._attachExtraTrace(h),f=e),d.invoke(_,l,{handler:null===p?f:"function"==typeof f&&p.bind(f),promise:c,receiver:i,value:h})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},r.prototype._setAsyncGuaranteed=function(){this._bitField=134217728|this._bitField},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:i.bind(t)),"function"==typeof e&&(this[a+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=k(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target(),o=i._bitField;if(0===(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;a>s;++s)i._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new g("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&j.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&"number"==typeof n.length?o=x(t).apply(this._boundValue(),n):(o=R,o.e=new y("cannot .spread() a non-array: "+f.classString(n))):o=x(t).call(e,n);var a=r._popContext();if(i=r._bitField,0===(65536&i))if(o===C)r._reject(n);else if(o===R||o===r){var s=o===r?c():o.e;r._rejectCallback(s,!1)}else j.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var a=t instanceof r,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),i instanceof F&&i.isFinallyHandler()?(i.cancelPromise=t,x(n).call(i,o)===R&&t._reject(R.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):a||t instanceof w?t._cancel():i.cancel()):"function"==typeof n?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&s)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;"function"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,f.isNode):void((65535&e)>0?0!==(134217728&e)?this._settlePromises():d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){j.deprecated("Promise.defer","new Promise");var t=new r(m);return{promise:t,resolve:i,reject:o}},f.notEnumerableProp(r,"_makeSelfResolutionError",c),t("./method")(r,m,k,u,j),t("./bind")(r,m,k,j),t("./cancel")(r,w,u,j),t("./direct_resolve")(r),t("./synchronous_inspection")(r),t("./join")(r,w,k,m,j),r.Promise=r,f.toFastProperties(r),f.toFastProperties(r.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new r(m)),j.setBounds(_.firstLineError,f.lastLineError),r}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var s=o._bitField;if(this._values=o,0===(50397184&s))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(o)},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;n>s;++s){var c=r(t[s],i);c instanceof e?(c=c._target(),a=c._bitField):a=null,o?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):o=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(c,s)}o||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;no;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityn;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!E.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return E.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=E.names(t.prototype),n=E.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=P.test(t+"")&&E.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function h(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return S.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&E.propertyIsWritable(t,"stack")}function C(t){return{}.toString.call(t)}function k(t,e,n){for(var r=E.names(t),i=0;i10||t[0]>0}(),U.isNode&&U.toFastProperties(process);try{throw new Error}catch(H){U.lastLineError=H}e.exports=U},{"./es5":10}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=s},{"./queue":17,"./schedule":18,"./util":21}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function a(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function s(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function f(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function h(){this._trace=new S(this._peekContext())}function _(t,e){if(B(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=w(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&$){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="a promise was created in a "+n+"handler but was not returned from it";r._warn(o,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(rt.warnings){var i,o=new U(t);if(n)r._attachExtraTrace(o);else if(rt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var a=w(o);o.stack=a.message+"\n"+a.stack.join("\n")}Y("warning",o)||E(o,"",!0)}}function g(t,e){for(var n=0;n=0;--s)if(r[s]===o){a=s;break}for(var s=a;s>=0;--s){var c=r[s];if(e[i]!==c)break;e.pop(),i--}e=r}}function C(t){for(var e=[],n=0;n0&&(e=e.slice(n)),e}function w(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?k(t):[" (No stack trace)"],{message:n,stack:C(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof N?N(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function j(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?Y(t,n,r)||i||E(n,"Unhandled rejection "):Y(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+T(e)+">, no stack trace)"}function T(t){var e=41;return t.lengtha||0>s||!n||!r||n!==r||a>=s||(tt=function(t){if(D.test(t))return!0;var e=P(t);return e&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);nt(this,S),e>32&&this.uncycle()}var x,A,N,L=e._getDomain,I=e._async,U=t("./errors").Warning,H=t("./util"),B=H.canAttachTrace,D=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,V=null,Q=null,q=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),M=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),W=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),$=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(M||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",x,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=L();A="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=L();x="function"==typeof t?null===e?t:e.bind(t):void 0};var z=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!rt.longStackTraces&&O()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;rt.longStackTraces=!0,z=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),rt.longStackTraces=!1},e.prototype._captureStackTrace=h,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return rt.longStackTraces&&O()};var X=function(){try{var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),K=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),J={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},Y=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=X(t,J[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&z()),"warnings"in t){var n=t.warnings;rt.warnings=!!n,$=rt.warnings,H.isObject(n)&&"wForgottenReturn"in n&&($=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!rt.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=s,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=o,Z=u,rt.cancellation=!0}"monitoring"in t&&(t.monitoring&&!rt.monitoring?(rt.monitoring=!0,e.prototype._fireEvent=Y):!t.monitoring&&rt.monitoring&&(rt.monitoring=!1,e.prototype._fireEvent=i))},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var Z=p,tt=function(){return!1},et=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=w(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(C(i.stack.split("\n"))),i=i._parent;b(r),m(r),H.notEnumerableProp(t,"stack",g(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var nt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,V=t,Q=e;var n=Error.captureStackTrace;return tt=function(t){return D.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return V=/@/,Q=e,q=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(V=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(N=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?N=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(N=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var rt={warnings:M,longStackTraces:!1,cancellation:!1,monitoring:!1};return W&&e.longStackTraces(),{longStackTraces:function(){return rt.longStackTraces},warnings:function(){return rt.warnings},cancellation:function(){return rt.cancellation},monitoring:function(){return rt.monitoring},propagateFromFunction:function(){return Z},boundValueFunction:function(){return f},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:X,fireGlobalEvent:K}}},{"./errors":9,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(v){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return c.call(this,this.promise._target()._settledValue())}function s(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var f=n(l,r);if(f instanceof e){if(null!=this.cancelPromise){if(f.isCancelled()){var h=new u("late cancellation observer");return r._attachExtraTrace(h),p.e=h,p}f.isPending()&&f._attachCancellationCallback(new i(this))}return f._then(a,s,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util");o.canEvaluate,o.tryCatch,o.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=s(t).apply(this,arguments),a=r._popContext();return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else c=s(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return u("expecting an object but got "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(j.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new w(this).promise()},r.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(m);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=R(t)(O(e,n));return i===P&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new w(t).promise()},r.cast=function(t){var e=k(t);return e instanceof r||(e=new r(m),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+f.classString(t));return d.setScheduler(t)},r.prototype._then=function(t,e,n,i,o){var a=void 0!==o,c=a?o:new r(m),l=this._target(),u=l._bitField;a||(c._propagateFrom(this,3), +c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,c));var p=s();if(0!==(50397184&u)){var f,h,_=l._settlePromiseCtx;0!==(33554432&u)?(h=l._rejectionHandler0,f=t):0!==(16777216&u)?(h=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,h=new g("late cancellation observer"),l._attachExtraTrace(h),f=e),d.invoke(_,l,{handler:null===p?f:"function"==typeof f&&p.bind(f),promise:c,receiver:i,value:h})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},r.prototype._setAsyncGuaranteed=function(){d.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:i.bind(t)),"function"==typeof e&&(this[a+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=k(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target();if(i===this)return void this._reject(c());var o=i._bitField;if(0===(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;a>s;++s)i._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new g("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&j.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&"number"==typeof n.length?o=R(t).apply(this._boundValue(),n):(o=P,o.e=new y("cannot .spread() a non-array: "+f.classString(n))):o=R(t).call(e,n);var a=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===P?r._rejectCallback(o.e,!1):(j.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)))}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var a=t instanceof r,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),i instanceof F&&i.isFinallyHandler()?(i.cancelPromise=t,R(n).call(i,o)===P&&t._reject(P.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):a||t instanceof w?t._cancel():i.cancel()):"function"==typeof n?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&s)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;"function"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,f.isNode):void((65535&e)>0?d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){j.deprecated("Promise.defer","new Promise");var t=new r(m);return{promise:t,resolve:i,reject:o}},f.notEnumerableProp(r,"_makeSelfResolutionError",c),t("./method")(r,m,k,u,j),t("./bind")(r,m,k,j),t("./cancel")(r,w,u,j),t("./direct_resolve")(r),t("./synchronous_inspection")(r),t("./join")(r,w,k,m,j),r.Promise=r,f.toFastProperties(r),f.toFastProperties(r.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new r(m)),j.setBounds(_.firstLineError,f.lastLineError),r}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var s=o._bitField;if(this._values=o,0===(50397184&s))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(o)},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;n>s;++s){var c=r(t[s],i);c instanceof e?(c=c._target(),a=c._bitField):a=null,o?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):o=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(c,s)}o||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;no;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityn;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!j.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return j.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=j.names(t.prototype),n=j.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&j.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function h(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return A.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&j.propertyIsWritable(t,"stack")}function C(t){return{}.toString.call(t)}function k(t,e,n){for(var r=j.names(t),i=0;i10||t[0]>0}(),H.isNode&&H.toFastProperties(process);try{throw new Error}catch(B){H.lastLineError=B}e.exports=H},{"./es5":10}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/tools/eslint/node_modules/bluebird/js/browser/bluebird.js b/tools/eslint/node_modules/bluebird/js/browser/bluebird.js index 98867e6cc13cba..25ac9b32dde640 100644 --- a/tools/eslint/node_modules/bluebird/js/browser/bluebird.js +++ b/tools/eslint/node_modules/bluebird/js/browser/bluebird.js @@ -1,18 +1,18 @@ /* @preserve * The MIT License (MIT) - * + * * Copyright (c) 2013-2015 Petka Antonov - * + * * 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 @@ -20,10 +20,10 @@ * 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. - * + * */ /** - * bluebird build version 3.3.1 + * bluebird build version 3.3.5 * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;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 _dereq_=="function"&&_dereq_;for(var o=0;o 0) { - if (((bitField & 134217728) !== 0)) { - this._settlePromises(); - } else { - async.settlePromises(this); - } + async.settlePromises(this); } else { this._ensurePossibleRejectionHandled(); } @@ -3322,42 +3351,42 @@ _dereq_("./join")( Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug); Promise.Promise = Promise; _dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./call_get.js')(Promise); _dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); _dereq_('./timers.js')(Promise, INTERNAL, debug); _dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); _dereq_('./nodeify.js')(Promise); -_dereq_('./call_get.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); _dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); _dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); _dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); _dereq_('./settle.js')(Promise, PromiseArray, debug); _dereq_('./some.js')(Promise, PromiseArray, apiRejection); -_dereq_('./promisify.js')(Promise, INTERNAL); -_dereq_('./any.js')(Promise); -_dereq_('./each.js')(Promise, INTERNAL); _dereq_('./filter.js')(Promise, INTERNAL); - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - debug.setBounds(Async.firstLineError, util.lastLineError); - return Promise; +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; }; @@ -4297,12 +4326,18 @@ var schedule; var noAsyncScheduler = function() { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); }; +var NativePromise = util.getNativePromise(); if (util.isNode && typeof MutationObserver === "undefined") { var GlobalSetImmediate = global.setImmediate; var ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; } else if ((typeof MutationObserver !== "undefined") && !(typeof window !== "undefined" && window.navigator && @@ -4314,23 +4349,23 @@ if (util.isNode && typeof MutationObserver === "undefined") { var div2 = document.createElement("div"); var o2 = new MutationObserver(function() { div.classList.toggle("foo"); - toggleScheduled = false; + toggleScheduled = false; }); o2.observe(div2, opts); var scheduleToggle = function() { if (toggleScheduled) return; - toggleScheduled = true; - div2.classList.toggle("foo"); - }; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; - return function schedule(fn) { - var o = new MutationObserver(function() { - o.disconnect(); - fn(); - }); - o.observe(div, opts); - scheduleToggle(); + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); }; })(); } else if (typeof setImmediate !== "undefined") { @@ -5361,6 +5396,17 @@ function env(key, def) { return isNode ? process.env[key] : def; } +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + var ret = { isClass: isClass, isIdentifier: isIdentifier, @@ -5392,7 +5438,8 @@ var ret = { typeof chrome.loadTimes === "function", isNode: isNode, env: env, - global: globalObject + global: globalObject, + getNativePromise: getNativePromise }; ret.isRecentNode = ret.isNode && (function() { var version = process.versions.node.split(".").map(Number); diff --git a/tools/eslint/node_modules/bluebird/js/browser/bluebird.min.js b/tools/eslint/node_modules/bluebird/js/browser/bluebird.min.js index 84453a8baf2ac6..fc35327f2f2c22 100644 --- a/tools/eslint/node_modules/bluebird/js/browser/bluebird.min.js +++ b/tools/eslint/node_modules/bluebird/js/browser/bluebird.min.js @@ -1,18 +1,18 @@ /* @preserve * The MIT License (MIT) - * + * * Copyright (c) 2013-2015 Petka Antonov - * + * * 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 @@ -20,12 +20,12 @@ * 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. - * + * */ /** - * bluebird build version 3.3.1 + * bluebird build version 3.3.5 * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new O(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&z){if(void 0!==i&&i._returnedNonUndefined())return;n&&(n+=" ");var o="a promise was created in a "+n+"handler but was not returned from it";r._warn(o,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(rt.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(rt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}Y("warning",o)||k(o,"",!0)}}function g(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n0&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:w(e)}}function k(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+M(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function E(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?Y(t,n,r)||i||k(n,"Unhandled rejection "):Y(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(tt=function(t){if(U.test(t))return!0;var e=R(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function O(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);nt(this,O),e>32&&this.uncycle()}var S,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,U=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,B=null,M=null,q=!1,Q=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),$=!(0==H.env("BLUEBIRD_WARNINGS")||!Q&&!H.env("BLUEBIRD_WARNINGS")),G=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!Q&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),z=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){E("rejectionHandled",S,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),E("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();S="function"==typeof t?null===e?t:e.bind(t):void 0};var X=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!rt.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;rt.longStackTraces=!0,X=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),rt.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return rt.longStackTraces&&T()};var W=function(){try{var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),K=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),J={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},Y=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=W(t,J[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&X()),"warnings"in t){var n=t.warnings;rt.warnings=!!n,z=rt.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(z=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!rt.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,Z=u,rt.cancellation=!0}"monitoring"in t&&(t.monitoring&&!rt.monitoring?(rt.monitoring=!0,e.prototype._fireEvent=Y):!t.monitoring&&rt.monitoring&&(rt.monitoring=!1,e.prototype._fireEvent=i))},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var Z=p,tt=function(){return!1},et=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(O,Error),n.CapturedTrace=O,O.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},O.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),m(r),H.notEnumerableProp(t,"stack",g(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var nt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,B=t,M=e;var n=Error.captureStackTrace;return tt=function(t){return U.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return B=/@/,M=e,q=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(M=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(B=t,M=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var rt={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return G&&e.longStackTraces(),{longStackTraces:function(){return rt.longStackTraces},warnings:function(){return rt.warnings},cancellation:function(){return rt.cancellation},monitoring:function(){return rt.monitoring},propagateFromFunction:function(){return Z},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:P,warn:y,deprecated:v,CapturedTrace:O,fireDomEvent:W,fireGlobalEvent:K}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return this.mapSeries(t)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,e){return r(t,e)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h.isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:i.bind(e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void 0,-2)}function c(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+u.classString(e));var o="object"==typeof n&&null!==n?n.concurrency:0;return o="number"==typeof o&&isFinite(o)&&o>=1?o:0,new a(t,e,o,i).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=[];u.inherits(a,n),a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit; -if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var g=++this._totalResolved;return g>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return u("expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},r.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(m);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=O(t)(R(e,n));return i===P&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new j(t).promise()},r.cast=function(t){var e=C(t);return e instanceof r||(e=new r(m),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t));var e=d._schedule;return d._schedule=t,e},r.prototype._then=function(t,e,n,i,o){var s=void 0!==o,c=s?o:new r(m),l=this._target(),u=l._bitField;s||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,c));var p=a();if(0!==(50397184&u)){var h,f,_=l._settlePromiseCtx;0!==(33554432&u)?(f=l._rejectionHandler0,h=t):0!==(16777216&u)?(f=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,f=new g("late cancellation observer"),l._attachExtraTrace(f),h=e),d.invoke(_,l,{handler:null===p?h:"function"==typeof h&&p.bind(h),promise:c,receiver:i,value:f})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},r.prototype._setAsyncGuaranteed=function(){this._bitField=134217728|this._bitField},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:i.bind(t)),"function"==typeof e&&(this[s+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=C(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target(),o=i._bitField;if(0===(50397184&o)){var s=this._length();s>0&&i._migrateCallback0(this);for(var a=1;s>a;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new g("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){var o="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=P,o.e=new y("cannot .spread() a non-array: "+h.classString(n))):o=O(t).call(e,n);var s=r._popContext();if(i=r._bitField,0===(65536&i))if(o===w)r._reject(n);else if(o===P||o===r){var a=o===r?c():o.e;r._rejectCallback(a,!1)}else F.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var s=t instanceof r,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),i instanceof x&&i.isFinallyHandler()?(i.cancelPromise=t,O(n).call(i,o)===P&&t._reject(P.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):s||t instanceof j?t._cancel():i.cancel()):"function"==typeof n?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&a)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;"function"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,h.isNode):void((65535&e)>0?0!==(134217728&e)?this._settlePromises():d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){F.deprecated("Promise.defer","new Promise");var t=new r(m);return{promise:t,resolve:i,reject:o}},h.notEnumerableProp(r,"_makeSelfResolutionError",c),t("./method")(r,m,C,u,F),t("./bind")(r,m,C,F),t("./cancel")(r,j,u,F),t("./direct_resolve")(r),t("./synchronous_inspection")(r),t("./join")(r,j,C,m,F),r.Promise=r,t("./map.js")(r,j,u,C,m,F),t("./using.js")(r,u,C,E,m,F),t("./timers.js")(r,m,F),t("./generators.js")(r,u,m,C,e,F),t("./nodeify.js")(r),t("./call_get.js")(r),t("./props.js")(r,j,C,u),t("./race.js")(r,m,C,u),t("./reduce.js")(r,j,u,C,m,F),t("./settle.js")(r,j,F),t("./some.js")(r,j,u),t("./promisify.js")(r,m),t("./any.js")(r),t("./each.js")(r,m),t("./filter.js")(r,m),h.toFastProperties(r),h.toFastProperties(r.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new r(m)),F.setBounds(_.firstLineError,h.lastLineError),r}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===E)t[_]=E(u,h,u,p,e,i);else{var d=r(p,function(){return E(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return E(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},E=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new g("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=m);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:s.bind(n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?[]:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")};if(i.isNode&&"undefined"==typeof MutationObserver){var s=global.setImmediate,a=process.nextTick;r=i.isRecentNode?function(t){s.call(global,t)}:function(t){a.call(process,t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField, -this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=t.prototype._isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype.isCancelled=function(){return this._target()._isCancelled()},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){return p.call(t,"_promise0")}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a))),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch;u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=x;return x=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return x=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!k.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return k.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=k.names(t.prototype),n=k.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=O.test(t+"")&&k.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return S.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&k.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=k.names(t),i=0;i10||t[0]>0}(),L.isNode&&L.toFastProperties(process);try{throw new Error}catch(H){L.lastLineError=H}e.exports=L},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&z){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="a promise was created in a "+n+"handler but was not returned from it";r._warn(o,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(rt.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(rt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}Y("warning",o)||k(o,"",!0)}}function m(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n0&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:w(e)}}function k(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+M(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function E(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?Y(t,n,r)||i||k(n,"Unhandled rejection "):Y(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(tt=function(t){if(U.test(t))return!0;var e=P(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);nt(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,U=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,B=null,M=null,q=!1,Q=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),$=!(0==H.env("BLUEBIRD_WARNINGS")||!Q&&!H.env("BLUEBIRD_WARNINGS")),G=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!Q&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),z=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){E("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),E("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:e.bind(t):void 0};var X=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!rt.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;rt.longStackTraces=!0,X=function(){if(I.haveItemsQueued()&&!rt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),rt.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return rt.longStackTraces&&T()};var W=function(){try{var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),K=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),J={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},Y=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=W(t,J[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&X()),"warnings"in t){var n=t.warnings;rt.warnings=!!n,z=rt.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(z=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!rt.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,Z=u,rt.cancellation=!0}"monitoring"in t&&(t.monitoring&&!rt.monitoring?(rt.monitoring=!0,e.prototype._fireEvent=Y):!t.monitoring&&rt.monitoring&&(rt.monitoring=!1,e.prototype._fireEvent=i))},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var Z=p,tt=function(){return!1},et=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),g(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var nt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,B=t,M=e;var n=Error.captureStackTrace;return tt=function(t){return U.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return B=/@/,M=e,q=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(M=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(B=t,M=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var rt={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return G&&e.longStackTraces(),{longStackTraces:function(){return rt.longStackTraces},warnings:function(){return rt.warnings},cancellation:function(){return rt.cancellation},monitoring:function(){return rt.monitoring},propagateFromFunction:function(){return Z},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:W,fireGlobalEvent:K}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return this.mapSeries(t)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,e){return r(t,e)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h.isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:i.bind(e), +this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void 0,-2)}function c(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+u.classString(e));var o="object"==typeof n&&null!==n?n.concurrency:0;return o="number"==typeof o&&isFinite(o)&&o>=1?o:0,new a(t,e,o,i).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=[];u.inherits(a,n),a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var m=++this._totalResolved;return m>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return u("expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},r.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(g);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=S(t)(P(e,n));return i===R&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new j(t).promise()},r.cast=function(t){var e=C(t);return e instanceof r||(e=new r(g),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(g);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t));return d.setScheduler(t)},r.prototype._then=function(t,e,n,i,o){var s=void 0!==o,c=s?o:new r(g),l=this._target(),u=l._bitField;s||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,c));var p=a();if(0!==(50397184&u)){var h,f,_=l._settlePromiseCtx;0!==(33554432&u)?(f=l._rejectionHandler0,h=t):0!==(16777216&u)?(f=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,f=new m("late cancellation observer"),l._attachExtraTrace(f),h=e),d.invoke(_,l,{handler:null===p?h:"function"==typeof h&&p.bind(h),promise:c,receiver:i,value:f})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},r.prototype._setAsyncGuaranteed=function(){d.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:i.bind(t)),"function"==typeof e&&(this[s+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=C(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target();if(i===this)return void this._reject(c());var o=i._bitField;if(0===(50397184&o)){var s=this._length();s>0&&i._migrateCallback0(this);for(var a=1;s>a;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new m("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){var o="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&"number"==typeof n.length?o=S(t).apply(this._boundValue(),n):(o=R,o.e=new y("cannot .spread() a non-array: "+h.classString(n))):o=S(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===R?r._rejectCallback(o.e,!1):(F.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var s=t instanceof r,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),i instanceof x&&i.isFinallyHandler()?(i.cancelPromise=t,S(n).call(i,o)===R&&t._reject(R.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):s||t instanceof j?t._cancel():i.cancel()):"function"==typeof n?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&a)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;"function"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,h.isNode):void((65535&e)>0?d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){F.deprecated("Promise.defer","new Promise");var t=new r(g);return{promise:t,resolve:i,reject:o}},h.notEnumerableProp(r,"_makeSelfResolutionError",c),t("./method")(r,g,C,u,F),t("./bind")(r,g,C,F),t("./cancel")(r,j,u,F),t("./direct_resolve")(r),t("./synchronous_inspection")(r),t("./join")(r,j,C,g,F),r.Promise=r,t("./map.js")(r,j,u,C,g,F),t("./call_get.js")(r),t("./using.js")(r,u,C,E,g,F),t("./timers.js")(r,g,F),t("./generators.js")(r,u,g,C,e,F),t("./nodeify.js")(r),t("./promisify.js")(r,g),t("./props.js")(r,j,C,u),t("./race.js")(r,g,C,u),t("./reduce.js")(r,j,u,C,g,F),t("./settle.js")(r,j,F),t("./some.js")(r,j,u),t("./filter.js")(r,g),t("./each.js")(r,g),t("./any.js")(r),h.toFastProperties(r),h.toFastProperties(r.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new r(g)),F.setBounds(_.firstLineError,h.lastLineError),r}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===E)t[_]=E(u,h,u,p,e,i);else{var d=r(p,function(){return E(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return E(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,m=t("./errors").TypeError,g="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},E=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=g);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:s.bind(n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?[]:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t); +},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=t.prototype._isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype.isCancelled=function(){return this._target()._isCancelled()},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){return p.call(t,"_promise0")}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a))),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,m=_.tryCatch;u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var g=r(d);g instanceof e&&(d=g._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=T;return T=null,t.apply(this,arguments)}catch(e){return x.e=e,x}}function i(t){return T=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!E.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return E.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=E.names(t.prototype),n=E.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=O.test(t+"")&&E.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return A.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function m(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&E.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=E.names(t),i=0;i10||t[0]>0}(),H.isNode&&H.toFastProperties(process);try{throw new Error}catch(N){H.lastLineError=N}e.exports=H},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/tools/eslint/node_modules/bluebird/package.json b/tools/eslint/node_modules/bluebird/package.json index 9e2e08ba759d64..e6ee6404c49b0c 100644 --- a/tools/eslint/node_modules/bluebird/package.json +++ b/tools/eslint/node_modules/bluebird/package.json @@ -2,18 +2,18 @@ "_args": [ [ "bluebird@^3.1.1", - "/Users/trott/test/node_modules/eslint/node_modules/table" + "/Users/trott/io.js/tools/node_modules/table" ] ], "_from": "bluebird@>=3.1.1 <4.0.0", - "_id": "bluebird@3.3.1", + "_id": "bluebird@3.3.5", "_inCache": true, "_installable": true, - "_location": "/eslint/bluebird", + "_location": "/bluebird", "_nodeVersion": "5.6.0", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/bluebird-3.3.1.tgz_1455386657547_0.7821501416619867" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/bluebird-3.3.5.tgz_1460492125062_0.2224250645376742" }, "_npmUser": { "email": "petka_antonov@hotmail.com", @@ -30,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/table" + "/table" ], - "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.1.tgz", - "_shasum": "f97ae1970f41d85177283053e9a120160e66c61d", + "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.5.tgz", + "_shasum": "5ee747f1c7bd967658b683936430aee753955a34", "_shrinkwrap": null, "_spec": "bluebird@^3.1.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/table", + "_where": "/Users/trott/io.js/tools/node_modules/table", "author": { "email": "petka_antonov@hotmail.com", "name": "Petka Antonov", @@ -76,15 +76,15 @@ }, "directories": {}, "dist": { - "shasum": "f97ae1970f41d85177283053e9a120160e66c61d", - "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-3.3.1.tgz" + "shasum": "5ee747f1c7bd967658b683936430aee753955a34", + "tarball": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.5.tgz" }, "files": [ "js/browser", "js/release", "LICENSE" ], - "gitHead": "22a4a099652dd555545c19973a5c6fc7e0a7973a", + "gitHead": "ee247f1a04b5ab7cc8a283bedd13d2e83d28f936", "homepage": "https://github.com/petkaantonov/bluebird", "keywords": [ "promise", @@ -124,5 +124,5 @@ "prepublish": "npm run generate-browser-core && npm run generate-browser-full", "test": "node tools/test.js" }, - "version": "3.3.1" + "version": "3.3.5" } diff --git a/tools/eslint/node_modules/brace-expansion/.npmignore b/tools/eslint/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/tools/eslint/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/tools/eslint/node_modules/brace-expansion/README.md b/tools/eslint/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/tools/eslint/node_modules/brace-expansion/README.md +++ b/tools/eslint/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/tools/eslint/node_modules/brace-expansion/example.js b/tools/eslint/node_modules/brace-expansion/example.js index 36cde4de5c114b..60ecfc74d41618 100644 --- a/tools/eslint/node_modules/brace-expansion/example.js +++ b/tools/eslint/node_modules/brace-expansion/example.js @@ -5,3 +5,4 @@ console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); console.log(expand('http://www.letters.com/file{a..z..2}.txt')); console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); + diff --git a/tools/eslint/node_modules/brace-expansion/index.js b/tools/eslint/node_modules/brace-expansion/index.js index abe535df327354..932718f9287173 100644 --- a/tools/eslint/node_modules/brace-expansion/index.js +++ b/tools/eslint/node_modules/brace-expansion/index.js @@ -188,3 +188,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/tools/eslint/node_modules/brace-expansion/package.json b/tools/eslint/node_modules/brace-expansion/package.json index db1cdee62bd86e..de15a744c8af49 100644 --- a/tools/eslint/node_modules/brace-expansion/package.json +++ b/tools/eslint/node_modules/brace-expansion/package.json @@ -2,14 +2,14 @@ "_args": [ [ "brace-expansion@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/minimatch" + "/Users/trott/io.js/tools/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", "_id": "brace-expansion@1.1.3", "_inCache": true, "_installable": true, - "_location": "/eslint/brace-expansion", + "_location": "/brace-expansion", "_nodeVersion": "5.5.0", "_npmOperationalInternal": { "host": "packages-6-west.internal.npmjs.com", @@ -30,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/minimatch" + "/minimatch" ], "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/minimatch", + "_where": "/Users/trott/io.js/tools/node_modules/minimatch", "author": { "email": "mail@juliangruber.com", "name": "Julian Gruber", diff --git a/tools/eslint/node_modules/caller-path/index.js b/tools/eslint/node_modules/caller-path/index.js new file mode 100644 index 00000000000000..b09866d479aa39 --- /dev/null +++ b/tools/eslint/node_modules/caller-path/index.js @@ -0,0 +1,6 @@ +'use strict'; +var callsites = require('callsites'); + +module.exports = function () { + return callsites()[2].getFileName(); +}; diff --git a/tools/eslint/node_modules/caller-path/package.json b/tools/eslint/node_modules/caller-path/package.json new file mode 100644 index 00000000000000..b58a29e66660b7 --- /dev/null +++ b/tools/eslint/node_modules/caller-path/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "caller-path@^0.1.0", + "/Users/trott/io.js/tools/node_modules/require-uncached" + ] + ], + "_from": "caller-path@>=0.1.0 <0.2.0", + "_id": "caller-path@0.1.0", + "_inCache": true, + "_installable": true, + "_location": "/caller-path", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "name": "caller-path", + "raw": "caller-path@^0.1.0", + "rawSpec": "^0.1.0", + "scope": null, + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/require-uncached" + ], + "_resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "_shasum": "94085ef63581ecd3daa92444a8fe94e82577751f", + "_shrinkwrap": null, + "_spec": "caller-path@^0.1.0", + "_where": "/Users/trott/io.js/tools/node_modules/require-uncached", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/caller-path/issues" + }, + "dependencies": { + "callsites": "^0.2.0" + }, + "description": "Get the path of the caller module", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "94085ef63581ecd3daa92444a8fe94e82577751f", + "tarball": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/caller-path", + "keywords": [ + "caller", + "calling", + "module", + "path", + "parent", + "callsites", + "callsite", + "stacktrace", + "stack", + "trace", + "function", + "file" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "caller-path", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/caller-path.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.0" +} diff --git a/tools/eslint/node_modules/caller-path/readme.md b/tools/eslint/node_modules/caller-path/readme.md new file mode 100644 index 00000000000000..9393301c355faa --- /dev/null +++ b/tools/eslint/node_modules/caller-path/readme.md @@ -0,0 +1,36 @@ +# caller-path [![Build Status](https://travis-ci.org/sindresorhus/caller-path.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-path) + +> Get the path of the caller module + +You can't use [`module.parent`](http://nodejs.org/api/modules.html#modules_module_parent) as modules are cached and it will return the first caller module, not necessarily the current one. + + +## Install + +``` +$ npm install --save caller-path +``` + + +## Usage + +```js +// foo.js +var callerPath = require('caller-path'); + +module.exports = function () { + console.log(callerPath()); + //=> /Users/sindresorhus/dev/unicorn/bar.js +} +``` + +```js +// bar.js +var foo = require('./foo'); +foo(); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/callsites/index.js b/tools/eslint/node_modules/callsites/index.js new file mode 100644 index 00000000000000..098a2513a6fedd --- /dev/null +++ b/tools/eslint/node_modules/callsites/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = function () { + var _ = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack }; + var stack = new Error().stack.slice(1); + Error.prepareStackTrace = _; + return stack; +}; diff --git a/tools/eslint/node_modules/callsites/package.json b/tools/eslint/node_modules/callsites/package.json new file mode 100644 index 00000000000000..e6476010de2def --- /dev/null +++ b/tools/eslint/node_modules/callsites/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "callsites@^0.2.0", + "/Users/trott/io.js/tools/node_modules/caller-path" + ] + ], + "_from": "callsites@>=0.2.0 <0.3.0", + "_id": "callsites@0.2.0", + "_inCache": true, + "_installable": true, + "_location": "/callsites", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "name": "callsites", + "raw": "callsites@^0.2.0", + "rawSpec": "^0.2.0", + "scope": null, + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/caller-path" + ], + "_resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "_shasum": "afab96262910a7f33c19a5775825c69f34e350ca", + "_shrinkwrap": null, + "_spec": "callsites@^0.2.0", + "_where": "/Users/trott/io.js/tools/node_modules/caller-path", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/callsites/issues" + }, + "dependencies": {}, + "description": "Get callsites from the V8 stack trace API", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "afab96262910a7f33c19a5775825c69f34e350ca", + "tarball": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/callsites", + "keywords": [ + "callsites", + "callsite", + "v8", + "stacktrace", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "callsites", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/callsites.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.2.0" +} diff --git a/tools/eslint/node_modules/callsites/readme.md b/tools/eslint/node_modules/callsites/readme.md new file mode 100644 index 00000000000000..23aaca443a4824 --- /dev/null +++ b/tools/eslint/node_modules/callsites/readme.md @@ -0,0 +1,47 @@ +# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites) + +> Get callsites from the [V8 stack trace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi) + + +## Install + +```sh +$ npm install --save callsites +``` + + +## Usage + +```js +var callsites = require('callsites'); + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> /Users/sindresorhus/dev/callsites/test.js +} + +unicorn(); +``` + +## API + +Returns an array of callsite objects with the following methods: + +- `getThis`: returns the value of this +- `getTypeName`: returns the type of this as a string. This is the name of the function stored in the constructor field of this, if available, otherwise the object's [[Class]] internal property. +- `getFunction`: returns the current function +- `getFunctionName`: returns the name of the current function, typically its name property. If a name property is not available an attempt will be made to try to infer a name from the function's context. +- `getMethodName`: returns the name of the property of this or one of its prototypes that holds the current function +- `getFileName`: if this function was defined in a script returns the name of the script +- `getLineNumber`: if this function was defined in a script returns the current line number +- `getColumnNumber`: if this function was defined in a script returns the current column number +- `getEvalOrigin`: if this function was created using a call to eval returns a CallSite object representing the location where eval was called +- `isToplevel`: is this a toplevel invocation, that is, is this the global object? +- `isEval`: does this call take place in code defined by a call to eval? +- `isNative`: is this call in native V8 code? +- `isConstructor`: is this a constructor call? + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/chalk/package.json b/tools/eslint/node_modules/chalk/package.json index 392510f7a39713..310c22ce48974a 100644 --- a/tools/eslint/node_modules/chalk/package.json +++ b/tools/eslint/node_modules/chalk/package.json @@ -1,45 +1,49 @@ { "_args": [ [ - "chalk@^1.0.0", - "/Users/trott/test/node_modules/eslint" + "chalk@^1.1.3", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "chalk@>=1.0.0 <2.0.0", - "_id": "chalk@1.1.1", + "_from": "chalk@>=1.1.3 <2.0.0", + "_id": "chalk@1.1.3", "_inCache": true, "_installable": true, - "_location": "/eslint/chalk", - "_nodeVersion": "0.12.7", + "_location": "/chalk", + "_nodeVersion": "0.10.32", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "email": "i.am.qix@gmail.com", + "name": "qix" }, - "_npmVersion": "2.13.5", + "_npmVersion": "2.14.2", "_phantomChildren": {}, "_requested": { "name": "chalk", - "raw": "chalk@^1.0.0", - "rawSpec": "^1.0.0", + "raw": "chalk@^1.1.3", + "rawSpec": "^1.1.3", "scope": null, - "spec": ">=1.0.0 <2.0.0", + "spec": ">=1.1.3 <2.0.0", "type": "range" }, "_requiredBy": [ "/eslint", - "/eslint/inquirer", - "/eslint/table" + "/inquirer", + "/table" ], - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", - "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019", + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", "_shrinkwrap": null, - "_spec": "chalk@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "chalk@^1.1.3", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "bugs": { "url": "https://github.com/chalk/chalk/issues" }, "dependencies": { - "ansi-styles": "^2.1.0", + "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", @@ -58,8 +62,8 @@ }, "directories": {}, "dist": { - "shasum": "509afb67066e7499f7eb3535c77445772ae2d019", - "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" + "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" }, "engines": { "node": ">=0.10.0" @@ -67,7 +71,7 @@ "files": [ "index.js" ], - "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5", + "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", "homepage": "https://github.com/chalk/chalk#readme", "keywords": [ "color", @@ -95,12 +99,12 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "email": "i.am.qix@gmail.com", + "name": "qix" }, { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, { "email": "sindresorhus+unicorn@gmail.com", @@ -120,7 +124,7 @@ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", "test": "xo && mocha" }, - "version": "1.1.1", + "version": "1.1.3", "xo": { "envs": [ "node", diff --git a/tools/eslint/node_modules/cli-cursor/package.json b/tools/eslint/node_modules/cli-cursor/package.json index e25d31bce80c75..ecc6fe50e580b3 100644 --- a/tools/eslint/node_modules/cli-cursor/package.json +++ b/tools/eslint/node_modules/cli-cursor/package.json @@ -2,14 +2,14 @@ "_args": [ [ "cli-cursor@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "cli-cursor@>=1.0.1 <2.0.0", "_id": "cli-cursor@1.0.2", "_inCache": true, "_installable": true, - "_location": "/eslint/cli-cursor", + "_location": "/cli-cursor", "_nodeVersion": "4.1.0", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/inquirer" ], "_resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", "_shasum": "64da3f7d56a54412e59794bd62dc35295e8f2987", "_shrinkwrap": null, "_spec": "cli-cursor@^1.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/cli-width/.npmignore b/tools/eslint/node_modules/cli-width/.npmignore deleted file mode 100644 index 9daeafb9864cf4..00000000000000 --- a/tools/eslint/node_modules/cli-width/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/tools/eslint/node_modules/cli-width/.travis.yml b/tools/eslint/node_modules/cli-width/.travis.yml deleted file mode 100644 index 7a188cb083b59e..00000000000000 --- a/tools/eslint/node_modules/cli-width/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.11' - - '0.12' - - 'iojs-1' - - 'iojs-2' - - 'iojs-3' - - '4.0' -after_script: - - npm run coveralls diff --git a/tools/eslint/node_modules/cli-width/coverage/coverage.json b/tools/eslint/node_modules/cli-width/coverage/coverage.json deleted file mode 100644 index 3443e029319b75..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/coverage.json +++ /dev/null @@ -1 +0,0 @@ -{"/Users/iradchenko/sandbox/cli-width/index.js":{"path":"/Users/iradchenko/sandbox/cli-width/index.js","s":{"1":1,"2":1,"3":1,"4":6,"5":1,"6":5,"7":5,"8":1,"9":4,"10":2,"11":2,"12":1,"13":3},"b":{"1":[1,5],"2":[1,4],"3":[2,2],"4":[1,1]},"f":{"1":6},"fnMap":{"1":{"name":"cliWidth","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":20}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":25}},"3":{"start":{"line":6,"column":0},"end":{"line":28,"column":1}},"4":{"start":{"line":7,"column":2},"end":{"line":27,"column":3}},"5":{"start":{"line":8,"column":4},"end":{"line":8,"column":45}},"6":{"start":{"line":11,"column":4},"end":{"line":11,"column":29}},"7":{"start":{"line":13,"column":4},"end":{"line":26,"column":5}},"8":{"start":{"line":14,"column":6},"end":{"line":14,"column":36}},"9":{"start":{"line":17,"column":6},"end":{"line":23,"column":7}},"10":{"start":{"line":18,"column":8},"end":{"line":18,"column":56}},"11":{"start":{"line":20,"column":8},"end":{"line":22,"column":9}},"12":{"start":{"line":21,"column":10},"end":{"line":21,"column":23}},"13":{"start":{"line":25,"column":6},"end":{"line":25,"column":34}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":2},"end":{"line":7,"column":2}},{"start":{"line":7,"column":2},"end":{"line":7,"column":2}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":13,"column":4}},{"start":{"line":13,"column":4},"end":{"line":13,"column":4}}]},"3":{"line":15,"type":"if","locations":[{"start":{"line":17,"column":6},"end":{"line":17,"column":6}},{"start":{"line":17,"column":6},"end":{"line":17,"column":6}}]},"4":{"line":18,"type":"if","locations":[{"start":{"line":20,"column":8},"end":{"line":20,"column":8}},{"start":{"line":20,"column":8},"end":{"line":20,"column":8}}]}}}} \ No newline at end of file diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/base.css b/tools/eslint/node_modules/cli-width/coverage/lcov-report/base.css deleted file mode 100644 index a6a2f3284d0221..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/lcov-report/base.css +++ /dev/null @@ -1,182 +0,0 @@ -body, html { - margin:0; padding: 0; -} -body { - font-family: Helvetica Neue, Helvetica,Arial; - font-size: 10pt; -} -div.header, div.footer { - background: #eee; - padding: 1em; -} -div.header { - z-index: 100; - position: fixed; - top: 0; - border-bottom: 1px solid #666; - width: 100%; -} -div.footer { - border-top: 1px solid #666; -} -div.body { - margin-top: 10em; -} -div.meta { - font-size: 90%; - text-align: center; -} -h1, h2, h3 { - font-weight: normal; -} -h1 { - font-size: 12pt; -} -h2 { - font-size: 10pt; -} -pre { - font-family: Consolas, Menlo, Monaco, monospace; - margin: 0; - padding: 0; - line-height: 1.3; - font-size: 14px; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} - -div.path { font-size: 110%; } -div.path a:link, div.path a:visited { color: #000; } -table.coverage { border-collapse: collapse; margin:0; padding: 0 } - -table.coverage td { - margin: 0; - padding: 0; - color: #111; - vertical-align: top; -} -table.coverage td.line-count { - width: 50px; - text-align: right; - padding-right: 5px; -} -table.coverage td.line-coverage { - color: #777 !important; - text-align: right; - border-left: 1px solid #666; - border-right: 1px solid #666; -} - -table.coverage td.text { -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 40px; -} -table.coverage td span.cline-neutral { - background: #eee; -} -table.coverage td span.cline-yes { - background: #b5d592; - color: #999; -} -table.coverage td span.cline-no { - background: #fc8c84; -} - -.cstat-yes { color: #111; } -.cstat-no { background: #fc8c84; color: #111; } -.fstat-no { background: #ffc520; color: #111 !important; } -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -.missing-if-branch { - display: inline-block; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: black; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} - -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} - -.entity, .metric { font-weight: bold; } -.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } -.metric small { font-size: 80%; font-weight: normal; color: #666; } - -div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } -div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } -div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } -div.coverage-summary th.file { border-right: none !important; } -div.coverage-summary th.pic { border-left: none !important; text-align: right; } -div.coverage-summary th.pct { border-right: none !important; } -div.coverage-summary th.abs { border-left: none !important; text-align: right; } -div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } -div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } -div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; } -div.coverage-summary td.pic { min-width: 120px !important; } -div.coverage-summary a:link { text-decoration: none; color: #000; } -div.coverage-summary a:visited { text-decoration: none; color: #777; } -div.coverage-summary a:hover { text-decoration: underline; } -div.coverage-summary tfoot td { border-top: 1px solid #666; } - -div.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -div.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -div.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} - -.high { background: #b5d592 !important; } -.medium { background: #ffe87c !important; } -.low { background: #fc8c84 !important; } - -span.cover-fill, span.cover-empty { - display:inline-block; - border:1px solid #444; - background: white; - height: 12px; -} -span.cover-fill { - background: #ccc; - border-right: 1px solid #444; -} -span.cover-empty { - background: white; - border-left: none; -} -span.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.html b/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.html deleted file mode 100644 index 305fff606d6916..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - Code coverage report for cli-width/ - - - - - - -
    -

    Code coverage report for cli-width/

    -

    - Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

    -
    All files » cli-width/
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FileStatementsBranchesFunctionsLines
    index.js100%(13 / 13)100%(8 / 8)100%(1 / 1)100%(13 / 13)
    -
    -
    - - - - - - diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html b/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html deleted file mode 100644 index ab53a6824e58d6..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - Code coverage report for cli-width/index.js - - - - - - -
    -

    Code coverage report for cli-width/index.js

    -

    - Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

    -
    All files » cli-width/ » index.js
    -
    -
    -
    
    -
    -
    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  -  -1 -1 -  -1 -6 -1 -  -  -5 -  -5 -1 -  -  -4 -2 -  -2 -1 -  -  -  -3 -  -  -  - 
    '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 {
    -      if (process.env.CLI_WIDTH) {
    -        var width = parseInt(process.env.CLI_WIDTH, 10);
    - 
    -        if (!isNaN(width)) {
    -          return width;
    -        }
    -      }
    - 
    -      return exports.defaultWidth;
    -    }
    -  }
    -};
    - 
    - -
    - - - - - - diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov-report/index.html b/tools/eslint/node_modules/cli-width/coverage/lcov-report/index.html deleted file mode 100644 index 1fcbfbbf8eedbc..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/lcov-report/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - Code coverage report for All files - - - - - - -
    -

    Code coverage report for All files

    -

    - Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FileStatementsBranchesFunctionsLines
    cli-width/100%(13 / 13)100%(8 / 8)100%(1 / 1)100%(13 / 13)
    -
    -
    - - - - - - diff --git a/tools/eslint/node_modules/cli-width/coverage/lcov.info b/tools/eslint/node_modules/cli-width/coverage/lcov.info deleted file mode 100644 index 5ec1cb2ff7d74d..00000000000000 --- a/tools/eslint/node_modules/cli-width/coverage/lcov.info +++ /dev/null @@ -1,32 +0,0 @@ -TN: -SF:/Users/iradchenko/sandbox/cli-width/index.js -FN:6,cliWidth -FNF:1 -FNH:1 -FNDA:6,cliWidth -DA:3,1 -DA:4,1 -DA:6,1 -DA:7,6 -DA:8,1 -DA:11,5 -DA:13,5 -DA:14,1 -DA:17,4 -DA:18,2 -DA:20,2 -DA:21,1 -DA:25,3 -LF:13 -LH:13 -BRDA:7,1,0,1 -BRDA:7,1,1,5 -BRDA:12,2,0,1 -BRDA:12,2,1,4 -BRDA:15,3,0,2 -BRDA:15,3,1,2 -BRDA:18,4,0,1 -BRDA:18,4,1,1 -BRF:8 -BRH:8 -end_of_record diff --git a/tools/eslint/node_modules/cli-width/package.json b/tools/eslint/node_modules/cli-width/package.json index b39ae0f57b2f83..6a65191c260523 100644 --- a/tools/eslint/node_modules/cli-width/package.json +++ b/tools/eslint/node_modules/cli-width/package.json @@ -2,14 +2,14 @@ "_args": [ [ "cli-width@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "cli-width@>=2.0.0 <3.0.0", "_id": "cli-width@2.1.0", "_inCache": true, "_installable": true, - "_location": "/eslint/cli-width", + "_location": "/cli-width", "_nodeVersion": "4.2.6", "_npmOperationalInternal": { "host": "packages-9-west.internal.npmjs.com", @@ -30,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/inquirer" ], "_resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", "_shasum": "b234ca209b29ef66fc518d9b98d5847b00edf00a", "_shrinkwrap": null, "_spec": "cli-width@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "ilya@burstcreations.com", "name": "Ilya Radchenko" diff --git a/tools/eslint/node_modules/code-point-at/package.json b/tools/eslint/node_modules/code-point-at/package.json index 6107f2629646cd..7ee3617543a0dc 100644 --- a/tools/eslint/node_modules/code-point-at/package.json +++ b/tools/eslint/node_modules/code-point-at/package.json @@ -2,14 +2,14 @@ "_args": [ [ "code-point-at@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/readline2" + "/Users/trott/io.js/tools/node_modules/readline2" ] ], "_from": "code-point-at@>=1.0.0 <2.0.0", "_id": "code-point-at@1.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/code-point-at", + "_location": "/code-point-at", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readline2", - "/eslint/string-width" + "/readline2", + "/string-width" ], "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", "_shrinkwrap": null, "_spec": "code-point-at@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/readline2", + "_where": "/Users/trott/io.js/tools/node_modules/readline2", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/concat-map/.travis.yml b/tools/eslint/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c8a54d0..00000000000000 --- a/tools/eslint/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/tools/eslint/node_modules/concat-map/example/map.js b/tools/eslint/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217b61d8f..00000000000000 --- a/tools/eslint/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/tools/eslint/node_modules/concat-map/package.json b/tools/eslint/node_modules/concat-map/package.json index 64765c7eec42e2..26be345465c5ae 100644 --- a/tools/eslint/node_modules/concat-map/package.json +++ b/tools/eslint/node_modules/concat-map/package.json @@ -2,14 +2,14 @@ "_args": [ [ "concat-map@0.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/brace-expansion" + "/Users/trott/io.js/tools/node_modules/brace-expansion" ] ], "_from": "concat-map@0.0.1", "_id": "concat-map@0.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/concat-map", + "_location": "/concat-map", "_npmUser": { "email": "mail@substack.net", "name": "substack" @@ -25,13 +25,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/brace-expansion" + "/brace-expansion" ], "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", "_shrinkwrap": null, "_spec": "concat-map@0.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/brace-expansion", + "_where": "/Users/trott/io.js/tools/node_modules/brace-expansion", "author": { "email": "mail@substack.net", "name": "James Halliday", diff --git a/tools/eslint/node_modules/concat-map/test/map.js b/tools/eslint/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022f6da17..00000000000000 --- a/tools/eslint/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/tools/eslint/node_modules/concat-stream/package.json b/tools/eslint/node_modules/concat-stream/package.json index 19b51af5e0718d..99e9fe9a963bd3 100644 --- a/tools/eslint/node_modules/concat-stream/package.json +++ b/tools/eslint/node_modules/concat-stream/package.json @@ -2,14 +2,14 @@ "_args": [ [ "concat-stream@^1.4.6", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "concat-stream@>=1.4.6 <2.0.0", "_id": "concat-stream@1.5.1", "_inCache": true, "_installable": true, - "_location": "/eslint/concat-stream", + "_location": "/concat-stream", "_nodeVersion": "4.0.0", "_npmUser": { "email": "max@maxogden.com", @@ -32,7 +32,7 @@ "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", "_shrinkwrap": null, "_spec": "concat-stream@^1.4.6", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "max@maxogden.com", "name": "Max Ogden" @@ -52,7 +52,7 @@ "directories": {}, "dist": { "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" }, "engines": [ "node >= 0.8" diff --git a/tools/eslint/node_modules/core-util-is/package.json b/tools/eslint/node_modules/core-util-is/package.json index 403fe40270acd1..3679efaaa9b8f4 100644 --- a/tools/eslint/node_modules/core-util-is/package.json +++ b/tools/eslint/node_modules/core-util-is/package.json @@ -2,14 +2,14 @@ "_args": [ [ "core-util-is@~1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + "/Users/trott/io.js/tools/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", + "_location": "/core-util-is", "_nodeVersion": "4.0.0", "_npmUser": { "email": "i@izs.me", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readable-stream" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/readable-stream", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", diff --git a/tools/eslint/node_modules/d/.npmignore b/tools/eslint/node_modules/d/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/node_modules/d/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -/node_modules -/npm-debug.log -/.lintcache diff --git a/tools/eslint/node_modules/d/.travis.yml b/tools/eslint/node_modules/d/.travis.yml deleted file mode 100644 index 50008b23e6bcb9..00000000000000 --- a/tools/eslint/node_modules/d/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 - - 0.11 - -notifications: - email: - - medikoo+d@medikoo.com diff --git a/tools/eslint/node_modules/d/CHANGES b/tools/eslint/node_modules/d/CHANGES deleted file mode 100644 index 45233f747eca72..00000000000000 --- a/tools/eslint/node_modules/d/CHANGES +++ /dev/null @@ -1,7 +0,0 @@ -v0.1.1 -- 2014.04.24 -- Add `autoBind` and `lazy` utilities -- Allow to pass other options to be merged onto created descriptor. - Useful when used with other custom utilties - -v0.1.0 -- 2013.06.20 -Initial (derived from es5-ext project) diff --git a/tools/eslint/node_modules/d/package.json b/tools/eslint/node_modules/d/package.json index c24ec5439461d9..af2dea007f3d25 100644 --- a/tools/eslint/node_modules/d/package.json +++ b/tools/eslint/node_modules/d/package.json @@ -2,14 +2,14 @@ "_args": [ [ "d@~0.1.1", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/node_modules/es6-map" ] ], "_from": "d@>=0.1.1 <0.2.0", "_id": "d@0.1.1", "_inCache": true, "_installable": true, - "_location": "/eslint/d", + "_location": "/d", "_npmUser": { "email": "medikoo+npm@medikoo.com", "name": "medikoo" @@ -25,18 +25,18 @@ "type": "range" }, "_requiredBy": [ - "/eslint/es6-iterator", - "/eslint/es6-map", - "/eslint/es6-set", - "/eslint/es6-symbol", - "/eslint/es6-weak-map", - "/eslint/event-emitter" + "/es6-iterator", + "/es6-map", + "/es6-set", + "/es6-symbol", + "/es6-weak-map", + "/event-emitter" ], "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", "_shrinkwrap": null, "_spec": "d@~0.1.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/es6-map", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/d/test/auto-bind.js b/tools/eslint/node_modules/d/test/auto-bind.js deleted file mode 100644 index 89edfb88bbec53..00000000000000 --- a/tools/eslint/node_modules/d/test/auto-bind.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var d = require('../'); - -module.exports = function (t, a) { - var o = Object.defineProperties({}, t({ - bar: d(function () { return this === o; }), - bar2: d(function () { return this; }) - })); - - a.deep([(o.bar)(), (o.bar2)()], [true, o]); -}; diff --git a/tools/eslint/node_modules/d/test/index.js b/tools/eslint/node_modules/d/test/index.js deleted file mode 100644 index 3db0af10acd3ca..00000000000000 --- a/tools/eslint/node_modules/d/test/index.js +++ /dev/null @@ -1,182 +0,0 @@ -'use strict'; - -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - -module.exports = function (t, a) { - var o, c, cg, cs, ce, ceg, ces, cew, cw, e, eg, es, ew, v, vg, vs, w, df, dfg - , dfs; - - o = Object.create(Object.prototype, { - c: t('c', c = {}), - cgs: t.gs('c', cg = function () {}, cs = function () {}), - ce: t('ce', ce = {}), - cegs: t.gs('ce', ceg = function () {}, ces = function () {}), - cew: t('cew', cew = {}), - cw: t('cw', cw = {}), - e: t('e', e = {}), - egs: t.gs('e', eg = function () {}, es = function () {}), - ew: t('ew', ew = {}), - v: t('', v = {}), - vgs: t.gs('', vg = function () {}, vs = function () {}), - w: t('w', w = {}), - - df: t(df = {}), - dfgs: t.gs(dfg = function () {}, dfs = function () {}) - }); - - return { - c: function (a) { - var d = getOwnPropertyDescriptor(o, 'c'); - a(d.value, c, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, true, "Configurable"); - a(d.enumerable, false, "Enumerable"); - a(d.writable, false, "Writable"); - - d = getOwnPropertyDescriptor(o, 'cgs'); - a(d.value, undefined, "GS Value"); - a(d.get, cg, "GS Get"); - a(d.set, cs, "GS Set"); - a(d.configurable, true, "GS Configurable"); - a(d.enumerable, false, "GS Enumerable"); - a(d.writable, undefined, "GS Writable"); - }, - ce: function (a) { - var d = getOwnPropertyDescriptor(o, 'ce'); - a(d.value, ce, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, true, "Configurable"); - a(d.enumerable, true, "Enumerable"); - a(d.writable, false, "Writable"); - - d = getOwnPropertyDescriptor(o, 'cegs'); - a(d.value, undefined, "GS Value"); - a(d.get, ceg, "GS Get"); - a(d.set, ces, "GS Set"); - a(d.configurable, true, "GS Configurable"); - a(d.enumerable, true, "GS Enumerable"); - a(d.writable, undefined, "GS Writable"); - }, - cew: function (a) { - var d = getOwnPropertyDescriptor(o, 'cew'); - a(d.value, cew, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, true, "Configurable"); - a(d.enumerable, true, "Enumerable"); - a(d.writable, true, "Writable"); - }, - cw: function (a) { - var d = getOwnPropertyDescriptor(o, 'cw'); - a(d.value, cw, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, true, "Configurable"); - a(d.enumerable, false, "Enumerable"); - a(d.writable, true, "Writable"); - }, - e: function (a) { - var d = getOwnPropertyDescriptor(o, 'e'); - a(d.value, e, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, false, "Configurable"); - a(d.enumerable, true, "Enumerable"); - a(d.writable, false, "Writable"); - - d = getOwnPropertyDescriptor(o, 'egs'); - a(d.value, undefined, "GS Value"); - a(d.get, eg, "GS Get"); - a(d.set, es, "GS Set"); - a(d.configurable, false, "GS Configurable"); - a(d.enumerable, true, "GS Enumerable"); - a(d.writable, undefined, "GS Writable"); - }, - ew: function (a) { - var d = getOwnPropertyDescriptor(o, 'ew'); - a(d.value, ew, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, false, "Configurable"); - a(d.enumerable, true, "Enumerable"); - a(d.writable, true, "Writable"); - }, - v: function (a) { - var d = getOwnPropertyDescriptor(o, 'v'); - a(d.value, v, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, false, "Configurable"); - a(d.enumerable, false, "Enumerable"); - a(d.writable, false, "Writable"); - - d = getOwnPropertyDescriptor(o, 'vgs'); - a(d.value, undefined, "GS Value"); - a(d.get, vg, "GS Get"); - a(d.set, vs, "GS Set"); - a(d.configurable, false, "GS Configurable"); - a(d.enumerable, false, "GS Enumerable"); - a(d.writable, undefined, "GS Writable"); - }, - w: function (a) { - var d = getOwnPropertyDescriptor(o, 'w'); - a(d.value, w, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, false, "Configurable"); - a(d.enumerable, false, "Enumerable"); - a(d.writable, true, "Writable"); - }, - d: function (a) { - var d = getOwnPropertyDescriptor(o, 'df'); - a(d.value, df, "Value"); - a(d.get, undefined, "Get"); - a(d.set, undefined, "Set"); - a(d.configurable, true, "Configurable"); - a(d.enumerable, false, "Enumerable"); - a(d.writable, true, "Writable"); - - d = getOwnPropertyDescriptor(o, 'dfgs'); - a(d.value, undefined, "GS Value"); - a(d.get, dfg, "GS Get"); - a(d.set, dfs, "GS Set"); - a(d.configurable, true, "GS Configurable"); - a(d.enumerable, false, "GS Enumerable"); - a(d.writable, undefined, "GS Writable"); - }, - Options: { - v: function (a) { - var x = {}, d = t(x, { foo: true }); - a.deep(d, { configurable: true, enumerable: false, writable: true, - value: x, foo: true }, "No descriptor"); - d = t('c', 'foo', { marko: 'elo' }); - a.deep(d, { configurable: true, enumerable: false, writable: false, - value: 'foo', marko: 'elo' }, "Descriptor"); - }, - gs: function (a) { - var gFn = function () {}, sFn = function () {}, d; - d = t.gs(gFn, sFn, { foo: true }); - a.deep(d, { configurable: true, enumerable: false, get: gFn, set: sFn, - foo: true }, "No descriptor"); - d = t.gs(null, sFn, { foo: true }); - a.deep(d, { configurable: true, enumerable: false, get: undefined, - set: sFn, foo: true }, "No descriptor: Just set"); - d = t.gs(gFn, { foo: true }); - a.deep(d, { configurable: true, enumerable: false, get: gFn, - set: undefined, foo: true }, "No descriptor: Just get"); - - d = t.gs('e', gFn, sFn, { bar: true }); - a.deep(d, { configurable: false, enumerable: true, get: gFn, set: sFn, - bar: true }, "Descriptor"); - d = t.gs('e', null, sFn, { bar: true }); - a.deep(d, { configurable: false, enumerable: true, get: undefined, - set: sFn, bar: true }, "Descriptor: Just set"); - d = t.gs('e', gFn, { bar: true }); - a.deep(d, { configurable: false, enumerable: true, get: gFn, - set: undefined, bar: true }, "Descriptor: Just get"); - } - } - }; -}; diff --git a/tools/eslint/node_modules/d/test/lazy.js b/tools/eslint/node_modules/d/test/lazy.js deleted file mode 100644 index 8266deb240fda3..00000000000000 --- a/tools/eslint/node_modules/d/test/lazy.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var d = require('../') - - , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - -module.exports = function (t, a) { - var Foo = function () {}, i = 1, o, o2, desc; - Object.defineProperties(Foo.prototype, t({ - bar: d(function () { return ++i; }), - bar2: d(function () { return this.bar + 23; }), - bar3: d(function () { return this.bar2 + 34; }, { desc: 'ew' }), - bar4: d(function () { return this.bar3 + 12; }, { cacheName: '_bar4_' }), - bar5: d(function () { return this.bar4 + 3; }, - { cacheName: '_bar5_', desc: 'e' }) - })); - - desc = getOwnPropertyDescriptor(Foo.prototype, 'bar'); - a(desc.configurable, true, "Configurable: default"); - a(desc.enumerable, false, "Enumerable: default"); - - o = new Foo(); - a.deep([o.bar, o.bar2, o.bar3, o.bar4, o.bar5], [2, 25, 59, 71, 74], - "Values"); - - a.deep(getOwnPropertyDescriptor(o, 'bar3'), { configurable: false, - enumerable: true, writable: true, value: 59 }, "Desc"); - a(o.hasOwnProperty('bar4'), false, "Cache not exposed"); - desc = getOwnPropertyDescriptor(o, 'bar5'); - a.deep(desc, { configurable: false, - enumerable: true, get: desc.get, set: desc.set }, "Cache & Desc: desc"); - - o2 = Object.create(o); - o2.bar = 30; - o2.bar3 = 100; - - a.deep([o2.bar, o2.bar2, o2.bar3, o2.bar4, o2.bar5], [30, 25, 100, 112, 115], - "Extension Values"); - - Foo = function () {}; - Object.defineProperties(Foo.prototype, t({ - test: d('w', function () { return 'raz'; }), - test2: d('', function () { return 'raz'; }, { desc: 'w' }), - test3: d('', function () { return 'raz'; }, - { cacheName: '__test3__', desc: 'w' }), - test4: d('w', 'bar') - })); - - o = new Foo(); - o.test = 'marko'; - a.deep(getOwnPropertyDescriptor(o, 'test'), - { configurable: false, enumerable: false, writable: true, value: 'marko' }, - "Set before get"); - o.test2 = 'marko2'; - a.deep(getOwnPropertyDescriptor(o, 'test2'), - { configurable: false, enumerable: false, writable: true, value: 'marko2' }, - "Set before get: Custom desc"); - o.test3 = 'marko3'; - a.deep(getOwnPropertyDescriptor(o, '__test3__'), - { configurable: false, enumerable: false, writable: true, value: 'marko3' }, - "Set before get: Custom cache name"); - a(o.test4, 'bar', "Resolve by value"); - - a.h1("Flat"); - Object.defineProperties(Foo.prototype, t({ - flat: d(function () { return 'foo'; }, { flat: true }), - flat2: d(function () { return 'bar'; }, { flat: true }) - })); - - a.h2("Instance"); - a(o.flat, 'foo', "Value"); - a(o.hasOwnProperty('flat'), false, "Instance"); - a(Foo.prototype.flat, 'foo', "Prototype"); - - a.h2("Direct"); - a(Foo.prototype.flat2, 'bar'); -}; diff --git a/tools/eslint/node_modules/debug/.jshintrc b/tools/eslint/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f26aeb6c..00000000000000 --- a/tools/eslint/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/tools/eslint/node_modules/debug/.npmignore b/tools/eslint/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163db02e5e7..00000000000000 --- a/tools/eslint/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/tools/eslint/node_modules/debug/History.md b/tools/eslint/node_modules/debug/History.md deleted file mode 100644 index 854c9711c6fd68..00000000000000 --- a/tools/eslint/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/tools/eslint/node_modules/debug/bower.json b/tools/eslint/node_modules/debug/bower.json deleted file mode 100644 index 6af573ff5c260d..00000000000000 --- a/tools/eslint/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/tools/eslint/node_modules/debug/component.json b/tools/eslint/node_modules/debug/component.json deleted file mode 100644 index ca1063724a4498..00000000000000 --- a/tools/eslint/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/tools/eslint/node_modules/debug/package.json b/tools/eslint/node_modules/debug/package.json index 6b4bce3216031d..cfa74e368b81f3 100644 --- a/tools/eslint/node_modules/debug/package.json +++ b/tools/eslint/node_modules/debug/package.json @@ -2,14 +2,14 @@ "_args": [ [ "debug@^2.1.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "debug@>=2.1.1 <3.0.0", "_id": "debug@2.2.0", "_inCache": true, "_installable": true, - "_location": "/eslint/debug", + "_location": "/debug", "_nodeVersion": "0.12.2", "_npmUser": { "email": "nathan@tootallnate.net", @@ -32,7 +32,7 @@ "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", "_shrinkwrap": null, "_spec": "debug@^2.1.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "tj@vision-media.ca", "name": "TJ Holowaychuk" @@ -65,7 +65,7 @@ "directories": {}, "dist": { "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" }, "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", "homepage": "https://github.com/visionmedia/debug", diff --git a/tools/eslint/node_modules/deep-is/.travis.yml b/tools/eslint/node_modules/deep-is/.travis.yml deleted file mode 100644 index d523c5f5658a4e..00000000000000 --- a/tools/eslint/node_modules/deep-is/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 - - 0.8 - - 0.10 diff --git a/tools/eslint/node_modules/deep-is/example/cmp.js b/tools/eslint/node_modules/deep-is/example/cmp.js deleted file mode 100644 index 67014b88dcbc9b..00000000000000 --- a/tools/eslint/node_modules/deep-is/example/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var equal = require('../'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); diff --git a/tools/eslint/node_modules/deep-is/package.json b/tools/eslint/node_modules/deep-is/package.json index 33f265b877516c..d7b59dca2239fe 100644 --- a/tools/eslint/node_modules/deep-is/package.json +++ b/tools/eslint/node_modules/deep-is/package.json @@ -2,14 +2,14 @@ "_args": [ [ "deep-is@~0.1.3", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/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", + "_location": "/deep-is", "_npmUser": { "email": "thlorenz@gmx.de", "name": "thlorenz" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/optionator" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "thlorenz@gmx.de", "name": "Thorsten Lorenz", diff --git a/tools/eslint/node_modules/deep-is/test/NaN.js b/tools/eslint/node_modules/deep-is/test/NaN.js deleted file mode 100644 index ddaa5a77b412fc..00000000000000 --- a/tools/eslint/node_modules/deep-is/test/NaN.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('NaN and 0 values', function (t) { - t.ok(equal(NaN, NaN)); - t.notOk(equal(0, NaN)); - t.ok(equal(0, 0)); - t.notOk(equal(0, 1)); - t.end(); -}); - - -test('nested NaN values', function (t) { - t.ok(equal([ NaN, 1, NaN ], [ NaN, 1, NaN ])); - t.end(); -}); diff --git a/tools/eslint/node_modules/deep-is/test/cmp.js b/tools/eslint/node_modules/deep-is/test/cmp.js deleted file mode 100644 index 307101341db090..00000000000000 --- a/tools/eslint/node_modules/deep-is/test/cmp.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('equal', function (t) { - t.ok(equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - )); - t.end(); -}); - -test('not equal', function (t) { - t.notOk(equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - )); - t.end(); -}); - -test('nested nulls', function (t) { - t.ok(equal([ null, null, null ], [ null, null, null ])); - t.end(); -}); diff --git a/tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js b/tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js deleted file mode 100644 index 73f1d71fb204f2..00000000000000 --- a/tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('0 values', function (t) { - t.ok(equal( 0, 0), ' 0 === 0'); - t.ok(equal( 0, +0), ' 0 === +0'); - t.ok(equal(+0, +0), '+0 === +0'); - t.ok(equal(-0, -0), '-0 === -0'); - - t.notOk(equal(-0, 0), '-0 !== 0'); - t.notOk(equal(-0, +0), '-0 !== +0'); - - t.end(); -}); diff --git a/tools/eslint/node_modules/del/package.json b/tools/eslint/node_modules/del/package.json index 296da4b986b3f4..a86ecbd0e1d23c 100644 --- a/tools/eslint/node_modules/del/package.json +++ b/tools/eslint/node_modules/del/package.json @@ -2,14 +2,14 @@ "_args": [ [ "del@^2.0.2", - "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + "/Users/trott/io.js/tools/node_modules/flat-cache" ] ], "_from": "del@>=2.0.2 <3.0.0", "_id": "del@2.2.0", "_inCache": true, "_installable": true, - "_location": "/eslint/del", + "_location": "/del", "_nodeVersion": "4.2.1", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/flat-cache" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/flat-cache", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -60,7 +60,7 @@ "directories": {}, "dist": { "shasum": "9a50f04bf37325e283b4f44e985336c252456bd5", - "tarball": "http://registry.npmjs.org/del/-/del-2.2.0.tgz" + "tarball": "https://registry.npmjs.org/del/-/del-2.2.0.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/del/readme.md b/tools/eslint/node_modules/del/readme.md index c4a64ee25e799e..fe22ccb5a66900 100644 --- a/tools/eslint/node_modules/del/readme.md +++ b/tools/eslint/node_modules/del/readme.md @@ -69,14 +69,14 @@ See the `node-glob` [options](https://github.com/isaacs/node-glob#options). ##### force -Type: `boolean` +Type: `boolean` Default: `false` Allow deleting the current working directory and files/folders outside it. ##### dryRun -Type: `boolean` +Type: `boolean` Default: `false` See what would be deleted. diff --git a/tools/eslint/node_modules/doctrine/README.md b/tools/eslint/node_modules/doctrine/README.md index 14e3dfe68cf1e5..bc6dcf91907faf 100644 --- a/tools/eslint/node_modules/doctrine/README.md +++ b/tools/eslint/node_modules/doctrine/README.md @@ -34,7 +34,7 @@ The primary method is `parse()`, which accepts two arguments: the JSDoc comment * `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`. +* `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. Here's a simple example: diff --git a/tools/eslint/node_modules/doctrine/lib/doctrine.js b/tools/eslint/node_modules/doctrine/lib/doctrine.js index 029a63fc963df5..f82331df092fbb 100644 --- a/tools/eslint/node_modules/doctrine/lib/doctrine.js +++ b/tools/eslint/node_modules/doctrine/lib/doctrine.js @@ -332,7 +332,9 @@ name += advance(); } while (source.charCodeAt(index) === 0x2E /* '.' */ || + source.charCodeAt(index) === 0x2F /* '/' */ || source.charCodeAt(index) === 0x23 /* '#' */ || + source.charCodeAt(index) === 0x2D /* '-' */ || source.charCodeAt(index) === 0x7E /* '~' */) { name += advance(); name += scanIdentifier(last); @@ -340,25 +342,37 @@ } if (useBrackets) { - - + skipWhiteSpace(last); // do we have a default value for this? if (source.charCodeAt(index) === 0x3D /* '=' */) { // consume the '='' symbol name += advance(); + skipWhiteSpace(last); + + var ch; var bracketDepth = 1; // scan in the default value while (index < last) { - if (source.charCodeAt(index) === 0x5B /* '[' */) { + ch = source.charCodeAt(index); + + if (esutils.code.isWhiteSpace(ch)) { + skipWhiteSpace(last); + ch = source.charCodeAt(index); + } + + if (ch === 0x5B /* '[' */) { bracketDepth++; - } else if (source.charCodeAt(index) === 0x5D /* ']' */ && + } else if (ch === 0x5D /* ']' */ && --bracketDepth === 0) { break; } + name += advance(); } } + skipWhiteSpace(last); + if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) { // we never found a closing ']' return null; 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 eab92737967040..53a9b85a620a47 100644 --- a/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json +++ b/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json @@ -2,14 +2,14 @@ "_args": [ [ "esutils@^1.1.6", - "/Users/trott/test/node_modules/eslint/node_modules/doctrine" + "/Users/trott/io.js/tools/node_modules/doctrine" ] ], "_from": "esutils@>=1.1.6 <2.0.0", "_id": "esutils@1.1.6", "_inCache": true, "_installable": true, - "_location": "/eslint/doctrine/esutils", + "_location": "/doctrine/esutils", "_npmUser": { "email": "utatane.tea@gmail.com", "name": "constellation" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/doctrine" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/doctrine", "bugs": { "url": "https://github.com/Constellation/esutils/issues" }, diff --git a/tools/eslint/node_modules/doctrine/package.json b/tools/eslint/node_modules/doctrine/package.json index 833edf51083967..a0f2745e421994 100644 --- a/tools/eslint/node_modules/doctrine/package.json +++ b/tools/eslint/node_modules/doctrine/package.json @@ -1,49 +1,55 @@ { "_args": [ [ - "doctrine@^1.1.0", - "/Users/trott/test/node_modules/eslint" + "doctrine@^1.2.1", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "doctrine@>=1.1.0 <2.0.0", - "_id": "doctrine@1.1.0", + "_from": "doctrine@>=1.2.1 <2.0.0", + "_id": "doctrine@1.2.1", "_inCache": true, "_installable": true, - "_location": "/eslint/doctrine", + "_location": "/doctrine", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/doctrine-1.2.1.tgz_1459275509740_0.26917822007089853" + }, "_npmUser": { "email": "nicholas@nczconsulting.com", "name": "nzakas" }, - "_npmVersion": "1.4.29", + "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { "name": "doctrine", - "raw": "doctrine@^1.1.0", - "rawSpec": "^1.1.0", + "raw": "doctrine@^1.2.1", + "rawSpec": "^1.2.1", "scope": null, - "spec": ">=1.1.0 <2.0.0", + "spec": ">=1.2.1 <2.0.0", "type": "range" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.1.0.tgz", - "_shasum": "1c36612937cf7d1596b983e9c5d0c6233eeaa3cf", + "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.2.1.tgz", + "_shasum": "ac0c649d70b9501e16e97acb7ec4e27168f746a3", "_shrinkwrap": null, - "_spec": "doctrine@^1.1.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "doctrine@^1.2.1", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "bugs": { "url": "https://github.com/eslint/doctrine/issues" }, "dependencies": { "esutils": "^1.1.6", - "isarray": "0.0.1" + "isarray": "^1.0.0" }, "description": "JSDoc parser", "devDependencies": { "coveralls": "^2.11.2", "dateformat": "^1.0.11", "eslint": "^1.10.3", + "eslint-release": "^0.3.0", "istanbul": "^0.4.1", "linefix": "^0.1.1", "mocha": "^2.3.3", @@ -57,8 +63,8 @@ "lib": "./lib" }, "dist": { - "shasum": "1c36612937cf7d1596b983e9c5d0c6233eeaa3cf", - "tarball": "http://registry.npmjs.org/doctrine/-/doctrine-1.1.0.tgz" + "shasum": "ac0c649d70b9501e16e97acb7ec4e27168f746a3", + "tarball": "http://registry.npmjs.org/doctrine/-/doctrine-1.2.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -70,7 +76,7 @@ "LICENSE.esprima", "README.md" ], - "gitHead": "165fc189b184b0daa72a2ee2f696e8cf7312d288", + "gitHead": "18dba10454f17acbc49ae3c0628119734cb34952", "homepage": "https://github.com/eslint/doctrine", "licenses": [ { @@ -97,8 +103,11 @@ "url": "git+ssh://git@github.com/eslint/doctrine.git" }, "scripts": { - "lint": "node Makefile.js lint", - "test": "node Makefile.js test" + "alpharelease": "eslint-prerelease alpha", + "betarelease": "eslint-prerelease beta", + "lint": "eslint lib/", + "release": "eslint-release", + "test": "npm run lint && node Makefile.js test" }, - "version": "1.1.0" + "version": "1.2.1" } diff --git a/tools/eslint/node_modules/es5-ext/.npmignore b/tools/eslint/node_modules/es5-ext/.npmignore deleted file mode 100644 index eb09b500d63ec8..00000000000000 --- a/tools/eslint/node_modules/es5-ext/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -/node_modules -/.lintcache -/npm-debug.log diff --git a/tools/eslint/node_modules/es5-ext/.travis.yml b/tools/eslint/node_modules/es5-ext/.travis.yml deleted file mode 100644 index e8e18ee77d88ed..00000000000000 --- a/tools/eslint/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.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 deleted file mode 100644 index 92ee5f6ef64ca9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/CHANGES +++ /dev/null @@ -1,628 +0,0 @@ -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/es5-ext/README.md b/tools/eslint/node_modules/es5-ext/README.md index ad09fe2317bfa7..11d8a343d57f1f 100644 --- a/tools/eslint/node_modules/es5-ext/README.md +++ b/tools/eslint/node_modules/es5-ext/README.md @@ -11,7 +11,7 @@ When used in ECMAScript 6 environment, native implementation (if valid) takes pr ### 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 @@ -114,7 +114,7 @@ Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/ 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. +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. @@ -162,7 +162,7 @@ Object that represents global scope #### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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)_ @@ -175,7 +175,7 @@ Returns true if object is plain array (not instance of one of the Array's extens #### of([…items]) _(es5-ext/array/of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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)_ @@ -190,7 +190,7 @@ Returns `obj` if it's an array, otherwise throws `TypeError` #### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ -In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. +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)_ @@ -203,7 +203,7 @@ Returns a copy of the context with all non-values (`null` or `undefined`) remove #### arr.concat() _(es5-ext/array/#/concat)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.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)_ @@ -212,7 +212,7 @@ 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). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). #### arr.diff(other) _(es5-ext/array/#/diff)_ @@ -228,7 +228,7 @@ _egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla. #### arr.entries() _(es5-ext/array/#/entries)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.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)_ @@ -237,21 +237,21 @@ Returns the array of elements that are found only in one of the lists (either co #### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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). +[_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). +[_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). +[_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)_ @@ -292,7 +292,7 @@ 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). +[_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)_ @@ -305,7 +305,7 @@ 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). +[_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)_ @@ -318,7 +318,7 @@ 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). +[_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)_ @@ -327,7 +327,7 @@ ES6's version of `slice`, returns array of same type as the context. #### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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)_ @@ -336,12 +336,12 @@ 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). +[_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). +[_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 @@ -399,11 +399,11 @@ Formats date up to given string. Supported patterns: #### custom(message/*, code, ext*/) _(es5-ext/error/custom)_ -Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) +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`). +Whether value is an error (instance of `Error`). #### validError(x) _(es5-ext/error/valid-error)_ @@ -434,7 +434,7 @@ _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_ method to arguments. _name_ can be name of the method or method itself. _invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ @@ -478,7 +478,7 @@ 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. +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)_ @@ -517,93 +517,93 @@ Serializes function into two (arguments and body) string tokens. Result is plain #### acosh(x) _(es5-ext/math/acosh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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). +[_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)_ @@ -612,16 +612,16 @@ 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). +[_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). +[_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). +[_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)_ @@ -647,7 +647,7 @@ Pad given number with zeros. Returns string #### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-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)_ @@ -690,7 +690,7 @@ Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/ #### 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. +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)_ @@ -750,7 +750,7 @@ 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). +[_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)_ @@ -773,7 +773,7 @@ Useful as an alternative for `setPrototypeOf` in environments in which it cannot #### normalizeOptions(options) _(es5-ext/object/normalize-options)_ -Normalizes options object into flat plain object. +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. @@ -795,18 +795,18 @@ Serialize value into string. Differs from [JSON.stringify](https://developer.moz #### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +[_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. +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. +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)_ @@ -855,28 +855,28 @@ It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jo #### re.match(string) _(es5-ext/reg-exp/#/match)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.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). +[_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). +[_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). +[_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). +[_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). +[_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 @@ -937,7 +937,7 @@ 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). +[_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)_ @@ -955,8 +955,8 @@ 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. +[_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)_ @@ -967,7 +967,7 @@ 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). +[_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)_ @@ -980,12 +980,12 @@ Simple `replace` version. Doesn't support regular expressions. Replaces all occu #### 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). +[_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). +[_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) diff --git a/tools/eslint/node_modules/es5-ext/package.json b/tools/eslint/node_modules/es5-ext/package.json index 0b5063bd5b3dfc..26b8c4e0576e0f 100644 --- a/tools/eslint/node_modules/es5-ext/package.json +++ b/tools/eslint/node_modules/es5-ext/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es5-ext@~0.10.8", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/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", + "_location": "/es5-ext", "_nodeVersion": "4.2.3", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,19 +26,19 @@ "type": "range" }, "_requiredBy": [ - "/eslint/d", - "/eslint/es6-iterator", - "/eslint/es6-map", - "/eslint/es6-set", - "/eslint/es6-symbol", - "/eslint/es6-weak-map", - "/eslint/event-emitter" + "/d", + "/es6-iterator", + "/es6-map", + "/es6-set", + "/es6-symbol", + "/es6-weak-map", + "/event-emitter" ], "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz", "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", "_shrinkwrap": null, "_spec": "es5-ext@~0.10.8", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/es6-map", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/es5-ext/test/__tad.js b/tools/eslint/node_modules/es5-ext/test/__tad.js deleted file mode 100644 index 884577887f5704..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/__tad.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -exports.context = null; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/implement.js deleted file mode 100644 index f0605399e0274e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/@@iterator/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/shim.js deleted file mode 100644 index e590d8f28e7c0e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var iterator = t.call(this); - a.deep(iterator.next(), { value: '1', done: false }); - a.deep(iterator.next(), { value: '2', done: false }); - a.deep(iterator.next(), { value: '3', done: false }); - a.deep(iterator.next(), { value: undefined, done: true }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/_compare-by-length.js b/tools/eslint/node_modules/es5-ext/test/array/#/_compare-by-length.js deleted file mode 100644 index e40c305b98fe68..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/_compare-by-length.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = [4, 5, 6], y = { length: 8 }, w = {}, z = { length: 1 }; - - a.deep([x, y, w, z].sort(t), [w, z, x, y]); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/binary-search.js b/tools/eslint/node_modules/es5-ext/test/array/#/binary-search.js deleted file mode 100644 index cf3317371b3491..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/binary-search.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var compare = function (value) { return this - value; }; - -module.exports = function (t, a) { - var arr; - arr = [2, 5, 5, 8, 34, 67, 98, 345, 678]; - - // highest, equal match - a(t.call(arr, compare.bind(1)), 0, "All higher"); - a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower"); - a(t.call(arr, compare.bind(4)), 0, "Mid"); - a(t.call(arr, compare.bind(5)), 2, "Match"); - a(t.call(arr, compare.bind(6)), 2, "Above"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/clear.js b/tools/eslint/node_modules/es5-ext/test/array/#/clear.js deleted file mode 100644 index a5b1c977ad98cf..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/clear.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = [1, 2, {}, 4]; - a(t.call(x), x, "Returns same array"); - a.deep(x, [], "Empties array"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/compact.js b/tools/eslint/node_modules/es5-ext/test/array/#/compact.js deleted file mode 100644 index 6390eb26dddf6b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/compact.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - a(t.call(this).length, 3); - }, - "": function (t, a) { - var o, x, y, z; - o = {}; - x = [0, 1, "", null, o, false, undefined, true]; - y = x.slice(0); - - a.not(z = t.call(x), x, "Returns different object"); - a.deep(x, y, "Origin not changed"); - a.deep(z, [0, 1, "", o, false, true], "Result"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/concat/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/concat/implement.js deleted file mode 100644 index 3bdbe86812aaaa..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/concat/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/concat/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/concat/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/concat/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/concat/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/concat/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/concat/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/concat/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/concat/shim.js deleted file mode 100644 index c30eb7eab08178..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/concat/shim.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var SubArray = require('../../../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr = [1, 3, 45], x = {}, subArr, subArr2, result; - - a.deep(t.call(arr, '2d', x, ['ere', 'fe', x], false, null), - [1, 3, 45, '2d', x, 'ere', 'fe', x, false, null], "Plain array"); - - subArr = new SubArray('lol', 'miszko'); - subArr2 = new SubArray('elo', 'fol'); - - result = t.call(subArr, 'df', arr, 'fef', subArr2, null); - a(result instanceof SubArray, true, "Instance of subclass"); - a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', 'elo', 'fol', null], - "Spreable by default"); - - SubArray.prototype['@@isConcatSpreadable'] = false; - - result = t.call(subArr, 'df', arr, 'fef', subArr2, null); - a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', subArr2, null], - "Non spreadable"); - - delete SubArray.prototype['@@isConcatSpreadable']; -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/contains.js b/tools/eslint/node_modules/es5-ext/test/array/#/contains.js deleted file mode 100644 index 21404a17a61358..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/contains.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - a(t.call(this, this[1]), true, "Contains"); - a(t.call(this, {}), false, "Does Not contain"); - }, - "": function (t, a) { - var o, x = {}, y = {}; - - o = [1, 'raz', x]; - - a(t.call(o, 1), true, "First"); - a(t.call(o, '1'), false, "Type coercion"); - a(t.call(o, 'raz'), true, "Primitive"); - a(t.call(o, 'foo'), false, "Primitive not found"); - a(t.call(o, x), true, "Object found"); - a(t.call(o, y), false, "Object not found"); - a(t.call(o, 1, 1), false, "Position"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/implement.js deleted file mode 100644 index 36070477d66802..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/copy-within/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/shim.js deleted file mode 100644 index 93c85ea3114c24..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/copy-within/shim.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var args, x; - - a.h1("2 args"); - x = [1, 2, 3, 4, 5]; - t.call(x, 0, 3); - a.deep(x, [4, 5, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]); - - a.h1("3 args"); - a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]); - - a.h1("Negative args"); - a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]); - a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]); - - a.h1("Array-likes"); - args = { 0: 1, 1: 2, 2: 3, length: 3 }; - a.deep(t.call(args, -2, 0), { '0': 1, '1': 1, '2': 2, length: 3 }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/diff.js b/tools/eslint/node_modules/es5-ext/test/array/#/diff.js deleted file mode 100644 index bcfa3a0bd12f84..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/diff.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - a.deep(t.call(this, this), []); - }, - "": function (t, a) { - var x = {}, y = {}; - - a.deep(t.call([1, 'raz', x, 2, 'trzy', y], [x, 2, 'trzy']), [1, 'raz', y], - "Scope longer"); - a.deep(t.call([1, 'raz', x], [x, 2, 'trzy', 1, y]), ['raz'], - "Arg longer"); - a.deep(t.call([1, 'raz', x], []), [1, 'raz', x], "Empty arg"); - a.deep(t.call([], [1, y, 'sdfs']), [], "Empty scope"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/e-index-of.js b/tools/eslint/node_modules/es5-ext/test/array/#/e-index-of.js deleted file mode 100644 index 4cf6c6359d44ee..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/e-index-of.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}; - a(t.call([3, 'raz', {}, x, {}], x), 3, "Regular"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN), 2, "NaN"); - a(t.call([3, 'raz', 0, {}, -0], -0), 2, "-0"); - a(t.call([3, 'raz', -0, {}, 0], +0), 2, "+0"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 4, "fromIndex"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/e-last-index-of.js b/tools/eslint/node_modules/es5-ext/test/array/#/e-last-index-of.js deleted file mode 100644 index ed4f700421a8f1..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/e-last-index-of.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}; - a(t.call([3, 'raz', {}, x, {}, x], x), 5, "Regular"); - a(t.call([3, 'raz', NaN, {}, x], NaN), 2, "NaN"); - a(t.call([3, 'raz', 0, {}, -0], -0), 4, "-0"); - a(t.call([3, 'raz', -0, {}, 0], +0), 4, "+0"); - a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 2, "fromIndex"); - a(t.call([3, 'raz', NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1"); - a(t.call([3, 'raz', NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/entries/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/entries/implement.js deleted file mode 100644 index 733209a1c80653..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/entries/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/entries/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/entries/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/entries/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/entries/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/entries/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/entries/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/entries/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/entries/shim.js deleted file mode 100644 index bf40d31005df45..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/entries/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var iterator = t.call(this); - a.deep(iterator.next(), { value: [0, '1'], done: false }); - a.deep(iterator.next(), { value: [1, '2'], done: false }); - a.deep(iterator.next(), { value: [2, '3'], done: false }); - a.deep(iterator.next(), { value: undefined, done: true }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/exclusion.js b/tools/eslint/node_modules/es5-ext/test/array/#/exclusion.js deleted file mode 100644 index 07b32d8e8cbf9b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/exclusion.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - var x = {}; - a.deep(t.call(this, this, [this[0], this[2], x]), [x]); - }, - "": function (t, a) { - var x = {}, y = {}; - - a.deep(t.call([x, y]), [x, y], "No arguments"); - a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments"); - a.deep(t.call([1, 'raz', x], [2, 'raz', y], [2, 'raz', x]), [1, y]); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/fill/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/fill/implement.js deleted file mode 100644 index 2a01d2850a18a9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/fill/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/fill/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/fill/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/fill/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/fill/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/fill/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/fill/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/fill/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/fill/shim.js deleted file mode 100644 index d67300fcc23be8..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/fill/shim.js +++ /dev/null @@ -1,18 +0,0 @@ -// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js - -'use strict'; - -module.exports = function (t, a) { - var x; - - x = [1, 2, 3, 4, 5, 6]; - a(t.call(x, -1), x, "Returns self object"); - a.deep(x, [-1, -1, -1, -1, -1, -1], "Value"); - - a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], - "Positive start"); - a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], - "Negative start"); - a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], - "Large start"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/filter/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/filter/implement.js deleted file mode 100644 index 6d6b87cc30a651..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/filter/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/filter/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/filter/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/filter/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/filter/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/filter/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/filter/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/filter/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/filter/shim.js deleted file mode 100644 index e8b5c39849097f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/filter/shim.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var SubArray = require('../../../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr, x = {}, subArr, result; - - arr = ['foo', undefined, 0, '2d', false, x, null]; - - a.deep(t.call(arr, Boolean), ['foo', '2d', x], "Plain array"); - - subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); - - result = t.call(subArr, Boolean); - a(result instanceof SubArray, true, "Instance of subclass"); - a.deep(result, ['foo', '2d', x], "Result of subclass"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/find-index/implement.js deleted file mode 100644 index 8d85e618ccd6bc..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/find-index/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/find-index/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/find-index/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/find-index/shim.js deleted file mode 100644 index b5fee463811d49..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find-index/shim.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var count = 0, o = {}, self = Object(this); - a(t.call(self, function (value, i, scope) { - a(value, this[i], "Value"); - a(i, count++, "Index"); - a(scope, this, "Scope"); - }, self), -1, "Falsy result"); - a(count, 3); - - count = -1; - a(t.call(this, function () { - return ++count ? o : null; - }, this), 1, "Truthy result"); - a(count, 1); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/find/implement.js deleted file mode 100644 index 29fac41e013353..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/find/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/find/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/find/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/find/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/find/shim.js deleted file mode 100644 index ad2e645067db5d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/find/shim.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var count = 0, o = {}, self = Object(this); - a(t.call(self, function (value, i, scope) { - a(value, this[i], "Value"); - a(i, count++, "Index"); - a(scope, this, "Scope"); - }, self), undefined, "Falsy result"); - a(count, 3); - - count = -1; - a(t.call(this, function () { - return ++count ? o : null; - }, this), this[1], "Truthy result"); - a(count, 1); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/first-index.js b/tools/eslint/node_modules/es5-ext/test/array/#/first-index.js deleted file mode 100644 index 4aebad64b44e51..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/first-index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a(t.call([]), null, "Empty"); - a(t.call([null]), 0, "One value"); - a(t.call([1, 2, 3]), 0, "Many values"); - a(t.call(new Array(1000)), null, "Sparse empty"); - x = []; - x[883] = undefined; - x[890] = null; - a(t.call(x), 883, "Manual sparse, distant value"); - x = new Array(1000); - x[657] = undefined; - x[700] = null; - a(t.call(x), 657, "Sparse, distant value"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/first.js b/tools/eslint/node_modules/es5-ext/test/array/#/first.js deleted file mode 100644 index 87fde0357ef1b0..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/first.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - a(t.call(this), this[0]); -}; -exports[''] = function (t, a) { - var x; - a(t.call([]), undefined, "Empty"); - a(t.call(new Array(234), undefined, "Sparse empty")); - x = new Array(2342); - x[434] = {}; - a(t.call(x), x[434], "Sparse"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/flatten.js b/tools/eslint/node_modules/es5-ext/test/array/#/flatten.js deleted file mode 100644 index 65f1214b04da93..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/flatten.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10]; - -module.exports = { - __generic: function (t, a) { - a(t.call(this).length, 3); - }, - "Nested Arrays": function (t, a) { - a(t.call(o).length, 10); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/for-each-right.js b/tools/eslint/node_modules/es5-ext/test/array/#/for-each-right.js deleted file mode 100644 index 2d24569d94d86d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/for-each-right.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - var count = 0, first, last, x, icount = this.length; - t.call(this, function (item, index, col) { - ++count; - if (!first) { - first = item; - } - last = item; - x = col; - a(index, --icount, "Index"); - }); - a(count, this.length, "Iterated"); - a(first, this[this.length - 1], "First is last"); - a(last, this[0], "Last is first"); - a.deep(x, Object(this), "Collection as third argument"); //jslint: skip - }, - "": function (t, a) { - var x = {}, y, count; - t.call([1], function () { y = this; }, x); - a(y, x, "Scope"); - y = 0; - t.call([3, 4, 4], function (a, i) { y += i; }); - a(y, 3, "Indexes"); - - x = [1, 3]; - x[5] = 'x'; - y = 0; - count = 0; - t.call(x, function (a, i) { ++count; y += i; }); - a(y, 6, "Misssing Indexes"); - a(count, 3, "Misssing Indexes, count"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/group.js b/tools/eslint/node_modules/es5-ext/test/array/#/group.js deleted file mode 100644 index 32dc8c2dbb68bf..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/group.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - var count = 0, self; - - self = Object(this); - a.deep(t.call(self, function (v, i, scope) { - a(v, this[i], "Value"); - a(i, count++, "Index"); - a(scope, this, "Scope"); - return i; - }, self), { 0: [this[0]], 1: [this[1]], 2: [this[2]] }); - }, - "": function (t, a) { - var r; - r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], - function (v) { - return v % 2 ? 'odd' : 'even'; - }); - a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]); - a.deep(r.even, [2, 4, 6, 34, 56]); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/indexes-of.js b/tools/eslint/node_modules/es5-ext/test/array/#/indexes-of.js deleted file mode 100644 index 3364170f1ec4a9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/indexes-of.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - a.deep(t.call(this, this[1]), [1]); - }, - "": function (t, a) { - var x = {}; - a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result"); - a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results"); - a.deep(t.call([], x), [], "Empty array"); - a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/intersection.js b/tools/eslint/node_modules/es5-ext/test/array/#/intersection.js deleted file mode 100644 index b72b2fb074fc46..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/intersection.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var toArray = require('../../../array/to-array'); - -module.exports = { - __generic: function (t, a) { - a.deep(t.call(this, this, this), toArray(this)); - }, - "": function (t, a) { - var x = {}, y = {}, p, r; - a.deep(t.call([], [2, 3, 4]), [], "Empty #1"); - a.deep(t.call([2, 3, 4], []), [], "Empty #2"); - a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different"); - p = t.call([3, 5, 'raz', {}, 'dwa', x], [1, 3, 'raz', 'dwa', 'trzy', x, {}], - [3, 'raz', x, 65]); - r = [3, 'raz', x]; - p.sort(); - r.sort(); - a.deep(p, r, "Same parts"); - a.deep(t.call(r, r), r, "Same"); - a.deep(t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), - [1, 2, x, 4, 5, y, 7], "Long reverse same"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/is-copy.js b/tools/eslint/node_modules/es5-ext/test/array/#/is-copy.js deleted file mode 100644 index e7f80e7a8d4ebc..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/is-copy.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}; - a(t.call([], []), true, "Empty"); - a(t.call([], {}), true, "Empty lists"); - a(t.call([1, x, 'raz'], [1, x, 'raz']), true, "Same"); - a(t.call([1, x, 'raz'], { 0: 1, 1: x, 2: 'raz', length: 3 }), true, - "Same lists"); - a(t.call([1, x, 'raz'], [x, 1, 'raz']), false, "Diff order"); - a(t.call([1, x], [1, x, 'raz']), false, "Diff length #1"); - a(t.call([1, x, 'raz'], [1, x]), false, "Diff length #2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/is-uniq.js b/tools/eslint/node_modules/es5-ext/test/array/#/is-uniq.js deleted file mode 100644 index 7349ba337135a7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/is-uniq.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}; - a(t.call([]), true, "Empty"); - a(t.call({}), true, "Empty lists"); - a(t.call([1, x, 'raz']), true, "Uniq"); - a(t.call([1, x, 1, 'raz']), false, "Not Uniq: primitive"); - a(t.call([1, x, '1', 'raz']), true, "Uniq: primitive"); - a(t.call([1, x, 1, {}, 'raz']), false, "Not Uniq: Obj"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/keys/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/keys/implement.js deleted file mode 100644 index b0c1aa078f190e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/keys/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/keys/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/keys/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/keys/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/keys/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/keys/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/keys/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/keys/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/keys/shim.js deleted file mode 100644 index a43c04cac103a6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/keys/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var iterator = t.call(this); - a.deep(iterator.next(), { value: 0, done: false }); - a.deep(iterator.next(), { value: 1, done: false }); - a.deep(iterator.next(), { value: 2, done: false }); - a.deep(iterator.next(), { value: undefined, done: true }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/last-index.js b/tools/eslint/node_modules/es5-ext/test/array/#/last-index.js deleted file mode 100644 index a1cac1073f8862..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/last-index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a(t.call([]), null, "Empty"); - a(t.call([null]), 0, "One value"); - a(t.call([1, 2, 3]), 2, "Many values"); - a(t.call(new Array(1000)), null, "Sparse empty"); - x = []; - x[883] = null; - x[890] = undefined; - a(t.call(x), 890, "Manual sparse, distant value"); - x = new Array(1000); - x[657] = null; - x[700] = undefined; - a(t.call(x), 700, "Sparse, distant value"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/last.js b/tools/eslint/node_modules/es5-ext/test/array/#/last.js deleted file mode 100644 index 8d051bc8d2f5df..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/last.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - a(t.call(this), this[this.length - 1]); -}; - -exports[''] = function (t, a) { - var x; - a(t.call([]), undefined, "Empty"); - a(t.call(new Array(234), undefined, "Sparse empty")); - x = new Array(2342); - x[434] = {}; - x[450] = {}; - a(t.call(x), x[450], "Sparse"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/map/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/map/implement.js deleted file mode 100644 index cdcbc8df6206a5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/map/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/map/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/map/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/map/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/map/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/map/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/map/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/map/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/map/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/map/shim.js deleted file mode 100644 index bbfefe8e333dc8..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/map/shim.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var SubArray = require('../../../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr, x = {}, subArr, result; - - arr = ['foo', undefined, 0, '2d', false, x, null]; - - a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], - "Plain array"); - - subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); - - result = t.call(subArr, Boolean); - a(result instanceof SubArray, true, "Instance of subclass"); - a.deep(result, [true, false, false, true, false, true, false], - "Result of subclass"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/remove.js b/tools/eslint/node_modules/es5-ext/test/array/#/remove.js deleted file mode 100644 index 3ebdca2d0183df..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/remove.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var y = {}, z = {}, x = [9, z, 5, y, 'foo']; - t.call(x, y); - a.deep(x, [9, z, 5, 'foo']); - t.call(x, {}); - a.deep(x, [9, z, 5, 'foo'], "Not existing"); - t.call(x, 5); - a.deep(x, [9, z, 'foo'], "Primitive"); - x = [9, z, 5, y, 'foo']; - t.call(x, z, 5, 'foo'); - a.deep(x, [9, y], "More than one argument"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/separate.js b/tools/eslint/node_modules/es5-ext/test/array/#/separate.js deleted file mode 100644 index 42918b59711e32..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/separate.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = [], y = {}, z = {}; - a.deep(t.call(x, y), [], "Empty"); - a.not(t.call(x), x, "Returns copy"); - a.deep(t.call([1], y), [1], "One"); - a.deep(t.call([1, 'raz'], y), [1, y, 'raz'], "One"); - a.deep(t.call([1, 'raz', x], y), [1, y, 'raz', y, x], "More"); - x = new Array(1000); - x[23] = 2; - x[3453] = 'raz'; - x[500] = z; - a.deep(t.call(x, y), [2, y, z, y, 'raz'], "Sparse"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/slice/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/slice/implement.js deleted file mode 100644 index 855ae2fa4df88e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/slice/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/slice/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/slice/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/slice/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/slice/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/slice/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/slice/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/slice/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/slice/shim.js deleted file mode 100644 index f674f3470037f7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/slice/shim.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var SubArray = require('../../../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr, x = {}, subArr, result; - - arr = ['foo', undefined, 0, '2d', false, x, null]; - - a.deep(t.call(arr, 2, 4), [0, '2d'], "Plain array: result"); - - subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); - - result = t.call(subArr, 2, 4); - a(result instanceof SubArray, true, "Instance of subclass"); - a.deep(result, [0, '2d'], "Subclass: result"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/some-right.js b/tools/eslint/node_modules/es5-ext/test/array/#/some-right.js deleted file mode 100644 index 900771a6f818a4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/some-right.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - var count = 0, first, last, x, icount = this.length; - t.call(this, function (item, index, col) { - ++count; - if (!first) { - first = item; - } - last = item; - x = col; - a(index, --icount, "Index"); - }); - a(count, this.length, "Iterated"); - a(first, this[this.length - 1], "First is last"); - a(last, this[0], "Last is first"); - a.deep(x, Object(this), "Collection as third argument"); //jslint: skip - }, - "": function (t, a) { - var x = {}, y, count; - t.call([1], function () { y = this; }, x); - a(y, x, "Scope"); - y = 0; - t.call([3, 4, 4], function (a, i) { y += i; }); - a(y, 3, "Indexes"); - - x = [1, 3]; - x[5] = 'x'; - y = 0; - count = 0; - a(t.call(x, function (a, i) { ++count; y += i; }), false, "Return"); - a(y, 6, "Misssing Indexes"); - a(count, 3, "Misssing Indexes, count"); - - count = 0; - a(t.call([-2, -3, -4, 2, -5], function (item) { - ++count; - return item > 0; - }), true, "Return"); - a(count, 2, "Break after true is returned"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/splice/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/splice/implement.js deleted file mode 100644 index 0d9f46188b528b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/splice/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/splice/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/splice/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/splice/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/splice/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/splice/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/splice/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/splice/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/splice/shim.js deleted file mode 100644 index 2c751e672400e6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/splice/shim.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var SubArray = require('../../../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr, x = {}, subArr, result; - - arr = ['foo', undefined, 0, '2d', false, x, null]; - - a.deep(t.call(arr, 2, 2, 'bar'), [0, '2d'], "Plain array: result"); - a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change"); - - subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); - - result = t.call(subArr, 2, 2, 'bar'); - a(result instanceof SubArray, true, "Instance of subclass"); - a.deep(result, [0, '2d'], "Subclass: result"); - a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/uniq.js b/tools/eslint/node_modules/es5-ext/test/array/#/uniq.js deleted file mode 100644 index 2f7e6c4ed1feb5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/uniq.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = { - __generic: function (t, a) { - a(t.call(this).length, 3); - }, - "": function (t, a) { - var o, x = {}, y = {}, z = {}, w; - o = [1, 2, x, 3, 1, 'raz', '1', y, x, 'trzy', z, 'raz']; - - a.not(w = t.call(o), o, "Returns different object"); - a.deep(w, [1, 2, x, 3, 'raz', '1', y, 'trzy', z], "Result"); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/values/implement.js b/tools/eslint/node_modules/es5-ext/test/array/#/values/implement.js deleted file mode 100644 index 9f40138c254b30..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/values/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../array/#/values/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/values/index.js b/tools/eslint/node_modules/es5-ext/test/array/#/values/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/values/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/values/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/#/values/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/values/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/#/values/shim.js b/tools/eslint/node_modules/es5-ext/test/array/#/values/shim.js deleted file mode 100644 index e590d8f28e7c0e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/#/values/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -exports.__generic = function (t, a) { - var iterator = t.call(this); - a.deep(iterator.next(), { value: '1', done: false }); - a.deep(iterator.next(), { value: '2', done: false }); - a.deep(iterator.next(), { value: '3', done: false }); - a.deep(iterator.next(), { value: undefined, done: true }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/__scopes.js b/tools/eslint/node_modules/es5-ext/test/array/__scopes.js deleted file mode 100644 index 6bfdcbc9494a87..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/__scopes.js +++ /dev/null @@ -1,11 +0,0 @@ -'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/es5-ext/test/array/_is-extensible.js b/tools/eslint/node_modules/es5-ext/test/array/_is-extensible.js deleted file mode 100644 index d387126fe111ed..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/_is-extensible.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(typeof t, 'boolean'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js deleted file mode 100644 index 29d8699d461a85..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var isArray = Array.isArray; - -module.exports = function (t, a) { - t((t === null) || isArray(t.prototype), true); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy.js b/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy.js deleted file mode 100644 index 29d8699d461a85..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var isArray = Array.isArray; - -module.exports = function (t, a) { - t((t === null) || isArray(t.prototype), true); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/from/implement.js b/tools/eslint/node_modules/es5-ext/test/array/from/implement.js deleted file mode 100644 index e0db846f99a0d9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/from/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../array/from/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/from/index.js b/tools/eslint/node_modules/es5-ext/test/array/from/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/from/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/from/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/from/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/from/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/from/shim.js b/tools/eslint/node_modules/es5-ext/test/array/from/shim.js deleted file mode 100644 index 310302ac486645..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/from/shim.js +++ /dev/null @@ -1,60 +0,0 @@ -// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js - -'use strict'; - -module.exports = function (t, a) { - var o = [1, 2, 3], MyType; - a.not(t(o), o, "Array"); - a.deep(t(o), o, "Array: same content"); - a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String"); - a.deep(t((function () { return arguments; }(3, o, 'raz'))), - [3, o, 'raz'], "Arguments"); - a.deep(t((function () { return arguments; }(3))), [3], - "Arguments with one numeric value"); - - a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other"); - - a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50], - "Mapping"); - - a.throws(function () { t(); }, TypeError, "Undefined"); - a.deep(t(3), [], "Primitive"); - - a(t.length, 1, "Length"); - a.deep(t({ length: 0 }), [], "No values Array-like"); - a.deep(t({ length: -1 }), [], "Invalid length Array-like"); - a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); - a.throws(function () { t(undefined); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a.deep(t(false), [], "Boolean"); - a.deep(t(-Infinity), [], "Inifity"); - a.deep(t(-0), [], "-0"); - a.deep(t(+0), [], "+0"); - a.deep(t(1), [], "1"); - a.deep(t(+Infinity), [], "+Infinity"); - a.deep(t({}), [], "Plain object"); - a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); - a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return x + x; }), ['aa', 'bb'], - "Map"); - a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, undefined), - ['undefined', 'undefined'], "Map context"); - a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, 'x'), - ['x', 'x'], "Map primitive context"); - a.throws(function () { t({}, 'foo', 'x'); }, TypeError, "Non callable for map"); - - a.deep(t.call(null, { length: 1, '0': 'a' }), ['a'], "Null context"); - - a(t({ __proto__: { '0': 'abc', length: 1 } })[0], 'abc', "Values on prototype"); - - a.throws(function () { t.call(function () { return Object.freeze({}); }, {}); }, - TypeError, "Contructor producing freezed objects"); - - // Ensure no setters are called for the indexes - // Ensure no setters are called for the indexes - MyType = function () {}; - Object.defineProperty(MyType.prototype, '0', { - set: function (x) { throw new Error('Setter called: ' + x); } - }); - a.deep(t.call(MyType, { '0': 'abc', length: 1 }), { '0': 'abc', length: 1 }, - "Defined not set"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/generate.js b/tools/eslint/node_modules/es5-ext/test/array/generate.js deleted file mode 100644 index d72e056887838b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/generate.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}, y = {}; - a.deep(t(3), [undefined, undefined, undefined], "Just length"); - a.deep(t(0, 'x'), [], "No repeat"); - a.deep(t(1, x, y), [x], "Arguments length larger than repeat number"); - a.deep(t(3, x), [x, x, x], "Single argument"); - a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/is-plain-array.js b/tools/eslint/node_modules/es5-ext/test/array/is-plain-array.js deleted file mode 100644 index 871a08aec21ff9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/is-plain-array.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var SubArray = require('../../array/_sub-array-dummy-safe'); - -module.exports = function (t, a) { - var arr = [1, 2, 3]; - a(t(arr), true, "Array"); - a(t(null), false, "Null"); - a(t(), false, "Undefined"); - a(t('234'), false, "String"); - a(t(23), false, "Number"); - a(t({}), false, "Plain object"); - a(t({ length: 1, 0: 'raz' }), false, "Array-like"); - a(t(Object.create(arr)), false, "Array extension"); - if (!SubArray) return; - a(t(new SubArray(23)), false, "Subclass instance"); - a(t(Array.prototype), false, "Array.prototype"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/of/implement.js b/tools/eslint/node_modules/es5-ext/test/array/of/implement.js deleted file mode 100644 index 30d53be2d7abbe..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/of/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../array/of/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/of/index.js b/tools/eslint/node_modules/es5-ext/test/array/of/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/of/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/array/of/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/array/of/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/of/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/array/of/shim.js b/tools/eslint/node_modules/es5-ext/test/array/of/shim.js deleted file mode 100644 index e6974420c1c274..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/of/shim.js +++ /dev/null @@ -1,68 +0,0 @@ -// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js -// Thanks @mathiasbynens - -'use strict'; - -var defineProperty = Object.defineProperty; - -module.exports = function (t, a) { - var x = {}, testObject, MyType; - - a.deep(t(), [], "No arguments"); - a.deep(t(3), [3], "One numeric argument"); - a.deep(t(3, 'raz', null, x, undefined), [3, 'raz', null, x, undefined], - "Many arguments"); - - a(t.length, 0, "Length"); - - a.deep(t('abc'), ['abc'], "String"); - a.deep(t(undefined), [undefined], "Undefined"); - a.deep(t(null), [null], "Null"); - a.deep(t(false), [false], "Boolean"); - a.deep(t(-Infinity), [-Infinity], "Infinity"); - a.deep(t(-0), [-0], "-0"); - a.deep(t(+0), [+0], "+0"); - a.deep(t(1), [1], "1"); - a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); - a.deep(t(+Infinity), [+Infinity], "+Infinity"); - a.deep(t({ '0': 'a', '1': 'b', '2': 'c', length: 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array like"); - a.deep(t(undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), - [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy arguments"); - - a.h1("Null context"); - a.deep(t.call(null, 'abc'), ['abc'], "String"); - a.deep(t.call(null, undefined), [undefined], "Undefined"); - a.deep(t.call(null, null), [null], "Null"); - a.deep(t.call(null, false), [false], "Boolean"); - a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity"); - a.deep(t.call(null, -0), [-0], "-0"); - a.deep(t.call(null, +0), [+0], "+0"); - a.deep(t.call(null, 1), [1], "1"); - a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); - a.deep(t.call(null, +Infinity), [+Infinity], "+Infinity"); - a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', length: 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array-like"); - a.deep(t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), - [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy"); - - a.h1("Other constructor context"); - a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, length: 3 }, "Many arguments"); - - testObject = Object(3); - testObject[0] = 1; - testObject[1] = 2; - testObject[2] = 3; - testObject.length = 3; - a.deep(t.call(Object, 1, 2, 3), testObject, "Test object"); - a(t.call(Object).length, 0, "No arguments"); - a.throws(function () { t.call(function () { return Object.freeze({}); }); }, TypeError, - "Frozen instance"); - - // Ensure no setters are called for the indexes - MyType = function () {}; - defineProperty(MyType.prototype, '0', { - set: function (x) { throw new Error('Setter called: ' + x); } - }); - a.deep(t.call(MyType, 'abc'), { '0': 'abc', length: 1 }, "Define, not set"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/to-array.js b/tools/eslint/node_modules/es5-ext/test/array/to-array.js deleted file mode 100644 index 4985b5eaee9769..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/to-array.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = [1, 2, 3]; - a(t(o), o, "Array"); - a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String"); - a.deep(t((function () { return arguments; }(3, o, 'raz'))), - [3, o, 'raz'], "Arguments"); - a.deep(t((function () { return arguments; }(3))), [3], - "Arguments with one numeric value"); - - a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/array/valid-array.js b/tools/eslint/node_modules/es5-ext/test/array/valid-array.js deleted file mode 100644 index 3732192d1bbd1f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/array/valid-array.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a.throws(function () { t(0); }, TypeError, "Number"); - a.throws(function () { t(true); }, TypeError, "Boolean"); - a.throws(function () { t('raz'); }, TypeError, "String"); - a.throws(function () { t(function () {}); }, TypeError, "Function"); - a.throws(function () { t({}); }, TypeError, "Object"); - a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); - a(t(x = []), x, "Array"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/boolean/is-boolean.js b/tools/eslint/node_modules/es5-ext/test/boolean/is-boolean.js deleted file mode 100644 index 4e6b3cb73e4f3b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/boolean/is-boolean.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t('arar'), false, "String"); - a(t(12), false, "Number"); - a(t(false), true, "Boolean"); - a(t(new Boolean(false)), true, "Boolean object"); - a(t(new Date()), false, "Date"); - a(t(new String('raz')), false, "String object"); - a(t({}), false, "Plain object"); - a(t(/a/), false, "Regular expression"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/copy.js b/tools/eslint/node_modules/es5-ext/test/date/#/copy.js deleted file mode 100644 index 767c5e16a4d053..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/copy.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = new Date(), o2; - - o2 = t.call(o); - a.not(o, o2, "Different objects"); - a.ok(o2 instanceof Date, "Instance of Date"); - a(o.getTime(), o2.getTime(), "Same time"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/days-in-month.js b/tools/eslint/node_modules/es5-ext/test/date/#/days-in-month.js deleted file mode 100644 index 9ddba55f74ac40..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/days-in-month.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(new Date(2001, 0, 1)), 31, "January"); - a(t.call(new Date(2001, 1, 1)), 28, "February"); - a(t.call(new Date(2000, 1, 1)), 29, "February (leap)"); - a(t.call(new Date(2001, 2, 1)), 31, "March"); - a(t.call(new Date(2001, 3, 1)), 30, "April"); - a(t.call(new Date(2001, 4, 1)), 31, "May"); - a(t.call(new Date(2001, 5, 1)), 30, "June"); - a(t.call(new Date(2001, 6, 1)), 31, "July"); - a(t.call(new Date(2001, 7, 1)), 31, "August"); - a(t.call(new Date(2001, 8, 1)), 30, "September"); - a(t.call(new Date(2001, 9, 1)), 31, "October"); - a(t.call(new Date(2001, 10, 1)), 30, "November"); - a(t.call(new Date(2001, 11, 1)), 31, "December"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/floor-day.js b/tools/eslint/node_modules/es5-ext/test/date/#/floor-day.js deleted file mode 100644 index d4f4a9087c059e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/floor-day.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(), - new Date(2000, 0, 1).valueOf()); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/floor-month.js b/tools/eslint/node_modules/es5-ext/test/date/#/floor-month.js deleted file mode 100644 index b4a81bef6d0850..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/floor-month.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(), - new Date(2000, 0, 1).valueOf()); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/floor-year.js b/tools/eslint/node_modules/es5-ext/test/date/#/floor-year.js deleted file mode 100644 index aae117e769b52c..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/floor-year.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(), - new Date(2000, 0, 1).valueOf()); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/#/format.js b/tools/eslint/node_modules/es5-ext/test/date/#/format.js deleted file mode 100644 index e68e4bf782ef30..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/#/format.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var dt = new Date(2011, 2, 3, 3, 5, 5, 32); - a(t.call(dt, ' %Y.%y.%m.%d.%H.%M.%S.%L '), ' 2011.11.03.03.03.05.05.032 '); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/is-date.js b/tools/eslint/node_modules/es5-ext/test/date/is-date.js deleted file mode 100644 index 109093dfbe32f8..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/is-date.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t('arar'), false, "String"); - a(t(12), false, "Number"); - a(t(true), false, "Boolean"); - a(t(new Date()), true, "Date"); - a(t(new String('raz')), false, "String object"); - a(t({}), false, "Plain object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/date/valid-date.js b/tools/eslint/node_modules/es5-ext/test/date/valid-date.js deleted file mode 100644 index 98787e40781687..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/date/valid-date.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var d = new Date(); - a(t(d), d, "Date"); - a.throws(function () { - t({}); - }, "Object"); - a.throws(function () { - t({ valueOf: function () { return 20; } }); - }, "Number object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/error/#/throw.js b/tools/eslint/node_modules/es5-ext/test/error/#/throw.js deleted file mode 100644 index 1213cfc3b12791..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/error/#/throw.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var e = new Error(); - try { - t.call(e); - } catch (e2) { - a(e2, e); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/error/custom.js b/tools/eslint/node_modules/es5-ext/test/error/custom.js deleted file mode 100644 index d4ff500c9b30f2..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/error/custom.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var T = t, err = new T('My Error', 'MY_ERROR', { errno: 123 }); - a(err instanceof Error, true, "Instance of error"); - a(err.constructor, Error, "Constructor"); - a(err.name, 'Error', "Name"); - a(String(err), 'Error: My Error', "String representation"); - a(err.code, 'MY_ERROR', "Code"); - a(err.errno, 123, "Errno"); - a(typeof err.stack, 'string', "Stack trace"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/error/is-error.js b/tools/eslint/node_modules/es5-ext/test/error/is-error.js deleted file mode 100644 index f8b5e2000eb769..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/error/is-error.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(), false, "Undefined"); - a(t(1), false, "Primitive"); - a(t({}), false, "Objectt"); - a(t({ toString: function () { return '[object Error]'; } }), false, - "Fake error"); - a(t(new Error()), true, "Error"); - a(t(new EvalError()), true, "EvalError"); - a(t(new RangeError()), true, "RangeError"); - a(t(new ReferenceError()), true, "ReferenceError"); - a(t(new SyntaxError()), true, "SyntaxError"); - a(t(new TypeError()), true, "TypeError"); - a(t(new URIError()), true, "URIError"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/error/valid-error.js b/tools/eslint/node_modules/es5-ext/test/error/valid-error.js deleted file mode 100644 index e04cdb33b7cdf4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/error/valid-error.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var e = new Error(); - a(t(e), e, "Error"); - a.throws(function () { - t({}); - }, "Other"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/compose.js b/tools/eslint/node_modules/es5-ext/test/function/#/compose.js deleted file mode 100644 index 83de5e844ac87d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/compose.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var f = function (a, b) { return ['a', arguments.length, a, b]; } - , g = function (a) { return ['b', arguments.length].concat(a); } - , h = function (a) { return ['c', arguments.length].concat(a); }; - -module.exports = function (t, a) { - a.deep(t.call(h, g, f)(1, 2), ['c', 1, 'b', 1, 'a', 2, 1, 2]); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/copy.js b/tools/eslint/node_modules/es5-ext/test/function/#/copy.js deleted file mode 100644 index 7a22e2f249276e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/copy.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var foo = 'raz', bar = 'dwa' - , fn = function marko(a, b) { return this + a + b + foo + bar; } - , result, o = {}; - - fn.prototype = o; - - fn.foo = 'raz'; - - result = t.call(fn); - - a(result.length, fn.length, "Length"); - a(result.name, fn.name, "Length"); - a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Body"); - a(result.prototype, fn.prototype, "Prototype"); - a(result.foo, fn.foo, "Custom property"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/curry.js b/tools/eslint/node_modules/es5-ext/test/function/#/curry.js deleted file mode 100644 index 18fb0389e79b26..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/curry.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var toArray = require('../../../array/to-array') - - , f = function () { return toArray(arguments); }; - -module.exports = function (t, a) { - var x, y = {}, z; - a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments"); - x = t.call(f, 5, {}); - a(x.length, 5, "Length #1"); - z = x(1, 2); - a(z.length, 3, "Length #2"); - z = z(3, 4); - a(z.length, 1, "Length #1"); - a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments"); - a.deep(x(8, 3)(y, 45)('raz', 6), [8, 3, y, 45, 'raz'], "Many arguments #2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/lock.js b/tools/eslint/node_modules/es5-ext/test/function/#/lock.js deleted file mode 100644 index 44a12d7b56c748..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/lock.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(function () { - return arguments.length; - })(1, 2, 3), 0); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/not.js b/tools/eslint/node_modules/es5-ext/test/function/#/not.js deleted file mode 100644 index c0f5e9d4b989a5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/not.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var identity = require('../../../function/identity') - , noop = require('../../../function/noop'); - -module.exports = function (t, a) { - a(t.call(identity)(''), true, "Falsy"); - a(t.call(noop)(), true, "Undefined"); - a(t.call(identity)({}), false, "Any object"); - a(t.call(identity)(true), false, "True"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/partial.js b/tools/eslint/node_modules/es5-ext/test/function/#/partial.js deleted file mode 100644 index bd00ce752f5202..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/partial.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var toArray = require('../../../array/to-array') - - , f = function () { return toArray(arguments); }; - -module.exports = function (t, a) { - a.deep(t.call(f, 1)(2, 3), [1, 2, 3]); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/spread.js b/tools/eslint/node_modules/es5-ext/test/function/#/spread.js deleted file mode 100644 index b82dfecfe95045..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/spread.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var f = function (a, b) { return this[a] + this[b]; } - , o = { a: 3, b: 4 }; - -module.exports = function (t, a) { - a(t.call(f).call(o, ['a', 'b']), 7); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/#/to-string-tokens.js b/tools/eslint/node_modules/es5-ext/test/function/#/to-string-tokens.js deleted file mode 100644 index 4c54d30354b405..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/#/to-string-tokens.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t.call(function (a, b) { return this[a] + this[b]; }), - { args: 'a, b', body: ' return this[a] + this[b]; ' }); - a.deep(t.call(function () {}), - { args: '', body: '' }); - a.deep(t.call(function (raz) {}), - { args: 'raz', body: '' }); - a.deep(t.call(function () { Object(); }), - { args: '', body: ' Object(); ' }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/_define-length.js b/tools/eslint/node_modules/es5-ext/test/function/_define-length.js deleted file mode 100644 index 8f037e857eaa09..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/_define-length.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var foo = 'raz', bar = 'dwa' - , fn = function (a, b) { return this + a + b + foo + bar; } - , result; - - result = t(fn, 3); - a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Content"); - a(result.length, 3, "Length"); - a(result.prototype, fn.prototype, "Prototype"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/constant.js b/tools/eslint/node_modules/es5-ext/test/function/constant.js deleted file mode 100644 index fda52aa43710c1..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/constant.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var o = {}; - -module.exports = function (t, a) { - a(t(o)(), o); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/identity.js b/tools/eslint/node_modules/es5-ext/test/function/identity.js deleted file mode 100644 index 8013e2e5af1288..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/identity.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var o = {}; - -module.exports = function (t, a) { - a(t(o), o); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/invoke.js b/tools/eslint/node_modules/es5-ext/test/function/invoke.js deleted file mode 100644 index fcce4aaaaafb87..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/invoke.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var constant = require('../../function/constant') - - , o = { b: constant('c') }; - -module.exports = function (t, a) { - a(t('b')(o), 'c'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/is-arguments.js b/tools/eslint/node_modules/es5-ext/test/function/is-arguments.js deleted file mode 100644 index f8de8812a5035d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/is-arguments.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var args, dummy; - args = (function () { return arguments; }()); - dummy = { '0': 1, '1': 2 }; - Object.defineProperty(dummy, 'length', { value: 2 }); - a(t(args), true, "Arguments"); - a(t(dummy), false, "Dummy"); - a(t([]), false, "Array"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/is-function.js b/tools/eslint/node_modules/es5-ext/test/function/is-function.js deleted file mode 100644 index 83acc42f9a6637..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/is-function.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var o = { call: Function.prototype.call, apply: Function.prototype.apply }; - -module.exports = function (t, a) { - a(t(function () {}), true, "Function is function"); - a(t(o), false, "Plain object is not function"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/noop.js b/tools/eslint/node_modules/es5-ext/test/function/noop.js deleted file mode 100644 index 4305c6fcfd51cd..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/noop.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(typeof t(1, 2, 3), 'undefined'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/pluck.js b/tools/eslint/node_modules/es5-ext/test/function/pluck.js deleted file mode 100644 index 5bf9583ad52b3e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/pluck.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var o = { foo: 'bar' }; - -module.exports = function (t, a) { - a(t('foo')(o), o.foo); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/function/valid-function.js b/tools/eslint/node_modules/es5-ext/test/function/valid-function.js deleted file mode 100644 index 59b16233b37978..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/function/valid-function.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var f = function () {}; - a(t(f), f, "Function"); - f = new Function(); - a(t(f), f, "Function"); - a.throws(function () { - t({}); - }, "Object"); - a.throws(function () { - t(/re/); - }, "RegExp"); - a.throws(function () { - t({ call: function () { return 20; } }); - }, "Plain object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/global.js b/tools/eslint/node_modules/es5-ext/test/global.js deleted file mode 100644 index 1f452aefb09827..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/global.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.ok(t && typeof t === 'object'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/iterable/for-each.js b/tools/eslint/node_modules/es5-ext/test/iterable/for-each.js deleted file mode 100644 index 0fed8ad898990e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/iterable/for-each.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var ArrayIterator = require('es6-iterator/array') - - , slice = Array.prototype.slice; - -module.exports = function (t, a) { - var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}; - t(x, function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); - a(this, y, "Array: context: " + (i++) + "#"); - }, y); - i = 0; - t((function () { return arguments; }('raz', 'dwa', 'trzy')), function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); - a(this, y, "Arguments: context: " + (i++) + "#"); - }, y); - i = 0; - t({ 0: 'raz', 1: 'dwa', 2: 'trzy', length: 3 }, function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#"); - a(this, y, "Array-like: context: " + (i++) + "#"); - }, y); - i = 0; - t(x = 'foo', function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); - a(this, y, "Regular String: context: " + (i++) + "#"); - }, y); - i = 0; - x = ['r', '💩', 'z']; - t('r💩z', function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); - a(this, y, "Unicode String: context: " + (i++) + "#"); - }, y); - i = 0; - t(new ArrayIterator(x), function () { - a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); - a(this, y, "Iterator: context: " + (i++) + "#"); - }, y); - -}; diff --git a/tools/eslint/node_modules/es5-ext/test/iterable/is.js b/tools/eslint/node_modules/es5-ext/test/iterable/is.js deleted file mode 100644 index c0d2a43ebfe17c..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/iterable/is.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (t, a) { - var x; - a(t([]), true, "Array"); - a(t(""), true, "String"); - a(t((function () { return arguments; }())), true, "Arguments"); - a(t({ length: 0 }), true, "List object"); - a(t(function () {}), false, "Function"); - a(t({}), false, "Plain object"); - a(t(/raz/), false, "Regexp"); - a(t(), false, "No argument"); - a(t(null), false, "Null"); - a(t(undefined), false, "Undefined"); - x = {}; - x[iteratorSymbol] = function () {}; - a(t(x), true, "Iterable"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/iterable/validate-object.js b/tools/eslint/node_modules/es5-ext/test/iterable/validate-object.js deleted file mode 100644 index da12529bc0368c..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/iterable/validate-object.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(0); }, TypeError, "0"); - a.throws(function () { t(false); }, TypeError, "false"); - a.throws(function () { t(''); }, TypeError, "String"); - a.throws(function () { t({}); }, TypeError, "Plain Object"); - a.throws(function () { t(function () {}); }, TypeError, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: ignore - - a(t(x = { length: 1 }), x, "Array like"); - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "null"); - x = {}; - x[iteratorSymbol] = function () {}; - a(t(x), x, "Iterable"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/iterable/validate.js b/tools/eslint/node_modules/es5-ext/test/iterable/validate.js deleted file mode 100644 index bcc2ad3d0aa1c9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/iterable/validate.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(0); }, TypeError, "0"); - a.throws(function () { t(false); }, TypeError, "false"); - a(t(''), '', "''"); - a.throws(function () { t({}); }, TypeError, "Plain Object"); - a.throws(function () { t(function () {}); }, TypeError, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: ignore - - a(t(x = { length: 1 }), x, "Array like"); - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "null"); - x = {}; - x[iteratorSymbol] = function () {}; - a(t(x), x, "Iterable"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/_pack-ieee754.js b/tools/eslint/node_modules/es5-ext/test/math/_pack-ieee754.js deleted file mode 100644 index 9041431d7769c9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/_pack-ieee754.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t(1.337, 8, 23), [63, 171, 34, 209]); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/_unpack-ieee754.js b/tools/eslint/node_modules/es5-ext/test/math/_unpack-ieee754.js deleted file mode 100644 index ca30b8208dbb95..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/_unpack-ieee754.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/acosh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/acosh/implement.js deleted file mode 100644 index 01fb6d08224e2a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/acosh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/acosh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/acosh/index.js b/tools/eslint/node_modules/es5-ext/test/math/acosh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/acosh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/acosh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/acosh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/acosh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/acosh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/acosh/shim.js deleted file mode 100644 index 3d710c7930d454..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/acosh/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(-1), NaN, "Negative"); - a(t(0), NaN, "Zero"); - a(t(0.5), NaN, "Below 1"); - a(t(1), 0, "1"); - a(t(2), 1.3169578969248166, "Other"); - a(t(Infinity), Infinity, "Infinity"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/asinh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/asinh/implement.js deleted file mode 100644 index d1fceceee13449..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/asinh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/asinh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/asinh/index.js b/tools/eslint/node_modules/es5-ext/test/math/asinh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/asinh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/asinh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/asinh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/asinh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/asinh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/asinh/shim.js deleted file mode 100644 index d9fbe49edc2d99..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/asinh/shim.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -Infinity, "-Infinity"); - a(t(-2), -1.4436354751788103, "Negative"); - a(t(2), 1.4436354751788103, "Positive"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/atanh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/atanh/implement.js deleted file mode 100644 index cba8fad83e4082..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/atanh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/atanh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/atanh/index.js b/tools/eslint/node_modules/es5-ext/test/math/atanh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/atanh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/atanh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/atanh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/atanh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/atanh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/atanh/shim.js deleted file mode 100644 index a857b496686048..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/atanh/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(-2), NaN, "Less than -1"); - a(t(2), NaN, "Greater than 1"); - a(t(-1), -Infinity, "-1"); - a(t(1), Infinity, "1"); - a(t(0), 0, "Zero"); - a(t(0.5), 0.5493061443340549, "Ohter"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cbrt/implement.js b/tools/eslint/node_modules/es5-ext/test/math/cbrt/implement.js deleted file mode 100644 index 374d4b383f5c5f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cbrt/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/cbrt/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cbrt/index.js b/tools/eslint/node_modules/es5-ext/test/math/cbrt/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cbrt/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/cbrt/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cbrt/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cbrt/shim.js b/tools/eslint/node_modules/es5-ext/test/math/cbrt/shim.js deleted file mode 100644 index 43ab68b848f61a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cbrt/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -Infinity, "-Infinity"); - a(t(-1), -1, "-1"); - a(t(1), 1, "1"); - a(t(2), 1.2599210498948732, "Ohter"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/clz32/implement.js b/tools/eslint/node_modules/es5-ext/test/math/clz32/implement.js deleted file mode 100644 index 44f8815526b7ec..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/clz32/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/clz32/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/clz32/index.js b/tools/eslint/node_modules/es5-ext/test/math/clz32/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/clz32/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/clz32/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/clz32/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/clz32/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/clz32/shim.js b/tools/eslint/node_modules/es5-ext/test/math/clz32/shim.js deleted file mode 100644 index a769b39b85b644..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/clz32/shim.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(1), 31, "1"); - a(t(1000), 22, "1000"); - a(t(), 32, "No arguments"); - a(t(Infinity), 32, "Infinity"); - a(t(-Infinity), 32, "-Infinity"); - a(t("foo"), 32, "String"); - a(t(true), 31, "Boolean"); - a(t(3.5), 30, "Float"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cosh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/cosh/implement.js deleted file mode 100644 index f3c712b1dfc977..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cosh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/cosh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cosh/index.js b/tools/eslint/node_modules/es5-ext/test/math/cosh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cosh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/cosh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/cosh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cosh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/cosh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/cosh/shim.js deleted file mode 100644 index 419c12367dbcd2..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/cosh/shim.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 1, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), Infinity, "-Infinity"); - a(t(1), 1.5430806348152437, "1"); - a(t(Number.MAX_VALUE), Infinity); - a(t(-Number.MAX_VALUE), Infinity); - a(t(Number.MIN_VALUE), 1); - a(t(-Number.MIN_VALUE), 1); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/expm1/implement.js b/tools/eslint/node_modules/es5-ext/test/math/expm1/implement.js deleted file mode 100644 index c21296725dc07b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/expm1/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/expm1/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/expm1/index.js b/tools/eslint/node_modules/es5-ext/test/math/expm1/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/expm1/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/expm1/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/expm1/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/expm1/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/expm1/shim.js b/tools/eslint/node_modules/es5-ext/test/math/expm1/shim.js deleted file mode 100644 index 15f0e796ce565b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/expm1/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -1, "-Infinity"); - a(t(1).toFixed(15), '1.718281828459045', "1"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/fround/implement.js b/tools/eslint/node_modules/es5-ext/test/math/fround/implement.js deleted file mode 100644 index c909af7c300b22..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/fround/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/fround/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/fround/index.js b/tools/eslint/node_modules/es5-ext/test/math/fround/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/fround/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/fround/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/fround/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/fround/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/fround/shim.js b/tools/eslint/node_modules/es5-ext/test/math/fround/shim.js deleted file mode 100644 index 4ef6d4ea9b199b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/fround/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -Infinity, "-Infinity"); - a(t(1.337), 1.3370000123977661, "1"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/hypot/implement.js b/tools/eslint/node_modules/es5-ext/test/math/hypot/implement.js deleted file mode 100644 index 99466464c122bc..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/hypot/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/hypot/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/hypot/index.js b/tools/eslint/node_modules/es5-ext/test/math/hypot/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/hypot/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/hypot/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/hypot/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/hypot/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/hypot/shim.js b/tools/eslint/node_modules/es5-ext/test/math/hypot/shim.js deleted file mode 100644 index 91d950a5d32899..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/hypot/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(), 0, "No arguments"); - a(t(0, -0, 0), 0, "Zeros"); - a(t(4, NaN, Infinity), Infinity, "Infinity"); - a(t(4, NaN, -Infinity), Infinity, "Infinity"); - a(t(4, NaN, 34), NaN, "NaN"); - a(t(3, 4), 5, "#1"); - a(t(3, 4, 5), 7.0710678118654755, "#2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/imul/implement.js b/tools/eslint/node_modules/es5-ext/test/math/imul/implement.js deleted file mode 100644 index 7b2a2a61653299..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/imul/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/imul/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/imul/index.js b/tools/eslint/node_modules/es5-ext/test/math/imul/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/imul/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/imul/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/imul/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/imul/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/imul/shim.js b/tools/eslint/node_modules/es5-ext/test/math/imul/shim.js deleted file mode 100644 index a2ca7fe78321ce..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/imul/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(), 0, "No arguments"); - a(t(0, 0), 0, "Zeros"); - a(t(2, 4), 8, "#1"); - a(t(-1, 8), -8, "#2"); - a(t(0xfffffffe, 5), -10, "#3"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log10/implement.js b/tools/eslint/node_modules/es5-ext/test/math/log10/implement.js deleted file mode 100644 index 4b3b4a4569fb81..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log10/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/log10/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log10/index.js b/tools/eslint/node_modules/es5-ext/test/math/log10/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log10/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/log10/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/log10/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log10/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log10/shim.js b/tools/eslint/node_modules/es5-ext/test/math/log10/shim.js deleted file mode 100644 index 5fa0d5be3af861..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log10/shim.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(-0.5), NaN, "Less than 0"); - a(t(0), -Infinity, "0"); - a(t(1), 0, "1"); - a(t(Infinity), Infinity, "Infinity"); - a(t(2), 0.3010299956639812, "Other"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log1p/implement.js b/tools/eslint/node_modules/es5-ext/test/math/log1p/implement.js deleted file mode 100644 index 5d269bd3eaf09b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log1p/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/log1p/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log1p/index.js b/tools/eslint/node_modules/es5-ext/test/math/log1p/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log1p/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/log1p/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/log1p/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log1p/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log1p/shim.js b/tools/eslint/node_modules/es5-ext/test/math/log1p/shim.js deleted file mode 100644 index d495ce0496b76d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log1p/shim.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(-1.5), NaN, "Less than -1"); - a(t(-1), -Infinity, "-1"); - a(t(0), 0, "0"); - a(t(Infinity), Infinity, "Infinity"); - a(t(1), 0.6931471805599453, "Other"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log2/implement.js b/tools/eslint/node_modules/es5-ext/test/math/log2/implement.js deleted file mode 100644 index 92b501ac72abed..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log2/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/log2/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log2/index.js b/tools/eslint/node_modules/es5-ext/test/math/log2/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log2/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/log2/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/log2/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log2/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/log2/shim.js b/tools/eslint/node_modules/es5-ext/test/math/log2/shim.js deleted file mode 100644 index faa9c32a8537ab..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/log2/shim.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(-0.5), NaN, "Less than 0"); - a(t(0), -Infinity, "0"); - a(t(1), 0, "1"); - a(t(Infinity), Infinity, "Infinity"); - a(t(3).toFixed(15), '1.584962500721156', "Other"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sign/implement.js b/tools/eslint/node_modules/es5-ext/test/math/sign/implement.js deleted file mode 100644 index 5875c42d608eb4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sign/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/sign/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sign/index.js b/tools/eslint/node_modules/es5-ext/test/math/sign/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sign/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/sign/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/sign/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sign/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sign/shim.js b/tools/eslint/node_modules/es5-ext/test/math/sign/shim.js deleted file mode 100644 index b6b89c15889dc4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sign/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var is = require('../../../object/is'); - -module.exports = function (t, a) { - a(is(t(0), +0), true, "+0"); - a(is(t(-0), -0), true, "-0"); - a(t({}), NaN, true, "NaN"); - a(t(-234234234), -1, "Negative"); - a(t(234234234), 1, "Positive"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sinh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/sinh/implement.js deleted file mode 100644 index e52089e4507156..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sinh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/sinh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sinh/index.js b/tools/eslint/node_modules/es5-ext/test/math/sinh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sinh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/sinh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/sinh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sinh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/sinh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/sinh/shim.js deleted file mode 100644 index 4f63b59e735bf0..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/sinh/shim.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -Infinity, "-Infinity"); - a(t(1), 1.1752011936438014, "1"); - a(t(Number.MAX_VALUE), Infinity); - a(t(-Number.MAX_VALUE), -Infinity); - a(t(Number.MIN_VALUE), 5e-324); - a(t(-Number.MIN_VALUE), -5e-324); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/tanh/implement.js b/tools/eslint/node_modules/es5-ext/test/math/tanh/implement.js deleted file mode 100644 index a96bf193366b30..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/tanh/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/tanh/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/tanh/index.js b/tools/eslint/node_modules/es5-ext/test/math/tanh/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/tanh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/tanh/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/tanh/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/tanh/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/tanh/shim.js b/tools/eslint/node_modules/es5-ext/test/math/tanh/shim.js deleted file mode 100644 index 2c67aaf47049fd..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/tanh/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), 1, "Infinity"); - a(t(-Infinity), -1, "-Infinity"); - a(t(1), 0.7615941559557649, "1"); - a(t(Number.MAX_VALUE), 1); - a(t(-Number.MAX_VALUE), -1); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/math/trunc/implement.js b/tools/eslint/node_modules/es5-ext/test/math/trunc/implement.js deleted file mode 100644 index 1830e61f69794d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/trunc/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../math/trunc/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/trunc/index.js b/tools/eslint/node_modules/es5-ext/test/math/trunc/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/trunc/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/math/trunc/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/math/trunc/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/trunc/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/math/trunc/shim.js b/tools/eslint/node_modules/es5-ext/test/math/trunc/shim.js deleted file mode 100644 index 9e5eed7910e13c..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/math/trunc/shim.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var is = require('../../../object/is'); - -module.exports = function (t, a) { - a(t({}), NaN, "NaN"); - a(t(0), 0, "Zero"); - a(t(Infinity), Infinity, "Infinity"); - a(t(-Infinity), -Infinity, "-Infinity"); - a(is(t(0.234), 0), true, "0"); - a(is(t(-0.234), -0), true, "-0"); - a(t(13.7), 13, "Positive #1"); - a(t(12.3), 12, "Positive #2"); - a(t(-12.3), -12, "Negative #1"); - a(t(-14.7), -14, "Negative #2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/#/pad.js b/tools/eslint/node_modules/es5-ext/test/number/#/pad.js deleted file mode 100644 index e02082353348dc..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/#/pad.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(78, 4), '0078'); - a(t.call(65.12323, 4, 3), '0065.123', "Precision"); - a(t.call(65, 4, 3), '0065.000', "Precision integer"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/epsilon/implement.js b/tools/eslint/node_modules/es5-ext/test/number/epsilon/implement.js deleted file mode 100644 index 574da75dcebb7f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/epsilon/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/epsilon/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/epsilon/index.js b/tools/eslint/node_modules/es5-ext/test/number/epsilon/index.js deleted file mode 100644 index c892fd47d41c16..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/epsilon/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(typeof t, 'number'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/number/epsilon/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/epsilon/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-finite/implement.js b/tools/eslint/node_modules/es5-ext/test/number/is-finite/implement.js deleted file mode 100644 index b35345fa6ee762..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-finite/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/is-finite/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-finite/index.js b/tools/eslint/node_modules/es5-ext/test/number/is-finite/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-finite/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/number/is-finite/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-finite/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-finite/shim.js b/tools/eslint/node_modules/es5-ext/test/number/is-finite/shim.js deleted file mode 100644 index 5205d1c2602520..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-finite/shim.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(2), true, "Number"); - a(t('23'), false, "Not numeric"); - a(t(NaN), false, "NaN"); - a(t(Infinity), false, "Infinity"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-integer/implement.js b/tools/eslint/node_modules/es5-ext/test/number/is-integer/implement.js deleted file mode 100644 index 127149ceeda9b5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-integer/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/is-integer/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-integer/index.js b/tools/eslint/node_modules/es5-ext/test/number/is-integer/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-integer/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/number/is-integer/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-integer/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-integer/shim.js b/tools/eslint/node_modules/es5-ext/test/number/is-integer/shim.js deleted file mode 100644 index 3f3985c3a05522..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-integer/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(2), true, "Number"); - a(t(2.34), false, "Float"); - a(t('23'), false, "Not numeric"); - a(t(NaN), false, "NaN"); - a(t(Infinity), false, "Infinity"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-nan/implement.js b/tools/eslint/node_modules/es5-ext/test/number/is-nan/implement.js deleted file mode 100644 index 2f01d6d30ad9f6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-nan/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/is-nan/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-nan/index.js b/tools/eslint/node_modules/es5-ext/test/number/is-nan/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-nan/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/number/is-nan/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-nan/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-nan/shim.js b/tools/eslint/node_modules/es5-ext/test/number/is-nan/shim.js deleted file mode 100644 index 425723e74b07b9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-nan/shim.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(2), false, "Number"); - a(t({}), false, "Not numeric"); - a(t(NaN), true, "NaN"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-natural.js b/tools/eslint/node_modules/es5-ext/test/number/is-natural.js deleted file mode 100644 index d56f12042b48f3..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-natural.js +++ /dev/null @@ -1,10 +0,0 @@ -'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/es5-ext/test/number/is-number.js b/tools/eslint/node_modules/es5-ext/test/number/is-number.js deleted file mode 100644 index 275133476a61ff..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-number.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(0), true, "Zero"); - a(t(NaN), true, "NaN"); - a(t(Infinity), true, "Infinity"); - a(t(12), true, "Number"); - a(t(false), false, "Boolean"); - a(t(new Date()), false, "Date"); - a(t(new Number(2)), true, "Number object"); - a(t('asdfaf'), false, "String"); - a(t(''), false, "Empty String"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/implement.js deleted file mode 100644 index 33667e2e9afb60..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/is-safe-integer/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/shim.js deleted file mode 100644 index 77e06674711795..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(2), true, "Number"); - a(t(2.34), false, "Float"); - a(t(Math.pow(2, 53)), false, "Too large"); - a(t(Math.pow(2, 53) - 1), true, "Maximum"); - a(t('23'), false, "Not numeric"); - a(t(NaN), false, "NaN"); - a(t(Infinity), false, "Infinity"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/implement.js deleted file mode 100644 index bef00ca413d3cb..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/max-safe-integer/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/index.js deleted file mode 100644 index c892fd47d41c16..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(typeof t, 'number'); -}; diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/implement.js deleted file mode 100644 index fa440248bf47a6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../number/min-safe-integer/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/index.js deleted file mode 100644 index c892fd47d41c16..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(typeof t, 'number'); -}; diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/number/to-integer.js b/tools/eslint/node_modules/es5-ext/test/number/to-integer.js deleted file mode 100644 index ff326ba7a95bbb..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/to-integer.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), 0, "NaN"); - a(t(20), 20, "Positive integer"); - a(t('-20'), -20, "String negative integer"); - a(t(Infinity), Infinity, "Infinity"); - a(t(15.343), 15, "Float"); - a(t(-15.343), -15, "Negative float"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/to-pos-integer.js b/tools/eslint/node_modules/es5-ext/test/number/to-pos-integer.js deleted file mode 100644 index 2f3b4e674ecc4b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/to-pos-integer.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), 0, "NaN"); - a(t(20), 20, "Positive integer"); - a(t(-20), 0, "Negative integer"); - a(t(Infinity), Infinity, "Infinity"); - a(t(15.343), 15, "Float"); - a(t(-15.343), 0, "Negative float"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/number/to-uint32.js b/tools/eslint/node_modules/es5-ext/test/number/to-uint32.js deleted file mode 100644 index 00d05bdfe346d7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/number/to-uint32.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), 0, "Not numeric"); - a(t(-4), 4294967292, "Negative"); - a(t(133432), 133432, "Positive"); - a(t(8589934592), 0, "Greater than maximum"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/_iterate.js b/tools/eslint/node_modules/es5-ext/test/object/_iterate.js deleted file mode 100644 index 179afed88ee845..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/_iterate.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = { raz: 1, dwa: 2, trzy: 3 } - , o2 = {}, o3 = {}, arr, i = -1; - - t = t('forEach'); - t(o, function (value, name, self, index) { - o2[name] = value; - a(index, ++i, "Index"); - a(self, o, "Self"); - a(this, o3, "Scope"); - }, o3); - a.deep(o2, o); - - arr = []; - o2 = {}; - i = -1; - t(o, function (value, name, self, index) { - arr.push(value); - o2[name] = value; - a(index, ++i, "Index"); - a(self, o, "Self"); - a(this, o3, "Scope"); - }, o3, function (a, b) { - return o[b] - o[a]; - }); - a.deep(o2, o, "Sort by Values: Content"); - a.deep(arr, [3, 2, 1], "Sort by Values: Order"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/assign/implement.js b/tools/eslint/node_modules/es5-ext/test/object/assign/implement.js deleted file mode 100644 index 40065594187cb9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/assign/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../object/assign/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/assign/index.js b/tools/eslint/node_modules/es5-ext/test/object/assign/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/assign/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/object/assign/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/object/assign/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/assign/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/assign/shim.js b/tools/eslint/node_modules/es5-ext/test/object/assign/shim.js deleted file mode 100644 index 9afe5f658c45b7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/assign/shim.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o1 = { a: 1, b: 2 } - , o2 = { b: 3, c: 4 }; - - a(t(o1, o2), o1, "Returns self"); - a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); - - a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/clear.js b/tools/eslint/node_modules/es5-ext/test/object/clear.js deleted file mode 100644 index bfc08cc208420b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/clear.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var isEmpty = require('../../object/is-empty'); - -module.exports = function (t, a) { - var x = {}; - a(t(x), x, "Empty: Returns same object"); - a(isEmpty(x), true, "Empty: Not changed"); - x.foo = 'raz'; - x.bar = 'dwa'; - a(t(x), x, "Same object"); - a(isEmpty(x), true, "Emptied"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/compact.js b/tools/eslint/node_modules/es5-ext/test/object/compact.js deleted file mode 100644 index 9c9064c7886445..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/compact.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}, y = {}, z; - z = t(x); - a.not(z, x, "Returns different object"); - a.deep(z, {}, "Empty on empty"); - - x = { foo: 'bar', a: 0, b: false, c: '', d: '0', e: null, bar: y, - elo: undefined }; - z = t(x); - a.deep(z, { foo: 'bar', a: 0, b: false, c: '', d: '0', bar: y }, - "Cleared null values"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/compare.js b/tools/eslint/node_modules/es5-ext/test/object/compare.js deleted file mode 100644 index cb9424109c334b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/compare.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var d = new Date(); - - a.ok(t(12, 3) > 0, "Numbers"); - a.ok(t(2, 13) < 0, "Numbers #2"); - a.ok(t("aaa", "aa") > 0, "Strings"); - a.ok(t("aa", "ab") < 0, "Strings #2"); - a(t("aa", "aa"), 0, "Strings same"); - a(t(d, new Date(d.getTime())), 0, "Same date"); - a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/copy-deep.js b/tools/eslint/node_modules/es5-ext/test/object/copy-deep.js deleted file mode 100644 index 79e02be49e3c11..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/copy-deep.js +++ /dev/null @@ -1,28 +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, "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/es5-ext/test/object/copy.js b/tools/eslint/node_modules/es5-ext/test/object/copy.js deleted file mode 100644 index 2f222ef809c6d7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/copy.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var stringify = JSON.stringify; - -module.exports = function (t, a) { - var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' } - , no = t(o); - - a.not(no, o, "Return different object"); - a(stringify(no), stringify(o), "Match properties and values"); - - o = { foo: 'bar', raz: { dwa: 'dwa', - trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {}, - 'dziewięć': function () { } }, 'dziesięć': 10 }; - o.raz.rec = o; - - no = t(o); - a(o.raz, no.raz, "Shallow"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/count.js b/tools/eslint/node_modules/es5-ext/test/object/count.js deleted file mode 100644 index 494f4f163515eb..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/count.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), 0, "Empty"); - a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4, - "Some properties"); - a(t(Object.defineProperties({}, { - raz: { value: 'raz' }, - dwa: { value: 'dwa', enumerable: true } - })), 1, "Some properties hidden"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/create.js b/tools/eslint/node_modules/es5-ext/test/object/create.js deleted file mode 100644 index 8b7be214136d2f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/create.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var setPrototypeOf = require('../../object/set-prototype-of') - - , getPrototypeOf = Object.getPrototypeOf; - -module.exports = function (t, a) { - var x = {}, obj; - - a(getPrototypeOf(t(x)), x, "Normal object"); - a(getPrototypeOf(t(null)), - (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null"); - - a.h1("Properties"); - a.h2("Normal object"); - a(getPrototypeOf(obj = t(x, { foo: { value: 'bar' } })), x, "Prototype"); - a(obj.foo, 'bar', "Property"); - a.h2("Null"); - a(getPrototypeOf(obj = t(null, { foo: { value: 'bar2' } })), - (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype"); - a(obj.foo, 'bar2', "Property"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number-value.js deleted file mode 100644 index dde23986babe18..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number-value.js +++ /dev/null @@ -1,12 +0,0 @@ -'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 deleted file mode 100644 index 5ebed1e524fcef..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number.js +++ /dev/null @@ -1,12 +0,0 @@ -'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/es5-ext/test/object/eq.js b/tools/eslint/node_modules/es5-ext/test/object/eq.js deleted file mode 100644 index 02b3f0027cbf82..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/eq.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = {}; - a(t(o, {}), false, "Different objects"); - a(t(o, o), true, "Same objects"); - a(t('1', '1'), true, "Same primitive"); - a(t('1', 1), false, "Different primitive types"); - a(t(NaN, NaN), true, "NaN"); - a(t(0, 0), true, "0,0"); - a(t(0, -0), true, "0,-0"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/every.js b/tools/eslint/node_modules/es5-ext/test/object/every.js deleted file mode 100644 index 07d5bbbd61f7af..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/every.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var o = { 1: 1, 2: 2, 3: 3 }; - -module.exports = function (t, a) { - var o2 = {}; - t(o, function (value, name) { - o2[name] = value; - return true; - }); - a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); - - a(t(o, function () { - return true; - }), true, "Succeeds"); - - a(t(o, function () { - return false; - }), false, "Fails"); - -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/filter.js b/tools/eslint/node_modules/es5-ext/test/object/filter.js deleted file mode 100644 index 7307da8640fcd1..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/filter.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 }, - function (value) { return Boolean(value % 2); }), { 1: 1, 3: 3 }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/find-key.js b/tools/eslint/node_modules/es5-ext/test/object/find-key.js deleted file mode 100644 index cca834d9362a29..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/find-key.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var o = { 1: 1, 2: 2, 3: 3 }; - -module.exports = function (t, a) { - var o2 = {}, i = 0; - t(o, function (value, name) { - o2[name] = value; - return false; - }); - a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); - - a(t(o, function () { - ++i; - return true; - }), '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 deleted file mode 100644 index b6ad60a542b741..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/find.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var o = { 1: 1, 2: 2, 3: 3 }; - -module.exports = function (t, a) { - var o2 = {}, i = 0; - t(o, function (value, name) { - o2[name] = value; - return false; - }); - a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); - - a(t(o, function () { - ++i; - return true; - }), 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/first-key.js b/tools/eslint/node_modules/es5-ext/test/object/first-key.js deleted file mode 100644 index 8169cd235344d9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/first-key.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}, y = Object.create(null); - a(t(x), null, "Normal: Empty"); - a(t(y), null, "Null extension: Empty"); - x.foo = 'raz'; - x.bar = 343; - a(['foo', 'bar'].indexOf(t(x)) !== -1, true, "Normal"); - y.elo = 'foo'; - y.mar = 'wew'; - a(['elo', 'mar'].indexOf(t(y)) !== -1, true, "Null extension"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/flatten.js b/tools/eslint/node_modules/es5-ext/test/object/flatten.js deleted file mode 100644 index ca342eab9c8ae4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/flatten.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }), - { aa: 1, ab: 2, ba: 3, bb: 4 }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/for-each.js b/tools/eslint/node_modules/es5-ext/test/object/for-each.js deleted file mode 100644 index 8690d1e82179aa..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/for-each.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = { raz: 1, dwa: 2, trzy: 3 } - , o2 = {}; - a(t(o, function (value, name) { - o2[name] = value; - }), undefined, "Return"); - a.deep(o2, o); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/get-property-names.js b/tools/eslint/node_modules/es5-ext/test/object/get-property-names.js deleted file mode 100644 index b91c3dd50e7bbf..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/get-property-names.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = { first: 1, second: 4 }, r1, r2; - o = Object.create(o, { - third: { value: null } - }); - o.first = 2; - o = Object.create(o); - o.fourth = 3; - - r1 = t(o); - r1.sort(); - r2 = ['first', 'second', 'third', 'fourth'] - .concat(Object.getOwnPropertyNames(Object.prototype)); - r2.sort(); - a.deep(r1, r2); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-array-like.js b/tools/eslint/node_modules/es5-ext/test/object/is-array-like.js deleted file mode 100644 index 6295973ca81acd..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-array-like.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t([]), true, "Array"); - a(t(""), true, "String"); - a(t((function () { return arguments; }())), true, "Arguments"); - a(t({ length: 0 }), true, "List object"); - a(t(function () {}), false, "Function"); - a(t({}), false, "Plain object"); - a(t(/raz/), false, "Regexp"); - a(t(), false, "No argument"); - a(t(null), false, "Null"); - a(t(undefined), false, "Undefined"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-callable.js b/tools/eslint/node_modules/es5-ext/test/object/is-callable.js deleted file mode 100644 index 625e221d2c3811..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-callable.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(function () {}), true, "Function"); - a(t({}), false, "Object"); - a(t(), false, "Undefined"); - a(t(null), false, "Null"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-copy-deep.js b/tools/eslint/node_modules/es5-ext/test/object/is-copy-deep.js deleted file mode 100644 index 4f14cbbe8108b2..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-copy-deep.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x, y; - - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, - "Different property value"); - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, - "Property only in source"); - a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, - "Property only in target"); - - a(t("raz", "dwa"), false, "String: diff"); - a(t("raz", "raz"), true, "String: same"); - a(t("32", 32), false, "String & Number"); - - a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same"); - a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff"); - a(t(['foo'], ['one']), false, "Array: One value comparision"); - - x = { foo: { bar: { mar: {} } } }; - y = { foo: { bar: { mar: {} } } }; - a(t(x, y), true, "Deep"); - - a(t({ foo: { bar: { mar: 'foo' } } }, { foo: { bar: { mar: {} } } }), - false, "Deep: false"); - - x = { foo: { bar: { mar: {} } } }; - x.rec = { foo: x }; - - y = { foo: { bar: { mar: {} } } }; - y.rec = { foo: x }; - - a(t(x, y), true, "Object: Infinite Recursion: Same #1"); - - x.rec.foo = y; - a(t(x, y), true, "Object: Infinite Recursion: Same #2"); - - x.rec.foo = x; - y.rec.foo = y; - a(t(x, y), true, "Object: Infinite Recursion: Same #3"); - - y.foo.bar.mar = 'raz'; - a(t(x, y), false, "Object: Infinite Recursion: Diff"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-copy.js b/tools/eslint/node_modules/es5-ext/test/object/is-copy.js deleted file mode 100644 index 394e2ed94c09f0..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-copy.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, - "Different property value"); - a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, - "Property only in source"); - a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, - "Property only in target"); - - a(t("raz", "dwa"), false, "String: diff"); - a(t("raz", "raz"), true, "String: same"); - a(t("32", 32), false, "String & Number"); - - a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same"); - a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-empty.js b/tools/eslint/node_modules/es5-ext/test/object/is-empty.js deleted file mode 100644 index b560c2c36b0d4b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-empty.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), true, "Empty"); - a(t({ 1: 1 }), false, "Not empty"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-number-value.js b/tools/eslint/node_modules/es5-ext/test/object/is-number-value.js deleted file mode 100644 index 21b6b620323b63..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-number-value.js +++ /dev/null @@ -1,15 +0,0 @@ -'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/es5-ext/test/object/is-object.js b/tools/eslint/node_modules/es5-ext/test/object/is-object.js deleted file mode 100644 index 72c8aa6daf4a3a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-object.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t('arar'), false, "String"); - a(t(12), false, "Number"); - a(t(true), false, "Boolean"); - a(t(null), false, "Null"); - a(t(new Date()), true, "Date"); - a(t(new String('raz')), true, "String object"); - a(t({}), true, "Plain object"); - a(t(/a/), true, "Regular expression"); - a(t(function () {}), true, "Function"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-plain-object.js b/tools/eslint/node_modules/es5-ext/test/object/is-plain-object.js deleted file mode 100644 index e988829d558ad0..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is-plain-object.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t({}), true, "Empty {} is plain object"); - a(t({ a: true }), true, "{} with property is plain object"); - a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true, - "{} with any property keys is plain object"); - a(t(null), false, "Null is not plain object"); - a(t('string'), false, "Primitive is not plain object"); - a(t(function () {}), false, "Function is not plain object"); - a(t(Object.create({})), false, - "Object whose prototype is not Object.prototype is not plain object"); - a(t(Object.create(Object.prototype)), true, - "Object whose prototype is Object.prototype is plain object"); - a(t(Object.create(null)), true, - "Object whose prototype is null is plain object"); - a(t(Object.prototype), false, "Object.prototype"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/is.js b/tools/eslint/node_modules/es5-ext/test/object/is.js deleted file mode 100644 index 4f8948cbf344e1..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/is.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = {}; - a(t(o, {}), false, "Different objects"); - a(t(o, o), true, "Same objects"); - a(t('1', '1'), true, "Same primitive"); - a(t('1', 1), false, "Different primitive types"); - a(t(NaN, NaN), true, "NaN"); - a(t(0, 0), true, "0,0"); - a(t(0, -0), false, "0,-0"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/key-of.js b/tools/eslint/node_modules/es5-ext/test/object/key-of.js deleted file mode 100644 index a9225a048c5c91..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/key-of.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = {}, y = {} - , o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' }; - - a(t(o, 'bar'), 'foo', "First property"); - a(t(o, 6), null, "Primitive that's not there"); - a(t(o, x), 'raz', "Object"); - a(t(o, y), null, "Object that's not there"); - a(t(o, '6'), 'five', "Last property"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/keys/implement.js b/tools/eslint/node_modules/es5-ext/test/object/keys/implement.js deleted file mode 100644 index 179e1e5612ea8f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/keys/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../object/keys/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/keys/index.js b/tools/eslint/node_modules/es5-ext/test/object/keys/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/keys/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/object/keys/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/object/keys/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/keys/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/keys/shim.js b/tools/eslint/node_modules/es5-ext/test/object/keys/shim.js deleted file mode 100644 index ed29eebcd751f7..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/keys/shim.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t({ foo: 'bar' }), ['foo'], "Object"); - a.deep(t('raz'), ['0', '1', '2'], "Primitive"); - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Undefined"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/map-keys.js b/tools/eslint/node_modules/es5-ext/test/object/map-keys.js deleted file mode 100644 index be84825b1be711..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/map-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) { - return 'x' + (key + value); - }), { x11: 1, x22: 2, x33: 3 }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/map.js b/tools/eslint/node_modules/es5-ext/test/object/map.js deleted file mode 100644 index f9cc09c01b3933..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/map.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var obj = { 1: 1, 2: 2, 3: 3 }; - a.deep(t(obj, function (value, key, context) { - a(context, obj, "Context argument"); - return (value + 1) + key; - }), { 1: '21', 2: '32', 3: '43' }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/mixin-prototypes.js b/tools/eslint/node_modules/es5-ext/test/object/mixin-prototypes.js deleted file mode 100644 index d1c727a95a7371..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/mixin-prototypes.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o, o1, o2, x, y = {}, z = {}; - o = { inherited: true, visible: 23 }; - o1 = Object.create(o); - o1.visible = z; - o1.nonremovable = 'raz'; - Object.defineProperty(o1, 'hidden', { value: 'hidden' }); - - o2 = Object.defineProperties({}, { nonremovable: { value: y } }); - o2.other = 'other'; - - try { t(o2, o1); } catch (ignore) {} - - a(o2.visible, z, "Enumerable"); - a(o1.hidden, 'hidden', "Not Enumerable"); - a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); - a(o2.propertyIsEnumerable('hidden'), false, - "Not enumerable is not enumerable"); - - a(o2.inherited, true, "Extend deep"); - - a(o2.nonremovable, y, "Do not overwrite non configurable"); - a(o2.other, 'other', "Own kept"); - - x = {}; - t(x, o2); - try { t(x, o1); } catch (ignore) {} - - a(x.visible, z, "Enumerable"); - a(x.hidden, 'hidden', "Not Enumerable"); - a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); - a(x.propertyIsEnumerable('hidden'), false, - "Not enumerable is not enumerable"); - - a(x.inherited, true, "Extend deep"); - - a(x.nonremovable, y, "Ignored non configurable"); - a(x.other, 'other', "Other"); - - x.visible = 3; - a(x.visible, 3, "Writable is writable"); - - x = {}; - t(x, o1); - a.throws(function () { - x.hidden = 3; - }, "Not writable is not writable"); - - x = {}; - t(x, o1); - delete x.visible; - a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable"); - - x = {}; - t(x, o1); - a.throws(function () { - delete x.hidden; - }, "Not configurable is not configurable"); - - x = Object.defineProperty({}, 'foo', - { configurable: false, writable: true, enumerable: false, value: 'bar' }); - - try { t(x, { foo: 'lorem' }); } catch (ignore) {} - a(x.foo, 'bar', "Writable, not enumerable"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/mixin.js b/tools/eslint/node_modules/es5-ext/test/object/mixin.js deleted file mode 100644 index 866005b03df29b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/mixin.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o, o1, o2, x, y = {}, z = {}; - o = { inherited: true }; - o1 = Object.create(o); - o1.visible = z; - o1.nonremovable = 'raz'; - Object.defineProperty(o1, 'hidden', { value: 'hidden' }); - - o2 = Object.defineProperties({}, { nonremovable: { value: y } }); - o2.other = 'other'; - - try { t(o2, o1); } catch (ignore) {} - - a(o2.visible, z, "Enumerable"); - a(o1.hidden, 'hidden', "Not Enumerable"); - a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); - a(o2.propertyIsEnumerable('hidden'), false, - "Not enumerable is not enumerable"); - - a(o2.hasOwnProperty('inherited'), false, "Extend only own"); - a(o2.inherited, undefined, "Extend ony own: value"); - - a(o2.nonremovable, y, "Do not overwrite non configurable"); - a(o2.other, 'other', "Own kept"); - - x = {}; - t(x, o2); - try { t(x, o1); } catch (ignore) {} - - a(x.visible, z, "Enumerable"); - a(x.hidden, 'hidden', "Not Enumerable"); - a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); - a(x.propertyIsEnumerable('hidden'), false, - "Not enumerable is not enumerable"); - - a(x.hasOwnProperty('inherited'), false, "Extend only own"); - a(x.inherited, undefined, "Extend ony own: value"); - - a(x.nonremovable, y, "Ignored non configurable"); - a(x.other, 'other', "Other"); - - x.visible = 3; - a(x.visible, 3, "Writable is writable"); - - x = {}; - t(x, o1); - a.throws(function () { - x.hidden = 3; - }, "Not writable is not writable"); - - x = {}; - t(x, o1); - delete x.visible; - a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable"); - - x = {}; - t(x, o1); - a.throws(function () { - delete x.hidden; - }, "Not configurable is not configurable"); - - x = Object.defineProperty({}, 'foo', - { configurable: false, writable: true, enumerable: false, value: 'bar' }); - - try { t(x, { foo: 'lorem' }); } catch (ignore) {} - a(x.foo, 'bar', "Writable, not enumerable"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/normalize-options.js b/tools/eslint/node_modules/es5-ext/test/object/normalize-options.js deleted file mode 100644 index 0d2d4da04a53b1..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/normalize-options.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var create = Object.create, defineProperty = Object.defineProperty; - -module.exports = function (t, a) { - var x = { foo: 'raz', bar: 'dwa' }, y; - y = t(x); - a.not(y, x, "Returns copy"); - a.deep(y, x, "Plain"); - - x = { raz: 'one', dwa: 'two' }; - defineProperty(x, 'get', { - configurable: true, - enumerable: true, - get: function () { return this.dwa; } - }); - x = create(x); - x.trzy = 'three'; - x.cztery = 'four'; - x = create(x); - x.dwa = 'two!'; - x.trzy = 'three!'; - x.piec = 'five'; - x.szesc = 'six'; - - a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'six', get: 'two!' }, "Deep object"); - - a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }), - { marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/primitive-set.js b/tools/eslint/node_modules/es5-ext/test/object/primitive-set.js deleted file mode 100644 index 839857eab3dd85..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/primitive-set.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var getPropertyNames = require('../../object/get-property-names') - , isPlainObject = require('../../object/is-plain-object'); - -module.exports = function (t, a) { - var x = t(); - a(isPlainObject(x), true, "Plain object"); - a.deep(getPropertyNames(x), [], "No properties"); - x.foo = 'bar'; - a.deep(getPropertyNames(x), ['foo'], "Extensible"); - - a.deep(t('raz', 'dwa', 3), { raz: true, dwa: true, 3: true }, - "Arguments handling"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/safe-traverse.js b/tools/eslint/node_modules/es5-ext/test/object/safe-traverse.js deleted file mode 100644 index d30cdefe68b8b6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/safe-traverse.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var obj = { foo: { bar: { lorem: 12 } } }; - a(t(obj), obj, "No props"); - a(t(obj, 'foo'), obj.foo, "One"); - a(t(obj, 'raz'), undefined, "One: Fail"); - a(t(obj, 'foo', 'bar'), obj.foo.bar, "Two"); - a(t(obj, 'dsd', 'raz'), undefined, "Two: Fail #1"); - a(t(obj, 'foo', 'raz'), undefined, "Two: Fail #2"); - a(t(obj, 'foo', 'bar', 'lorem'), obj.foo.bar.lorem, "Three"); - a(t(obj, 'dsd', 'raz', 'fef'), undefined, "Three: Fail #1"); - a(t(obj, 'foo', 'raz', 'asdf'), undefined, "Three: Fail #2"); - a(t(obj, 'foo', 'bar', 'asd'), undefined, "Three: Fail #3"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/serialize.js b/tools/eslint/node_modules/es5-ext/test/object/serialize.js deleted file mode 100644 index 43eed6a8616f9a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/serialize.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var fn = function (raz, dwa) { return raz + dwa; }; - a(t(), 'undefined', "Undefined"); - a(t(null), 'null', "Null"); - a(t(null), 'null', "Null"); - a(t('raz'), '"raz"', "String"); - a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape"); - a(t(false), 'false', "Booelean"); - a(t(fn), String(fn), "Function"); - - a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp"); - a(t(new Date(1234567)), 'new Date(1234567)', "Date"); - a(t([]), '[]', "Empty array"); - a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]), - '[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) + - ',/raz/g,new Date(1234567),["foo"]]', "Rich Array"); - a(t({}), '{}', "Empty object"); - a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g, - siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }), - '{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) + - ',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + - '"dziewiec":{"foo":"bar","dwa":343}}', "Rich object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/implement.js deleted file mode 100644 index 30b2ac4b96ba2e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/implement.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var create = require('../../../object/create') - , isImplemented = require('../../../object/set-prototype-of/is-implemented'); - -module.exports = function (a) { a(isImplemented(create), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/index.js b/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/index.js deleted file mode 100644 index aec2605cc2661a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var create = require('../../../object/create') - - , getPrototypeOf = Object.getPrototypeOf; - -module.exports = function (t, a) { - var x = {}, y = {}; - - if (t === null) return; - a(t(x, y), x, "Return self object"); - a(getPrototypeOf(x), y, "Object"); - a.throws(function () { t(x); }, TypeError, "Undefined"); - a.throws(function () { t('foo'); }, TypeError, "Primitive"); - a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); - x = create(null); - a.h1("Change null prototype"); - a(t(x, y), x, "Result"); - a(getPrototypeOf(x), y, "Prototype"); - a.h1("Set null prototype"); - a(t(y, null), y, "Result"); - a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); -}; diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/shim.js deleted file mode 100644 index aec2605cc2661a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/shim.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var create = require('../../../object/create') - - , getPrototypeOf = Object.getPrototypeOf; - -module.exports = function (t, a) { - var x = {}, y = {}; - - if (t === null) return; - a(t(x, y), x, "Return self object"); - a(getPrototypeOf(x), y, "Object"); - a.throws(function () { t(x); }, TypeError, "Undefined"); - a.throws(function () { t('foo'); }, TypeError, "Primitive"); - a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); - x = create(null); - a.h1("Change null prototype"); - a(t(x, y), x, "Result"); - a(getPrototypeOf(x), y, "Prototype"); - a.h1("Set null prototype"); - a(t(y, null), y, "Result"); - a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/some.js b/tools/eslint/node_modules/es5-ext/test/object/some.js deleted file mode 100644 index 490431e7acd543..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/some.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var o = { 1: 1, 2: 2, 3: 3 }; - -module.exports = function (t, a) { - var o2 = {}, i = 0; - t(o, function (value, name) { - o2[name] = value; - return false; - }); - a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); - - a(t(o, function () { - ++i; - return true; - }), true, "Succeeds"); - a(i, 1, "Stops iteration after condition is met"); - - a(t(o, function () { - return false; - }), false, "Fails"); - -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/to-array.js b/tools/eslint/node_modules/es5-ext/test/object/to-array.js deleted file mode 100644 index 1f4beef7eae835..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/to-array.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var o = { 1: 1, 2: 2, 3: 3 }, o1 = {} - , o2 = t(o, function (value, name, self) { - a(self, o, "Self"); - a(this, o1, "Scope"); - return value + Number(name); - }, o1); - a.deep(o2, [2, 4, 6]); - - t(o).sort().forEach(function (item) { - a.deep(item, [item[0], o[item[0]]], "Default"); - }); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/unserialize.js b/tools/eslint/node_modules/es5-ext/test/object/unserialize.js deleted file mode 100644 index 405eef112ff76e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/unserialize.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var fn = function (raz, dwa) { return raz + dwa; }; - a(t('undefined'), undefined, "Undefined"); - a(t('null'), null, "Null"); - a(t('"raz"'), 'raz', "String"); - a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape"); - a(t('false'), false, "Booelean"); - a(String(t(String(fn))), String(fn), "Function"); - - a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp"); - a.deep(t('new Date(1234567)'), new Date(1234567), "Date"); - a.deep(t('[]'), [], "Empty array"); - a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'), - [undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array"); - a.deep(t('{}'), {}, "Empty object"); - a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' + - '"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + - '"dziewiec":{"foo":"bar","dwa":343}}'), - { raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g, - siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }, - "Rich object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/valid-callable.js b/tools/eslint/node_modules/es5-ext/test/object/valid-callable.js deleted file mode 100644 index b40540b6ba61b0..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/valid-callable.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var f = function () {}; - a(t(f), f, "Function"); - a.throws(function () { - t({}); - }, "Not Function"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/valid-object.js b/tools/eslint/node_modules/es5-ext/test/object/valid-object.js deleted file mode 100644 index eaa8e7bcb364b5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/valid-object.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(0); }, TypeError, "0"); - a.throws(function () { t(false); }, TypeError, "false"); - a.throws(function () { t(''); }, TypeError, "''"); - a(t(x = {}), x, "Object"); - a(t(x = function () {}), x, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: ignore - a(t(x = new Date()), x, "Date"); - - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "null"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/valid-value.js b/tools/eslint/node_modules/es5-ext/test/object/valid-value.js deleted file mode 100644 index f1eeafa9778863..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/valid-value.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var numIsNaN = require('../../number/is-nan'); - -module.exports = function (t, a) { - var x; - a(t(0), 0, "0"); - a(t(false), false, "false"); - a(t(''), '', "''"); - a(numIsNaN(t(NaN)), true, "NaN"); - a(t(x = {}), x, "{}"); - - a.throws(function () { - t(); - }, "Undefined"); - a.throws(function () { - t(null); - }, "null"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/validate-array-like-object.js b/tools/eslint/node_modules/es5-ext/test/object/validate-array-like-object.js deleted file mode 100644 index 2f3e31b442ebcb..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/validate-array-like-object.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(0); }, TypeError, "0"); - a.throws(function () { t(false); }, TypeError, "false"); - a.throws(function () { t(''); }, TypeError, "String"); - a.throws(function () { t({}); }, TypeError, "Plain Object"); - a.throws(function () { t(function () {}); }, TypeError, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: ignore - - a(t(x = { length: 1 }), x, "Array like"); - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "null"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/validate-array-like.js b/tools/eslint/node_modules/es5-ext/test/object/validate-array-like.js deleted file mode 100644 index 53bd11249e3d04..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/validate-array-like.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(0); }, TypeError, "0"); - a.throws(function () { t(false); }, TypeError, "false"); - a(t(''), '', "''"); - a.throws(function () { t({}); }, TypeError, "Plain Object"); - a.throws(function () { t(function () {}); }, TypeError, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: ignore - - a(t(x = { length: 1 }), x, "Array like"); - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "null"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable-value.js deleted file mode 100644 index ae9bd17a59a028..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable-value.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a(t(0), "0"); - a(t(false), "false"); - a(t(''), ""); - a(t({}), String({}), "Object"); - a(t(x = function () {}), String(x), "Function"); - a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore - a(t(x = new Date()), String(x), "Date"); - - a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable.js b/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable.js deleted file mode 100644 index 4a46bb521900db..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x; - a(t(), 'undefined', "Undefined"); - a(t(null), 'null', "Null"); - a(t(0), "0"); - a(t(false), "false"); - a(t(''), ""); - a(t({}), String({}), "Object"); - a(t(x = function () {}), String(x), "Function"); - a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore - a(t(x = new Date()), String(x), "Date"); - - a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/index.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/index.js deleted file mode 100644 index ca2bd650615889..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var indexTest = require('tad/lib/utils/index-test') - - , path = require('path').resolve(__dirname, '../../../reg-exp/#'); - -module.exports = function (t, a, d) { - indexTest(indexTest.readDir(path).aside(function (data) { - delete data.sticky; - delete data.unicode; - }))(t, a, d); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-sticky.js deleted file mode 100644 index e154ac2916557f..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-sticky.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var re; - a(t.call(/raz/), false, "Normal"); - a(t.call(/raz/g), false, "Global"); - try { re = new RegExp('raz', 'y'); } catch (ignore) {} - if (!re) return; - a(t.call(re), true, "Sticky"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-unicode.js deleted file mode 100644 index 2ffb9e869bd6a3..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-unicode.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var re; - a(t.call(/raz/), false, "Normal"); - a(t.call(/raz/g), false, "Global"); - try { re = new RegExp('raz', 'u'); } catch (ignore) {} - if (!re) return; - a(t.call(re), true, "Unicode"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/implement.js deleted file mode 100644 index 89825a45f6148d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/match/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/index.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/shim.js deleted file mode 100644 index 5249139fff2277..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/shim.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var result = ['foo']; - result.index = 0; - result.input = 'foobar'; - a.deep(t.call(/foo/, 'foobar'), result); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/implement.js deleted file mode 100644 index c32b23a6d03e79..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/replace/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/shim.js deleted file mode 100644 index 2b378fd594e2ef..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/shim.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(/foo/, 'foobar', 'mar'), 'marbar'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/implement.js deleted file mode 100644 index ff1b8087f2c697..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/search/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/index.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/shim.js deleted file mode 100644 index 596bcdb92ed203..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/shim.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(/foo/, 'barfoo'), 3); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/implement.js deleted file mode 100644 index 1cee441806c065..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/split/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/index.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/shim.js deleted file mode 100644 index 6a95cd03d6ce68..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/shim.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t.call(/\|/, 'bar|foo'), ['bar', 'foo']); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js deleted file mode 100644 index d94e7b98d8fe46..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/sticky/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js deleted file mode 100644 index 9b1aa0f2ab992d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../reg-exp/#/unicode/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/escape.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/escape.js deleted file mode 100644 index 5b00f67f28ce45..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/escape.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var str = "(?:^te|er)s{2}t\\[raz]+$"; - a(RegExp('^' + t(str) + '$').test(str), true); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/is-reg-exp.js deleted file mode 100644 index 785ca28c2ecb2c..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/is-reg-exp.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t('arar'), false, "String"); - a(t(12), false, "Number"); - a(t(true), false, "Boolean"); - a(t(new Date()), false, "Date"); - a(t(new String('raz')), false, "String object"); - a(t({}), false, "Plain object"); - a(t(/a/), true, "Regular expression"); - a(t(new RegExp('a')), true, "Regular expression via constructor"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/tools/eslint/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js deleted file mode 100644 index cd12cf126a609a..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var r = /raz/; - a(t(r), r, "Direct"); - r = new RegExp('foo'); - a(t(r), r, "Constructor"); - a.throws(function () { - t({}); - }, "Object"); - a.throws(function () { - t(function () {}); - }, "Function"); - a.throws(function () { - t({ exec: function () { return 20; } }); - }, "Plain object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/implement.js deleted file mode 100644 index 09bf3361acd6a2..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/@@iterator/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/shim.js deleted file mode 100644 index 3b0e0b7547ece9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/shim.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var it = t.call('r💩z'); - a.deep(it.next(), { done: false, value: 'r' }, "#1"); - a.deep(it.next(), { done: false, value: '💩' }, "#2"); - a.deep(it.next(), { done: false, value: 'z' }, "#3"); - a.deep(it.next(), { done: true, value: undefined }, "End"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/at.js b/tools/eslint/node_modules/es5-ext/test/string/#/at.js deleted file mode 100644 index 2447a9f64d5d83..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/at.js +++ /dev/null @@ -1,97 +0,0 @@ -// See tests at https://github.com/mathiasbynens/String.prototype.at - -'use strict'; - -module.exports = function (t, a) { - a(t.length, 1, "Length"); - - a.h1("BMP"); - a(t.call('abc\uD834\uDF06def', -Infinity), '', "-Infinity"); - a(t.call('abc\uD834\uDF06def', -1), '', "-1"); - a(t.call('abc\uD834\uDF06def', -0), 'a', "-0"); - a(t.call('abc\uD834\uDF06def', +0), 'a', "+0"); - a(t.call('abc\uD834\uDF06def', 1), 'b', "1"); - a(t.call('abc\uD834\uDF06def', 3), '\uD834\uDF06', "3"); - a(t.call('abc\uD834\uDF06def', 4), '\uDF06', "4"); - a(t.call('abc\uD834\uDF06def', 5), 'd', "5"); - a(t.call('abc\uD834\uDF06def', 42), '', "42"); - a(t.call('abc\uD834\uDF06def', +Infinity), '', "+Infinity"); - a(t.call('abc\uD834\uDF06def', null), 'a', "null"); - a(t.call('abc\uD834\uDF06def', undefined), 'a', "undefined"); - a(t.call('abc\uD834\uDF06def'), 'a', "No argument"); - a(t.call('abc\uD834\uDF06def', false), 'a', "false"); - a(t.call('abc\uD834\uDF06def', NaN), 'a', "NaN"); - a(t.call('abc\uD834\uDF06def', ''), 'a', "Empty string"); - a(t.call('abc\uD834\uDF06def', '_'), 'a', "_"); - a(t.call('abc\uD834\uDF06def', '1'), 'b', "'1'"); - a(t.call('abc\uD834\uDF06def', []), 'a', "[]"); - a(t.call('abc\uD834\uDF06def', {}), 'a', "{}"); - a(t.call('abc\uD834\uDF06def', -0.9), 'a', "-0.9"); - a(t.call('abc\uD834\uDF06def', 1.9), 'b', "1.9"); - a(t.call('abc\uD834\uDF06def', 7.9), 'f', "7.9"); - a(t.call('abc\uD834\uDF06def', Math.pow(2, 32)), '', "Big number"); - - a.h1("Astral symbol"); - a(t.call('\uD834\uDF06def', -Infinity), '', "-Infinity"); - a(t.call('\uD834\uDF06def', -1), '', "-1"); - a(t.call('\uD834\uDF06def', -0), '\uD834\uDF06', "-0"); - a(t.call('\uD834\uDF06def', +0), '\uD834\uDF06', "+0"); - a(t.call('\uD834\uDF06def', 1), '\uDF06', "1"); - a(t.call('\uD834\uDF06def', 2), 'd', "2"); - a(t.call('\uD834\uDF06def', 3), 'e', "3"); - a(t.call('\uD834\uDF06def', 4), 'f', "4"); - a(t.call('\uD834\uDF06def', 42), '', "42"); - a(t.call('\uD834\uDF06def', +Infinity), '', "+Infinity"); - a(t.call('\uD834\uDF06def', null), '\uD834\uDF06', "null"); - a(t.call('\uD834\uDF06def', undefined), '\uD834\uDF06', "undefined"); - a(t.call('\uD834\uDF06def'), '\uD834\uDF06', "No arguments"); - a(t.call('\uD834\uDF06def', false), '\uD834\uDF06', "false"); - a(t.call('\uD834\uDF06def', NaN), '\uD834\uDF06', "NaN"); - a(t.call('\uD834\uDF06def', ''), '\uD834\uDF06', "Empty string"); - a(t.call('\uD834\uDF06def', '_'), '\uD834\uDF06', "_"); - a(t.call('\uD834\uDF06def', '1'), '\uDF06', "'1'"); - - a.h1("Lone high surrogates"); - a(t.call('\uD834abc', -Infinity), '', "-Infinity"); - a(t.call('\uD834abc', -1), '', "-1"); - a(t.call('\uD834abc', -0), '\uD834', "-0"); - a(t.call('\uD834abc', +0), '\uD834', "+0"); - a(t.call('\uD834abc', 1), 'a', "1"); - a(t.call('\uD834abc', 42), '', "42"); - a(t.call('\uD834abc', +Infinity), '', "Infinity"); - a(t.call('\uD834abc', null), '\uD834', "null"); - a(t.call('\uD834abc', undefined), '\uD834', "undefined"); - a(t.call('\uD834abc'), '\uD834', "No arguments"); - a(t.call('\uD834abc', false), '\uD834', "false"); - a(t.call('\uD834abc', NaN), '\uD834', "NaN"); - a(t.call('\uD834abc', ''), '\uD834', "Empty string"); - a(t.call('\uD834abc', '_'), '\uD834', "_"); - a(t.call('\uD834abc', '1'), 'a', "'a'"); - - a.h1("Lone low surrogates"); - a(t.call('\uDF06abc', -Infinity), '', "-Infinity"); - a(t.call('\uDF06abc', -1), '', "-1"); - a(t.call('\uDF06abc', -0), '\uDF06', "-0"); - a(t.call('\uDF06abc', +0), '\uDF06', "+0"); - a(t.call('\uDF06abc', 1), 'a', "1"); - a(t.call('\uDF06abc', 42), '', "42"); - a(t.call('\uDF06abc', +Infinity), '', "+Infinity"); - a(t.call('\uDF06abc', null), '\uDF06', "null"); - a(t.call('\uDF06abc', undefined), '\uDF06', "undefined"); - a(t.call('\uDF06abc'), '\uDF06', "No arguments"); - a(t.call('\uDF06abc', false), '\uDF06', "false"); - a(t.call('\uDF06abc', NaN), '\uDF06', "NaN"); - a(t.call('\uDF06abc', ''), '\uDF06', "Empty string"); - a(t.call('\uDF06abc', '_'), '\uDF06', "_"); - a(t.call('\uDF06abc', '1'), 'a', "'1'"); - - a.h1("Context"); - a.throws(function () { t.call(undefined); }, TypeError, "Undefined"); - a.throws(function () { t.call(undefined, 4); }, TypeError, - "Undefined + argument"); - a.throws(function () { t.call(null); }, TypeError, "Null"); - a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument"); - a(t.call(42, 0), '4', "Number #1"); - a(t.call(42, 1), '2', "Number #2"); - a(t.call({ toString: function () { return 'abc'; } }, 2), 'c', "Object"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/tools/eslint/node_modules/es5-ext/test/string/#/camel-to-hyphen.js deleted file mode 100644 index 8b47a8158a29d3..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/camel-to-hyphen.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/capitalize.js b/tools/eslint/node_modules/es5-ext/test/string/#/capitalize.js deleted file mode 100644 index fa11ff8eeff856..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/capitalize.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('raz'), 'Raz', "Word"); - a(t.call('BLA'), 'BLA', "Uppercase"); - a(t.call(''), '', "Empty"); - a(t.call('a'), 'A', "One letter"); - a(t.call('this is a test'), 'This is a test', "Sentence"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/tools/eslint/node_modules/es5-ext/test/string/#/case-insensitive-compare.js deleted file mode 100644 index 01a90c39ce8307..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/case-insensitive-compare.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call("AA", "aa"), 0, "Same"); - a.ok(t.call("Amber", "zebra") < 0, "Less"); - a.ok(t.call("Zebra", "amber") > 0, "Greater"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/implement.js deleted file mode 100644 index 5e33cd715ff47b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/implement.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var isImplemented = - require('../../../../string/#/code-point-at/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/shim.js deleted file mode 100644 index 0df4751c564421..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/shim.js +++ /dev/null @@ -1,81 +0,0 @@ -// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt -// /blob/master/tests/tests.js - -'use strict'; - -module.exports = function (t, a) { - a(t.length, 1, "Length"); - - // String that starts with a BMP symbol - a(t.call('abc\uD834\uDF06def', ''), 0x61); - a(t.call('abc\uD834\uDF06def', '_'), 0x61); - a(t.call('abc\uD834\uDF06def'), 0x61); - a(t.call('abc\uD834\uDF06def', -Infinity), undefined); - a(t.call('abc\uD834\uDF06def', -1), undefined); - a(t.call('abc\uD834\uDF06def', -0), 0x61); - a(t.call('abc\uD834\uDF06def', 0), 0x61); - a(t.call('abc\uD834\uDF06def', 3), 0x1D306); - a(t.call('abc\uD834\uDF06def', 4), 0xDF06); - a(t.call('abc\uD834\uDF06def', 5), 0x64); - a(t.call('abc\uD834\uDF06def', 42), undefined); - a(t.call('abc\uD834\uDF06def', Infinity), undefined); - a(t.call('abc\uD834\uDF06def', Infinity), undefined); - a(t.call('abc\uD834\uDF06def', NaN), 0x61); - a(t.call('abc\uD834\uDF06def', false), 0x61); - a(t.call('abc\uD834\uDF06def', null), 0x61); - a(t.call('abc\uD834\uDF06def', undefined), 0x61); - - // String that starts with an astral symbol - a(t.call('\uD834\uDF06def', ''), 0x1D306); - a(t.call('\uD834\uDF06def', '1'), 0xDF06); - a(t.call('\uD834\uDF06def', '_'), 0x1D306); - a(t.call('\uD834\uDF06def'), 0x1D306); - a(t.call('\uD834\uDF06def', -1), undefined); - a(t.call('\uD834\uDF06def', -0), 0x1D306); - a(t.call('\uD834\uDF06def', 0), 0x1D306); - a(t.call('\uD834\uDF06def', 1), 0xDF06); - a(t.call('\uD834\uDF06def', 42), undefined); - a(t.call('\uD834\uDF06def', false), 0x1D306); - a(t.call('\uD834\uDF06def', null), 0x1D306); - a(t.call('\uD834\uDF06def', undefined), 0x1D306); - - // Lone high surrogates - a(t.call('\uD834abc', ''), 0xD834); - a(t.call('\uD834abc', '_'), 0xD834); - a(t.call('\uD834abc'), 0xD834); - a(t.call('\uD834abc', -1), undefined); - a(t.call('\uD834abc', -0), 0xD834); - a(t.call('\uD834abc', 0), 0xD834); - a(t.call('\uD834abc', false), 0xD834); - a(t.call('\uD834abc', NaN), 0xD834); - a(t.call('\uD834abc', null), 0xD834); - a(t.call('\uD834abc', undefined), 0xD834); - - // Lone low surrogates - a(t.call('\uDF06abc', ''), 0xDF06); - a(t.call('\uDF06abc', '_'), 0xDF06); - a(t.call('\uDF06abc'), 0xDF06); - a(t.call('\uDF06abc', -1), undefined); - a(t.call('\uDF06abc', -0), 0xDF06); - a(t.call('\uDF06abc', 0), 0xDF06); - a(t.call('\uDF06abc', false), 0xDF06); - a(t.call('\uDF06abc', NaN), 0xDF06); - a(t.call('\uDF06abc', null), 0xDF06); - a(t.call('\uDF06abc', undefined), 0xDF06); - - a.throws(function () { t.call(undefined); }, TypeError); - a.throws(function () { t.call(undefined, 4); }, TypeError); - a.throws(function () { t.call(null); }, TypeError); - a.throws(function () { t.call(null, 4); }, TypeError); - a(t.call(42, 0), 0x34); - a(t.call(42, 1), 0x32); - a(t.call({ toString: function () { return 'abc'; } }, 2), 0x63); - - a.throws(function () { t.apply(undefined); }, TypeError); - a.throws(function () { t.apply(undefined, [4]); }, TypeError); - a.throws(function () { t.apply(null); }, TypeError); - a.throws(function () { t.apply(null, [4]); }, TypeError); - a(t.apply(42, [0]), 0x34); - a(t.apply(42, [1]), 0x32); - a(t.apply({ toString: function () { return 'abc'; } }, [2]), 0x63); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/contains/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/contains/implement.js deleted file mode 100644 index 220f50d4672f13..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/contains/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/contains/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/contains/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/contains/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/contains/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/contains/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/contains/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/contains/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/contains/shim.js deleted file mode 100644 index a0ea4db20812e5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/contains/shim.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('raz', ''), true, "Empty"); - a(t.call('', ''), true, "Both Empty"); - a(t.call('raz', 'raz'), true, "Same"); - a(t.call('razdwa', 'raz'), true, "Starts with"); - a(t.call('razdwa', 'dwa'), true, "Ends with"); - a(t.call('razdwa', 'zdw'), true, "In middle"); - a(t.call('', 'raz'), false, "Something in empty"); - a(t.call('az', 'raz'), false, "Longer"); - a(t.call('azasdfasdf', 'azff'), false, "Not found"); - a(t.call('razdwa', 'raz', 1), false, "Position"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/implement.js deleted file mode 100644 index 93bd2ddcd6dc20..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/ends-with/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/shim.js deleted file mode 100644 index e4b93c407bc2b5..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/ends-with/shim.js +++ /dev/null @@ -1,16 +0,0 @@ -// In some parts copied from: -// http://closure-library.googlecode.com/svn/trunk/closure/goog/ -// string/string_test.html - -'use strict'; - -module.exports = function (t, a) { - a(t.call('abc', ''), true, "Empty needle"); - a(t.call('abcd', 'cd'), true, "Ends with needle"); - a(t.call('abcd', 'abcd'), true, "Needle equals haystack"); - a(t.call('abcd', 'ab'), false, "Doesn't end with needle"); - a(t.call('abc', 'defg'), false, "Length trick"); - a(t.call('razdwa', 'zd', 3), false, "Position: false"); - a(t.call('razdwa', 'zd', 4), true, "Position: true"); - a(t.call('razdwa', 'zd', 5), false, "Position: false #2"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/tools/eslint/node_modules/es5-ext/test/string/#/hyphen-to-camel.js deleted file mode 100644 index bd7ded4befbc7d..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/hyphen-to-camel.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/indent.js b/tools/eslint/node_modules/es5-ext/test/string/#/indent.js deleted file mode 100644 index eb92b36f5438d6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/indent.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('ra\nzz', ''), 'ra\nzz', "Empty"); - a(t.call('ra\nzz', '\t', 3), '\t\t\tra\n\t\t\tzz', "String repeat"); - a(t.call('ra\nzz\nsss\nfff\n', '\t'), '\tra\n\tzz\n\tsss\n\tfff\n', - "Multi-line"); - a(t.call('ra\n\nzz\n', '\t'), '\tra\n\n\tzz\n', "Don't touch empty lines"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/last.js b/tools/eslint/node_modules/es5-ext/test/string/#/last.js deleted file mode 100644 index ad36a213c6053e..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/last.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call(''), null, "Null"); - a(t.call('abcdef'), 'f', "String"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/_data.js b/tools/eslint/node_modules/es5-ext/test/string/#/normalize/_data.js deleted file mode 100644 index c741addb0055a9..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/_data.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t[0], 'object'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/normalize/implement.js deleted file mode 100644 index 4886c9b834285b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/normalize/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/normalize/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/normalize/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/normalize/shim.js deleted file mode 100644 index 28e27f595247be..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/normalize/shim.js +++ /dev/null @@ -1,13 +0,0 @@ -// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js - -'use strict'; - -var str = 'äiti'; - -module.exports = function (t, a) { - a(t.call(str), "\u00e4iti"); - a(t.call(str, "NFC"), "\u00e4iti"); - a(t.call(str, "NFD"), "a\u0308iti"); - a(t.call(str, "NFKC"), "\u00e4iti"); - a(t.call(str, "NFKD"), "a\u0308iti"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/pad.js b/tools/eslint/node_modules/es5-ext/test/string/#/pad.js deleted file mode 100644 index 28c3fcaa10c4da..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/pad.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var partial = require('../../../function/#/partial'); - -module.exports = { - Left: function (t, a) { - t = partial.call(t, 'x', 5); - - a(t.call('yy'), 'xxxyy'); - a(t.call(''), 'xxxxx', "Empty string"); - - a(t.call('yyyyy'), 'yyyyy', 'Equal length'); - a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); - }, - Right: function (t, a) { - t = partial.call(t, 'x', -5); - - a(t.call('yy'), 'yyxxx'); - a(t.call(''), 'xxxxx', "Empty string"); - - a(t.call('yyyyy'), 'yyyyy', 'Equal length'); - a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); - } -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace-all.js b/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace-all.js deleted file mode 100644 index a425c87a40553b..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace-all.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic"); - a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts"); - a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace"); - - a(t.call('$raz$$dwa$trzy$', '$', '&&'), '&&raz&&&&dwa&&trzy&&', "Multi"); - a(t.call('$raz$$dwa$$$$trzy$', '$$', '&'), '$raz&dwa&&trzy$', - "Multi many chars"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace.js b/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace.js deleted file mode 100644 index 54522ed749fe37..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/plain-replace.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic"); - a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts"); - a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/repeat/implement.js deleted file mode 100644 index 7ff65a811068b4..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/repeat/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/repeat/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/repeat/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/repeat/shim.js deleted file mode 100644 index 7e0d077ec4bdb6..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/repeat/shim.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('a', 0), '', "Empty"); - a(t.call('a', 1), 'a', "1"); - a(t.call('\t', 5), '\t\t\t\t\t', "Whitespace"); - a(t.call('raz', 3), 'razrazraz', "Many chars"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/implement.js b/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/implement.js deleted file mode 100644 index fc8490fc916ac3..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../../string/#/starts-with/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/index.js b/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/shim.js b/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/shim.js deleted file mode 100644 index e0e123b324e115..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/starts-with/shim.js +++ /dev/null @@ -1,14 +0,0 @@ -// Inspired and in some parts copied from: -// http://closure-library.googlecode.com/svn/trunk/closure/goog -// /string/string_test.html - -'use strict'; - -module.exports = function (t, a) { - a(t.call('abc', ''), true, "Empty needle"); - a(t.call('abcd', 'ab'), true, "Starts with needle"); - a(t.call('abcd', 'abcd'), true, "Needle equals haystack"); - a(t.call('abcd', 'bcde', 1), false, "Needle larger than haystack"); - a(!t.call('abcd', 'cd'), true, "Doesn't start with needle"); - a(t.call('abcd', 'bc', 1), true, "Position"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/uncapitalize.js b/tools/eslint/node_modules/es5-ext/test/string/#/uncapitalize.js deleted file mode 100644 index 50f35f1fe40a91..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/#/uncapitalize.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t.call('raz'), 'raz', "Word"); - a(t.call('BLA'), 'bLA', "Uppercase"); - a(t.call(''), '', "Empty"); - a(t.call('a'), 'a', "One letter"); - a(t.call('this is a test'), 'this is a test', "Sentence"); - a(t.call('This is a test'), 'this is a test', "Capitalized sentence"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/format-method.js b/tools/eslint/node_modules/es5-ext/test/string/format-method.js deleted file mode 100644 index bb5561ee45bb59..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/format-method.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - t = t({ a: 'A', aa: 'B', ab: 'C', b: 'D', - c: function () { return ++this.a; } }); - a(t.call({ a: 0 }, ' %a%aab%abb%b\\%aa%ab%c%c '), ' ABbCbD%aaC12 '); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/implement.js b/tools/eslint/node_modules/es5-ext/test/string/from-code-point/implement.js deleted file mode 100644 index 0aceb97efdcf36..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../string/from-code-point/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/index.js b/tools/eslint/node_modules/es5-ext/test/string/from-code-point/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/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 deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/shim.js b/tools/eslint/node_modules/es5-ext/test/string/from-code-point/shim.js deleted file mode 100644 index 88cda3d6364719..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/from-code-point/shim.js +++ /dev/null @@ -1,47 +0,0 @@ -// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master -// /tests/tests.js - -'use strict'; - -var pow = Math.pow; - -module.exports = function (t, a) { - var counter, result; - - a(t.length, 1, "Length"); - a(String.propertyIsEnumerable('fromCodePoint'), false, "Not enumerable"); - - a(t(''), '\0', "Empty string"); - a(t(), '', "No arguments"); - a(t(-0), '\0', "-0"); - a(t(0), '\0', "0"); - a(t(0x1D306), '\uD834\uDF06', "Unicode"); - a(t(0x1D306, 0x61, 0x1D307), '\uD834\uDF06a\uD834\uDF07', "Complex unicode"); - a(t(0x61, 0x62, 0x1D307), 'ab\uD834\uDF07', "Complex"); - a(t(false), '\0', "false"); - a(t(null), '\0', "null"); - - a.throws(function () { t('_'); }, RangeError, "_"); - a.throws(function () { t(Infinity); }, RangeError, "Infinity"); - a.throws(function () { t(-Infinity); }, RangeError, "-Infinity"); - a.throws(function () { t(-1); }, RangeError, "-1"); - a.throws(function () { t(0x10FFFF + 1); }, RangeError, "Range error #1"); - a.throws(function () { t(3.14); }, RangeError, "Range error #2"); - a.throws(function () { t(3e-2); }, RangeError, "Range error #3"); - a.throws(function () { t(-Infinity); }, RangeError, "Range error #4"); - a.throws(function () { t(+Infinity); }, RangeError, "Range error #5"); - a.throws(function () { t(NaN); }, RangeError, "Range error #6"); - a.throws(function () { t(undefined); }, RangeError, "Range error #7"); - a.throws(function () { t({}); }, RangeError, "Range error #8"); - a.throws(function () { t(/re/); }, RangeError, "Range error #9"); - - counter = pow(2, 15) * 3 / 2; - result = []; - while (--counter >= 0) result.push(0); // one code unit per symbol - t.apply(null, result); // must not throw - - counter = pow(2, 15) * 3 / 2; - result = []; - while (--counter >= 0) result.push(0xFFFF + 1); // two code units per symbol - t.apply(null, result); // must not throw -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/is-string.js b/tools/eslint/node_modules/es5-ext/test/string/is-string.js deleted file mode 100644 index 32f595829168ee..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/is-string.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a(t(null), false, "Null"); - a(t(''), true, "Empty string"); - a(t(12), false, "Number"); - a(t(false), false, "Boolean"); - a(t(new Date()), false, "Date"); - a(t(new String('raz')), true, "String object"); - a(t('asdfaf'), true, "String"); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/random-uniq.js b/tools/eslint/node_modules/es5-ext/test/string/random-uniq.js deleted file mode 100644 index 6791ac266e7530..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/random-uniq.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); - -module.exports = function (t, a) { - a(typeof t(), 'string'); - a.ok(t().length > 7); - a.not(t(), t()); - a.ok(isValidFormat(t())); - a.ok(isValidFormat(t())); - a.ok(isValidFormat(t())); - a.ok(isValidFormat(t())); - a.ok(isValidFormat(t())); -}; diff --git a/tools/eslint/node_modules/es5-ext/test/string/raw/implement.js b/tools/eslint/node_modules/es5-ext/test/string/raw/implement.js deleted file mode 100644 index 59416de3af53ad..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/raw/implement.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var isImplemented = require('../../../string/raw/is-implemented'); - -module.exports = function (a) { a(isImplemented(), true); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/raw/index.js b/tools/eslint/node_modules/es5-ext/test/string/raw/index.js deleted file mode 100644 index 2e0bfa3249d806..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/raw/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./shim'); diff --git a/tools/eslint/node_modules/es5-ext/test/string/raw/is-implemented.js b/tools/eslint/node_modules/es5-ext/test/string/raw/is-implemented.js deleted file mode 100644 index 1a8832889bf493..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/raw/is-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/tools/eslint/node_modules/es5-ext/test/string/raw/shim.js b/tools/eslint/node_modules/es5-ext/test/string/raw/shim.js deleted file mode 100644 index 025ed780455667..00000000000000 --- a/tools/eslint/node_modules/es5-ext/test/string/raw/shim.js +++ /dev/null @@ -1,15 +0,0 @@ -// Partially taken from: -// https://github.com/paulmillr/es6-shim/blob/master/test/string.js - -'use strict'; - -module.exports = function (t, a) { - var callSite = []; - - callSite.raw = ["The total is ", " ($", " with tax)"]; - a(t(callSite, '{total}', '{total * 1.01}'), - 'The total is {total} (${total * 1.01} with tax)'); - - callSite.raw = []; - a(t(callSite, '{total}', '{total * 1.01}'), ''); -}; diff --git a/tools/eslint/node_modules/es6-iterator/.npmignore b/tools/eslint/node_modules/es6-iterator/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/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/es6-iterator/.travis.yml b/tools/eslint/node_modules/es6-iterator/.travis.yml deleted file mode 100644 index fc254110608e62..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index ce33180939c05f..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/CHANGES +++ /dev/null @@ -1,35 +0,0 @@ -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/es6-iterator/README.md b/tools/eslint/node_modules/es6-iterator/README.md index 30faa82bbaefaa..288373da7ab506 100644 --- a/tools/eslint/node_modules/es6-iterator/README.md +++ b/tools/eslint/node_modules/es6-iterator/README.md @@ -4,7 +4,7 @@ ### 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 @@ -63,7 +63,7 @@ May also be used for _arguments_ objects: #### StringIterator(str) _(es6-iterator/string)_ -Assures proper iteration over unicode symbols. +Assures proper iteration over unicode symbols. See: http://mathiasbynens.be/notes/javascript-unicode ```javascript diff --git a/tools/eslint/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/es6-iterator/package.json index 8c0029c98869d8..87b8fcf5ac4ef0 100644 --- a/tools/eslint/node_modules/es6-iterator/package.json +++ b/tools/eslint/node_modules/es6-iterator/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es6-iterator@2", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/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", + "_location": "/es6-iterator", "_nodeVersion": "0.12.7", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,16 +26,16 @@ "type": "range" }, "_requiredBy": [ - "/eslint/es5-ext", - "/eslint/es6-map", - "/eslint/es6-set", - "/eslint/es6-weak-map" + "/es5-ext", + "/es6-map", + "/es6-set", + "/es6-weak-map" ], "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", "_shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", "_shrinkwrap": null, "_spec": "es6-iterator@2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/es6-map", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/es6-iterator/test/#/chain.js b/tools/eslint/node_modules/es6-iterator/test/#/chain.js deleted file mode 100644 index a414c66d78f44f..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/#/chain.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var Iterator = require('../../'); - -module.exports = function (t, a) { - var i1 = new Iterator(['raz', 'dwa', 'trzy']) - , i2 = new Iterator(['cztery', 'pięć', 'sześć']) - , i3 = new Iterator(['siedem', 'osiem', 'dziewięć']) - - , iterator = t.call(i1, i2, i3); - - a.deep(iterator.next(), { done: false, value: 'raz' }, "#1"); - a.deep(iterator.next(), { done: false, value: 'dwa' }, "#2"); - a.deep(iterator.next(), { done: false, value: 'trzy' }, "#3"); - a.deep(iterator.next(), { done: false, value: 'cztery' }, "#4"); - a.deep(iterator.next(), { done: false, value: 'pięć' }, "#5"); - a.deep(iterator.next(), { done: false, value: 'sześć' }, "#6"); - a.deep(iterator.next(), { done: false, value: 'siedem' }, "#7"); - a.deep(iterator.next(), { done: false, value: 'osiem' }, "#8"); - a.deep(iterator.next(), { done: false, value: 'dziewięć' }, "#9"); - a.deep(iterator.next(), { done: true, value: undefined }, "Done #1"); - a.deep(iterator.next(), { done: true, value: undefined }, "Done #2"); -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/array.js b/tools/eslint/node_modules/es6-iterator/test/array.js deleted file mode 100644 index ae7c2199e84a72..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/array.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (T) { - return { - Values: function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; - - it = new T(x); - a(it[iteratorSymbol](), it, "@@iterator"); - a.deep(it.next(), { done: false, value: 'raz' }, "#1"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); - x.splice(1, 0, 'elo'); - a.deep(it.next(), { done: false, value: 'dwa' }, "Insert"); - a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); - a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); - x.pop(); - a.deep(it.next(), { done: false, value: 'pięć' }, "#5"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Keys & Values": function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; - - it = new T(x, 'key+value'); - a(it[iteratorSymbol](), it, "@@iterator"); - a.deep(it.next(), { done: false, value: [0, 'raz'] }, "#1"); - a.deep(it.next(), { done: false, value: [1, 'dwa'] }, "#2"); - x.splice(1, 0, 'elo'); - a.deep(it.next(), { done: false, value: [2, 'dwa'] }, "Insert"); - a.deep(it.next(), { done: false, value: [3, 'trzy'] }, "#3"); - a.deep(it.next(), { done: false, value: [4, 'cztery'] }, "#4"); - x.pop(); - a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - Keys: function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; - - it = new T(x, 'key'); - a(it[iteratorSymbol](), it, "@@iterator"); - a.deep(it.next(), { done: false, value: 0 }, "#1"); - a.deep(it.next(), { done: false, value: 1 }, "#2"); - x.splice(1, 0, 'elo'); - a.deep(it.next(), { done: false, value: 2 }, "Insert"); - a.deep(it.next(), { done: false, value: 3 }, "#3"); - a.deep(it.next(), { done: false, value: 4 }, "#4"); - x.pop(); - a.deep(it.next(), { done: false, value: 5 }, "#5"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - Sparse: function (a) { - var x = new Array(6), it; - - x[2] = 'raz'; - x[4] = 'dwa'; - it = new T(x); - a.deep(it.next(), { done: false, value: undefined }, "#1"); - a.deep(it.next(), { done: false, value: undefined }, "#2"); - a.deep(it.next(), { done: false, value: 'raz' }, "#3"); - a.deep(it.next(), { done: false, value: undefined }, "#4"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#5"); - a.deep(it.next(), { done: false, value: undefined }, "#6"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - } - }; -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/for-of.js b/tools/eslint/node_modules/es6-iterator/test/for-of.js deleted file mode 100644 index 108df7d97a3c39..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/for-of.js +++ /dev/null @@ -1,40 +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((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 deleted file mode 100644 index 81ce6e6ae48b79..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/get.js +++ /dev/null @@ -1,17 +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((function () { return arguments; }()))), '[object Array Iterator]', " Arguments"); - a(String(t('foo')), '[object String Iterator]', "String"); -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/index.js b/tools/eslint/node_modules/es6-iterator/test/index.js deleted file mode 100644 index ea3621adfebeb5..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/index.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -var ee = require('event-emitter') - , iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (T) { - return { - "": function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z; - - it = new T(x); - a(it[iteratorSymbol](), it, "@@iterator"); - y = it.next(); - a.deep(y, { done: false, value: 'raz' }, "#1"); - z = it.next(); - a.not(y, z, "Recreate result"); - a.deep(z, { done: false, value: 'dwa' }, "#2"); - a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); - a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); - a.deep(it.next(), { done: false, value: 'pięć' }, "#5"); - a.deep(y = it.next(), { done: true, value: undefined }, "End"); - a.not(y, it.next(), "Recreate result on dead"); - }, - Emited: function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; - - y = ee(); - it = new T(x, y); - a.deep(it.next(), { done: false, value: 'raz' }, "#1"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); - y.emit('_add', x.push('sześć') - 1); - a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); - x.splice(1, 0, 'półtora'); - y.emit('_add', 1); - a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); - x.splice(5, 1); - y.emit('_delete', 5); - a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); - a.deep(it.next(), { done: false, value: 'sześć' }, "#5"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited #2": function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; - - y = ee(); - it = new T(x, y); - a.deep(it.next(), { done: false, value: 'raz' }, "#1"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); - x.splice(1, 0, 'półtora'); - y.emit('_add', 1); - x.splice(1, 0, '1.25'); - y.emit('_add', 1); - x.splice(0, 1); - y.emit('_delete', 0); - a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); - a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2"); - a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); - a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); - x.splice(5, 1); - y.emit('_delete', 5); - a.deep(it.next(), { done: false, value: 'sześć' }, "#5"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #1": function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; - - y = ee(); - it = new T(x, y); - a.deep(it.next(), { done: false, value: 'raz' }, "#1"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); - x.length = 0; - y.emit('_clear'); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #2": function (a) { - var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; - - y = ee(); - it = new T(x, y); - a.deep(it.next(), { done: false, value: 'raz' }, "#1"); - a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); - x.length = 0; - y.emit('_clear'); - x.push('foo'); - x.push('bar'); - a.deep(it.next(), { done: false, value: 'foo' }, "#3"); - a.deep(it.next(), { done: false, value: 'bar' }, "#4"); - x.splice(1, 0, 'półtora'); - y.emit('_add', 1); - x.splice(1, 0, '1.25'); - y.emit('_add', 1); - x.splice(0, 1); - y.emit('_delete', 0); - a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); - a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - } - }; -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/is-iterable.js b/tools/eslint/node_modules/es6-iterator/test/is-iterable.js deleted file mode 100644 index 438ad349ca3d48..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/is-iterable.js +++ /dev/null @@ -1,19 +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"); - a(t((function () { return arguments; }())), true, "Arguments"); -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/string.js b/tools/eslint/node_modules/es6-iterator/test/string.js deleted file mode 100644 index d11855f2511609..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/string.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator; - -module.exports = function (T, a) { - var it = new T('foobar'); - - a(it[iteratorSymbol](), it, "@@iterator"); - a.deep(it.next(), { done: false, value: 'f' }, "#1"); - a.deep(it.next(), { done: false, value: 'o' }, "#2"); - a.deep(it.next(), { done: false, value: 'o' }, "#3"); - a.deep(it.next(), { done: false, value: 'b' }, "#4"); - a.deep(it.next(), { done: false, value: 'a' }, "#5"); - a.deep(it.next(), { done: false, value: 'r' }, "#6"); - a.deep(it.next(), { done: true, value: undefined }, "End"); - - a.h1("Outside of BMP"); - it = new T('r💩z'); - a.deep(it.next(), { done: false, value: 'r' }, "#1"); - a.deep(it.next(), { done: false, value: '💩' }, "#2"); - a.deep(it.next(), { done: false, value: 'z' }, "#3"); - a.deep(it.next(), { done: true, value: undefined }, "End"); -}; diff --git a/tools/eslint/node_modules/es6-iterator/test/valid-iterable.js b/tools/eslint/node_modules/es6-iterator/test/valid-iterable.js deleted file mode 100644 index a407f1a0c46923..00000000000000 --- a/tools/eslint/node_modules/es6-iterator/test/valid-iterable.js +++ /dev/null @@ -1,18 +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'); - obj = (function () { return arguments; }()); - a(t(obj), obj, "Arguments"); -}; diff --git a/tools/eslint/node_modules/es6-map/.npmignore b/tools/eslint/node_modules/es6-map/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/node_modules/es6-map/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -/node_modules -/npm-debug.log -/.lintcache diff --git a/tools/eslint/node_modules/es6-map/.travis.yml b/tools/eslint/node_modules/es6-map/.travis.yml deleted file mode 100644 index 83625d8c3e44a9..00000000000000 --- a/tools/eslint/node_modules/es6-map/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 97f484a5c03f0b..00000000000000 --- a/tools/eslint/node_modules/es6-map/CHANGES +++ /dev/null @@ -1,26 +0,0 @@ -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/es6-map/README.md b/tools/eslint/node_modules/es6-map/README.md index f1a2d95d4f9bf5..387eb1a1458a98 100644 --- a/tools/eslint/node_modules/es6-map/README.md +++ b/tools/eslint/node_modules/es6-map/README.md @@ -24,7 +24,7 @@ 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 diff --git a/tools/eslint/node_modules/es6-map/package.json b/tools/eslint/node_modules/es6-map/package.json index 1f1ff679fe9ee6..0a564043a31638 100644 --- a/tools/eslint/node_modules/es6-map/package.json +++ b/tools/eslint/node_modules/es6-map/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es6-map@^0.1.3", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/es6-map", "_nodeVersion": "4.2.2", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint", - "/eslint/escope" + "/escope", + "/eslint" ], "_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", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/es6-map/test/implement.js b/tools/eslint/node_modules/es6-map/test/implement.js deleted file mode 100644 index 3569df61d221ff..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/implement.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof Map, 'function'); }; diff --git a/tools/eslint/node_modules/es6-map/test/index.js b/tools/eslint/node_modules/es6-map/test/index.js deleted file mode 100644 index 907b8c5a7bb2e7..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (T, a) { - a((new T([['raz', 1], ['dwa', 2]])).size, 2); -}; diff --git a/tools/eslint/node_modules/es6-map/test/is-implemented.js b/tools/eslint/node_modules/es6-map/test/is-implemented.js deleted file mode 100644 index 06df91cc529c02..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/is-implemented.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var global = require('es5-ext/global') - , polyfill = require('../polyfill'); - -module.exports = function (t, a) { - var cache; - a(typeof t(), 'boolean'); - cache = global.Map; - global.Map = polyfill; - a(t(), true); - if (cache === undefined) delete global.Map; - else global.Map = cache; -}; diff --git a/tools/eslint/node_modules/es6-map/test/is-map.js b/tools/eslint/node_modules/es6-map/test/is-map.js deleted file mode 100644 index f600b2298b8e7a..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/is-map.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var MapPoly = require('../polyfill'); - -module.exports = function (t, a) { - a(t(undefined), false, "Undefined"); - a(t(null), false, "Null"); - a(t(true), false, "Primitive"); - a(t('raz'), false, "String"); - a(t({}), false, "Object"); - a(t([]), false, "Array"); - if (typeof Map !== 'undefined') { - a(t(new Map()), true, "Native"); - } - a(t(new MapPoly()), true, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/es6-map/test/is-native-implemented.js b/tools/eslint/node_modules/es6-map/test/is-native-implemented.js deleted file mode 100644 index df8ba0323f0cad..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/is-native-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js b/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js deleted file mode 100644 index 41ea10c57deffc..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - a.deep(t, { key: true, value: true, 'key+value': true }); -}; diff --git a/tools/eslint/node_modules/es6-map/test/lib/iterator.js b/tools/eslint/node_modules/es6-map/test/lib/iterator.js deleted file mode 100644 index 2688ed26cb7a73..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/lib/iterator.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var Map = require('../../polyfill') - , toArray = require('es5-ext/array/to-array'); - -module.exports = function (T, a) { - var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); - - a.deep(toArray(new T(map)), arr, "Default"); - a.deep(toArray(new T(map, 'key+value')), arr, "Key & Value"); - a.deep(toArray(new T(map, 'value')), ['one', 'two'], "Value"); - a.deep(toArray(new T(map, 'key')), ['raz', 'dwa'], "Value"); -}; diff --git a/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js deleted file mode 100644 index ed2790de9b5cc6..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -var iteratorSymbol = require('es6-symbol').iterator - , toArray = require('es5-ext/array/to-array') - , Map = require('../../primitive') - - , compare, mapToResults; - -compare = function (a, b) { - if (!a.value) return -1; - if (!b.value) return 1; - return a.value[0].localeCompare(b.value[0]); -}; - -mapToResults = function (arr) { - return arr.sort().map(function (value) { - return { done: false, value: value }; - }); -}; - -module.exports = function (T) { - return { - "": function (a) { - var arr, it, y, z, map, result = []; - - arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], - ['cztery', 'four'], ['pięć', 'five']]; - map = new Map(arr); - - it = new T(map); - a(it[iteratorSymbol](), it, "@@iterator"); - y = it.next(); - result.push(y); - z = it.next(); - a.not(y, z, "Recreate result"); - result.push(z); - result.push(it.next()); - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), mapToResults(arr)); - a.deep(y = it.next(), { done: true, value: undefined }, "End"); - a.not(y, it.next(), "Recreate result on dead"); - }, - Emited: function (a) { - var arr, it, map, result = []; - - arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], - ['cztery', 'four'], ['pięć', 'five']]; - map = new Map(arr); - - it = new T(map); - result.push(it.next()); - result.push(it.next()); - map.set('sześć', 'six'); - arr.push(['sześć', 'six']); - result.push(it.next()); - map.delete('pięć'); - arr.splice(4, 1); - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), mapToResults(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited #2": function (a) { - var arr, it, map, result = []; - - arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], - ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; - map = new Map(arr); - - it = new T(map); - result.push(it.next()); - result.push(it.next()); - map.set('siedem', 'seven'); - map.delete('siedem'); - result.push(it.next()); - result.push(it.next()); - map.delete('pięć'); - arr.splice(4, 1); - result.push(it.next()); - a.deep(result.sort(compare), mapToResults(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #1": function (a) { - var arr, it, map, result = []; - - arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], - ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; - map = new Map(arr); - - it = new T(map); - result.push(it.next()); - result.push(it.next()); - arr = [['raz', 'one'], ['dwa', 'two']]; - map.clear(); - a.deep(result.sort(compare), mapToResults(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #2": function (a) { - var arr, it, map, result = []; - - arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], - ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; - map = new Map(arr); - - it = new T(map); - result.push(it.next()); - result.push(it.next()); - map.clear(); - map.set('foo', 'bru'); - map.set('bar', 'far'); - arr = [['raz', 'one'], ['dwa', 'two'], ['foo', 'bru'], ['bar', 'far']]; - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), mapToResults(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - Kinds: function (a) { - var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); - - a.deep(toArray(new T(map)).sort(), arr.sort(), "Default"); - a.deep(toArray(new T(map, 'key+value')).sort(), arr.sort(), - "Key + Value"); - a.deep(toArray(new T(map, 'value')).sort(), ['one', 'two'].sort(), - "Value"); - a.deep(toArray(new T(map, 'key')).sort(), ['raz', 'dwa'].sort(), - "Key"); - } - }; -}; diff --git a/tools/eslint/node_modules/es6-map/test/polyfill.js b/tools/eslint/node_modules/es6-map/test/polyfill.js deleted file mode 100644 index 6816cb049b4b39..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/polyfill.js +++ /dev/null @@ -1,60 +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"); - - 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 deleted file mode 100644 index a99c68522d57c7..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/primitive/index.js +++ /dev/null @@ -1,59 +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"); - - 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/valid-map.js b/tools/eslint/node_modules/es6-map/test/valid-map.js deleted file mode 100644 index ac0314949a3009..00000000000000 --- a/tools/eslint/node_modules/es6-map/test/valid-map.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var MapPoly = require('../polyfill'); - -module.exports = function (t, a) { - var map; - a.throws(function () { t(undefined); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a.throws(function () { t(true); }, TypeError, "Primitive"); - a.throws(function () { t('raz'); }, TypeError, "String"); - a.throws(function () { t({}); }, TypeError, "Object"); - a.throws(function () { t([]); }, TypeError, "Array"); - if (typeof Map !== 'undefined') { - map = new Map(); - a(t(map), map, "Native"); - } - map = new MapPoly(); - a(t(map), map, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/es6-set/.npmignore b/tools/eslint/node_modules/es6-set/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/node_modules/es6-set/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -/node_modules -/npm-debug.log -/.lintcache diff --git a/tools/eslint/node_modules/es6-set/.travis.yml b/tools/eslint/node_modules/es6-set/.travis.yml deleted file mode 100644 index a51e21e3bca728..00000000000000 --- a/tools/eslint/node_modules/es6-set/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 613bbb20d34d28..00000000000000 --- a/tools/eslint/node_modules/es6-set/CHANGES +++ /dev/null @@ -1,30 +0,0 @@ -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/es6-set/package.json b/tools/eslint/node_modules/es6-set/package.json index c273e3c1c1fd28..9717f130ec97c1 100644 --- a/tools/eslint/node_modules/es6-set/package.json +++ b/tools/eslint/node_modules/es6-set/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es6-set@~0.1.3", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/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", + "_location": "/es6-set", "_nodeVersion": "4.2.4", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/es6-map" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", @@ -57,7 +57,7 @@ "directories": {}, "dist": { "shasum": "9516b6761c2964b92ff479456233a247dc707ce8", - "tarball": "http://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz" + "tarball": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz" }, "gitHead": "89717f1b294382ca28e9070e644f768ff240dc71", "homepage": "https://github.com/medikoo/es6-set#readme", diff --git a/tools/eslint/node_modules/es6-set/test/ext/copy.js b/tools/eslint/node_modules/es6-set/test/ext/copy.js deleted file mode 100644 index 84fe912a36f735..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/copy.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var toArray = require('es5-ext/array/to-array') - , Set = require('../../'); - -module.exports = function (t, a) { - var content = ['raz', 2, true], set = new Set(content), copy; - - copy = t.call(set); - a.not(copy, set, "Copy"); - a.deep(toArray(copy), content, "Content"); -}; diff --git a/tools/eslint/node_modules/es6-set/test/ext/every.js b/tools/eslint/node_modules/es6-set/test/ext/every.js deleted file mode 100644 index f56ca385fa5a73..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/every.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var Set = require('../../'); - -module.exports = function (t, a) { - a(t.call(new Set(), Boolean), true, "Empty set"); - a(t.call(new Set([2, 3, 4]), Boolean), true, "Truthy"); - a(t.call(new Set([2, 0, 4]), Boolean), false, "Falsy"); -}; diff --git a/tools/eslint/node_modules/es6-set/test/ext/filter.js b/tools/eslint/node_modules/es6-set/test/ext/filter.js deleted file mode 100644 index 46981859b6bdc0..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/filter.js +++ /dev/null @@ -1,12 +0,0 @@ -'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/es6-set/test/ext/get-first.js b/tools/eslint/node_modules/es6-set/test/ext/get-first.js deleted file mode 100644 index f99829e5afe0bc..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/get-first.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Set = require('../../'); - -module.exports = function (t, a) { - var content = ['raz', 2, true], set = new Set(content); - - a(t.call(set), 'raz'); - - set = new Set(); - a(t.call(set), undefined); -}; diff --git a/tools/eslint/node_modules/es6-set/test/ext/get-last.js b/tools/eslint/node_modules/es6-set/test/ext/get-last.js deleted file mode 100644 index 1dcc993ed0ec73..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/get-last.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Set = require('../../'); - -module.exports = function (t, a) { - var content = ['raz', 2, true], set = new Set(content); - - a(t.call(set), true); - - set = new Set(); - a(t.call(set), undefined); -}; diff --git a/tools/eslint/node_modules/es6-set/test/ext/some.js b/tools/eslint/node_modules/es6-set/test/ext/some.js deleted file mode 100644 index 84ce11916a8bb9..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/ext/some.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var Set = require('../../'); - -module.exports = function (t, a) { - a(t.call(new Set(), Boolean), false, "Empty set"); - a(t.call(new Set([2, 3, 4]), Boolean), true, "All true"); - a(t.call(new Set([0, false, 4]), Boolean), true, "Some false"); - a(t.call(new Set([0, false, null]), Boolean), false, "All false"); -}; diff --git a/tools/eslint/node_modules/es6-set/test/implement.js b/tools/eslint/node_modules/es6-set/test/implement.js deleted file mode 100644 index 4882d3786a62d9..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/implement.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof Set, 'function'); }; diff --git a/tools/eslint/node_modules/es6-set/test/index.js b/tools/eslint/node_modules/es6-set/test/index.js deleted file mode 100644 index 19c64865097d31..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (T, a) { a((new T(['raz', 'dwa'])).size, 2); }; diff --git a/tools/eslint/node_modules/es6-set/test/is-implemented.js b/tools/eslint/node_modules/es6-set/test/is-implemented.js deleted file mode 100644 index 124793e7373f1c..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/is-implemented.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var global = require('es5-ext/global') - , polyfill = require('../polyfill'); - -module.exports = function (t, a) { - var cache; - a(typeof t(), 'boolean'); - cache = global.Set; - global.Set = polyfill; - a(t(), true); - if (cache === undefined) delete global.Set; - else global.Set = cache; -}; diff --git a/tools/eslint/node_modules/es6-set/test/is-native-implemented.js b/tools/eslint/node_modules/es6-set/test/is-native-implemented.js deleted file mode 100644 index df8ba0323f0cad..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/is-native-implemented.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/tools/eslint/node_modules/es6-set/test/is-set.js b/tools/eslint/node_modules/es6-set/test/is-set.js deleted file mode 100644 index c969cce232f0d6..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/is-set.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var SetPoly = require('../polyfill'); - -module.exports = function (t, a) { - a(t(undefined), false, "Undefined"); - a(t(null), false, "Null"); - a(t(true), false, "Primitive"); - a(t('raz'), false, "String"); - a(t({}), false, "Object"); - a(t([]), false, "Array"); - if (typeof Set !== 'undefined') { - a(t(new Set()), true, "Native"); - } - a(t(new SetPoly()), true, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/es6-set/test/lib/iterator.js b/tools/eslint/node_modules/es6-set/test/lib/iterator.js deleted file mode 100644 index 9e5cfb91b9217f..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/lib/iterator.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var Set = require('../../polyfill') - , toArray = require('es5-ext/array/to-array'); - -module.exports = function (T, a) { - var set = new Set(['raz', 'dwa']); - - a.deep(toArray(new T(set)), ['raz', 'dwa'], "Default"); - a.deep(toArray(new T(set, 'key+value')), [['raz', 'raz'], ['dwa', 'dwa']], - "Key & Value"); - a.deep(toArray(new T(set, 'value')), ['raz', 'dwa'], "Other"); -}; diff --git a/tools/eslint/node_modules/es6-set/test/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-set/test/lib/primitive-iterator.js deleted file mode 100644 index 2a4956b80b3877..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/lib/primitive-iterator.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -var Set = require('../../primitive') - , toArray = require('es5-ext/array/to-array') - , iteratorSymbol = require('es6-symbol').iterator - - , compare, map; - -compare = function (a, b) { - if (!a.value) return -1; - if (!b.value) return 1; - return a.value.localeCompare(b.value); -}; - -map = function (arr) { - return arr.sort().map(function (value) { - return { done: false, value: value }; - }); -}; - -module.exports = function (T) { - return { - "": function (a) { - var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z - , set = new Set(arr), result = []; - - it = new T(set); - a(it[iteratorSymbol](), it, "@@iterator"); - y = it.next(); - result.push(y); - z = it.next(); - a.not(y, z, "Recreate result"); - result.push(z); - result.push(it.next()); - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), map(arr)); - a.deep(y = it.next(), { done: true, value: undefined }, "End"); - a.not(y, it.next(), "Recreate result on dead"); - }, - Emited: function (a) { - var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it - , set = new Set(arr), result = []; - - it = new T(set); - result.push(it.next()); - result.push(it.next()); - set.add('sześć'); - arr.push('sześć'); - result.push(it.next()); - set.delete('pięć'); - arr.splice(4, 1); - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), map(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited #2": function (a) { - var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it - , set = new Set(arr), result = []; - - it = new T(set); - result.push(it.next()); - result.push(it.next()); - set.add('siedem'); - set.delete('siedem'); - result.push(it.next()); - result.push(it.next()); - set.delete('pięć'); - arr.splice(4, 1); - result.push(it.next()); - a.deep(result.sort(compare), map(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #1": function (a) { - var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it - , set = new Set(arr), result = []; - - it = new T(set); - result.push(it.next()); - result.push(it.next()); - arr = ['raz', 'dwa']; - set.clear(); - a.deep(result.sort(compare), map(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - "Emited: Clear #2": function (a) { - var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it - , set = new Set(arr), result = []; - - it = new T(set); - result.push(it.next()); - result.push(it.next()); - set.clear(); - set.add('foo'); - set.add('bar'); - arr = ['raz', 'dwa', 'foo', 'bar']; - result.push(it.next()); - result.push(it.next()); - a.deep(result.sort(compare), map(arr)); - a.deep(it.next(), { done: true, value: undefined }, "End"); - }, - Kinds: function (a) { - var set = new Set(['raz', 'dwa']); - - a.deep(toArray(new T(set)).sort(), ['raz', 'dwa'].sort(), "Default"); - a.deep(toArray(new T(set, 'key+value')).sort(), - [['raz', 'raz'], ['dwa', 'dwa']].sort(), "Key & Value"); - a.deep(toArray(new T(set, 'value')).sort(), ['raz', 'dwa'].sort(), - "Other"); - } - }; -}; diff --git a/tools/eslint/node_modules/es6-set/test/polyfill.js b/tools/eslint/node_modules/es6-set/test/polyfill.js deleted file mode 100644 index 94ae3e6e6384a7..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/polyfill.js +++ /dev/null @@ -1,50 +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"); - - 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 deleted file mode 100644 index 88f9502fd9c72e..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/primitive/index.js +++ /dev/null @@ -1,50 +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"); - - 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/valid-set.js b/tools/eslint/node_modules/es6-set/test/valid-set.js deleted file mode 100644 index 8c71f5f8c709e4..00000000000000 --- a/tools/eslint/node_modules/es6-set/test/valid-set.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var SetPoly = require('../polyfill'); - -module.exports = function (t, a) { - var set; - a.throws(function () { t(undefined); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a.throws(function () { t(true); }, TypeError, "Primitive"); - a.throws(function () { t('raz'); }, TypeError, "String"); - a.throws(function () { t({}); }, TypeError, "Object"); - a.throws(function () { t([]); }, TypeError, "Array"); - if (typeof Set !== 'undefined') { - set = new Set(); - a(t(set), set, "Native"); - } - set = new SetPoly(); - a(t(set), set, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/es6-symbol/.npmignore b/tools/eslint/node_modules/es6-symbol/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/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/es6-symbol/.travis.yml b/tools/eslint/node_modules/es6-symbol/.travis.yml deleted file mode 100644 index 6830765b567773..00000000000000 --- a/tools/eslint/node_modules/es6-symbol/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index cbedd4244bc8b6..00000000000000 --- a/tools/eslint/node_modules/es6-symbol/CHANGES +++ /dev/null @@ -1,46 +0,0 @@ -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/es6-symbol/package.json b/tools/eslint/node_modules/es6-symbol/package.json index 6a2f26db1f2abd..3036cdb35f3079 100644 --- a/tools/eslint/node_modules/es6-symbol/package.json +++ b/tools/eslint/node_modules/es6-symbol/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es6-symbol@~3.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/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", + "_location": "/es6-symbol", "_nodeVersion": "5.2.0", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,17 +26,17 @@ "type": "range" }, "_requiredBy": [ - "/eslint/es5-ext", - "/eslint/es6-iterator", - "/eslint/es6-map", - "/eslint/es6-set", - "/eslint/es6-weak-map" + "/es5-ext", + "/es6-iterator", + "/es6-map", + "/es6-set", + "/es6-weak-map" ], "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz", "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", "_shrinkwrap": null, "_spec": "es6-symbol@~3.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/es6-map", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/es6-symbol/test/implement.js b/tools/eslint/node_modules/es6-symbol/test/implement.js deleted file mode 100644 index eb35c3018835c7..00000000000000 --- a/tools/eslint/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/es6-symbol/test/index.js b/tools/eslint/node_modules/es6-symbol/test/index.js deleted file mode 100644 index 62b3296df6fc5e..00000000000000 --- a/tools/eslint/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/es6-symbol/test/is-implemented.js b/tools/eslint/node_modules/es6-symbol/test/is-implemented.js deleted file mode 100644 index bb0d64536ebbae..00000000000000 --- a/tools/eslint/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/es6-symbol/test/is-native-implemented.js b/tools/eslint/node_modules/es6-symbol/test/is-native-implemented.js deleted file mode 100644 index df8ba0323f0cad..00000000000000 --- a/tools/eslint/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/es6-symbol/test/is-symbol.js b/tools/eslint/node_modules/es6-symbol/test/is-symbol.js deleted file mode 100644 index ac24b9abbff4e6..00000000000000 --- a/tools/eslint/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/es6-symbol/test/polyfill.js b/tools/eslint/node_modules/es6-symbol/test/polyfill.js deleted file mode 100644 index 83fb5e9253677b..00000000000000 --- a/tools/eslint/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/es6-symbol/test/validate-symbol.js b/tools/eslint/node_modules/es6-symbol/test/validate-symbol.js deleted file mode 100644 index 2c8f84c8239b6e..00000000000000 --- a/tools/eslint/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/es6-weak-map/.npmignore b/tools/eslint/node_modules/es6-weak-map/.npmignore deleted file mode 100644 index 155e41f69142ef..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -/node_modules -/npm-debug.log -/.lintcache diff --git a/tools/eslint/node_modules/es6-weak-map/.travis.yml b/tools/eslint/node_modules/es6-weak-map/.travis.yml deleted file mode 100644 index cdd424cc2ecc17..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 74fced55714a5f..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/CHANGES +++ /dev/null @@ -1,42 +0,0 @@ -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/es6-weak-map/package.json b/tools/eslint/node_modules/es6-weak-map/package.json index 7a708a00bd03cf..af1aa49eefe369 100644 --- a/tools/eslint/node_modules/es6-weak-map/package.json +++ b/tools/eslint/node_modules/es6-weak-map/package.json @@ -2,14 +2,14 @@ "_args": [ [ "es6-weak-map@^2.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/escope" + "/Users/trott/io.js/tools/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", + "_location": "/es6-weak-map", "_nodeVersion": "0.12.7", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/escope" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/escope", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", diff --git a/tools/eslint/node_modules/es6-weak-map/test/implement.js b/tools/eslint/node_modules/es6-weak-map/test/implement.js deleted file mode 100644 index 860027ed290974..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/implement.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { a(typeof WeakMap, 'function'); }; diff --git a/tools/eslint/node_modules/es6-weak-map/test/index.js b/tools/eslint/node_modules/es6-weak-map/test/index.js deleted file mode 100644 index 9b26e4fa7e4a01..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = function (T, a) { - var x = {}; - a((new T([[x, 'foo']])).get(x), 'foo'); -}; diff --git a/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js b/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js deleted file mode 100644 index 0186871e2e3f4f..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var global = require('es5-ext/global') - , polyfill = require('../polyfill'); - -module.exports = function (t, a) { - var cache; - a(typeof t(), 'boolean'); - cache = global.WeakMap; - global.WeakMap = polyfill; - a(t(), true); - if (cache === undefined) delete global.WeakMap; - else global.WeakMap = cache; -}; diff --git a/tools/eslint/node_modules/es6-weak-map/test/is-native-implemented.js b/tools/eslint/node_modules/es6-weak-map/test/is-native-implemented.js deleted file mode 100644 index df8ba0323f0cad..00000000000000 --- a/tools/eslint/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/es6-weak-map/test/is-weak-map.js b/tools/eslint/node_modules/es6-weak-map/test/is-weak-map.js deleted file mode 100644 index ba8c04519ca204..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/is-weak-map.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var WeakMapPoly = require('../polyfill'); - -module.exports = function (t, a) { - a(t(undefined), false, "Undefined"); - a(t(null), false, "Null"); - a(t(true), false, "Primitive"); - a(t('raz'), false, "String"); - a(t({}), false, "Object"); - a(t([]), false, "Array"); - if (typeof WeakMap !== 'undefined') { - a(t(new WeakMap()), true, "Native"); - } - a(t(new WeakMapPoly()), true, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/es6-weak-map/test/polyfill.js b/tools/eslint/node_modules/es6-weak-map/test/polyfill.js deleted file mode 100644 index aaffe4a1c27283..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/polyfill.js +++ /dev/null @@ -1,23 +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.h1("Empty initialization"); - map = new T(); - map.set(x, 'bar'); - a(map.get(x), 'bar'); -}; diff --git a/tools/eslint/node_modules/es6-weak-map/test/valid-weak-map.js b/tools/eslint/node_modules/es6-weak-map/test/valid-weak-map.js deleted file mode 100644 index a7823421a7c503..00000000000000 --- a/tools/eslint/node_modules/es6-weak-map/test/valid-weak-map.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var WeakMapPoly = require('../polyfill'); - -module.exports = function (t, a) { - var map; - a.throws(function () { t(undefined); }, TypeError, "Undefined"); - a.throws(function () { t(null); }, TypeError, "Null"); - a.throws(function () { t(true); }, TypeError, "Primitive"); - a.throws(function () { t('raz'); }, TypeError, "String"); - a.throws(function () { t({}); }, TypeError, "Object"); - a.throws(function () { t([]); }, TypeError, "Array"); - if (typeof WeakMap !== 'undefined') { - map = new WeakMap(); - a(t(map), map, "Native"); - } - map = new WeakMapPoly(); - a(t(map), map, "Polyfill"); -}; diff --git a/tools/eslint/node_modules/escape-string-regexp/package.json b/tools/eslint/node_modules/escape-string-regexp/package.json index a6fa52d711a24d..9a9088035f0e0d 100644 --- a/tools/eslint/node_modules/escape-string-regexp/package.json +++ b/tools/eslint/node_modules/escape-string-regexp/package.json @@ -2,20 +2,24 @@ "_args": [ [ "escape-string-regexp@^1.0.2", - "/Users/trott/test/node_modules/eslint/node_modules/chalk" + "/Users/trott/io.js/tools/node_modules/chalk" ] ], "_from": "escape-string-regexp@>=1.0.2 <2.0.0", - "_id": "escape-string-regexp@1.0.4", + "_id": "escape-string-regexp@1.0.5", "_inCache": true, "_installable": true, - "_location": "/eslint/escape-string-regexp", - "_nodeVersion": "4.2.1", + "_location": "/escape-string-regexp", + "_nodeVersion": "4.2.6", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "email": "jappelman@xebia.com", + "name": "jbnicolai" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { "name": "escape-string-regexp", @@ -26,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/chalk" + "/chalk" ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz", - "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", "_shrinkwrap": null, "_spec": "escape-string-regexp@^1.0.2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/chalk", + "_where": "/Users/trott/io.js/tools/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -49,8 +53,8 @@ }, "directories": {}, "dist": { - "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz" + "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" }, "engines": { "node": ">=0.8.0" @@ -58,7 +62,7 @@ "files": [ "index.js" ], - "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97", + "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", "homepage": "https://github.com/sindresorhus/escape-string-regexp", "keywords": [ "escape", @@ -93,5 +97,5 @@ "scripts": { "test": "xo && ava" }, - "version": "1.0.4" + "version": "1.0.5" } diff --git a/tools/eslint/node_modules/escope/.jshintrc b/tools/eslint/node_modules/escope/.jshintrc deleted file mode 100644 index defbf02636c7aa..00000000000000 --- a/tools/eslint/node_modules/escope/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "indent": 4, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - "validthis": true, - - "onevar": true, - - "node": true -} diff --git a/tools/eslint/node_modules/escope/CONTRIBUTING.md b/tools/eslint/node_modules/escope/CONTRIBUTING.md deleted file mode 100644 index f1ddca9cbdcc30..00000000000000 --- a/tools/eslint/node_modules/escope/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -## Project license: \ - -- You will only Submit Contributions where You have authored 100% of the content. -- You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions. -- Whatever content You Contribute will be provided under the Project License. diff --git a/tools/eslint/node_modules/escope/README.md b/tools/eslint/node_modules/escope/README.md index a2bfeb72f85416..02b3a3e7dceca7 100644 --- a/tools/eslint/node_modules/escope/README.md +++ b/tools/eslint/node_modules/escope/README.md @@ -19,7 +19,7 @@ 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 } @@ -28,7 +28,7 @@ estraverse.traverse(ast, { if (/Function/.test(node.type)) { currentScope = currentScope.upper; // set to parent scope } - + // do stuff } }); diff --git a/tools/eslint/node_modules/escope/bower.json b/tools/eslint/node_modules/escope/bower.json deleted file mode 100644 index 70ad5e5ff3948c..00000000000000 --- a/tools/eslint/node_modules/escope/bower.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "escope", - "version": "2.0.2-dev", - "main": "escope.js", - "dependencies": { - "estraverse": ">= 0.0.2" - }, - "ignore": [ - "**/.*", - "node_modules", - "components" - ] -} diff --git a/tools/eslint/node_modules/escope/gulpfile.js b/tools/eslint/node_modules/escope/gulpfile.js deleted file mode 100644 index 64cc31d459956e..00000000000000 --- a/tools/eslint/node_modules/escope/gulpfile.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - mocha = require('gulp-mocha'), - babel = require('gulp-babel'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'), - sourcemaps = require('gulp-sourcemaps'), - plumber = require('gulp-plumber'), - source = require('vinyl-source-stream'), - browserify = require('browserify'), - lazypipe = require('lazypipe'), - eslint = require('gulp-eslint'), - fs = require('fs'); - -require('babel-register')({ - only: /escope\/(src|test)\// -}); - -var TEST = [ 'test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -var ESLINT_OPTION = { - rules: { - 'quotes': 0, - 'eqeqeq': 0, - 'no-use-before-define': 0, - 'no-shadow': 0, - 'no-new': 0, - 'no-underscore-dangle': 0, - 'no-multi-spaces': 0, - 'no-native-reassign': 0, - 'no-loop-func': 0, - 'no-lone-blocks': 0 - }, - ecmaFeatures: { - jsx: false, - modules: true - }, - env: { - node: true, - es6: true - } -}; - -var BABEL_OPTIONS = JSON.parse(fs.readFileSync('.babelrc', { encoding: 'utf8' })); - -var build = lazypipe() - .pipe(sourcemaps.init) - .pipe(babel, BABEL_OPTIONS) - .pipe(sourcemaps.write) - .pipe(gulp.dest, 'lib'); - -gulp.task('build-for-watch', function () { - return gulp.src(SOURCE).pipe(plumber()).pipe(build()); -}); - -gulp.task('build', function () { - return gulp.src(SOURCE).pipe(build()); -}); - -gulp.task('browserify', [ 'build' ], function () { - return browserify({ - entries: [ './lib/index.js' ] - }) - .bundle() - .pipe(source('bundle.js')) - .pipe(gulp.dest('build')) -}); - -gulp.task('test', [ 'build' ], function () { - return gulp.src(TEST) - .pipe(mocha({ - reporter: 'spec', - timeout: 100000 // 100s - })); -}); - -gulp.task('watch', [ 'build-for-watch' ], function () { - gulp.watch(SOURCE, [ 'build-for-watch' ]); -}); - -// Currently, not works for ES6. -gulp.task('lint', function () { - return gulp.src(SOURCE) - .pipe(eslint(ESLINT_OPTION)) - .pipe(eslint.formatEach('stylish', process.stderr)) - .pipe(eslint.failOnError()); -}); - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ 'build' ], function () { return inc('patch'); }) -gulp.task('minor', [ 'build' ], function () { return inc('minor'); }) -gulp.task('major', [ 'build' ], function () { return inc('major'); }) - -gulp.task('travis', [ 'test' ]); -gulp.task('default', [ 'travis' ]); diff --git a/tools/eslint/node_modules/escope/lib/definition.js b/tools/eslint/node_modules/escope/lib/definition.js index cef445de5b3915..d6fa778cebdf95 100644 --- a/tools/eslint/node_modules/escope/lib/definition.js +++ b/tools/eslint/node_modules/escope/lib/definition.js @@ -17,16 +17,16 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" 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 @@ -76,6 +76,7 @@ var Definition = function Definition(type, name, node, parent, index, kind) { * @class ParameterDefinition */ + exports.default = Definition; var ParameterDefinition = function (_Definition) { @@ -102,4 +103,4 @@ exports.ParameterDefinition = ParameterDefinition; exports.Definition = Definition; /* vim: set sw=4 ts=4 et tw=80 : */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlZmluaXRpb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBNkJxQixhQUNqQixTQURpQixVQUNqQixDQUFZLElBQVosRUFBa0IsSUFBbEIsRUFBd0IsSUFBeEIsRUFBOEIsTUFBOUIsRUFBc0MsS0FBdEMsRUFBNkMsSUFBN0MsRUFBbUQ7d0JBRGxDLFlBQ2tDOzs7OztBQUkvQyxPQUFLLElBQUwsR0FBWSxJQUFaOzs7O0FBSitDLE1BUS9DLENBQUssSUFBTCxHQUFZLElBQVo7Ozs7QUFSK0MsTUFZL0MsQ0FBSyxJQUFMLEdBQVksSUFBWjs7OztBQVorQyxNQWdCL0MsQ0FBSyxNQUFMLEdBQWMsTUFBZDs7OztBQWhCK0MsTUFvQi9DLENBQUssS0FBTCxHQUFhLEtBQWI7Ozs7QUFwQitDLE1Bd0IvQyxDQUFLLElBQUwsR0FBWSxJQUFaLENBeEIrQztDQUFuRDs7Ozs7O2tCQURpQjs7SUFnQ2Y7OztBQUNGLFdBREUsbUJBQ0YsQ0FBWSxJQUFaLEVBQWtCLElBQWxCLEVBQXdCLEtBQXhCLEVBQStCLElBQS9CLEVBQXFDOzBCQURuQ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luZGV4LCBudWxsKTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFdoZXRoZXIgdGhlIHBhcmFtZXRlciBkZWZpbml0aW9uIGlzIGEgcGFydCBvZiBhIHJlc3QgcGFyYW1ldGVyLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBQYXJhbWV0ZXJEZWZpbml0aW9uI3Jlc3RcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucmVzdCA9IHJlc3Q7XG4gICAgfVxufVxuXG5leHBvcnQge1xuICAgIFBhcmFtZXRlckRlZmluaXRpb24sXG4gICAgRGVmaW5pdGlvblxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 diff --git a/tools/eslint/node_modules/escope/lib/index.js b/tools/eslint/node_modules/escope/lib/index.js index 6861459edae75a..16e6478b448c5d 100644 --- a/tools/eslint/node_modules/escope/lib/index.js +++ b/tools/eslint/node_modules/escope/lib/index.js @@ -1,19 +1,24 @@ 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ScopeManager = exports.Scope = exports.Variable = exports.Reference = exports.version = undefined; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /* Copyright (C) 2012-2014 Yusuke Suzuki Copyright (C) 2013 Alex Seville Copyright (C) 2014 Thiago de Arruda - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -50,10 +55,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /*jslint bitwise:true */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ScopeManager = exports.Scope = exports.Variable = exports.Reference = exports.version = undefined; exports.analyze = analyze; var _assert = require('assert'); @@ -91,7 +92,9 @@ function defaultOptions() { nodejsScope: false, impliedStrict: false, sourceType: 'script', // one of ['script', 'module'] - ecmaVersion: 5 + ecmaVersion: 5, + childVisitorKeys: null, + fallback: 'iteration' }; } @@ -99,7 +102,7 @@ function updateDeeply(target, override) { var key, val; function isHashObject(target) { - return (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target instanceof Object && !(target instanceof RegExp); + return (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target instanceof Object && !(target instanceof Array) && !(target instanceof RegExp); } for (key in override) { @@ -135,6 +138,8 @@ function updateDeeply(target, override) { * (if ecmaVersion >= 5). * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. * @return {ScopeManager} */ function analyze(tree, providedOptions) { @@ -144,7 +149,7 @@ function analyze(tree, providedOptions) { scopeManager = new _scopeManager2.default(options); - referencer = new _referencer2.default(scopeManager); + referencer = new _referencer2.default(options, scopeManager); referencer.visit(tree); (0, _assert2.default)(scopeManager.__currentScope === null, 'currentScope should be null.'); @@ -169,4 +174,4 @@ exports. ScopeManager = _scopeManager2.default; /* vim: set sw=4 ts=4 et tw=80 : */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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Y2VyLCBvcHRpb25zO1xuXG4gICAgb3B0aW9ucyA9IHVwZGF0ZURlZXBseShkZWZhdWx0T3B0aW9ucygpLCBwcm92aWRlZE9wdGlvbnMpO1xuXG4gICAgc2NvcGVNYW5hZ2VyID0gbmV3IFNjb3BlTWFuYWdlcihvcHRpb25zKTtcblxuICAgIHJlZmVyZW5jZXIgPSBuZXcgUmVmZXJlbmNlcihvcHRpb25zLCBzY29wZU1hbmFnZXIpO1xuICAgIHJlZmVyZW5jZXIudmlzaXQodHJlZSk7XG5cbiAgICBhc3NlcnQoc2NvcGVNYW5hZ2VyLl9fY3VycmVudFNjb3BlID09PSBudWxsLCAnY3VycmVudFNjb3BlIHNob3VsZCBiZSBudWxsLicpO1xuXG4gICAgcmV0dXJuIHNjb3BlTWFuYWdlcjtcbn1cblxuZXhwb3J0IHtcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS52ZXJzaW9uICovXG4gICAgdmVyc2lvbixcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5SZWZlcmVuY2UgKi9cbiAgICBSZWZlcmVuY2UsXG4gICAgLyoqIEBuYW1lIG1vZHVsZTplc2NvcGUuVmFyaWFibGUgKi9cbiAgICBWYXJpYWJsZSxcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5TY29wZSAqL1xuICAgIFNjb3BlLFxuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLlNjb3BlTWFuYWdlciAqL1xuICAgIFNjb3BlTWFuYWdlclxufTtcblxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 diff --git a/tools/eslint/node_modules/escope/lib/pattern-visitor.js b/tools/eslint/node_modules/escope/lib/pattern-visitor.js index 39687239bb5f62..e67f3e0f3f6a63 100644 --- a/tools/eslint/node_modules/escope/lib/pattern-visitor.js +++ b/tools/eslint/node_modules/escope/lib/pattern-visitor.js @@ -1,11 +1,11 @@ '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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _estraverse = require('estraverse'); var _esrecurse = require('esrecurse'); @@ -20,16 +20,16 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen 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 @@ -57,10 +57,10 @@ var PatternVisitor = function (_esrecurse$Visitor) { } }]); - function PatternVisitor(rootPattern, callback) { + function PatternVisitor(options, rootPattern, callback) { _classCallCheck(this, PatternVisitor); - var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PatternVisitor).call(this)); + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PatternVisitor).call(this, null, options)); _this.rootPattern = rootPattern; _this.callback = callback; @@ -171,5 +171,6 @@ var PatternVisitor = function (_esrecurse$Visitor) { /* vim: set sw=4 ts=4 et tw=80 : */ + exports.default = PatternVisitor; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhdHRlcm4tdmlzaXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJCQSxTQUFTLE9BQVQsQ0FBaUIsRUFBakIsRUFBcUI7QUFDakIsV0FBTyxHQUFHLEdBQUcsTUFBSCxHQUFZLENBQVosQ0FBSCxJQUFxQixJQUFyQixDQURVO0NBQXJCOztJQUlxQjs7Ozs7a0NBQ0EsTUFBTTtBQUNuQixnQkFBSSxXQUFXLEtBQUssSUFBTCxDQURJO0FBRW5CLG1CQUNJLGFBQWEsbUJBQU8sVUFBUCxJQUNiLGFBQWEsbUJBQU8sYUFBUCxJQUNiLGFBQWEsbUJBQU8sWUFBUCxJQUNiLGFBQWEsbUJBQU8sYUFBUCxJQUNiLGFBQWEsbUJBQU8sV0FBUCxJQUNiLGFBQWEsbUJBQU8saUJBQVAsQ0FSRTs7OztBQVl2QixhQWJpQixjQWFqQixDQUFZLFdBQVosRUFBeUIsUUFBekIsRUFBbUM7OEJBYmxCLGdCQWFrQjs7MkVBYmxCLDRCQWFrQjs7QUFFL0IsY0FBSyxXQUFMLEdBQW1CLFdBQW5CLENBRitCO0FBRy9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XMuXG4gICAgICAgIG5vZGUuYXJndW1lbnRzLmZvckVhY2goYSA9PiB7IHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChhKTsgfSk7XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5jYWxsZWUpO1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== diff --git a/tools/eslint/node_modules/escope/lib/reference.js b/tools/eslint/node_modules/escope/lib/reference.js index 6b1d60a2cd789a..590d356ce644f2 100644 --- a/tools/eslint/node_modules/escope/lib/reference.js +++ b/tools/eslint/node_modules/escope/lib/reference.js @@ -1,11 +1,11 @@ "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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /* @@ -99,6 +99,7 @@ var Reference = function () { * @return {boolean} */ + _createClass(Reference, [{ key: "isStatic", value: function isStatic() { @@ -174,6 +175,7 @@ var Reference = function () { * @private */ + exports.default = Reference; Reference.READ = READ; /** @@ -188,4 +190,4 @@ Reference.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ICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciB0aGUgUmVmZXJlbmNlIGlzIHRvIHdyaXRlIG9mIGluaXRpYWxpemF0aW9uLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI2luaXRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5pbml0ID0gaW5pdDtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG1heWJlSW1wbGljaXRHbG9iYWw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHN0YXRpYy5cbiAgICAgKiBAbWV0aG9kIFJlZmVyZW5jZSNpc1N0YXRpY1xuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNTdGF0aWMoKSB7XG4gICAgICAgIHJldHVybiAhdGhpcy50YWludGVkICYmIHRoaXMucmVzb2x2ZWQgJiYgdGhpcy5yZXNvbHZlZC5zY29wZS5pc1N0YXRpYygpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyB3cml0ZWFibGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNXcml0ZSgpIHtcbiAgICAgICAgcmV0dXJuICEhKHRoaXMuZmxhZyAmIFJlZmVyZW5jZS5XUklURSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWRhYmxlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkKCkge1xuICAgICAgICByZXR1cm4gISEodGhpcy5mbGFnICYgU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iAqL1xuUmVmZXJlbmNlLlJXID0gUlc7XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= diff --git a/tools/eslint/node_modules/escope/lib/referencer.js b/tools/eslint/node_modules/escope/lib/referencer.js index 4620007006f096..ae401615568b02 100644 --- a/tools/eslint/node_modules/escope/lib/referencer.js +++ b/tools/eslint/node_modules/escope/lib/referencer.js @@ -1,11 +1,11 @@ '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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _estraverse = require('estraverse'); var _esrecurse = require('esrecurse'); @@ -38,16 +38,16 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen 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 @@ -60,9 +60,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -function traverseIdentifierInPattern(rootPattern, referencer, callback) { + +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { // Call the callback at left hand identifier nodes, and Collect right hand nodes. - var visitor = new _patternVisitor2.default(rootPattern, callback); + var visitor = new _patternVisitor2.default(options, rootPattern, callback); visitor.visit(rootPattern); // Process the right hand nodes recursively. @@ -83,7 +84,7 @@ var Importer = function (_esrecurse$Visitor) { function Importer(declaration, referencer) { _classCallCheck(this, Importer); - var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Importer).call(this)); + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Importer).call(this, null, referencer.options)); _this.declaration = declaration; _this.referencer = referencer; @@ -130,14 +131,16 @@ var Importer = function (_esrecurse$Visitor) { // Referencing variables and creating bindings. + var Referencer = function (_esrecurse$Visitor2) { _inherits(Referencer, _esrecurse$Visitor2); - function Referencer(scopeManager) { + function Referencer(options, scopeManager) { _classCallCheck(this, Referencer); - var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Referencer).call(this)); + var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Referencer).call(this, null, options)); + _this3.options = options; _this3.scopeManager = scopeManager; _this3.parent = null; _this3.isInnerMethodDefinition = false; @@ -205,7 +208,7 @@ var Referencer = function (_esrecurse$Visitor2) { callback = options; options = { processRightHandNodes: false }; } - traverseIdentifierInPattern(node, options.processRightHandNodes ? this : null, callback); + traverseIdentifierInPattern(this.options, node, options.processRightHandNodes ? this : null, callback); } }, { key: 'visitFunction', @@ -619,6 +622,11 @@ var Referencer = function (_esrecurse$Visitor2) { var local = node.id || node.local; this.visit(local); } + }, { + key: 'MetaProperty', + value: function MetaProperty() { + // do nothing. + } }]); return Referencer; @@ -626,5 +634,6 @@ var Referencer = function (_esrecurse$Visitor2) { /* vim: set sw=4 ts=4 et tw=80 : */ + exports.default = Referencer; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUErQkEsU0FBUywyQkFBVCxDQUFxQyxXQUFyQyxFQUFrRCxVQUFsRCxFQUE4RCxRQUE5RCxFQUF3RTs7QUFFcEUsUUFBSSxVQUFVLDZCQUFtQixXQUFuQixFQUFnQyxRQUFoQyxDQUFWLENBRmdFO0FBR3BFLFlBQVEsS0FBUixDQUFjLFdBQWQ7OztBQUhvRSxRQU1oRSxjQUFjLElBQWQsRUFBb0I7QUFDcEIsZ0JBQVEsY0FBUixDQUF1QixPQUF2QixDQUErQixXQUFXLEtBQVgsRUFBa0IsVUFBakQsRUFEb0I7S0FBeEI7Q0FOSjs7Ozs7Ozs7SUFpQk07OztBQUNGLGFBREUsUUFDRixDQUFZLFdBQVosRUFBeUIsVUFBekIsRUFBcUM7OEJBRG5DLFVBQ21DOzsyRUFEbkMsc0JBQ21DOztBQUVqQyxjQUFLLFdBQUwsR0FBbUIsV0FBbkIsQ0FGaUM7QUFHakMsY0FBSyxVQUFMLEdBQWtCLFVBQWxCLENBSGlDOztLQUFyQzs7aUJBREU7O29DQU9VLEl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Edsb2JhbCwgaW5pdCkge1xuICAgICAgICBjb25zdCBzY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGFzc2lnbm1lbnRzLmZvckVhY2goYXNzaWdubWVudCA9PiB7XG4gICAgICAgICAgICBzY29wZS5fX3JlZmVyZW5jaW5nKFxuICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgUmVmZXJlbmNlLldSSVRFLFxuICAgICAgICAgICAgICAgIGFzc2lnbm1lbnQucmlnaHQsXG4gICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuICE9PSBhc3NpZ25tZW50LmxlZnQsXG4gICAgICAgICAgICAgICAgaW5pdCk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHZpc2l0UGF0dGVybihub2RlLCBvcHRpb25zLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gb3B0aW9ucztcbiAgICAgICAgICAgIG9wdGlvbnMgPSB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiBmYWxzZX1cbiAgICAgICAgfVxuICAgICAgICB0cmF2ZXJzZUlkZW50aWZpZXJJblBhdHRlcm4oXG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgb3B0aW9ucy5wcm9jZXNzUmlnaHRIYW5kTm9kZXMgPyB0aGlzIDogbnVsbCxcbiAgICAgICAgICAgIGNhbGxiYWNrKTtcbiAgICB9XG5cbiAgICB2aXNpdEZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuICAgICAgICAvLyBGdW5jdGlvbkRlY2xhcmF0aW9uIG5hbWUgaXMgZGVmaW5lZCBpbiB1cHBlciBzY29wZVxuICAgICAgICAvLyBOT1RFOiBOb3QgcmVmZXJyaW5nIHZhcmlhYmxlU2NvcGUuIEl0IGlzIGludGVuZGVkLlxuICAgICAgICAvLyBTaW5jZVxuICAgICAgICAvLyAgaW4gRVM1LCBGdW5jdGlvbkRlY2xhcmF0aW9uIHNob3VsZCBiZSBpbiBGdW5jdGlvbkJvZHkuXG4gICAgICAgIC8vICBpbiBFUzYsIEZ1bmN0aW9uRGVjbGFyYXRpb24gc2hvdWxkIGJlIGJsb2NrIHNjb3BlZC5cbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkZ1bmN0aW9uRGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIC8vIGlkIGlzIGRlZmluZWQgaW4gdXBwZXIgc2NvcGVcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5GdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbiB3aXRoIG5hbWUgY3JlYXRlcyBpdHMgc3BlY2lhbCBzY29wZTtcbiAgICAgICAgLy8gRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlLlxuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguRnVuY3Rpb25FeHByZXNzaW9uICYmIG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2R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XR0ZXJuKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnUmVzdEVsZW1lbnQnLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50OiBub2RlLnJlc3RcbiAgICAgICAgICAgIH0sIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2tpcCBCbG9ja1N0YXRlbWVudCB0byBwcmV2ZW50IGNyZWF0aW5nIEJsb2NrU3RhdGVtZW50IHNjb3BlLlxuICAgICAgICBpZiAobm9kZS5ib2R5LnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUuYm9keSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIHZpc2l0Q2xhc3Mobm9kZSkge1xuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguQ2xhc3NEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRklYTUU6IE1heWJlIGNvbnNpZGVyIFREWi5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnN1cGVyQ2xhc3MpO1xuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENsYXNzU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdFByb3BlcnR5KG5vZGUpIHtcbiAgICAgICAgdmFyIHByZXZpb3VzLCBpc01ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzTWV0aG9kRGVmaW5pdGlvbiA9IG5vZGUudHlwZSA9PT0gU3ludGF4Lk1ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHByZXZpb3VzID0gdGhpcy5wdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS52YWx1ZSk7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMucG9wSW5uZXJNZXRob2REZWZpbml0aW9uKHByZXZpb3VzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZpc2l0Rm9ySW4obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUubGVmdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5tYXRlcmlhbGl6ZVREWlNjb3BlKG5vZGUucmlnaHQsIG5vZGUpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZS5yaWdodCk7XG5cbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5ib2R5KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgdHlwZSwgbm9kZSwgaW5kZXgsIGZyb21URFopIHtcbiAgICAgICAgLy8gSWYgdGhpcyB3YXMgY2FsbGVkIHRvIGluaXRpYWxpemUgYSBURFogc2NvcGUsIHRoaXMgbmVlZHMgdG8gbWFrZSBkZWZpbml0aW9ucywgYnV0IGRvZXNuJ3QgbWFrZSByZWZlcmVuY2VzLlxuICAgICAgICB2YXIgZGVjbCwgaW5pdDtcblxuICAgICAgICBkZWNsID0gbm9kZS5kZWNsYXJhdGlvbnNbaW5kZXhdO1xuICAgICAgICBpbml0ID0gZGVjbC5pbml0O1xuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihkZWNsLmlkLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiAhZnJvbVREWn0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB2YXJpYWJsZVRhcmdldFNjb3BlLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIGRlY2wsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgICAgICAgICBub2RlLmtpbmRcbiAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgaWYgKCFmcm9tVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbml0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgaW5pdCwgbnVsbCwgIWluZm8udG9wTGV2ZWwsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBBc3NpZ25tZW50RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIGlmIChQYXR0ZXJuVmlzaXRvci5pc1BhdHRlcm4obm9kZS5sZWZ0KSkge1xuICAgICAgICAgICAgaWYgKG5vZGUub3BlcmF0b3IgPT09ICc9Jykge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtYXliZUltcGxpY2l0R2xvYmFsID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXliZUltcGxpY2l0R2xvYmFsID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm46IHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogbm9kZVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG1heWJlSW1wbGljaXRHbG9iYWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgIWluZm8udG9wTGV2ZWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUubGVmdCwgUmVmZXJlbmNlLlJXLCBub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgIH1cblxuICAgIENhdGNoQ2xhdXNlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Q2F0Y2hTY29wZShub2RlKTtcblxuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2F0Y2hDbGF1c2UsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW0sXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgIH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jZXI7XG4gICAgfVxuXG4gICAgdmlzaXRJbXBvcnQoaWQsIHNwZWNpZmllcikge1xuICAgICAgICB0aGlzLnJlZmVyZW5jZXIudmlzaXRQYXR0ZXJuKGlkLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2VyLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkltcG9ydEJpbmRpbmcsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcixcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIGlmIChsb2NhbCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBJbXBvcnREZWZhdWx0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIHRoaXMudmlzaXRJbXBvcnQobG9jYWwsIG5vZGUpO1xuICAgIH1cblxuICAgIEltcG9ydFNwZWNpZmllcihub2RlKSB7XG4gICAgICAgIGxldCBsb2NhbCA9IChub2RlLmxvY2FsIHx8IG5vZGUuaWQpO1xuICAgICAgICBpZiAobm9kZS5uYW1lKSB7XG4gICAgICAgICAgICB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sO1xuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGb3JTY29wZShub2RlKTtcbiAgICAgICAgbGV0T3JDb25zdERlY2wgPSBub2RlLmxlZnQ7XG4gICAgICAgIHRoaXMudmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHRoaXMuY3VycmVudFNjb3BlKCksIFZhcmlhYmxlLlZhcmlhYmxlLCBsZXRPckNvbnN0RGVjbCwgMCk7XG4gICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKGxldE9yQ29uc3REZWNsLmRlY2xhcmF0aW9uc1swXS5pZCwgKHBhdHRlcm4pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBhc3NpZ25tZW50cywgbWF5YmVJbXBsaWNpdEdsb2JhbCwgaW5pdCkge1xuICAgICAgICBjb25zdCBzY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGFzc2lnbm1lbnRzLmZvckVhY2goYXNzaWdubWVudCA9PiB7XG4gICAgICAgICAgICBzY29wZS5fX3JlZmVyZW5jaW5nKFxuICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgUmVmZXJlbmNlLldSSVRFLFxuICAgICAgICAgICAgICAgIGFzc2lnbm1lbnQucmlnaHQsXG4gICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuICE9PSBhc3NpZ25tZW50LmxlZnQsXG4gICAgICAgICAgICAgICAgaW5pdCk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHZpc2l0UGF0dGVybihub2RlLCBvcH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gICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5GdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbiB3aXRoIG5hbWUgY3JlYXRlcyBpdHMgc3BlY2lhbCBzY29wZTtcbiAgICAgICAgLy8gRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlLlxuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguRnVuY3Rpb25FeHByZXNzaW9uICYmIG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENvbnNpZGVyIHRoaXMgZnVuY3Rpb24gaXMgaW4gdGhlIE1ldGhvZERlZmluaXRpb24uXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgdGhpcy5pc0lubmVyTWV0aG9kRGVmaW5pdGlvbik7XG5cbiAgICAgICAgLy8gUHJvY2VzcyBwYXJhbWV0ZXIgZGVjbGFyYXRpb25zLlxuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IG5vZGUucGFyYW1zLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUucGFyYW1zW2ldLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBQYXJhbWV0ZXJEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5yZXN0XG4gICAgICAgICAgICAgICAgICAgICkpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgdGhlcmUncyBhIHJlc3QgYXJndW1lbnQsIGFkZCB0aGF0XG4gICAgICAgIGlmIChub2RlLnJlc3QpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnUmVzdEVsZW1lbnQnLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50OiBub2RlLnJlc3RcbiAgICAgICAgICAgIH0sIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2tpcCBCbG9ja1N0YXRlbWVudCB0byBwcmV2ZW50IGNyZWF0aW5nIEJsb2NrU3RhdGVtZW50IHNjb3BlLlxuICAgICAgICBpZiAobm9kZS5ib2R5LnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUuYm9keSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIHZpc2l0Q2xhc3Mobm9kZSkge1xuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguQ2xhc3NEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRklYTUU6IE1heWJlIGNvbnNpZGVyIFREWi5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnN1cGVyQ2xhc3MpO1xuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENsYXNzU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdFByb3BlcnR5KG5vZGUpIHtcbiAgICAgICAgdmFyIHByZXZpb3VzLCBpc01ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzTWV0aG9kRGVmaW5pdGlvbiA9IG5vZGUudHlwZSA9PT0gU3ludGF4Lk1ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHByZXZpb3VzID0gdGhpcy5wdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS52YWx1ZSk7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMucG9wSW5uZXJNZXRob2REZWZpbml0aW9uKHByZXZpb3VzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZpc2l0Rm9ySW4obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUubGVmdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5tYXRlcmlhbGl6ZVREWlNjb3BlKG5vZGUucmlnaHQsIG5vZGUpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZS5yaWdodCk7XG5cbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5ib2R5KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgdHlwZSwgbm9kZSwgaW5kZXgsIGZyb21URFopIHtcbiAgICAgICAgLy8gSWYgdGhpcyB3YXMgY2FsbGVkIHRvIGluaXRpYWxpemUgYSBURFogc2NvcGUsIHRoaXMgbmVlZHMgdG8gbWFrZSBkZWZpbml0aW9ucywgYnV0IGRvZXNuJ3QgbWFrZSByZWZlcmVuY2VzLlxuICAgICAgICB2YXIgZGVjbCwgaW5pdDtcblxuICAgICAgICBkZWNsID0gbm9kZS5kZWNsYXJhdGlvbnNbaW5kZXhdO1xuICAgICAgICBpbml0ID0gZGVjbC5pbml0O1xuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihkZWNsLmlkLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiAhZnJvbVREWn0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB2YXJpYWJsZVRhcmdldFNjb3BlLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIGRlY2wsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgICAgICAgICBub2RlLmtpbmRcbiAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgaWYgKCFmcm9tVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbml0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgaW5pdCwgbnVsbCwgIWluZm8udG9wTGV2ZWwsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBBc3NpZ25tZW50RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIGlmIChQYXR0ZXJuVmlzaXRvci5pc1BhdHRlcm4obm9kZS5sZWZ0KSkge1xuICAgICAgICAgICAgaWYgKG5vZGUub3BlcmF0b3IgPT09ICc9Jykge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtYXliZUltcGxpY2l0R2xvYmFsID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXliZUltcGxpY2l0R2xvYmFsID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm46IHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogbm9kZVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG1heWJlSW1wbGljaXRHbG9iYWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgIWluZm8udG9wTGV2ZWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUubGVmdCwgUmVmZXJlbmNlLlJXLCBub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgIH1cblxuICAgIENhdGNoQ2xhdXNlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Q2F0Y2hTY29wZShub2RlKTtcblxuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2F0Y2hDbGF1c2UsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW0sXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBQcm9ncmFtKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0R2xvYmFsU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKHRoaXMuc2NvcGVNYW5hZ2VyLl9faXNOb2RlanNTY29wZSgpKSB7XG4gICAgICAgICAgICAvLyBGb3JjZSBzdHJpY3RuZXNzIG9mIEdsb2JhbFNjb3BlIHRvIGZhbHNlIHdoZW4gdXNpbmcgbm9kZS5qcyBzY29wZS5cbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuaXNTdHJpY3QgPSBmYWxzZTtcbiAgICAgICAgICA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GFQcm9wZXJ0eSgpIHtcbiAgICAgICAgLy8gZG8gbm90aGluZy5cbiAgICB9XG59XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= diff --git a/tools/eslint/node_modules/escope/lib/scope-manager.js b/tools/eslint/node_modules/escope/lib/scope-manager.js index 6e85372a540d47..66b37c94f737a2 100644 --- a/tools/eslint/node_modules/escope/lib/scope-manager.js +++ b/tools/eslint/node_modules/escope/lib/scope-manager.js @@ -1,17 +1,21 @@ 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* 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 @@ -24,10 +28,6 @@ var _createClass = function () { function defineProperties(target, props) { for THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -Object.defineProperty(exports, "__esModule", { - value: true -}); - var _es6WeakMap = require('es6-weak-map'); var _es6WeakMap2 = _interopRequireDefault(_es6WeakMap); @@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gZGVmYXVsdCB2YWx1ZSBpcyBmYWxzZS5cbiAgICAgKiBAcmV0dXJuIHtTY29wZT99XG4gICAgICovXG4gICAgYWNxdWlyZShub2RlLCBpbm5lcikge1xuICAgICAgICB2YXIgc2NvcGVzLCBzY29wZSwgaSwgaXo7XG5cbiAgICAgICAgZnVuY3Rpb24gcHJlZGljYXRlKHNjb3BlKSB7XG4gICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gJ2Z1bmN0aW9uJyAmJiBzY29wZS5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChzY29wZS50eXBlID09PSAnVERaJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgc2NvcGVzID0gdGhpcy5fX2dldChub2RlKTtcbiAgICAgICAgaWYgKCFzY29wZXMgfHwgc2NvcGVzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBIZXVyaXN0aWMgc2VsZWN0aW9uIGZyb20gYWxsIHNjb3Blcy5cbiAgICAgICAgLy8gSWYgeW91IHdvdWxkIGxpa2UgdG8gZ2V0IGFsbCBzY29wZXMsIHBsZWFzZSB1c2UgU2NvcGVNYW5hZ2VyI2FjcXVpcmVBbGwuXG4gICAgICAgIGlmIChzY29wZXMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICByZXR1cm4gc2NvcGVzWzBdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlubmVyKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSBzY29wZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgICAgICAgICBzY29wZSA9IHNjb3Blc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocHJlZGljYXRlKHNjb3BlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm9yIChpID0gMCwgaXogPSBzY29wZXMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgICAgIHNjb3BlID0gc2NvcGVzW2ldO1xuICAgICAgICAgICAgICAgIGlmIChwcmVkaWNhdGUoc2NvcGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY29wZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBhY3F1aXJlIGFsbCBzY29wZXMgZnJvbSBub2RlLlxuICAgICAqIEBtZXRob2QgU2NvcGVNYW5hZ2VyI2FjcXVpcmVBbGxcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuTm9kZX0gbm9kZSAtIG5vZGUgZm9yIHRoZSBhY3F1aXJlZCBzY29wZS5cbiAgICAgKiBAcmV0dXJuIHtTY29wZVtdP31cbiAgICAgKi9cbiAgICBhY3F1aXJlQWxsKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19nZXQobm9kZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogcmVsZWFzZSB0aGUgbm9kZS5cbiAgICAgKiBAbWV0aG9kIFNjb3BlTWFuYWdlciNyZWxlYXNlXG4gICAgICogQHBhcmFtIHtFc3ByaW1hLk5vZGV9IG5vZGUgLSByZWxlYXNpbmcgbm9kZS5cbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW49fSBpbm5lciAtIGxvb2sgdXAgdGhlIG1vc3QgaW5uZXIgc2NvcGUsIGRlZmF1bHQgdmFsdWUgaXMgZmFsc2UuXG4gICAgICogQHJldHVybiB7U2NvcGU/fSB1cHBlciBzY29wZSBmb3IgdGhlIG5vZGUuXG4gICAgICovXG4gICAgcmVsZWFzZShub2RlLCBpbm5lcikge1xuICAgICAgICB2YXIgc2NvcGVzLCBzY29wZTtcbiAgICAgICAgc2NvcGVzID0gdGhpcy5fX2dldChub2RlKTtcbiAgICAgICAgaWYgKHNjb3BlcyAmJiBzY29wZXMubGVuZ3RoKSB7XG4gICAgICAgICAgICBzY29wZSA9IHNjb3Blc1swXS51cHBlcjtcbiAgICAgICAgICAgIGlmICghc2NvcGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLmFjcXVpcmUoc2NvcGUuYmxvY2ssIGlubmVyKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBhdHRhY2goKSB7IH1cblxuICAgIGRldGFjaCgpIHsgfVxuXG4gICAgX19uZXN0U2NvcGUoc2NvcGUpIHtcbiAgICAgICAgaWYgKHNjb3BlIGluc3RhbmNlb2YgR2xvYmFsU2NvcGUpIHtcbiAgICAgICAgICAgIGFzc2VydCh0aGlzLl9fY3VycmVudFNjb3BlID09PSBudWxsKTtcbiAgICAgICAgICAgIHRoaXMuZ2xvYmFsU2NvcGUgPSBzY29wZTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fY3VycmVudFNjb3BlID0gc2NvcGU7XG4gICAgICAgIHJldHVybiBzY29wZTtcbiAgICB9XG5cbiAgICBfX25lc3RHbG9iYWxTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBHbG9iYWxTY29wZSh0aGlzLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0QmxvY2tTY29wZShub2RlLCBpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRoaX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AgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlcyA9IHRoaXMuX19nZXQobm9kZSk7XG4gICAgICAgIGlmICghc2NvcGVzIHx8IHNjb3Blcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSGV1cmlzdGljIHNlbGVjdGlvbiBmcm9tIGFsbCBzY29wZXMuXG4gICAgICAgIC8vIElmIHlvdSB3b3VsZCBsaWtlIHRvIGdldCBhbGwgc2NvcGVzLCBwbGVhc2UgdXNlIFNjb3BlTWFuYWdlciNhY3F1aXJlQWxsLlxuICAgICAgICBpZiAoc2NvcGVzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIHNjb3Blc1swXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbm5lcikge1xuICAgICAgICAgICAgZm9yIChpID0gc2NvcGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUgPSBzY29wZXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHByZWRpY2F0ZShzY29wZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGl6ID0gc2NvcGVzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgICAgICBzY29wZSA9IHNjb3Blc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocHJlZGljYXRlKHNjb3BlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgIC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aGlzLl9fbmVzdFNjb3BlKG5ldyBGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9faXNFUzYoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5lY21hVmVyc2lvbiA+PSA2O1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== diff --git a/tools/eslint/node_modules/escope/lib/scope.js b/tools/eslint/node_modules/escope/lib/scope.js index a9b3b897d87db1..88ded9c82760f3 100644 --- a/tools/eslint/node_modules/escope/lib/scope.js +++ b/tools/eslint/node_modules/escope/lib/scope.js @@ -1,19 +1,24 @@ 'use strict'; +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) { 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 @@ -26,11 +31,6 @@ var _createClass = function () { function defineProperties(target, props) { for THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -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 _estraverse = require('estraverse'); var _es6Map = require('es6-map'); @@ -550,8 +550,8 @@ var GlobalScope = exports.GlobalScope = function (_Scope) { } // create an implicit global variable from assignment expression - for (var i = 0, iz = implicit.length; i < iz; ++i) { - var info = implicit[i]; + 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)); } @@ -761,4 +761,4 @@ var ClassScope = exports.ClassScope = function (_Scope11) { }(Scope); /* vim: set sw=4 ts=4 et tw=80 : */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWdDQSxTQUFTLGFBQVQsQ0FBdUIsS0F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ICdjbGFzcycgfHwgc2NvcGUudHlwZSA9PT0gJ21vZHVsZScpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdibG9jaycgfHwgc2NvcGUudHlwZSA9PT0gJ3N3aXRjaCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGlmIChibG9jay50eXBlID09PSBTeW50YXguUHJvZ3JhbSkge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrLmJvZHk7XG4gICAgICAgIH1cbiAgICB9IGVsc2UgaWYgKHNjb3BlLnR5cGUgPT09ICdnbG9iYWwnKSB7XG4gICAgICAgIGJvZHkgPSBibG9jaztcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2VhcmNoICd1c2Ugc3RyaWN0JyBkaXJlY3RpdmUuXG4gICAgaWYgKHVzZURpcmVjdGl2ZSkge1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IGJvZHkuYm9keS5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBzdG10ID0gYm9keS5ib2R5W2ldO1xuICAgICAgICAgICAgaWYgKHN0bXQudHlwZSAhPT0gU3ludGF4LkRpcmVjdGl2ZVN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gcmVnaXN0ZXJTY29wZShzY29wZU1hbmFnZXIsIHNjb3BlKSB7XG4gICAgdmFyIHNjb3BlcztcblxuICAgIHNjb3BlTWFuYWdlci5zY29wZXMucHVzaChzY29wZSk7XG5cbiAgICBzY29wZXMgPSBzY29wZU1hbmFnZXIuX19ub2RlVG9TY29wZS5nZXQ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ZSA9PT0gJ21vZHVsZScpID8gdGhpcyA6IHVwcGVyU2NvcGUudmFyaWFibGVTY29wZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgc2NvcGUgaXMgY3JlYXRlZCBieSBhIEZ1bmN0aW9uRXhwcmVzc2lvbi5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gU2NvcGUjZnVuY3Rpb25FeHByZXNzaW9uU2NvcGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgYSBzY29wZSB0aGF0IGNvbnRhaW5zIGFuICdldmFsKCknIGludm9jYXRpb24uXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2RpcmVjdENhbGxUb0V2YWxTY29wZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5kaXJlY3RDYWxsVG9FdmFsU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSN0aGlzRm91bmRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhpc0ZvdW5kID0gZmFsc2U7XG5cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBbXTtcblxuICAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcGFyZW50IHtAbGluayBTY29wZXxzY29wZX0uXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN1cHBlclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy51cHBlciA9IHVwcGVyU2NvcGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogV2hldGhlciAndXNlIHN0cmljdCcgaXMgaW4gZWZmZWN0IGluIHRoaXMgc2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge2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obmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fYWRkRGVjbGFyZWRWYXJpYWJsZXNPZk5vZGUodmFyaWFibGUsIG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHZhcmlhYmxlcyA9IHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcy5nZXQobm9kZSk7XG4gICAgICAgIGlmICh2YXJpYWJsZXMgPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyaWFibGVzID0gW107XG4gICAgICAgICAgICB0aGlzLl9fZGVjbGFyZWRWYXJpYWJsZXMuc2V0KG5vZGUsIHZhcmlhYmxlcyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZhcmlhYmxlcy5pbmRleE9mKHZhcmlhYmxlKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlcy5wdXNoKHZhcmlhYmxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgICAgIGlmIChkZWYudHlwZSAhPT0gVmFyaWFibGUuVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYubm9kZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYucGFyZW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsLCBpbml0KSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmRsZSBsaWtlIGB0aGlzYC5cbiAgICAgICAgaWYgKG5vZGUubmFtZSA9PT0gJ3N1cGVyJykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHJlZiA9IG5ldyBSZWZlcmVuY2Uobm9kZSwgdGhpcywgYXNzaWduIHx8IFJlZmVyZW5jZS5SRUFELCB3cml0ZUV4cHIsIG1heWJlSW1wbGljaXRHbG9iYWwsICEhcGFydGlhbCwgISFpbml0KTtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgdGhpcy5fX2xlZnQucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGV0ZWN0RXZhbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnQ7XG4gICAgICAgIGN1cnJlbnQgPSB0aGlzO1xuICAgICAgICB0aGlzLmRpcmVjdENhbGxUb0V2YWxTY29wZSA9I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7XG4gICAgICAgICAgICAgICAgaW1wbGljaXQucHVzaChyZWYuX19tYXliZUltcGxpY2l0R2xvYmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNyZWF0ZSBhbiBpbXBsaWNpdCBnbG9iYWwgdmFyaWFibGUgZnJvbSBhc3NpZ25tZW50IGV4cHJlc3Npb25cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gaW1wbGljaXQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IGluZm8gPSBpbXBsaWNpdFtpXTtcbiAgICAgICAgICAgIHRoaXMuX19kZWZpbmVJbXBsaWNpdChpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5pbXBsaWNpdC5sZWZ0ID0gdGhpcy5fX2xlZnQ7XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLl9fY2xvc2Uoc2NvcGVNYW5hZ2VyKTtcbiAgICB9XG5cbiAgICBfX2RlZmluZUltcGxpY2l0KG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmltcGxpY2l0LnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBNb2R1bGVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ21vZHVsZScsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5fX2RlZmluZShibG9jay5pZCxcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBibG9jay5pZCxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2ssXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgdGhpcy5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSA9IHRydWU7XG4gICAgfVxufVxu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gICAgICByZXR1cm4gdGhpcy50aGlzRm91bmQ7XG4gICAgfVxuXG4gICAgX19kZWZpbmVBcmd1bWVudHMoKSB7XG4gICAgICAgIHRoaXMuX19kZWZpbmVHZW5lcmljKFxuICAgICAgICAgICAgICAgICdhcmd1bWVudHMnLFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0LFxuICAgICAgICAgICAgICAgIHRoaXMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgbnVsbCk7XG4gICAgICAgIHRoaXMudGFpbnRzLnNldCgnYXJndW1lbnRzJywgdHJ1ZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRm9yU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmb3InLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIENsYXNzU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdjbGFzcycsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXdCQTs7QUFDQTs7OztBQUVBOzs7O0FBQ0E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24pIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdjbGFzcycgfHwgc2NvcGUudHlwZSA9PT0gJ21vZHVsZScpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdibG9jaycgfHwgc2NvcGUudHlwZSA9PT0gJ3N3aXRjaCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGlmIChibG9jay50eXBlID09PSBTeW50YXguUHJvZ3JhbSkge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrLmJvZHk7XG4gICAgICAgIH1cbiAgICB9IGVsc2UgaWYgKHNjb3BlLnR5cGUgPT09ICdnbG9iYWwnKSB7XG4gICAgICAgIGJvZHkgPSBibG9jaztcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2VhcmNoICd1c2Ugc3RyaWN0JyBkaXJlY3RpdmUuXG4gICAgaWYgKHVzZURpcmVjdGl2ZSkge1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IGJvZHkuYm9keS5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBzdG10ID0gYm9keS5ib2R5W2ldO1xuICAgICAgICAgICAgaWYgKHN0bXQudHlwZSAhPT0gU3ludGF4LkRpcmVjdGl2ZVN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gcmVnaXN0ZXJTY29wZShzY29wZU1hbmFnZXIsIHNjb3BlKSB7XG4gICAgdmFyIHNjb3BlcztcblxuICAgIHNjb3BlTWFuYWdlci5zY29wZX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udHlwZSA9PT0gJ2dsb2JhbCcgfHwgdGhpcy50eXBlID09PSAnZnVuY3Rpb24nIHx8IHRoaXMudHlwZSA9PT0gJ21vZHVsZScpID8gdGhpcyA6IHVwcGVyU2NvcGUudmFyaWFibGVTY29wZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgc2NvcGUgaXMgY3JlYXRlZCBieSBhIEZ1bmN0aW9uRXhwcmVzc2lvbi5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gU2NvcGUjZnVuY3Rpb25FeHByZXNzaW9uU2NvcGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgYSBzY29wZSB0aGF0IGNvbnRhaW5zIGFuICdldmFsKCknIGludm9jYXRpb24uXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2RpcmVjdENhbGxUb0V2YWxTY29wZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5kaXJlY3RDYWxsVG9FdmFsU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSN0aGlzRm91bmRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhpc0ZvdW5kID0gZmFsc2U7XG5cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBbXTtcblxuICAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcGFyZW50IHtAbGluayBTY29wZXxzY29wZX0uXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN1cHBlclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy51cHBlciA9IHVwcGVyU2NvcGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogV2hldGhlciAndXNl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gKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fYWRkRGVjbGFyZWRWYXJpYWJsZXNPZk5vZGUodmFyaWFibGUsIG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHZhcmlhYmxlcyA9IHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcy5nZXQobm9kZSk7XG4gICAgICAgIGlmICh2YXJpYWJsZXMgPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyaWFibGVzID0gW107XG4gICAgICAgICAgICB0aGlzLl9fZGVjbGFyZWRWYXJpYWJsZXMuc2V0KG5vZGUsIHZhcmlhYmxlcyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZhcmlhYmxlcy5pbmRleE9mKHZhcmlhYmxlKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlcy5wdXNoKHZhcmlhYmxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgICAgIGlmIChkZWYudHlwZSAhPT0gVmFyaWFibGUuVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYubm9kZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYucGFyZW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsLCBpbml0KSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmRsZSBsaWtlIGB0aGlzYC5cbiAgICAgICAgaWYgKG5vZGUubmFtZSA9PT0gJ3N1cGVyJykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHJlZiA9IG5ldyBSZWZlcmVuY2Uobm9kZSwgdGhpcywgYXNzaWduIHx8IFJlZmVyZW5jZS5SRUFELCB3cml0ZUV4cHIsIG1heWJlSW1wbGljaXRHbG9iYWwsICEhcGFydGlhbCwgISFpbml0KTtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgdGhpcy5fX2xlZnQucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGV0ZWN0RXZhbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnQ7XG4gIC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mVJbXBsaWNpdEdsb2JhbCAmJiAhdGhpcy5zZXQuaGFzKHJlZi5pZGVudGlmaWVyLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgaW1wbGljaXQucHVzaChyZWYuX19tYXliZUltcGxpY2l0R2xvYmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNyZWF0ZSBhbiBpbXBsaWNpdCBnbG9iYWwgdmFyaWFibGUgZnJvbSBhc3NpZ25tZW50IGV4cHJlc3Npb25cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gaW1wbGljaXQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IGluZm8gPSBpbXBsaWNpdFtpXTtcbiAgICAgICAgICAgIHRoaXMuX19kZWZpbmVJbXBsaWNpdChpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5pbXBsaWNpdC5sZWZ0ID0gdGhpcy5fX2xlZnQ7XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLl9fY2xvc2Uoc2NvcGVNYW5hZ2VyKTtcbiAgICB9XG5cbiAgICBfX2RlZmluZUltcGxpY2l0KG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmltcGxpY2l0LnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBNb2R1bGVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ21vZHVsZScsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5fX2RlZmluZShibG9jay5pZCxcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBibG9jay5pZCxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2ssXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAp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ghdGhpcy5pc1N0YXRpYygpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy50aGlzRm91bmQ7XG4gICAgfVxuXG4gICAgX19kZWZpbmVBcmd1bWVudHMoKSB7XG4gICAgICAgIHRoaXMuX19kZWZpbmVHZW5lcmljKFxuICAgICAgICAgICAgICAgICdhcmd1bWVudHMnLFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0LFxuICAgICAgICAgICAgICAgIHRoaXMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgbnVsbCk7XG4gICAgICAgIHRoaXMudGFpbnRzLnNldCgnYXJndW1lbnRzJywgdHJ1ZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRm9yU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmb3InLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIENsYXNzU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdjbGFzcycsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 diff --git a/tools/eslint/node_modules/escope/lib/variable.js b/tools/eslint/node_modules/escope/lib/variable.js index cafd5ce2f6a12e..2f972c2318000b 100644 --- a/tools/eslint/node_modules/escope/lib/variable.js +++ b/tools/eslint/node_modules/escope/lib/variable.js @@ -80,6 +80,7 @@ var Variable = function Variable(name, scope) { exports.default = Variable; + Variable.CatchClause = 'CatchClause'; Variable.Parameter = 'Parameter'; Variable.FunctionName = 'FunctionName'; @@ -90,4 +91,4 @@ Variable.TDZ = 'TDZ'; Variable.ImplicitGlobalVariable = 'ImplicitGlobalVariable'; /* vim: set sw=4 ts=4 et tw=80 : */ -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZhcmlhYmxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBNkJxQixXQUNqQixTQURpQixRQUNqQixDQUFZLElBQVosRUFBa0IsS0FBbEIsRUFBeUI7d0JBRFIsVUFDUTs7Ozs7O0FBS3JCLE9BQUssSUFBTCxHQUFZLElBQVo7Ozs7OztBQUxxQixNQVdyQixDQUFLLFdBQUwsR0FBbUIsRUFBbkI7Ozs7Ozs7QUFYcUIsTUFrQnJCLENBQUssVUFBTCxHQUFrQixFQUFsQjs7Ozs7OztBQWxCcUIsTUF5QnJCLENBQUssSUFBTCxHQUFZLEVBQVosQ0F6QnFCOztBQTJCckIsT0FBSyxPQUFMLEdBQWUsS0FBZjs7Ozs7QUEzQnFCLE1BZ0NyQixDQUFLLEtBQUwsR0FBYSxJQUFiOzs7OztBQWhDcUIsTUFxQ3JCLENBQUssS0FBTCxHQUFhLEtBQWIsQ0FyQ3FCO0NBQXpCOztrQkFEaUI7O0FBMENyQixTQUFTLFdBQVQsR0FBdUIsYUFBdkI7QUFDQSxTQUFTLFNBQVQsR0FBcUIsV0FBckI7QUFDQSxTQUFTLFlBQVQsR0FBd0IsY0FBeEI7QUFDQSxTQUFTLFNBQVQsR0FBcUIsV0FBckI7QUFDQSxTQUFTLFFBQVQsR0FBb0IsVUFBcEI7QUFDQSxTQUFTLGFBQVQsR0FBeUI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a/tools/eslint/node_modules/escope/package.json b/tools/eslint/node_modules/escope/package.json index 7fa28a7f6a782a..aaa6ddd9e4f7b0 100644 --- a/tools/eslint/node_modules/escope/package.json +++ b/tools/eslint/node_modules/escope/package.json @@ -1,45 +1,49 @@ { "_args": [ [ - "escope@^3.4.0", - "/Users/trott/test/node_modules/eslint" + "escope@^3.6.0", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "escope@>=3.4.0 <4.0.0", - "_id": "escope@3.4.0", + "_from": "escope@>=3.6.0 <4.0.0", + "_id": "escope@3.6.0", "_inCache": true, "_installable": true, - "_location": "/eslint/escope", - "_nodeVersion": "4.2.2", + "_location": "/escope", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/escope-3.6.0.tgz_1457720018969_0.025237560039386153" + }, "_npmUser": { - "email": "npm@michael.ficarra.me", - "name": "michaelficarra" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { "name": "escope", - "raw": "escope@^3.4.0", - "rawSpec": "^3.4.0", + "raw": "escope@^3.6.0", + "rawSpec": "^3.6.0", "scope": null, - "spec": ">=3.4.0 <4.0.0", + "spec": ">=3.6.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/escope/-/escope-3.4.0.tgz", - "_shasum": "488c646b682c313f0eb1a7350d39e8e4af5e6a69", + "_resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "_shasum": "e01975e812781a163a6dadfdd80398dc64c889c3", "_shrinkwrap": null, - "_spec": "escope@^3.4.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "escope@^3.6.0", + "_where": "/Users/trott/io.js/tools/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", + "esrecurse": "^4.1.0", "estraverse": "^4.1.1" }, "description": "ECMAScript scope analyzer", @@ -49,7 +53,7 @@ "babel-register": "^6.3.13", "browserify": "^13.0.0", "chai": "^3.4.1", - "espree": "^2.2.5", + "espree": "^3.1.1", "esprima": "^2.7.1", "gulp": "^3.9.0", "gulp-babel": "^6.1.1", @@ -68,13 +72,13 @@ }, "directories": {}, "dist": { - "shasum": "488c646b682c313f0eb1a7350d39e8e4af5e6a69", - "tarball": "http://registry.npmjs.org/escope/-/escope-3.4.0.tgz" + "shasum": "e01975e812781a163a6dadfdd80398dc64c889c3", + "tarball": "http://registry.npmjs.org/escope/-/escope-3.6.0.tgz" }, "engines": { "node": ">=0.4.0" }, - "gitHead": "69145ebb4b7ebda6ca87d6235491c26447d5c82a", + "gitHead": "aa35861faa76a09f01203dee3497a939d70b463c", "homepage": "http://github.com/estools/escope", "license": "BSD-2-Clause", "main": "lib/index.js", @@ -105,5 +109,5 @@ "test": "gulp travis", "unit-test": "gulp test" }, - "version": "3.4.0" + "version": "3.6.0" } diff --git a/tools/eslint/node_modules/escope/powered-test/arguments.js b/tools/eslint/node_modules/escope/powered-test/arguments.js new file mode 100644 index 00000000000000..5b841062a74e70 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/arguments.js @@ -0,0 +1,34 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('arguments', function() { + return it('arguments are correctly materialized', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("(function () {\n arguments;\n}());"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["true"]; + expect(scope.references).to.have.length(1); + return expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFyZ3VtZW50cy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSxnQ0FBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsU0FBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRlYsQ0FBQTs7QUFBQSxFQUdBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhULENBQUE7O0FBQUEsRUFLQSxRQUFBLENBQVUsV0FBVixFQUFzQixTQUFBLEdBQUE7V0FDbEIsRUFBQSxDQUFJLHNDQUFKLEVBQTJDLFNBQUEsR0FBQTtBQUN2QyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsdUNBQWpCLENBQU4sQ0FBQTtBQUFBLE1BTUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQU5mLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUEEsQ0FBQTtBQUFBLE1BUUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVJsQyxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQ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RvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/catch-scope.js b/tools/eslint/node_modules/escope/powered-test/catch-scope.js new file mode 100644 index 00000000000000..34fa16526d4212 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/catch-scope.js @@ -0,0 +1,39 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('catch', function() { + return it('creates scope', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("(function () {\n try {\n } catch (e) {\n }\n}());"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(3); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["false"]; + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('catch'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('e'); + expect(scope.isArgumentsMaterialized()).to.be["true"]; + return expect(scope.references).to.have.length(0); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhdGNoLXNjb3BlLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtXQUNkLEVBQUEsQ0FBSSxlQUFKLEVBQW9CLFNBQUEsR0FBQTtBQUNoQixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsNERBQWpCLENBQU4sQ0FBQTtBQUFBLE1BUUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQVJmLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBVEEsQ0FBQTtBQUFBLE1BVUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVZsQyxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixD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4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js b/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js new file mode 100644 index 00000000000000..cf616c19f3b082 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js @@ -0,0 +1,57 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 arrow function expression', function() { + it('materialize scope for arrow function expression', function() { + var ast, scope, scopeManager; + ast = harmony.parse("var arrow = () => {\n let i = 0;\n var j = 20;\n console.log(i);\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(1); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('ArrowFunctionExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('i'); + return expect(scope.variables[1].name).to.be.equal('j'); + }); + return it('generate bindings for parameters', function() { + var ast, scope, scopeManager; + ast = harmony.parse("var arrow = (a, b, c, d) => {\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(1); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('ArrowFunctionExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('a'); + expect(scope.variables[1].name).to.be.equal('b'); + expect(scope.variables[2].name).to.be.equal('c'); + return expect(scope.variables[3].name).to.be.equal('d'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1hcnJvdy1mdW5jdGlvbi1leHByZXNzaW9uLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLHVCQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FGVCxDQUFBOztBQUFBLEVBSUEsUUFBQSxDQUFVLCtCQUFWLEVBQTBDLFNBQUEsR0FBQTtBQUN0QyxJQUFBLEVBQUEsQ0FBSSxpREFBSixFQUFzRCxTQUFBLEdBQUE7QUFDbEQsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDhFQUFqQixDQUFOLENBQUE7QUFBQSxNQVFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMs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leHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzNdLm5hbWUpLnRvLmJlLmVxdWFsICdkJ1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js b/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js new file mode 100644 index 00000000000000..89c68775846f61 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js @@ -0,0 +1,136 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 block scope', function() { + it('let is materialized in ES6 block scope#1', function() { + var ast, scope, scopeManager; + ast = harmony.parse("{\n let i = 20;\n i;\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('i'); + return expect(scope.references[1].identifier.name).to.be.equal('i'); + }); + it('let is materialized in ES6 block scope#2', function() { + var ast, scope, scopeManager; + ast = harmony.parse("{\n let i = 20;\n var i = 20;\n i;\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.references).to.have.length(3); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[1].identifier.name).to.be.equal('i'); + return expect(scope.references[2].identifier.name).to.be.equal('i'); + }); + it('function delaration is materialized in ES6 block scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("{\n function test() {\n }\n test();\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('test'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('test'); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + it('let is not hoistable#1', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("var i = 42; (1)\n{\n i; // (2) ReferenceError at runtime.\n let i = 20; // (2)\n i; // (2)\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(1); + expect(globalScope.variables[0].name).to.be.equal('i'); + expect(globalScope.references).to.have.length(1); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.references).to.have.length(3); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + expect(scope.references[1].resolved).to.be.equal(scope.variables[0]); + return expect(scope.references[2].resolved).to.be.equal(scope.variables[0]); + }); + return it('let is not hoistable#2', function() { + var ast, globalScope, scope, scopeManager, v1, v2, v3; + ast = harmony.parse("(function () {\n var i = 42; // (1)\n i; // (1)\n {\n i; // (3)\n {\n i; // (2)\n let i = 20; // (2)\n i; // (2)\n }\n let i = 30; // (3)\n i; // (3)\n }\n i; // (1)\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(4); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('i'); + v1 = scope.variables[1]; + expect(scope.references).to.have.length(3); + expect(scope.references[0].resolved).to.be.equal(v1); + expect(scope.references[1].resolved).to.be.equal(v1); + expect(scope.references[2].resolved).to.be.equal(v1); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + v3 = scope.variables[0]; + expect(scope.references).to.have.length(3); + expect(scope.references[0].resolved).to.be.equal(v3); + expect(scope.references[1].resolved).to.be.equal(v3); + expect(scope.references[2].resolved).to.be.equal(v3); + scope = scopeManager.scopes[3]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + v2 = scope.variables[0]; + expect(scope.references).to.have.length(3); + expect(scope.references[0].resolved).to.be.equal(v2); + expect(scope.references[1].resolved).to.be.equal(v2); + return expect(scope.references[2].resolved).to.be.equal(v2); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1ibG9jay1zY29wZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUM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0aCAxXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMF1cblxuICAgIGl0ICdsZXQgaXMgbm90IGhvaXN0YWJsZSMyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpID0gNDI7IC8vICgxKVxuICAgICAgICAgICAgaTsgIC8vICgxKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGk7ICAvLyAoMylcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGk7ICAvLyAoMilcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSAyMDsgIC8vICgyKVxuICAgICAgICAgICAgICAgICAgICBpOyAgLy8gKDIpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxldCBpID0gM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xlc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgdjJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHYyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCB2MlxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-catch.js b/tools/eslint/node_modules/escope/powered-test/es6-catch.js new file mode 100644 index 00000000000000..986c5eb51e7faa --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-catch.js @@ -0,0 +1,39 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 catch', function() { + return it('takes binding pattern', function() { + var ast, scope, scopeManager; + ast = harmony.parse("try {\n} catch ({ a, b, c, d }) {\n let e = 20;\n a;\n b;\n let c = 30;\n c;\n d;\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(4); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('block'); + expect(scope.block.type).to.be.equal('BlockStatement'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('catch'); + expect(scope.block.type).to.be.equal('CatchClause'); + return expect(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TdHJpY3QpLnRvLmJlLmZhbHNlXG5cbiAgICAgICAgIyBGSVhNRSBBZnRlciBFc3ByaW1hJ3MgYnVnIGlzIGZpeGVkLCBJJ2xsIGFkZCB0ZXN0cyAjMzNcbiAgICAgICAgIyBodHRwczovL2dpdGh1Yi5jb20vZXN0b29scy9lc2NvcGUvaXNzdWVzLzMzI2lzc3VlY29tbWVudC02NDEzNTgzMlxuICAgICAgICAjXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICAjIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnYidcbiAgICAgICAgIyBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICAjIGV4cGVjdChzY29wZS52YXJpYWJsZXNbM10ubmFtZSkudG8uYmUuZXF1YWwgJ2QnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-class.js b/tools/eslint/node_modules/escope/powered-test/es6-class.js new file mode 100644 index 00000000000000..9fcbe8ebdda953 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-class.js @@ -0,0 +1,155 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 class', function() { + it('declaration name creates class scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("class Derived extends Base {\n constructor() {\n }\n}\nnew Derived();"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('Derived'); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('Base'); + expect(scope.references[1].identifier.name).to.be.equal('Derived'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('class'); + expect(scope.block.type).to.be.equal('ClassDeclaration'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('Derived'); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + it('declaration name creates class scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("class Base {\n constructor() {\n }\n}\nlet foo = new Base();"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('Base'); + expect(scope.variables[1].name).to.be.equal('foo'); + expect(scope.through).to.have.length(0); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('foo'); + expect(scope.references[1].identifier.name).to.be.equal('Base'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('class'); + expect(scope.block.type).to.be.equal('ClassDeclaration'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + console.dir(scope.variables); + expect(scope.variables[0].name).to.be.equal('Base'); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + it('expression name creates class scope#1', function() { + var ast, scope, scopeManager; + ast = harmony.parse("(class Derived extends Base {\n constructor() {\n }\n});"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('Base'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('class'); + expect(scope.block.type).to.be.equal('ClassExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('Derived'); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + return expect(scope.block.type).to.be.equal('FunctionExpression'); + }); + it('expression name creates class scope#2', function() { + var ast, scope, scopeManager; + ast = harmony.parse("(class extends Base {\n constructor() {\n }\n});"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('Base'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('class'); + expect(scope.block.type).to.be.equal('ClassExpression'); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + return expect(scope.block.type).to.be.equal('FunctionExpression'); + }); + return it('computed property key may refer variables', function() { + var ast, scope, scopeManager; + ast = harmony.parse("(function () {\n var yuyushiki = 42;\n (class {\n [yuyushiki]() {\n }\n\n [yuyushiki + 40]() {\n }\n });\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(5); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('yuyushiki'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('yuyushiki'); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('class'); + expect(scope.block.type).to.be.equal('ClassExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('yuyushiki'); + return expect(scope.references[1].identifier.name).to.be.equal('yuyushiki'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1jbGFzcy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBRlQsQ0FBQTs7QUFBQSxFQUlBLFFBQUEsQ0FBVSxXQUFWLEVBQXNCLFNBQUEsR0FBQTt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b3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdjbGFzcydcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdDbGFzc0V4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAneXV5dXNoaWtpJ1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js b/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js new file mode 100644 index 00000000000000..5f23b274f7edb3 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js @@ -0,0 +1,504 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 destructuring assignments', function() { + it('Pattern in var in ForInStatement', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function () {\n for (var [a, b, c] in array);\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('a'); + expect(scope.variables[2].name).to.be.equal('b'); + expect(scope.variables[3].name).to.be.equal('c'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('a'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[1].identifier.name).to.be.equal('b'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be.equal(scope.variables[2]); + expect(scope.references[2].identifier.name).to.be.equal('c'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be.equal(scope.variables[3]); + expect(scope.references[3].identifier.name).to.be.equal('array'); + return expect(scope.references[3].isWrite()).to.be["false"]; + }); + it('ArrayPattern in var', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function () {\n var [a, b, c] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('a'); + expect(scope.variables[2].name).to.be.equal('b'); + expect(scope.variables[3].name).to.be.equal('c'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('a'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[1].identifier.name).to.be.equal('b'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be.equal(scope.variables[2]); + expect(scope.references[2].identifier.name).to.be.equal('c'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be.equal(scope.variables[3]); + expect(scope.references[3].identifier.name).to.be.equal('array'); + return expect(scope.references[3].isWrite()).to.be["false"]; + }); + it('SpreadElement in var', function() { + var ast, globalScope, index, name, scope, scopeManager, _i, _j, _len, _len1, _ref, _ref1; + ast = harmony.parse("(function () {\n var [a, b, ...rest] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('a'); + expect(scope.variables[2].name).to.be.equal('b'); + expect(scope.variables[3].name).to.be.equal('rest'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('a'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[1].identifier.name).to.be.equal('b'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be.equal(scope.variables[2]); + expect(scope.references[2].identifier.name).to.be.equal('rest'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be.equal(scope.variables[3]); + expect(scope.references[3].identifier.name).to.be.equal('array'); + expect(scope.references[3].isWrite()).to.be["false"]; + ast = harmony.parse("(function () {\n var [a, b, ...[c, d, ...rest]] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(6); + _ref = ['arguments', 'a', 'b', 'c', 'd', 'rest']; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + name = _ref[index]; + expect(scope.variables[index].name).to.be.equal(name); + } + expect(scope.references).to.have.length(6); + _ref1 = ['a', 'b', 'c', 'd', 'rest']; + for (index = _j = 0, _len1 = _ref1.length; _j < _len1; index = ++_j) { + name = _ref1[index]; + expect(scope.references[index].identifier.name).to.be.equal(name); + expect(scope.references[index].isWrite()).to.be["true"]; + expect(scope.references[index].partial).to.be["true"]; + } + expect(scope.references[5].identifier.name).to.be.equal('array'); + return expect(scope.references[5].isWrite()).to.be["false"]; + }); + it('ObjectPattern in var', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function () {\n var {\n shorthand,\n key: value,\n hello: {\n world\n }\n } = object;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('object'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('shorthand'); + expect(scope.variables[2].name).to.be.equal('value'); + expect(scope.variables[3].name).to.be.equal('world'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('shorthand'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[1].identifier.name).to.be.equal('value'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be.equal(scope.variables[2]); + expect(scope.references[2].identifier.name).to.be.equal('world'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be.equal(scope.variables[3]); + expect(scope.references[3].identifier.name).to.be.equal('object'); + return expect(scope.references[3].isWrite()).to.be["false"]; + }); + it('complex pattern in var', function() { + var ast, globalScope, index, name, scope, scopeManager, _i, _j, _len, _len1, _ref, _ref1; + ast = harmony.parse("(function () {\n var {\n shorthand,\n key: [ a, b, c, d, e ],\n hello: {\n world\n }\n } = object;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('object'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(8); + _ref = ['arguments', 'shorthand', 'a', 'b', 'c', 'd', 'e', 'world']; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + name = _ref[index]; + expect(scope.variables[index].name).to.be.equal(name); + } + expect(scope.references).to.have.length(8); + _ref1 = ['shorthand', 'a', 'b', 'c', 'd', 'e', 'world']; + for (index = _j = 0, _len1 = _ref1.length; _j < _len1; index = ++_j) { + name = _ref1[index]; + expect(scope.references[index].identifier.name).to.be.equal(name); + expect(scope.references[index].isWrite()).to.be["true"]; + expect(scope.references[index].partial).to.be["true"]; + } + expect(scope.references[7].identifier.name).to.be.equal('object'); + return expect(scope.references[7].isWrite()).to.be["false"]; + }); + it('ArrayPattern in AssignmentExpression', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function () {\n [a, b, c] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(4); + expect(scope.implicit.left.map((function(_this) { + return function(ref) { + return ref.identifier.name; + }; + })(this))).to.deep.equal(['a', 'b', 'c', 'array']); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('a'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be["null"]; + expect(scope.references[1].identifier.name).to.be.equal('b'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be["null"]; + expect(scope.references[2].identifier.name).to.be.equal('c'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be["null"]; + expect(scope.references[3].identifier.name).to.be.equal('array'); + return expect(scope.references[3].isWrite()).to.be["false"]; + }); + it('SpreadElement in AssignmentExpression', function() { + var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref; + ast = harmony.parse("(function () {\n [a, b, ...rest] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(4); + expect(scope.implicit.left.map((function(_this) { + return function(ref) { + return ref.identifier.name; + }; + })(this))).to.deep.equal(['a', 'b', 'rest', 'array']); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('a'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to.be["null"]; + expect(scope.references[1].identifier.name).to.be.equal('b'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to.be["null"]; + expect(scope.references[2].identifier.name).to.be.equal('rest'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to.be["null"]; + expect(scope.references[3].identifier.name).to.be.equal('array'); + expect(scope.references[3].isWrite()).to.be["false"]; + ast = harmony.parse("(function () {\n [a, b, ...[c, d, ...rest]] = array;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(6); + expect(scope.implicit.left.map((function(_this) { + return function(ref) { + return ref.identifier.name; + }; + })(this))).to.deep.equal(['a', 'b', 'c', 'd', 'rest', 'array']); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.references).to.have.length(6); + _ref = ['a', 'b', 'c', 'd', 'rest']; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + name = _ref[index]; + expect(scope.references[index].identifier.name).to.be.equal(name); + expect(scope.references[index].isWrite()).to.be["true"]; + expect(scope.references[index].partial).to.be["true"]; + expect(scope.references[index].resolved).to.be["null"]; + } + expect(scope.references[5].identifier.name).to.be.equal('array'); + return expect(scope.references[5].isWrite()).to.be["false"]; + }); + it('ObjectPattern in AssignmentExpression', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function () {\n ({\n shorthand,\n key: value,\n hello: {\n world\n }\n }) = object;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(4); + expect(scope.implicit.left.map((function(_this) { + return function(ref) { + return ref.identifier.name; + }; + })(this))).to.deep.equal(['shorthand', 'value', 'world', 'object']); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('shorthand'); + expect(scope.references[0].isWrite()).to.be["true"]; + expect(scope.references[0].partial).to.be["true"]; + expect(scope.references[0].resolved).to["null"]; + expect(scope.references[1].identifier.name).to.be.equal('value'); + expect(scope.references[1].isWrite()).to.be["true"]; + expect(scope.references[1].partial).to.be["true"]; + expect(scope.references[1].resolved).to["null"]; + expect(scope.references[2].identifier.name).to.be.equal('world'); + expect(scope.references[2].isWrite()).to.be["true"]; + expect(scope.references[2].partial).to.be["true"]; + expect(scope.references[2].resolved).to["null"]; + expect(scope.references[3].identifier.name).to.be.equal('object'); + return expect(scope.references[3].isWrite()).to.be["false"]; + }); + it('complex pattern in AssignmentExpression', function() { + var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref; + ast = harmony.parse("(function () {\n ({\n shorthand,\n key: [ a, b, c, d, e ],\n hello: {\n world\n }\n }) = object;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + expect(scope.implicit.left).to.have.length(8); + expect(scope.implicit.left.map((function(_this) { + return function(ref) { + return ref.identifier.name; + }; + })(this))).to.deep.equal(['shorthand', 'a', 'b', 'c', 'd', 'e', 'world', 'object']); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.references).to.have.length(8); + _ref = ['shorthand', 'a', 'b', 'c', 'd', 'e', 'world']; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + name = _ref[index]; + expect(scope.references[index].identifier.name).to.be.equal(name); + expect(scope.references[index].isWrite()).to.be["true"]; + expect(scope.references[index].partial).to.be["true"]; + } + expect(scope.references[7].identifier.name).to.be.equal('object'); + return expect(scope.references[7].isWrite()).to.be["false"]; + }); + it('ArrayPattern in parameters', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function ([a, b, c]) {\n}(array));"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('array'); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('a'); + expect(scope.variables[2].name).to.be.equal('b'); + expect(scope.variables[3].name).to.be.equal('c'); + return expect(scope.references).to.have.length(0); + }); + it('SpreadElement in parameters', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function ([a, b, ...rest], ...rest2) {\n}(array));"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('array'); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('array'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(5); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('a'); + expect(scope.variables[2].name).to.be.equal('b'); + expect(scope.variables[3].name).to.be.equal('rest'); + expect(scope.variables[3].defs[0].rest).to.be["false"]; + expect(scope.variables[4].name).to.be.equal('rest2'); + expect(scope.variables[4].defs[0].rest).to.be["true"]; + return expect(scope.references).to.have.length(0); + }); + it('ObjectPattern in parameters', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("(function ({\n shorthand,\n key: value,\n hello: {\n world\n }\n }) {\n}(object));"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('object'); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('object'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(4); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('shorthand'); + expect(scope.variables[2].name).to.be.equal('value'); + expect(scope.variables[3].name).to.be.equal('world'); + return expect(scope.references).to.have.length(0); + }); + return it('complex pattern in parameters', function() { + var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref; + ast = harmony.parse("(function ({\n shorthand,\n key: [ a, b, c, d, e ],\n hello: {\n world\n }\n }) {\n}(object));"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + globalScope = scope; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('object'); + expect(scope.implicit.left).to.have.length(1); + expect(scope.implicit.left[0].identifier.name).to.be.equal('object'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(8); + _ref = ['arguments', 'shorthand', 'a', 'b', 'c', 'd', 'e', 'world']; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + name = _ref[index]; + expect(scope.variables[index].name).to.be.equal(name); +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zBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDZcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdyZXN0J1xuICAgICAgICAgICAgXVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1tpbmRleF0ubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgIGZvciBuYW1lLCBpbmRleCBpbiBbXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICAgICBdXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCBuYW1lXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleH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gICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbaW5kZXhdLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnc2hvcnRoYW5kJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzddLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29iamVjdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbN10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ0FycmF5UGF0dGVybiBpbiBBc3NpZ25tZW50RXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJc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GUuaW1wbGljaXQubGVmdC5tYXAoKHJlZikgPT4gcmVmLmlkZW50aWZpZXIubmFtZSkpLnRvLmRlZXAuZXF1YWwgW1xuICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAnYidcbiAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAncmVzdCdcbiAgICAgICAgICAgICdhcnJheSdcbiAgICAgICAgXVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgIGZvciBuYW1lLCBpbmRleCBpbiBbXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICAgICBdXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCBuYW1lXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbaW5kZXhdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzVdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1s1XS5pc1dyaXRlKCkpLnRvLmJlLmZhbHNlXG5cbiAgICBpdCAnT2JqZWN0UGF0dGVybiBpbiBBc3NpZ25tZW50RXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAoe1xuICAgICAgICAgICAgICAgIHNob3J0aGFuZCxcbiAgICAgICAgICAgICAgICBrZXk6IHZhbHVlLFxuICAgICAgICAgICAgICAgIGhlbGxvOiB7XG4gICAgICAgICAgICAgICAgICAgIHdvcmxkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkgPSBvYmplY3Q7XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdC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8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3dvcmxkJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5yZXNvbHZlZCkudG8ubnVsbFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlzV3JpdGUoKSkudG8uYmUuZmFsc2VcblxuICAgIGl0ICdjb21wbGV4IHBhdHRlcm4gaW4gQXNzaWdubWVudEV4cHJlc3Npb24nLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgKHtcbiAgICAgICAgICAgICAgICBzaG9ydGhhbmQsXG4gICAgICAgICAgICAgICAga2V5OiBbIGEsIGIsIGMsIGQsIGUgXSxcbiAgICAgICAgICAgICAgICBoZWxsbzoge1xuICAgICAgICAgICAgICAgICAgICB3b3JsZFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pID0gb2JqZWN0O1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSB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ICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnc2hvcnRoYW5kJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzddLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29iamVjdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbN10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ0FycmF5UGF0dGVybiBpbiBwYXJhbWV0ZXJzJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uIChbYSwgYiwgY10pIHtcbiAgICAgICAgfShhcnJheSkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxl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Y29wZXNbMF1cbiAgICAgICAgIyBnbG9iYWxTY29wZSA9IHNjb3BlXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICAjIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgIyBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcblxuICAgICAgICAjIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICAjIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG5cbiAgICAgICAgIyBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgICMgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgIyAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICMgICAgICAgICAnYSdcbiAgICAgICAgIyAgICAgICAgICdiJ1xuICAgICAgICAjICAgICAgICAgJ2MnXG4gICAgICAgICMgICAgICAgICAnZCdcbiAgICAgICAgIyAgICAgICAgICdyZXN0J1xuICAgICAgICAjICAgICBdXG4gICAgICAgICMgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbaW5kZXhdLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcblxuICAgICAgICAjIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgICMgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgIyAgICAgICAgICdhJ1xuICAgICAgICAjICAgICAgICAgJ2InXG4gICAgICAgICMgICAgICAgICAnYydcbiAgICAgICAgIyAgICAgICAgICdkJ1xuICAgICAgICAjICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICMgICAgIF1cbiAgICAgICAgIyAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbaW5kZXhdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuICAgICAgICAjICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICMgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ09iamVjdFBhdHRlcm4gaW4gcGFyYW1ldGVycycsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoe1xuICAgICAgICAgICAgICAgIHNob3J0aGFuZCxcbiAgICAgICAgICAgICAgICBrZXk6IHZhbHVlLFxuICAgICAgICAgICAgICAgIGhlbGxvOiB7XG4gICAgICAgICAgICAgICAgICAgIHdvcmxkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkge1xuICAgICAgICB9KG9iamVjdCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbm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cGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICdzaG9ydGhhbmQnXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ2UnXG4gICAgICAgICAgICAgICAgJ3dvcmxkJ1xuICAgICAgICAgICAgXVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1tpbmRleF0ubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-export.js b/tools/eslint/node_modules/escope/powered-test/es6-export.js new file mode 100644 index 00000000000000..194fb0693565ae --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-export.js @@ -0,0 +1,202 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('export declaration', function() { + it('should create vairable bindings', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export var v;", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('v'); + expect(scope.variables[0].defs[0].type).to.be.equal('Variable'); + return expect(scope.references).to.have.length(0); + }); + it('should create function declaration bindings', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export default function f(){};", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(3); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('f'); + expect(scope.variables[0].defs[0].type).to.be.equal('FunctionName'); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + it('should export function expression', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export default function(){};", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(3); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(0); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + it('should export literal', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export default 42;", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + return expect(scope.references).to.have.length(0); + }); + it('should refer exported references#1', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export {x};", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + return expect(scope.references[0].identifier.name).to.be.equal('x'); + }); + it('should refer exported references#2', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export {v as x};", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + return expect(scope.references[0].identifier.name).to.be.equal('v'); + }); + it('should not refer exported references from other source#1', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export {x} from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + return expect(scope.references).to.have.length(0); + }); + it('should not refer exported references from other source#2', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export {v as x} from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + return expect(scope.references).to.have.length(0); + }); + return it('should not refer exported references from other source#3', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("export * from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(0); + return expect(scope.references).to.have.length(0); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1leHBvcnQuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7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NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-import.js b/tools/eslint/node_modules/escope/powered-test/es6-import.js new file mode 100644 index 00000000000000..4d6e7f575e15d6 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-import.js @@ -0,0 +1,103 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('import declaration', function() { + it('should import names from source', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("import v from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('v'); + expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding'); + return expect(scope.references).to.have.length(0); + }); + it('should import namespaces', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("import * as ns from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('ns'); + expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding'); + return expect(scope.references).to.have.length(0); + }); + it('should import insided names#1', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("import {x} from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('x'); + expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding'); + return expect(scope.references).to.have.length(0); + }); + return it('should import insided names#2', function() { + var ast, globalScope, scope, scopeManager; + ast = harmony.parse("import {x as v} from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('module'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('v'); + expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding'); + return expect(scope.references).to.have.length(0); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1pbXBvcnQuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsb0JBQVYsRUFBK0IsU0FBQSxHQUFBO0FBRTNCLElBQUEsRUFBQSxDQUFJLGlDQUFKLEVBQXNDLFNBQUEsR0FBQTtBQUNsQyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsd0JBQWpCLEVBRUQ7QUFBQSxRQUFBLFVBQUEsRUFBYSxRQUFiO09BRkMsQ0FBTixDQUFBO0FBQUEsTUFJQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEs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3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAndidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5kZWZzWzBdLnR5cGUpLnRvLmJlLmVxdWFsICdJbXBvcnRCaW5kaW5nJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgIyBUT0RPOiBTaG91bGQgcGFyc2UgaXQuXG4gICAgIyBpbXBvcnQgZnJvbSBcIm1vZFwiO1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js b/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js new file mode 100644 index 00000000000000..79dbf8de292463 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js @@ -0,0 +1,167 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 iteration scope', function() { + it('let materialize iteration scope for ForInStatement#1', function() { + var ast, iterScope, scope, scopeManager; + ast = harmony.parse("(function () {\n let i = 20;\n for (let i in i) {\n console.log(i);\n }\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(5); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('i'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + iterScope = scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('TDZ'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.variables[0].defs[0].type).to.be.equal('TDZ'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + iterScope = scope = scopeManager.scopes[3]; + expect(scope.type).to.be.equal('for'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + scope = scopeManager.scopes[4]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('console'); + expect(scope.references[0].resolved).to.be.equal(null); + expect(scope.references[1].identifier.name).to.be.equal('i'); + return expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]); + }); + it('let materialize iteration scope for ForInStatement#2', function() { + var ast, iterScope, scope, scopeManager; + ast = harmony.parse("(function () {\n let i = 20;\n for (let { i, j, k } in i) {\n console.log(i);\n }\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(5); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('i'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + iterScope = scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('TDZ'); + expect(scope.variables).to.have.length(3); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.variables[0].defs[0].type).to.be.equal('TDZ'); + expect(scope.variables[1].name).to.be.equal('j'); + expect(scope.variables[1].defs[0].type).to.be.equal('TDZ'); + expect(scope.variables[2].name).to.be.equal('k'); + expect(scope.variables[2].defs[0].type).to.be.equal('TDZ'); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + iterScope = scope = scopeManager.scopes[3]; + expect(scope.type).to.be.equal('for'); + expect(scope.variables).to.have.length(3); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.variables[1].name).to.be.equal('j'); + expect(scope.variables[2].name).to.be.equal('k'); + expect(scope.references).to.have.length(3); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + expect(scope.references[1].identifier.name).to.be.equal('j'); + expect(scope.references[1].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[2].identifier.name).to.be.equal('k'); + expect(scope.references[2].resolved).to.be.equal(scope.variables[2]); + scope = scopeManager.scopes[4]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('console'); + expect(scope.references[0].resolved).to.be.equal(null); + expect(scope.references[1].identifier.name).to.be.equal('i'); + return expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]); + }); + return it('let materialize iteration scope for ForStatement#2', function() { + var ast, functionScope, iterScope, scope, scopeManager; + ast = harmony.parse("(function () {\n let i = 20;\n let obj = {};\n for (let { i, j, k } = obj; i < okok; ++i) {\n console.log(i, j, k);\n }\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(4); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.variables).to.have.length(0); + functionScope = scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(3); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('i'); + expect(scope.variables[2].name).to.be.equal('obj'); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[1].identifier.name).to.be.equal('obj'); + expect(scope.references[1].resolved).to.be.equal(scope.variables[2]); + iterScope = scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('for'); + expect(scope.variables).to.have.length(3); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.variables[0].defs[0].type).to.be.equal('Variable'); + expect(scope.variables[1].name).to.be.equal('j'); + expect(scope.variables[1].defs[0].type).to.be.equal('Variable'); + expect(scope.variables[2].name).to.be.equal('k'); + expect(scope.variables[2].defs[0].type).to.be.equal('Variable'); + expect(scope.references).to.have.length(7); + expect(scope.references[0].identifier.name).to.be.equal('i'); + expect(scope.references[0].resolved).to.be.equal(scope.variables[0]); + expect(scope.references[1].identifier.name).to.be.equal('j'); + expect(scope.references[1].resolved).to.be.equal(scope.variables[1]); + expect(scope.references[2].identifier.name).to.be.equal('k'); + expect(scope.references[2].resolved).to.be.equal(scope.variables[2]); + expect(scope.references[3].identifier.name).to.be.equal('obj'); + expect(scope.references[3].resolved).to.be.equal(functionScope.variables[2]); + expect(scope.references[4].identifier.name).to.be.equal('i'); + expect(scope.references[4].resolved).to.be.equal(scope.variables[0]); + expect(scope.references[5].identifier.name).to.be.equal('okok'); + expect(scope.references[5].resolved).to.be["null"]; + expect(scope.references[6].identifier.name).to.be.equal('i'); + expect(scope.references[6].resolved).to.be.equal(scope.variables[0]); + scope = scopeManager.scopes[3]; + expect(scope.type).to.be.equal('block'); + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(4); + expect(scope.references[0].identifier.name).to.be.equal('console'); + expect(scope.references[0].resolved).to.be["null"]; + expect(scope.references[1].identifier.name).to.be.equal('i'); + expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]); + expect(scope.references[2].identifier.name).to.be.equal('j'); + expect(scope.references[2].resolved).to.be.equal(iterScope.variables[1]); + expect(scope.references[3].identifier.name).to.be.equal('k'); + return expect(scope.references[3].resolved).to.be.equal(iterScope.variables[2]); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1pdGVyYXRpb24tc2NvcGUuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUscUJBQVYsRUFBZ0MsU0FBQSxHQUFBO0FBQzVCLElBQUEsRUFBQSxDQUFJLHNEQUFKLEVBQTJELFNBQUEsR0FBQTtBQUN2RCxVQUFBLG1DQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsZ0dBQWpCLENBQU4sQ0FBQTtBQUFBLE1BU0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FUZixDQUFBO0FBQUEsTUFVQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEy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kKS50by5iZS5lcXVhbCBudWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzBdXG5cbiAgICBpdCAnbGV0IG1hdGVyaWFsaXplIGl0ZXJhdGlvbiBzY29wZSBmb3IgRm9yU3RhdGVtZW50IzInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgbGV0IGkgPSAyMDtcbiAgICAgICAgICAgIGxldCBvYmogPSB7fTtcbiAgICAgICAgICAgIGZvciAobGV0IHsgaSwgaiwgayB9ID0gb2JqOyBpIDwgb2tvazsgKytpKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coaSwgaiwgayk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDRcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBmdW5jdGlvblNjb3BlID0gc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZn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Y2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2snXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzJdXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-object.js b/tools/eslint/node_modules/escope/powered-test/es6-object.js new file mode 100644 index 00000000000000..2241d2558e3c2d --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-object.js @@ -0,0 +1,57 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 object', function() { + it('method definition', function() { + var ast, scope, scopeManager; + ast = harmony.parse("({\n constructor() {\n }\n})"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.references).to.have.length(0); + }); + return it('computed property key may refer variables', function() { + var ast, scope, scopeManager; + ast = harmony.parse("(function () {\n var yuyushiki = 42;\n ({\n [yuyushiki]() {\n },\n\n [yuyushiki + 40]() {\n }\n })\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(4); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('yuyushiki'); + expect(scope.references).to.have.length(3); + expect(scope.references[0].identifier.name).to.be.equal('yuyushiki'); + expect(scope.references[1].identifier.name).to.be.equal('yuyushiki'); + return expect(scope.references[2].identifier.name).to.be.equal('yuyushiki'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1vYmplY3QuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQU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dChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnRnVuY3Rpb25FeHByZXNzaW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAzXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAneXV5dXNoaWtpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js b/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js new file mode 100644 index 00000000000000..3342b7ed849aa3 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js @@ -0,0 +1,35 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 rest arguments', function() { + return it('materialize rest argument in scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("function foo(...bar) {\n return bar;\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(1); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('bar'); + expect(scope.variables[1].defs[0].name.name).to.be.equal('bar'); + return expect(scope.variables[1].defs[0].rest).to.be["true"]; + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1yZXN0LWFyZ3MuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsb0JBQVYsRUFBK0IsU0FBQSxHQUFBO1dBQzNCLEVBQUEsQ0FBSSxvQ0FBSixFQUF5QyxTQUFBLEdBQUE7QUFDckMsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRDQUFqQixDQUFOLENBQUE7QUFBQSxNQU1BLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBTmYsQ0FBQTtBQUFBLE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uICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5kZWZzWzBdLm5hbWUubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5kZWZzWzBdLnJlc3QpLnRvLmJlLnRydWVcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-switch.js b/tools/eslint/node_modules/escope/powered-test/es6-switch.js new file mode 100644 index 00000000000000..44336f0f9d270a --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-switch.js @@ -0,0 +1,43 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 switch', function() { + return it('materialize scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("switch (ok) {\n case hello:\n let i = 20;\n i;\n break;\n\n default:\n let test = 30;\n test;\n}"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + expect(scope.references).to.have.length(1); + expect(scope.references[0].identifier.name).to.be.equal('ok'); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('switch'); + expect(scope.block.type).to.be.equal('SwitchStatement'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('i'); + expect(scope.variables[1].name).to.be.equal('test'); + expect(scope.references).to.have.length(5); + expect(scope.references[0].identifier.name).to.be.equal('hello'); + expect(scope.references[1].identifier.name).to.be.equal('i'); + expect(scope.references[2].identifier.name).to.be.equal('i'); + expect(scope.references[3].identifier.name).to.be.equal('test'); + return expect(scope.references[4].identifier.name).to.be.equal('test'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1zd2l0Y2guY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FB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BlLnJlZmVyZW5jZXNbNF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVzdCdcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js b/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js new file mode 100644 index 00000000000000..5e71ad21775269 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js @@ -0,0 +1,45 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('ES6 template literal', function() { + return it('refer variables', function() { + var ast, scope, scopeManager; + ast = harmony.parse("(function () {\n let i, j, k;\n function testing() { }\n let template = testing`testing ${i} and ${j}`\n return template;\n}());"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6 + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('FunctionExpression'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(6); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.variables[1].name).to.be.equal('i'); + expect(scope.variables[2].name).to.be.equal('j'); + expect(scope.variables[3].name).to.be.equal('k'); + expect(scope.variables[4].name).to.be.equal('testing'); + expect(scope.variables[5].name).to.be.equal('template'); + expect(scope.references).to.have.length(5); + expect(scope.references[0].identifier.name).to.be.equal('template'); + expect(scope.references[1].identifier.name).to.be.equal('testing'); + expect(scope.references[2].identifier.name).to.be.equal('i'); + expect(scope.references[3].identifier.name).to.be.equal('j'); + return expect(scope.references[4].identifier.name).to.be.equal('template'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,ey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Y29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0ubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbM10ubmFtZSkudG8uYmUuZXF1YWwgJ2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbNF0ubmFtZSkudG8uYmUuZXF1YWwgJ3Rlc3RpbmcnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbNV0ubmFtZSkudG8uYmUuZXF1YWwgJ3RlbXBsYXRlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggNVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd0ZW1wbGF0ZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVzdGluZydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVtcGxhdGUnXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/function-expression-name.js b/tools/eslint/node_modules/escope/powered-test/function-expression-name.js new file mode 100644 index 00000000000000..7df0841856e3e8 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/function-expression-name.js @@ -0,0 +1,42 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('function name', function() { + return it('should create its special scope', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("(function name() {\n}());"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(3); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + expect(globalScope.isArgumentsMaterialized()).to.be["true"]; + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function-expression-name'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('name'); + expect(scope.isArgumentsMaterialized()).to.be["true"]; + expect(scope.references).to.have.length(0); + expect(scope.upper === globalScope).to.be["true"]; + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["false"]; + expect(scope.references).to.have.length(0); + return expect(scope.upper === scopeManager.scopes[1]).to.be["true"]; + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZ1bmN0aW9uLWV4cHJlc3Npb24tbmFtZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSxnQ0FBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsU0FBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRlYsQ0FBQTs7QUFBQSxFQ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NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnVwcGVyIGlzIHNjb3BlTWFuYWdlci5zY29wZXNbMV0pLnRvLmJlLnRydWVcblxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/global-increment.js b/tools/eslint/node_modules/escope/powered-test/global-increment.js new file mode 100644 index 00000000000000..39024ff15899c8 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/global-increment.js @@ -0,0 +1,28 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('global increment', function() { + return it('becomes read/write', function() { + var ast, globalScope, scopeManager; + ast = esprima.parse("b++;"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(1); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(1); + return expect(globalScope.references[0].isReadWrite()).to.be["true"]; + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsb2JhbC1pbmNyZW1lbnQuY29mZmVlIl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tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js b/tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js new file mode 100644 index 00000000000000..b6cf989d99adb9 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js @@ -0,0 +1,113 @@ +(function() { + 'use strict'; + var escope, esprima, expect; + + expect = require('chai').expect; + + escope = require('..'); + + esprima = require('esprima'); + + describe('implicit global reference', function() { + it('assignments global scope', function() { + var ast, scopes; + ast = esprima.parse("var x = 20;\nx = 300;"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.defs.map(function(def) { + return def.type; + }); + }); + })).to.be.eql([[['Variable']]]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql([]); + }); + it('assignments global scope without definition', function() { + var ast, scopes; + ast = esprima.parse("x = 300;\nx = 300;"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.defs.map(function(def) { + return def.type; + }); + }); + })).to.be.eql([[]]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql(['x']); + }); + it('assignments global scope without definition eval', function() { + var ast, scopes; + ast = esprima.parse("function inner() {\n eval(str);\n x = 300;\n}"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.defs.map(function(def) { + return def.type; + }); + }); + })).to.be.eql([[['FunctionName']], [[]]]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql([]); + }); + it('assignment leaks', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n x = 20;\n}"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments']]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql(['x']); + }); + it('assignment doesn\'t leak', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n function inner() {\n x = 20;\n }\n var x;\n}"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments', 'inner', 'x'], ['arguments']]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql([]); + }); + it('for-in-statement leaks', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n for (x in y) { }\n}"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments']]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql(['x']); + }); + return it('for-in-statement doesn\'t leaks', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n function inner() {\n for (x in y) { }\n }\n var x;\n}"); + scopes = escope.analyze(ast).scopes; + expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments', 'inner', 'x'], ['arguments']]); + return expect(scopes[0].implicit.variables.map(function(variable) { + return variable.name; + })).to.be.eql([]); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcGxpY2l0LWdsb2JhbC1yZWZlcmVuY2UuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCQztBQUFBLEVBQUEsWUFBQSxDQUFBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUVELE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFGeEIsQ0FBQTs7QUFBQSxFQUdELE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhSLENBQUE7O0FBQUEsRUFJRCxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FKVCxDQUFBOztBQUFBLEVBTUQsUUFBQ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XhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcblxuZGVzY3JpYmUgJ2ltcGxpY2l0IGdsb2JhbCByZWZlcmVuY2UnLCAtPlxuICAgIGl0ICdhc3NpZ25tZW50cyBnbG9iYWwgc2NvcGUnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICB2YXIgeCA9IDIwO1xuICAgICAgICB4ID0gMzAwO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPlxuICAgICAgICAgICAgICAgIHZhcmlhYmxlLmRlZnMubWFwKChkZWYpIC0+IGRlZi50eXBlKSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnVmFyaWFibGUnXG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgICAgICBleHBlY3Qoc2NvcGVzWzBdLmltcGxpY2l0LnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkudG8uYmUuZXFsKFtdKVxuXG4gICAgaXQgJ2Fzc2lnbm1lbnRzIGdsb2JhbCBzY29wZSB3aXRob3V0IGRlZmluaXRpb24nLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICB4ID0gMzAwO1xuICAgICAgICB4ID0gMzAwO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPlxuICAgICAgICAgICAgICAgIHZhcmlhYmxlLmRlZnMubWFwKChkZWYpIC0+IGRlZi50eXBlKSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgICAgIGV4cGVjdChzY29wZXNbMF0uaW1wbGljaXQudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgJ3gnXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgIGl0ICdhc3NpZ25tZW50cyBnbG9iYWwgc2NvcGUgd2l0aG91dCBkZWZpbml0aW9uIGV2YWwnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgIGV2YWwoc3RyKTtcbiAgICAgICAgICAgIHggPSAzMDA7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVzID0gZXNjb3BlLmFuYWx5emUoYXN0KS5zY29wZXNcblxuICAgICAgICBleHBlY3Qoc2NvcGVzLm1hcCgoc2NvcGUpIC0+XG4gICAgICAgICAgICBzY29wZS52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT5cbiAgICAgICAgICAgICAgICB2YXJpYWJsZS5kZWZzLm1hcCgoZGVmKSAtPiBkZWYudHlwZSkpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0Z1bmN0aW9uTmFtZSdcbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgICAgIGV4cGVjdChzY29wZXNbMF0uaW1wbGljaXQudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKS50by5iZS5lcWwoW10pXG5cbiAgICBpdCAnYXNzaWdubWVudCBsZWFrcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIG91dGVyKCkge1xuICAgICAgICAgICAgeCA9IDIwO1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAneCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ2Fzc2lnbm1lbnQgZG9lc25cXCd0IGxlYWsnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBvdXRlcigpIHtcbiAgICAgICAgICAgIGZ1bmN0aW9uIGlubmVyKCkge1xuICAgICAgICAgICAgICAgIHggPSAyMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB4O1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgICAgICdpbm5lcidcbiAgICAgICAgICAgICAgICAgICAgJ3gnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ2FyZ3VtZW50cydcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgICAgICBleHBlY3Qoc2NvcGVzWzBdLmltcGxpY2l0LnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkudG8uYmUuZXFsKFtdKVxuXG5cbiAgICBpdCAnZm9yLWluLXN0YXRlbWVudCBsZWFrcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIG91dGVyKCkge1xuICAgICAgICAgICAgZm9yICh4IGluIHkpIHsgfVxuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAneCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ2Zvci1pbi1zdGF0ZW1lbnQgZG9lc25cXCd0IGxlYWtzJywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZnVuY3Rpb24gb3V0ZXIoKSB7XG4gICAgICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHggaW4geSkgeyB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgeDtcbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdvdXRlcidcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICAgICAnaW5uZXInXG4gICAgICAgICAgICAgICAgICAgICd4J1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChbXSlcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/label-children.js b/tools/eslint/node_modules/escope/powered-test/label-children.js new file mode 100644 index 00000000000000..710732f8071a8c --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/label-children.js @@ -0,0 +1,34 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('label', function() { + return it('should not create variables', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("function bar() { q: for(;;) { break q; } }"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(1); + expect(globalScope.variables[0].name).to.be.equal('bar'); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["false"]; + return expect(scope.references).to.have.length(0); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLWNoaWxkcmVuLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtXQUNkLEVBQUEsQ0FBSSw2QkFBSixFQUFrQyxTQUFBLEdBQUE7QUFDOUIsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRDQUFqQixDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQ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5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/label.js b/tools/eslint/node_modules/escope/powered-test/label.js new file mode 100644 index 00000000000000..a54dcd9d340a8f --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/label.js @@ -0,0 +1,47 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('label', function() { + it('should not create variables', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("function bar() { q: for(;;) { break q; } }"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(2); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(1); + expect(globalScope.variables[0].name).to.be.equal('bar'); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["false"]; + return expect(scope.references).to.have.length(0); + }); + return it('should count child node references', function() { + var ast, globalScope, scopeManager; + ast = esprima.parse("var foo = 5;\n\nlabel: while (true) {\n console.log(foo);\n break;\n}"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(1); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(1); + expect(globalScope.variables[0].name).to.be.equal('foo'); + expect(globalScope.through.length).to.be.equal(3); + expect(globalScope.through[2].identifier.name).to.be.equal('foo'); + return expect(globalScope.through[2].isRead()).to.be["true"]; + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtBQUNkLElBQUEsRUFBQSxDQUFJLDZCQUFKLEVBQWtDLFNBQUEsR0FBQTtBQUM5QixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsNENBQWpCLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQUpmLENBQUE7QUFBQSxNQUtBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFB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ICAgICAgICBcIlwiXCJcblxuICAgICAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0XG4gICAgICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2ZvbydcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50aHJvdWdoLmxlbmd0aCkudG8uYmUuZXF1YWwgM1xuICAgICAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnRocm91Z2hbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnZm9vJ1xuICAgICAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnRocm91Z2hbMl0uaXNSZWFkKCkpLnRvLmJlLnRydWVcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js b/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js new file mode 100644 index 00000000000000..24fd61c2c6ba7d --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js @@ -0,0 +1,65 @@ +(function() { + var escope, expect, harmony; + + expect = require('chai').expect; + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('nodejsScope option', function() { + it('creates a function scope following the global scope immediately', function() { + var ast, scope, scopeManager; + ast = harmony.parse("'use strict';\nvar hello = 20;"); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + nodejsScope: true + }); + expect(scopeManager.scopes).to.have.length(2); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["true"]; + expect(scope.variables).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('arguments'); + return expect(scope.variables[1].name).to.be.equal('hello'); + }); + return it('creates a function scope following the global scope immediately and creates module scope', function() { + var ast, scope, scopeManager; + ast = harmony.parse("import {x as v} from \"mod\";", { + sourceType: 'module' + }); + scopeManager = escope.analyze(ast, { + ecmaVersion: 6, + nodejsScope: true, + sourceType: 'module' + }); + expect(scopeManager.scopes).to.have.length(3); + scope = scopeManager.scopes[0]; + expect(scope.type).to.be.equal('global'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.block.type).to.be.equal('Program'); + expect(scope.isStrict).to.be["false"]; + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('module'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('v'); + expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding'); + return expect(scope.references).to.have.length(0); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVqcy1zY29wZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBL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ICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICd2J1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ0ltcG9ydEJpbmRpbmcnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cblxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/object-expression.js b/tools/eslint/node_modules/escope/powered-test/object-expression.js new file mode 100644 index 00000000000000..3e845c7d798971 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/object-expression.js @@ -0,0 +1,56 @@ +(function() { + 'use strict'; + var escope, expect; + + expect = require('chai').expect; + + escope = require('..'); + + describe('object expression', function() { + return it('doesn\'t require property type', function() { + var ast, scope; + ast = { + type: 'Program', + body: [ + { + type: 'VariableDeclaration', + declarations: [ + { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'a' + }, + init: { + type: 'ObjectExpression', + properties: [ + { + kind: 'init', + key: { + type: 'Identifier', + name: 'foo' + }, + value: { + type: 'Identifier', + name: 'a' + } + } + ] + } + } + ] + } + ] + }; + scope = escope.analyze(ast).scopes[0]; + expect(scope.variables).to.have.length(1); + expect(scope.references).to.have.length(2); + expect(scope.variables[0].name).to.be.equal('a'); + expect(scope.references[0].identifier.name).to.be.equal('a'); + return expect(scope.references[1].identifier.name).to.be.equal('a'); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdC1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zb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdvYmplY3QgZXhwcmVzc2lvbicsIC0+XG4gICAgaXQgJ2RvZXNuXFwndCByZXF1aXJlIHByb3BlcnR5IHR5cGUnLCAtPlxuICAgICAgICAjIEhhcmRjb2RlZCBBU1QuICBFc3ByaW1hIGFkZHMgYW4gZXh0cmEgJ1Byb3BlcnR5J1xuICAgICAgICAjIGtleS92YWx1ZSB0byBPYmplY3RFeHByZXNzaW9ucywgc28gd2UncmUgbm90IHVzaW5nXG4gICAgICAgICMgaXQgcGFyc2UgYSBwcm9ncmFtIHN0cmluZy5cbiAgICAgICAgYXN0ID1cbiAgICAgICAgICAgIHR5cGU6ICdQcm9ncmFtJ1xuICAgICAgICAgICAgYm9keTogW3tcbiAgICAgICAgICAgICAgICB0eXBlOiAnVmFyaWFibGVEZWNsYXJhdGlvbidcbiAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbnM6IFt7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICdWYXJpYWJsZURlY2xhcmF0b3InXG4gICAgICAgICAgICAgICAgICAgIGlkOlxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ0lkZW50aWZpZXInXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnYSdcbiAgICAgICAgICAgICAgICAgICAgaW5pdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdPYmplY3RFeHByZXNzaW9uJ1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogW3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnaW5pdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdJZGVudGlmaWVyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnZm9vJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogJ2EnXG4gICAgICAgICAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgICAgIH1dXG4gICAgICAgICAgICB9XVxuXG4gICAgICAgIHNjb3BlID0gZXNjb3BlLmFuYWx5emUoYXN0KS5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGgoMSlcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoKDIpXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwoJ2EnKVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsKCdhJylcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCgnYScpXG4iXX0= \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/optimistic.js b/tools/eslint/node_modules/escope/powered-test/optimistic.js new file mode 100644 index 00000000000000..5e93a0a834d291 --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/optimistic.js @@ -0,0 +1,40 @@ +(function() { + 'use strict'; + var escope, esprima, expect; + + expect = require('chai').expect; + + escope = require('..'); + + esprima = require('esprima'); + + describe('optimistic', function() { + it('direct call to eval', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n eval(str);\n var i = 20;\n function inner() {\n i;\n }\n}"); + scopes = escope.analyze(ast, { + optimistic: true + }).scopes; + return expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments', 'i', 'inner'], ['arguments']]); + }); + return it('with statement', function() { + var ast, scopes; + ast = esprima.parse("function outer() {\n eval(str);\n var i = 20;\n with (obj) {\n i;\n }\n}"); + scopes = escope.analyze(ast, { + optimistic: true + }).scopes; + return expect(scopes.map(function(scope) { + return scope.variables.map(function(variable) { + return variable.name; + }); + })).to.be.eql([['outer'], ['arguments', 'i'], []]); + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wdGltaXN0aWMuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCQztBQUFBLEVBQUEsWUFBQSxDQUFBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUVELE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFGeEIsQ0FBQTs7QUFBQSxFQUdELE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhSLENBQUE7O0FBQUEsRUFJRCxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FKVCxDQUFBOztBQUFBLEVBTUQsUUFBQSxDQUFVLFlBQVYsRUFBdUIsU0FBQSxHQUFBO0FBQ25CLElBQUEsRUFBQSxDQUFJLHFCQUFKLEVBQTBCLFNBQUEsR0FBQTtBQUN0QixVQUFBLFdBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixtR0FBakIsQ0FBTixDQUFBO0FBQUEsTUFVQSxNQUFBLEdBQVMsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxVQUFBLEVBQVksSUFBWjtPQUFwQixDQUFvQyxDQUFDLE1BVjlDLENBQUE7YUFZQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FB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PlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBvdXRlcigpIHtcbiAgICAgICAgICAgIGV2YWwoc3RyKTtcbiAgICAgICAgICAgIHZhciBpID0gMjA7XG4gICAgICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgICAgICBpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCwgb3B0aW1pc3RpYzogeWVzKS5zY29wZXNcblxuICAgICAgICBleHBlY3Qoc2NvcGVzLm1hcCgoc2NvcGUpIC0+XG4gICAgICAgICAgICBzY29wZS52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnb3V0ZXInXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ2FyZ3VtZW50cydcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgICAgICdpbm5lcidcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ3dpdGggc3RhdGVtZW50JywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZnVuY3Rpb24gb3V0ZXIoKSB7XG4gICAgICAgICAgICBldmFsKHN0cik7XG4gICAgICAgICAgICB2YXIgaSA9IDIwO1xuICAgICAgICAgICAgd2l0aCAob2JqKSB7XG4gICAgICAgICAgICAgICAgaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QsIG9wdGltaXN0aWM6IHllcykuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgICAgICdpJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cblxuIl19 \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/powered-test/with-scope.js b/tools/eslint/node_modules/escope/powered-test/with-scope.js new file mode 100644 index 00000000000000..bb2c74569091ea --- /dev/null +++ b/tools/eslint/node_modules/escope/powered-test/with-scope.js @@ -0,0 +1,40 @@ +(function() { + var escope, esprima, expect, harmony; + + expect = require('chai').expect; + + esprima = require('esprima'); + + harmony = require('../third_party/esprima'); + + escope = require('..'); + + describe('with', function() { + return it('creates scope', function() { + var ast, globalScope, scope, scopeManager; + ast = esprima.parse("(function () {\n with (obj) {\n testing;\n }\n}());"); + scopeManager = escope.analyze(ast); + expect(scopeManager.scopes).to.have.length(3); + globalScope = scopeManager.scopes[0]; + expect(globalScope.type).to.be.equal('global'); + expect(globalScope.variables).to.have.length(0); + expect(globalScope.references).to.have.length(0); + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal('function'); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal('arguments'); + expect(scope.isArgumentsMaterialized()).to.be["false"]; + expect(scope.references).to.have.length(1); + expect(scope.references[0].resolved).to.be["null"]; + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal('with'); + expect(scope.variables).to.have.length(0); + expect(scope.isArgumentsMaterialized()).to.be["true"]; + expect(scope.references).to.have.length(1); + return expect(scope.references[0].resolved).to.be["null"]; + }); + }); + +}).call(this); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndpdGgtc2NvcGUuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsZ0NBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQUZWLENBQUE7O0FBQUEsRUFHQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FIVCxDQUFBOztBQUFBLEVBS0EsUUFBQSxDQUFVLE1BQVYsRUFBaUIsU0FBQSxHQUFBO1dBQ2IsRUFBQSxDQUFJLGVBQUosRUFBb0IsU0FBQSxHQUFBO0FBQ2hCLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixrRUFBakIsQ0FBTixDQUFBO0FBQUEsTUFRQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsT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lLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLm51bGxcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICd3aXRoJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ== \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/src/index.js b/tools/eslint/node_modules/escope/src/index.js index bc9e176ef43e05..a345e1c71359eb 100644 --- a/tools/eslint/node_modules/escope/src/index.js +++ b/tools/eslint/node_modules/escope/src/index.js @@ -64,7 +64,9 @@ function defaultOptions() { nodejsScope: false, impliedStrict: false, sourceType: 'script', // one of ['script', 'module'] - ecmaVersion: 5 + ecmaVersion: 5, + childVisitorKeys: null, + fallback: 'iteration' }; } @@ -72,7 +74,7 @@ function updateDeeply(target, override) { var key, val; function isHashObject(target) { - return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp); + return typeof target === 'object' && target instanceof Object && !(target instanceof Array) && !(target instanceof RegExp); } for (key in override) { @@ -108,6 +110,8 @@ function updateDeeply(target, override) { * (if ecmaVersion >= 5). * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. * @return {ScopeManager} */ export function analyze(tree, providedOptions) { @@ -117,7 +121,7 @@ export function analyze(tree, providedOptions) { scopeManager = new ScopeManager(options); - referencer = new Referencer(scopeManager); + referencer = new Referencer(options, scopeManager); referencer.visit(tree); assert(scopeManager.__currentScope === null, 'currentScope should be null.'); diff --git a/tools/eslint/node_modules/escope/src/pattern-visitor.js b/tools/eslint/node_modules/escope/src/pattern-visitor.js index a6761a4384e029..b98e98ad22dd9a 100644 --- a/tools/eslint/node_modules/escope/src/pattern-visitor.js +++ b/tools/eslint/node_modules/escope/src/pattern-visitor.js @@ -42,8 +42,8 @@ export default class PatternVisitor extends esrecurse.Visitor { ); } - constructor(rootPattern, callback) { - super(); + constructor(options, rootPattern, callback) { + super(null, options); this.rootPattern = rootPattern; this.callback = callback; this.assignments = []; diff --git a/tools/eslint/node_modules/escope/src/referencer.js b/tools/eslint/node_modules/escope/src/referencer.js index e09768d7e28750..bd810808ce10cc 100644 --- a/tools/eslint/node_modules/escope/src/referencer.js +++ b/tools/eslint/node_modules/escope/src/referencer.js @@ -29,9 +29,9 @@ import PatternVisitor from './pattern-visitor'; import { ParameterDefinition, Definition } from './definition'; import assert from 'assert'; -function traverseIdentifierInPattern(rootPattern, referencer, callback) { +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { // Call the callback at left hand identifier nodes, and Collect right hand nodes. - var visitor = new PatternVisitor(rootPattern, callback); + var visitor = new PatternVisitor(options, rootPattern, callback); visitor.visit(rootPattern); // Process the right hand nodes recursively. @@ -48,7 +48,7 @@ function traverseIdentifierInPattern(rootPattern, referencer, callback) { class Importer extends esrecurse.Visitor { constructor(declaration, referencer) { - super(); + super(null, referencer.options); this.declaration = declaration; this.referencer = referencer; } @@ -91,8 +91,9 @@ class Importer extends esrecurse.Visitor { // Referencing variables and creating bindings. export default class Referencer extends esrecurse.Visitor { - constructor(scopeManager) { - super(); + constructor(options, scopeManager) { + super(null, options); + this.options = options; this.scopeManager = scopeManager; this.parent = null; this.isInnerMethodDefinition = false; @@ -155,6 +156,7 @@ export default class Referencer extends esrecurse.Visitor { options = {processRightHandNodes: false} } traverseIdentifierInPattern( + this.options, node, options.processRightHandNodes ? this : null, callback); @@ -573,6 +575,10 @@ export default class Referencer extends esrecurse.Visitor { let local = (node.id || node.local); this.visit(local); } + + MetaProperty() { + // do nothing. + } } /* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/escope/third_party/espree.js b/tools/eslint/node_modules/escope/third_party/espree.js index 26df9ee6ae621e..2f68051de6419c 100644 --- a/tools/eslint/node_modules/escope/third_party/espree.js +++ b/tools/eslint/node_modules/escope/third_party/espree.js @@ -47,75 +47,9 @@ module.exports = function (code) { // top-level errors array tolerant: true, - // specify parsing features (default only has blockBindings: true) - ecmaFeatures: { - - // enable parsing of arrow functions - arrowFunctions: true, - - // enable parsing of let/const - blockBindings: true, - - // enable parsing of destructured arrays and objects - destructuring: true, - - // enable parsing of regular expression y flag - regexYFlag: true, - - // enable parsing of regular expression u flag - regexUFlag: true, - - // enable parsing of template strings - templateStrings: true, - - // enable parsing of binary literals - binaryLiterals: true, - - // enable parsing of ES6 octal literals - octalLiterals: true, - - // enable parsing unicode code point escape sequences - unicodeCodePointEscapes: true, - - // enable parsing of default parameters - defaultParams: true, - - // enable parsing of rest parameters - restParams: true, - - // enable parsing of for-of statement - forOf: true, - - // enable parsing computed object literal properties - objectLiteralComputedProperties: true, - - // enable parsing of shorthand object literal methods - objectLiteralShorthandMethods: true, - - // enable parsing of shorthand object literal properties - objectLiteralShorthandProperties: true, - - // Allow duplicate object literal properties (except '__proto__') - objectLiteralDuplicateProperties: true, - - // enable parsing of generators/yield - generators: true, - - // enable parsing spread operator - spread: true, - - // enable parsing classes - classes: true, - - // enable parsing of modules - modules: true, - - // enable React JSX parsing - jsx: true, - - // enable return in global scope - globalReturn: true - } + // enable es6 features. + ecmaVersion: 6, + sourceType: "module" }); }; diff --git a/tools/eslint/node_modules/espree/LICENSE b/tools/eslint/node_modules/espree/LICENSE new file mode 100644 index 00000000000000..b5cef0004d5b81 --- /dev/null +++ b/tools/eslint/node_modules/espree/LICENSE @@ -0,0 +1,22 @@ +Espree +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +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/espree/README.md b/tools/eslint/node_modules/espree/README.md index 09e906c0bf9e41..80ca0482bf62f3 100644 --- a/tools/eslint/node_modules/espree/README.md +++ b/tools/eslint/node_modules/espree/README.md @@ -41,7 +41,7 @@ var ast = espree.parse(code, { // create a top-level tokens array containing all tokens tokens: true, - // specify the language version (3, 5, or 6, default is 5) + // specify the language version (3, 5, 6, or 7, default is 5) ecmaVersion: 5, // specify which type of script you're parsing (script or module, default is script) @@ -130,6 +130,10 @@ We are building on top of Acorn, however, so that we can contribute back and hel All of them. +### What ECMAScript 7 features do you support? + +There is only one ECMAScript 7 syntax change: the exponentiation operator. Espree supports this. + ### How do you determine which experimental features to 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/espree.js b/tools/eslint/node_modules/espree/espree.js index e085d2d5228992..9ad6e2e78cd50a 100644 --- a/tools/eslint/node_modules/espree/espree.js +++ b/tools/eslint/node_modules/espree/espree.js @@ -1,6 +1,5 @@ /** * @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 @@ -96,8 +95,6 @@ function resetExtra() { var tt = acorn.tokTypes, - Parser = acorn.Parser, - pp = Parser.prototype, getLineInfo = acorn.getLineInfo; // custom type for JSX attribute values @@ -113,9 +110,6 @@ function isValidNode(node) { var ecma = extra.ecmaFeatures; switch (node.type) { - case "Identifier": - return !extra.isModule || node.name !== "await"; - case "ExperimentalSpreadProperty": case "ExperimentalRestProperty": return ecma.experimentalObjectRestSpread; @@ -235,215 +229,218 @@ function wrapFinishNode(finishNode) { }; } -pp.extend("finishNode", wrapFinishNode); +acorn.plugins.espree = function(instance) { -pp.extend("finishNodeAt", wrapFinishNode); + instance.extend("finishNode", wrapFinishNode); -pp.extend("next", function(next) { - return /** @this acorn.Parser */ function() { - if (!isValidToken(this)) { - this.unexpected(); - } - return next.call(this); - }; -}); + instance.extend("finishNodeAt", wrapFinishNode); + + instance.extend("next", function(next) { + return /** @this acorn.Parser */ function() { + if (!isValidToken(this)) { + this.unexpected(); + } + return next.call(this); + }; + }); -// needed for experimental object rest/spread -pp.extend("checkLVal", function(checkLVal) { + // needed for experimental object rest/spread + instance.extend("checkLVal", function(checkLVal) { - return /** @this acorn.Parser */ function(expr, isBinding, checkClashes) { + 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); + if (extra.ecmaFeatures.experimentalObjectRestSpread && expr.type === "ObjectPattern") { + for (var i = 0; i < expr.properties.length; i++) { + if (expr.properties[i].type.indexOf("Experimental") === -1) { + this.checkLVal(expr.properties[i].value, isBinding, checkClashes); + } } + return undefined; } - return undefined; - } - return checkLVal.call(this, expr, isBinding, checkClashes); - }; -}); + return checkLVal.call(this, expr, isBinding, checkClashes); + }; + }); -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); - }; -}); + instance.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); + }; + }); -pp.extend("toAssignable", function(toAssignable) { + instance.extend("toAssignable", function(toAssignable) { - return /** @this acorn.Parser */ function(node, isBinding) { + return /** @this acorn.Parser */ function(node, isBinding) { - if (extra.ecmaFeatures.experimentalObjectRestSpread && - node.type === "ObjectExpression" - ) { - node.type = "ObjectPattern"; + if (extra.ecmaFeatures.experimentalObjectRestSpread && + node.type === "ObjectExpression" + ) { + node.type = "ObjectPattern"; - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i]; + 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); + 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); + } } + + return node; + } else { + return toAssignable.call(this, node, isBinding); } + }; - return node; - } else { - return toAssignable.call(this, node, isBinding); - } - }; + }); -}); + /** + * Method to parse an object rest or object spread. + * @returns {ASTNode} The node representing object rest or object spread. + * @this acorn.Parser + */ + instance.parseObjectRest = function() { + var node = this.startNode(); + this.next(); + node.argument = this.parseIdent(); + return this.finishNode(node, "ExperimentalRestProperty"); + }; -/** - * 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"); -}; + /** + * Method to parse an object with object rest or object spread. + * @param {boolean} isPattern True if the object is a destructuring pattern. + * @param {Object} refShorthandDefaultPos ? + * @returns {ASTNode} The node representing object rest or object spread. + * @this acorn.Parser + */ + instance.parseObj = function(isPattern, refShorthandDefaultPos) { + var node = this.startNode(), + first = true, + propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(tt.braceR)) { + + if (!first) { + this.expect(tt.comma); + + if (this.afterTrailingComma(tt.braceR)) { + break; + } -/** - * 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; + } else { + first = false; } - } else { - first = false; - } + var prop = this.startNode(), + isGenerator, + startPos, + startLoc; - var prop = this.startNode(), - isGenerator, - startPos, - startLoc; + if (extra.ecmaFeatures.experimentalObjectRestSpread && this.type === tt.ellipsis) { + if (isPattern) { + prop = this.parseObjectRest(); + } else { + prop = this.parseSpread(); + prop.type = "ExperimentalSpreadProperty"; + } - if (extra.ecmaFeatures.experimentalObjectRestSpread && this.type === tt.ellipsis) { - if (isPattern) { - prop = this.parseObjectRest(); - } else { - prop = this.parseSpread(); - prop.type = "ExperimentalSpreadProperty"; + node.properties.push(prop); + continue; } - node.properties.push(prop); - continue; - } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; + if (isPattern || refShorthandDefaultPos) { + startPos = this.start; + startLoc = this.startLoc; + } - if (isPattern || refShorthandDefaultPos) { - startPos = this.start; - startLoc = this.startLoc; + if (!isPattern) { + isGenerator = this.eat(tt.star); + } } - if (!isPattern) { - isGenerator = this.eat(tt.star); - } + this.parsePropertyName(prop); + this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); + node.properties.push(this.finishNode(prop, "Property")); } - this.parsePropertyName(prop); - this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos); - this.checkPropClash(prop, propHash); - node.properties.push(this.finishNode(prop, "Property")); - } - - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + }; -/** - * 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; -}; + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + instance.raise = instance.raiseRecoverable = function(pos, message) { + var loc = getLineInfo(this.input, pos); + var err = new SyntaxError(message); + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + }; -/** - * 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"; + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + instance.unexpected = function(pos) { + var message = "Unexpected token"; - if (pos !== null && pos !== undefined) { - this.pos = pos; + if (pos !== null && pos !== undefined) { + this.pos = pos; - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } } - } - - this.nextToken(); - } - - if (this.end > this.start) { - message += " " + this.input.slice(this.start, this.end); - } - this.raise(this.start, message); -}; + this.nextToken(); + } -/* - * 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; + if (this.end > this.start) { + message += " " + this.input.slice(this.start, this.end); } - return result; + this.raise(this.start, message); }; -}); + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + instance.extend("jsx_readString", function(jsxReadString) { + return /** @this acorn.Parser */ function(quote) { + var result = jsxReadString.call(this, quote); + if (this.type === tt.string) { + extra.jsxAttrValueToken = true; + } + + return result; + }; + }); +}; //------------------------------------------------------------------------------ // Tokenizer @@ -474,7 +471,10 @@ function tokenize(code, options) { options = options || {}; var acornOptions = { - ecmaVersion: 5 + ecmaVersion: 5, + plugins: { + espree: true + } }; resetExtra(); @@ -505,12 +505,13 @@ function tokenize(code, options) { case 3: case 5: case 6: + case 7: acornOptions.ecmaVersion = options.ecmaVersion; extra.ecmaVersion = options.ecmaVersion; break; default: - throw new Error("ecmaVersion must be 3, 5, or 6."); + throw new Error("ecmaVersion must be 3, 5, 6, or 7."); } } @@ -595,7 +596,10 @@ function parse(code, options) { translator, impliedStrict, acornOptions = { - ecmaVersion: 5 + ecmaVersion: 5, + plugins: { + espree: true + } }; lastToken = null; @@ -638,12 +642,13 @@ function parse(code, options) { case 3: case 5: case 6: + case 7: acornOptions.ecmaVersion = options.ecmaVersion; extra.ecmaVersion = options.ecmaVersion; break; default: - throw new Error("ecmaVersion must be 3, 5, or 6."); + throw new Error("ecmaVersion must be 3, 5, 6, or 7."); } } @@ -699,7 +704,11 @@ function parse(code, options) { } if (extra.ecmaFeatures.jsx) { - acornOptions.plugins = { jsx: true }; + // Should process jsx plugin before espree plugin. + acornOptions.plugins = { + jsx: true, + espree: true + }; } } 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 ec9eaa1fbe377c..18ee3551ad663d 100644 --- a/tools/eslint/node_modules/espree/lib/ast-node-types.js +++ b/tools/eslint/node_modules/espree/lib/ast-node-types.js @@ -1,28 +1,6 @@ /** * @fileoverview The AST node types produced 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"; diff --git a/tools/eslint/node_modules/espree/lib/comment-attachment.js b/tools/eslint/node_modules/espree/lib/comment-attachment.js index b0f033dceac1fc..b82b5f1cd39cdd 100644 --- a/tools/eslint/node_modules/espree/lib/comment-attachment.js +++ b/tools/eslint/node_modules/espree/lib/comment-attachment.js @@ -1,28 +1,6 @@ /** * @fileoverview Attaches comments to the AST. * @author Nicholas C. Zakas - * @copyright 2015 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"; @@ -40,7 +18,8 @@ var astNodeTypes = require("./ast-node-types"); var extra = { trailingComments: [], leadingComments: [], - bottomRightStack: [] + bottomRightStack: [], + previousNode: null }; //------------------------------------------------------------------------------ @@ -53,6 +32,7 @@ module.exports = { extra.trailingComments = []; extra.leadingComments = []; extra.bottomRightStack = []; + extra.previousNode = null; }, addComment: function(comment) { @@ -63,7 +43,8 @@ module.exports = { processComment: function(node) { var lastChild, trailingComments, - i; + i, + j; if (node.type === astNodeTypes.Program) { if (node.body.length > 0) { @@ -126,10 +107,19 @@ module.exports = { } } } else if (extra.leadingComments.length > 0) { - if (extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) { - node.leadingComments = extra.leadingComments; - extra.leadingComments = []; + if (extra.previousNode) { + for (j = 0; j < extra.leadingComments.length; j++) { + if (extra.leadingComments[j].end < extra.previousNode.end) { + extra.leadingComments.splice(j, 1); + j--; + } + } + } + if (extra.leadingComments.length > 0) { + node.leadingComments = extra.leadingComments; + extra.leadingComments = []; + } } else { // https://github.com/eslint/espree/issues/2 @@ -173,6 +163,8 @@ module.exports = { } } + extra.previousNode = node; + if (trailingComments) { node.trailingComments = trailingComments; } diff --git a/tools/eslint/node_modules/espree/lib/features.js b/tools/eslint/node_modules/espree/lib/features.js index aa2a6e48b62585..774f8e5e581d05 100644 --- a/tools/eslint/node_modules/espree/lib/features.js +++ b/tools/eslint/node_modules/espree/lib/features.js @@ -2,28 +2,6 @@ * @fileoverview The list of feature flags supported by the parser and their default * settings. * @author Nicholas C. Zakas - * @copyright 2015 Fred K. Schott. All rights reserved. - * @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"; diff --git a/tools/eslint/node_modules/espree/lib/token-translator.js b/tools/eslint/node_modules/espree/lib/token-translator.js index fbae0d80ff309a..857c18eefa3122 100644 --- a/tools/eslint/node_modules/espree/lib/token-translator.js +++ b/tools/eslint/node_modules/espree/lib/token-translator.js @@ -1,27 +1,6 @@ /** * @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 */ @@ -131,6 +110,10 @@ TokenTranslator.prototype = { token.type = Token.Keyword; } + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + } else if (type === tt.semi || type === tt.comma || type === tt.parenL || type === tt.parenR || type === tt.braceL || type === tt.braceR || @@ -138,6 +121,7 @@ TokenTranslator.prototype = { type === tt.colon || type === tt.question || type === tt.bracketR || type === tt.ellipsis || type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || type === tt.jsxTagEnd || (type.binop && !type.keyword) || type.isAssign) { diff --git a/tools/eslint/node_modules/espree/lib/visitor-keys.js b/tools/eslint/node_modules/espree/lib/visitor-keys.js index 6934dfd26529f9..d1efeb7afc3f34 100644 --- a/tools/eslint/node_modules/espree/lib/visitor-keys.js +++ b/tools/eslint/node_modules/espree/lib/visitor-keys.js @@ -1,30 +1,8 @@ /** * @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. + * This file contains code from estraverse-fb. * * The MIT license. Copyright (c) 2014 Ingvar Stepanyan * diff --git a/tools/eslint/node_modules/espree/package.json b/tools/eslint/node_modules/espree/package.json index 6ea1d086f9b10a..3afa735062f49f 100644 --- a/tools/eslint/node_modules/espree/package.json +++ b/tools/eslint/node_modules/espree/package.json @@ -1,41 +1,42 @@ { "_args": [ [ - "espree@^3.0.0", - "/Users/trott/test/node_modules/eslint" + "espree@3.1.4", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "espree@>=3.0.0 <4.0.0", - "_id": "espree@3.0.1", + "_from": "espree@3.1.4", + "_id": "espree@3.1.4", "_inCache": true, "_installable": true, - "_location": "/eslint/espree", + "_location": "/espree", + "_nodeVersion": "4.4.2", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/espree-3.0.1.tgz_1454452460192_0.6580590554513037" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/espree-3.1.4.tgz_1461264685938_0.4520344687625766" }, "_npmUser": { "email": "nicholas@nczconsulting.com", "name": "nzakas" }, - "_npmVersion": "1.4.10", + "_npmVersion": "2.15.0", "_phantomChildren": {}, "_requested": { "name": "espree", - "raw": "espree@^3.0.0", - "rawSpec": "^3.0.0", + "raw": "espree@3.1.4", + "rawSpec": "3.1.4", "scope": null, - "spec": ">=3.0.0 <4.0.0", - "type": "range" + "spec": "3.1.4", + "type": "version" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/espree/-/espree-3.0.1.tgz", - "_shasum": "85a5c95c168563159406b698d3ee7d4c1ca2073f", + "_resolved": "https://registry.npmjs.org/espree/-/espree-3.1.4.tgz", + "_shasum": "0726d7ac83af97a7c8498da9b363a3609d2a68a1", "_shrinkwrap": null, - "_spec": "espree@^3.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "espree@3.1.4", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "nicholas+npm@nczconsulting.com", "name": "Nicholas C. Zakas" @@ -44,8 +45,8 @@ "url": "http://github.com/eslint/espree.git" }, "dependencies": { - "acorn": "^2.7.0", - "acorn-jsx": "^2.0.1" + "acorn": "^3.1.0", + "acorn-jsx": "^3.0.0" }, "description": "An Esprima-compatible JavaScript parser built on Acorn", "devDependencies": { @@ -53,14 +54,13 @@ "chai": "^1.10.0", "eslint": "^2.0.0-beta.1", "eslint-config-eslint": "^3.0.0", - "eslint-release": "^0.2.0", + "eslint-release": "^0.3.0", "esprima": "latest", "esprima-fb": "^8001.2001.0-dev-harmony-fb", "istanbul": "~0.2.6", "json-diff": "~0.3.1", "leche": "^1.0.1", "mocha": "^2.0.1", - "optimist": "~0.6.0", "regenerate": "~0.5.4", "shelljs": "^0.3.0", "shelljs-nodecli": "^0.1.1", @@ -68,8 +68,8 @@ }, "directories": {}, "dist": { - "shasum": "85a5c95c168563159406b698d3ee7d4c1ca2073f", - "tarball": "http://registry.npmjs.org/espree/-/espree-3.0.1.tgz" + "shasum": "0726d7ac83af97a7c8498da9b363a3609d2a68a1", + "tarball": "https://registry.npmjs.org/espree/-/espree-3.1.4.tgz" }, "engines": { "node": ">=0.10.0" @@ -78,6 +78,7 @@ "lib", "espree.js" ], + "gitHead": "72ef3f4a332d6f8bfb32a55573eacb06f65e7f11", "homepage": "https://github.com/eslint/espree", "keywords": [ "ast", @@ -103,12 +104,13 @@ "url": "git+ssh://git@github.com/eslint/espree.git" }, "scripts": { + "alpharelease": "eslint-prelease alpha", + "betarelease": "eslint-prelease beta", "browserify": "node Makefile.js browserify", "generate-regex": "node tools/generate-identifier-regex.js", "lint": "node Makefile.js lint", - "prerelease": "eslint-release", "release": "eslint-release", "test": "npm run-script lint && node Makefile.js test" }, - "version": "3.0.1" + "version": "3.1.4" } diff --git a/tools/eslint/node_modules/esprima/ChangeLog b/tools/eslint/node_modules/esprima/ChangeLog deleted file mode 100644 index 864ab696199e2c..00000000000000 --- a/tools/eslint/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,170 +0,0 @@ -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/package.json b/tools/eslint/node_modules/esprima/package.json index c1d6e65f9a0334..332d87e6d82e85 100644 --- a/tools/eslint/node_modules/esprima/package.json +++ b/tools/eslint/node_modules/esprima/package.json @@ -2,14 +2,14 @@ "_args": [ [ "esprima@^2.6.0", - "/Users/trott/test/node_modules/eslint/node_modules/js-yaml" + "/Users/trott/io.js/tools/node_modules/js-yaml" ] ], "_from": "esprima@>=2.6.0 <3.0.0", "_id": "esprima@2.7.2", "_inCache": true, "_installable": true, - "_location": "/eslint/esprima", + "_location": "/esprima", "_nodeVersion": "4.2.2", "_npmOperationalInternal": { "host": "packages-9-west.internal.npmjs.com", @@ -30,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/js-yaml" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/js-yaml", "author": { "email": "ariya.hidayat@gmail.com", "name": "Ariya Hidayat" @@ -77,7 +77,7 @@ "directories": {}, "dist": { "shasum": "f43be543609984eae44c933ac63352a6af35f339", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" + "tarball": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/esrecurse/README.md b/tools/eslint/node_modules/esrecurse/README.md deleted file mode 100644 index e767592faab07e..00000000000000 --- a/tools/eslint/node_modules/esrecurse/README.md +++ /dev/null @@ -1,86 +0,0 @@ -### Esrecurse [![Build Status](https://secure.travis-ci.org/estools/esrecurse.png)](http://travis-ci.org/estools/esrecurse) - -Esrecurse ([esrecurse](http://github.com/estools/esrecurse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -recursive traversing functionality. - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -esrecurse.visit(ast, { - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); -``` - -We can use `Visitor` instance. - -```javascript -var visitor = new esrecurse.Visitor({ - XXXStatement: function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); - } -}); - -visitor.visit(ast); -``` - -We can inherit `Visitor` instance easily. - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - this.visit(node.left); - // do something... - this.visit(node.right); -}; -``` - -And you can invoke default visiting operation inside custom visit operation. - -```javascript -function DerivedVisitor() { - esrecurse.Visitor.call(/* this for constructor */ this /* visitor object automatically becomes this. */); -} -util.inherits(DerivedVisitor, esrecurse.Visitor); -DerivedVisitor.prototype.XXXStatement = function (node) { - // do something... - this.visitChildren(node); -}; -``` - -### License - -Copyright (C) 2014 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/esrecurse/esrecurse.js b/tools/eslint/node_modules/esrecurse/esrecurse.js index 0774f86f6bc6de..0805e67f391041 100644 --- a/tools/eslint/node_modules/esrecurse/esrecurse.js +++ b/tools/eslint/node_modules/esrecurse/esrecurse.js @@ -24,18 +24,17 @@ (function () { 'use strict'; - var estraverse, + var assign, + estraverse, isArray, objectKeys; + assign = require('object-assign'); estraverse = require('estraverse'); - isArray = Array.isArray; - if (!isArray) { - isArray = function isArray(array) { - return Object.prototype.toString.call(array) === '[object Array]'; - }; - } + isArray = Array.isArray || function isArray(array) { + return Object.prototype.toString.call(array) === '[object Array]'; + }; objectKeys = Object.keys || function (o) { var keys = [], key; @@ -56,8 +55,18 @@ return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; } - function Visitor(visitor) { + function Visitor(visitor, options) { + options = options || {}; + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = objectKeys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } } /* Default method for visiting children. @@ -73,15 +82,19 @@ type = node.type || estraverse.Syntax.Property; - children = estraverse.VisitorKeys[type]; + children = this.__childVisitorKeys[type]; if (!children) { - children = objectKeys(node); + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } } for (i = 0, iz = children.length; i < iz; ++i) { child = node[children[i]]; if (child) { - if (Array.isArray(child)) { + if (isArray(child)) { for (j = 0, jz = child.length; j < jz; ++j) { if (child[j]) { if (isNode(child[j]) || isProperty(type, children[i])) { @@ -114,8 +127,8 @@ exports.version = require('./package.json').version; exports.Visitor = Visitor; - exports.visit = function (node, visitor) { - var v = new Visitor(visitor); + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); v.visit(node); }; }()); diff --git a/tools/eslint/node_modules/esrecurse/gulpfile.coffee b/tools/eslint/node_modules/esrecurse/gulpfile.coffee deleted file mode 100644 index e7781896774265..00000000000000 --- a/tools/eslint/node_modules/esrecurse/gulpfile.coffee +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2014 Yusuke Suzuki -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -gulp = require 'gulp' -mocha = require 'gulp-mocha' -eslint = require 'gulp-eslint' -minimist = require 'minimist' -git = require 'gulp-git' -bump = require 'gulp-bump' -filter = require 'gulp-filter' -tagVersion = require 'gulp-tag-version' -require 'coffee-script/register' - -SOURCE = [ - '*.js' -] - -ESLINT_OPTION = - rules: - 'quotes': 0 - 'eqeqeq': 0 - 'no-use-before-define': 0 - 'no-shadow': 0 - 'no-new': 0 - 'no-underscore-dangle': 0 - 'no-multi-spaces': false - 'no-native-reassign': 0 - 'no-loop-func': 0 - env: - 'node': true - -gulp.task 'test', -> - options = minimist process.argv.slice(2), - string: 'test', - default: - test: 'test/*.coffee' - return gulp.src(options.test).pipe(mocha reporter: 'spec') - -gulp.task 'lint', -> - return gulp.src(SOURCE) - .pipe(eslint(ESLINT_OPTION)) - .pipe(eslint.formatEach('stylish', process.stderr)) - .pipe(eslint.failOnError()) - -inc = (importance) -> - gulp.src(['./package.json']) - .pipe(bump({type: importance})) - .pipe(gulp.dest('./')) - .pipe(git.commit('Bumps package version')) - .pipe(filter('package.json')) - .pipe(tagVersion({ - prefix: '' - })) - -gulp.task 'travis', [ 'lint', 'test' ] -gulp.task 'default', [ 'travis' ] - -gulp.task 'patch', [ ], -> inc('patch') -gulp.task 'minor', [ ], -> inc('minor') -gulp.task 'major', [ ], -> inc('major') diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/.jshintrc b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae7683b81..00000000000000 --- a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md index 4242c513309e9a..acefff6473c19c 100644 --- a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md +++ b/tools/eslint/node_modules/esrecurse/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/esrecurse/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js index a668aa3e61123f..0de6cec24f3ec6 100644 --- a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js @@ -185,6 +185,7 @@ LabeledStatement: 'LabeledStatement', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', MethodDefinition: 'MethodDefinition', ModuleSpecifier: 'ModuleSpecifier', NewExpression: 'NewExpression', @@ -196,7 +197,7 @@ ReturnStatement: 'ReturnStatement', SequenceExpression: 'SequenceExpression', SpreadElement: 'SpreadElement', - SuperExpression: 'SuperExpression', + Super: 'Super', SwitchStatement: 'SwitchStatement', SwitchCase: 'SwitchCase', TaggedTemplateExpression: 'TaggedTemplateExpression', @@ -258,6 +259,7 @@ LabeledStatement: ['label', 'body'], LogicalExpression: ['left', 'right'], MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], MethodDefinition: ['key', 'value'], ModuleSpecifier: [], NewExpression: ['callee', 'arguments'], @@ -269,7 +271,7 @@ ReturnStatement: ['argument'], SequenceExpression: ['expressions'], SpreadElement: ['argument'], - SuperExpression: ['super'], + Super: [], SwitchStatement: ['discriminant', 'cases'], SwitchCase: ['test', 'consequent'], TaggedTemplateExpression: ['tag', 'quasi'], @@ -504,7 +506,7 @@ } node = element.node; - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { @@ -658,7 +660,7 @@ continue; } - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/gulpfile.js b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbcca542a8..00000000000000 --- a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json index 82a1d3ad1cbf72..14d333246056af 100644 --- a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json @@ -1,37 +1,38 @@ { "_args": [ [ - "estraverse@~3.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/esrecurse" + "estraverse@~4.1.0", + "/Users/trott/io.js/tools/node_modules/esrecurse" ] ], - "_from": "estraverse@>=3.1.0 <3.2.0", - "_id": "estraverse@3.1.0", + "_from": "estraverse@>=4.1.0 <4.2.0", + "_id": "estraverse@4.1.1", "_inCache": true, "_installable": true, - "_location": "/eslint/esrecurse/estraverse", + "_location": "/esrecurse/estraverse", + "_nodeVersion": "4.1.1", "_npmUser": { "email": "utatane.tea@gmail.com", "name": "constellation" }, - "_npmVersion": "2.0.0-alpha-5", + "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { "name": "estraverse", - "raw": "estraverse@~3.1.0", - "rawSpec": "~3.1.0", + "raw": "estraverse@~4.1.0", + "rawSpec": "~4.1.0", "scope": null, - "spec": ">=3.1.0 <3.2.0", + "spec": ">=4.1.0 <4.2.0", "type": "range" }, "_requiredBy": [ - "/eslint/esrecurse" + "/esrecurse" ], - "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz", - "_shasum": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba", + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "_shasum": "f6caca728933a850ef90661d0e17982ba47111a2", "_shrinkwrap": null, - "_spec": "estraverse@~3.1.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/esrecurse", + "_spec": "estraverse@~4.1.0", + "_where": "/Users/trott/io.js/tools/node_modules/esrecurse", "bugs": { "url": "https://github.com/estools/estraverse/issues" }, @@ -51,20 +52,15 @@ }, "directories": {}, "dist": { - "shasum": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba", - "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz" + "shasum": "f6caca728933a850ef90661d0e17982ba47111a2", + "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz" }, "engines": { "node": ">=0.10.0" }, - "gitHead": "166ebbe0a8d45ceb2391b6f5ef5d1bab6bfb267a", + "gitHead": "bbcccbfe98296585e4311c8755e1d00dcd581e3c", "homepage": "https://github.com/estools/estraverse", - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/estools/estraverse/raw/master/LICENSE.BSD" - } - ], + "license": "BSD-2-Clause", "main": "estraverse.js", "maintainers": [ { @@ -74,6 +70,10 @@ { "email": "npm@michael.ficarra.me", "name": "michaelficarra" + }, + { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" } ], "name": "estraverse", @@ -88,5 +88,5 @@ "test": "npm run-script lint && npm run-script unit-test", "unit-test": "mocha --compilers coffee:coffee-script/register" }, - "version": "3.1.0" + "version": "4.1.1" } diff --git a/tools/eslint/node_modules/esrecurse/package.json b/tools/eslint/node_modules/esrecurse/package.json index 25a9651eb032ff..cffe502c119268 100644 --- a/tools/eslint/node_modules/esrecurse/package.json +++ b/tools/eslint/node_modules/esrecurse/package.json @@ -1,74 +1,75 @@ { "_args": [ [ - "esrecurse@^3.1.1", - "/Users/trott/test/node_modules/eslint/node_modules/escope" + "esrecurse@^4.1.0", + "/Users/trott/io.js/tools/node_modules/escope" ] ], - "_from": "esrecurse@>=3.1.1 <4.0.0", - "_id": "esrecurse@3.1.1", + "_from": "esrecurse@>=4.1.0 <5.0.0", + "_id": "esrecurse@4.1.0", "_inCache": true, "_installable": true, - "_location": "/eslint/esrecurse", + "_location": "/esrecurse", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/esrecurse-4.1.0.tgz_1457712782215_0.15950557170435786" + }, "_npmUser": { - "email": "utatane.tea@gmail.com", - "name": "constellation" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, - "_npmVersion": "2.0.0-alpha-5", + "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { "name": "esrecurse", - "raw": "esrecurse@^3.1.1", - "rawSpec": "^3.1.1", + "raw": "esrecurse@^4.1.0", + "rawSpec": "^4.1.0", "scope": null, - "spec": ">=3.1.1 <4.0.0", + "spec": ">=4.1.0 <5.0.0", "type": "range" }, "_requiredBy": [ - "/eslint/escope" + "/escope" ], - "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz", - "_shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9", + "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", + "_shasum": "4713b6536adf7f2ac4f327d559e7756bff648220", "_shrinkwrap": null, - "_spec": "esrecurse@^3.1.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/escope", + "_spec": "esrecurse@^4.1.0", + "_where": "/Users/trott/io.js/tools/node_modules/escope", "bugs": { "url": "https://github.com/estools/esrecurse/issues" }, "dependencies": { - "estraverse": "~3.1.0" + "estraverse": "~4.1.0", + "object-assign": "^4.0.1" }, - "description": "ECMAScript scope analyzer", + "description": "ECMAScript AST recursive visitor", "devDependencies": { - "chai": "^2.1.1", + "chai": "^3.3.0", "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": "^3.9.0", + "gulp-bump": "^1.0.0", + "gulp-eslint": "^1.0.0", + "gulp-filter": "^3.0.1", "gulp-git": "^1.1.0", - "gulp-mocha": "~2.0.0", + "gulp-mocha": "^2.1.3", "gulp-tag-version": "^1.2.1", - "jsdoc": "~3.3.0-alpha10", + "jsdoc": "^3.3.0-alpha10", "minimist": "^1.1.0" }, "directories": {}, "dist": { - "shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9", - "tarball": "http://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz" + "shasum": "4713b6536adf7f2ac4f327d559e7756bff648220", + "tarball": "http://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.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" - } - ], + "gitHead": "63a34714834bd7ad2063054bd4abb24fb82ca667", + "homepage": "https://github.com/estools/esrecurse", + "license": "BSD-2-Clause", "main": "esrecurse.js", "maintainers": [ { @@ -78,6 +79,10 @@ { "email": "npm@michael.ficarra.me", "name": "michaelficarra" + }, + { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" } ], "name": "esrecurse", @@ -85,12 +90,12 @@ "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git+ssh://git@github.com/estools/esrecurse.git" + "url": "git+https://github.com/estools/esrecurse.git" }, "scripts": { "lint": "gulp lint", "test": "gulp travis", "unit-test": "gulp test" }, - "version": "3.1.1" + "version": "4.1.0" } diff --git a/tools/eslint/node_modules/estraverse-fb/.npmignore b/tools/eslint/node_modules/estraverse-fb/.npmignore deleted file mode 100644 index da23d0d4bab050..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/.npmignore +++ /dev/null @@ -1,25 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Deployed apps should consider commenting this line out: -# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git -node_modules diff --git a/tools/eslint/node_modules/estraverse-fb/.travis.yml b/tools/eslint/node_modules/estraverse-fb/.travis.yml deleted file mode 100644 index ffb9f710ac283a..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/.travis.yml +++ /dev/null @@ -1,2 +0,0 @@ -language: node_js -node_js: '0.10' diff --git a/tools/eslint/node_modules/estraverse-fb/LICENSE b/tools/eslint/node_modules/estraverse-fb/LICENSE deleted file mode 100644 index 54530b38082641..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ingvar Stepanyan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/README.md b/tools/eslint/node_modules/estraverse-fb/README.md deleted file mode 100644 index 20b02966b871d0..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/README.md +++ /dev/null @@ -1,34 +0,0 @@ -estraverse-fb -============= -[![Build Status](https://travis-ci.org/RReverser/estraverse-fb.svg?branch=master)](https://travis-ci.org/RReverser/estraverse-fb) - -Drop-in for estraverse that enables traversal over React's JSX and Flow nodes using monkey-patching technique. - -You can use estraverse-fb in two possible ways: - -* by default, you just require it and it injects needed keys into your installed version of estraverse (it's installed automatically if you don't have it yet): - ```javascript - var estraverse = require('estraverse-fb'); - /* same as: - require('estraverse-fb'); - var estraverse = require('estraverse'); - */ - - estraverse.traverse(ast, { - enter: ..., - leave: ... - }); - ``` - -* alternatively, you can use it manually for selected traversals: - ```javascript - var jsxKeys = require('estraverse-fb/keys'); - - estraverse.traverse(ast, { - enter: ..., - leave: ..., - keys: jsxKeys - }) -``` - -Check out [estraverse page](https://github.com/Constellation/estraverse) for detailed usage. diff --git a/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js b/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js deleted file mode 100644 index 795ec40e62a2ae..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js +++ /dev/null @@ -1,13 +0,0 @@ -var estraverse = module.exports = require('estraverse'); - -var VisitorKeys = require('./keys'); - -for (var nodeType in VisitorKeys) { - estraverse.Syntax[nodeType] = nodeType; - - var keys = VisitorKeys[nodeType]; - - if (keys) { - estraverse.VisitorKeys[nodeType] = keys; - } -} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/keys.js b/tools/eslint/node_modules/estraverse-fb/keys.js deleted file mode 100644 index 47df04a58ba37d..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/keys.js +++ /dev/null @@ -1,57 +0,0 @@ -var unprefixedKeys = { - Identifier: [], - NamespacedName: ['namespace', 'name'], - MemberExpression: ['object', 'property'], - EmptyExpression: [], - ExpressionContainer: ['expression'], - Element: ['openingElement', 'closingElement', 'children'], - ClosingElement: ['name'], - OpeningElement: ['name', 'attributes'], - Attribute: ['name', 'value'], - Text: null, - SpreadAttribute: ['argument'] -}; - -var flowKeys = { - Type: [], - AnyTypeAnnotation: [], - VoidTypeAnnotation: [], - NumberTypeAnnotation: [], - StringTypeAnnotation: [], - StringLiteralTypeAnnotation: ["value", "raw"], - BooleanTypeAnnotation: [], - TypeAnnotation: ["typeAnnotation"], - NullableTypeAnnotation: ["typeAnnotation"], - FunctionTypeAnnotation: ["params", "returnType", "rest", "typeParameters"], - FunctionTypeParam: ["name", "typeAnnotation", "optional"], - ObjectTypeAnnotation: ["properties"], - ObjectTypeProperty: ["key", "value", "optional"], - ObjectTypeIndexer: ["id", "key", "value"], - ObjectTypeCallProperty: ["value"], - QualifiedTypeIdentifier: ["qualification", "id"], - GenericTypeAnnotation: ["id", "typeParameters"], - MemberTypeAnnotation: ["object", "property"], - UnionTypeAnnotation: ["types"], - IntersectionTypeAnnotation: ["types"], - TypeofTypeAnnotation: ["argument"], - TypeParameterDeclaration: ["params"], - TypeParameterInstantiation: ["params"], - ClassProperty: ["key", "typeAnnotation"], - ClassImplements: [], - InterfaceDeclaration: ["id", "body", "extends"], - InterfaceExtends: ["id"], - TypeAlias: ["id", "typeParameters", "right"], - TupleTypeAnnotation: ["types"], - DeclareVariable: ["id"], - DeclareFunction: ["id"], - DeclareClass: ["id"], - DeclareModule: ["id", "body"] -}; - -for (var key in unprefixedKeys) { - exports['XJS' + key] = exports['JSX' + key] = unprefixedKeys[key]; -} - -for (var key in flowKeys) { - exports[key] = flowKeys[key]; -} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/package.json b/tools/eslint/node_modules/estraverse-fb/package.json deleted file mode 100644 index f645d728aea7cb..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_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" - }, - "_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": { - "email": "me@rreverser.com", - "name": "Ingvar Stepanyan", - "url": "https://github.com/RReverser" - }, - "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" - }, - "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", - "keywords": [ - "traverse", - "ast", - "react", - "jsx" - ], - "license": "MIT", - "main": "estraverse-fb.js", - "maintainers": [ - { - "email": "me@rreverser.com", - "name": "rreverser" - } - ], - "name": "estraverse-fb", - "optionalDependencies": {}, - "peerDependencies": { - "estraverse": "*" - }, - "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-fb/test.js b/tools/eslint/node_modules/estraverse-fb/test.js deleted file mode 100644 index e0fca88a01689a..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/test.js +++ /dev/null @@ -1,116 +0,0 @@ -var assert = require('chai').assert; -var parse = require('esprima-fb').parse; -var originalKeys = require('./keys'); - -describe('works', function () { - var code = ['class MyClass{', - 'x: number;', - 'y: number;', - 'constructor(x: number, y: number){', - 'this.x = x;', - 'this.y = y;', - '}', - 'render(){', - 'return !{}', - '}', - '}'].join('\n'); - - var ast = parse(code); - - var expectedKeys = [ - 'ClassProperty', - 'TypeAnnotation', - 'NumberTypeAnnotation', - 'ClassProperty', - 'TypeAnnotation', - 'NumberTypeAnnotation', - 'XJSElement', - 'XJSOpeningElement', - 'XJSNamespacedName', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSAttribute', - 'XJSIdentifier', - 'XJSAttribute', - 'XJSIdentifier', - 'XJSExpressionContainer', - 'XJSSpreadAttribute', - 'XJSClosingElement', - 'XJSNamespacedName', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSElement', - 'XJSOpeningElement', - 'XJSMemberExpression', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSClosingElement', - 'XJSMemberExpression', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSExpressionContainer', - 'XJSEmptyExpression' - ]; - - beforeEach(function () { - for (var key in require.cache) { - delete require.cache[key]; - } - }); - - it('directly from dependency', function () { - var traverse = require('./').traverse; - var actualKeys = []; - var actualTypeKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - } - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); - - it('in injected mode', function () { - require('./'); - var traverse = require('estraverse').traverse; - var actualKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - } - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); - - it('in single-pass mode', function () { - var traverse = require('estraverse').traverse; - var keys = require('./keys'); - - var actualKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - }, - keys: keys - }); - - assert.throws(function () { - traverse(ast, { - enter: function () {} - }); - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); -}); diff --git a/tools/eslint/node_modules/estraverse/.babelrc b/tools/eslint/node_modules/estraverse/.babelrc new file mode 100644 index 00000000000000..dc1bc4f9cdba17 --- /dev/null +++ b/tools/eslint/node_modules/estraverse/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse/.jshintrc b/tools/eslint/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae7683b81..00000000000000 --- a/tools/eslint/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/tools/eslint/node_modules/estraverse/README.md b/tools/eslint/node_modules/estraverse/README.md deleted file mode 100644 index acefff6473c19c..00000000000000 --- a/tools/eslint/node_modules/estraverse/README.md +++ /dev/null @@ -1,124 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.png)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the existing traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -### License - -Copyright (C) 2012-2013 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/estraverse/estraverse.js index 0de6cec24f3ec6..09ae4783247f0c 100644 --- a/tools/eslint/node_modules/estraverse/estraverse.js +++ b/tools/eslint/node_modules/estraverse/estraverse.js @@ -432,7 +432,13 @@ this.__leavelist = []; this.__current = null; this.__state = null; - this.__fallback = visitor.fallback === 'iteration'; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = objectKeys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + this.__keys = VisitorKeys; if (visitor.keys) { this.__keys = extend(objectCreate(this.__keys), visitor.keys); @@ -510,7 +516,7 @@ candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { - candidates = objectKeys(node); + candidates = this.__fallback(node); } else { throw new Error('Unknown node type ' + nodeType + '.'); } @@ -548,6 +554,20 @@ }; Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + function removeElem(element) { var i, key, @@ -573,20 +593,6 @@ } } - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - this.__initialize(root, visitor); sentinel = {}; @@ -664,7 +670,7 @@ candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { - candidates = objectKeys(node); + candidates = this.__fallback(node); } else { throw new Error('Unknown node type ' + nodeType + '.'); } diff --git a/tools/eslint/node_modules/estraverse/gulpfile.js b/tools/eslint/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbcca542a8..00000000000000 --- a/tools/eslint/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/tools/eslint/node_modules/estraverse/package.json b/tools/eslint/node_modules/estraverse/package.json index 0c93cb3587e3ad..20ae6912b014c1 100644 --- a/tools/eslint/node_modules/estraverse/package.json +++ b/tools/eslint/node_modules/estraverse/package.json @@ -1,47 +1,52 @@ { "_args": [ [ - "estraverse@^4.1.1", - "/Users/trott/test/node_modules/eslint" + "estraverse@^4.2.0", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "estraverse@>=4.1.1 <5.0.0", - "_id": "estraverse@4.1.1", + "_from": "estraverse@>=4.2.0 <5.0.0", + "_id": "estraverse@4.2.0", "_inCache": true, "_installable": true, - "_location": "/eslint/estraverse", - "_nodeVersion": "4.1.1", + "_location": "/estraverse", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/estraverse-4.2.0.tgz_1457646738925_0.7118953282479197" + }, "_npmUser": { - "email": "utatane.tea@gmail.com", - "name": "constellation" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, - "_npmVersion": "2.14.4", + "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { "name": "estraverse", - "raw": "estraverse@^4.1.1", - "rawSpec": "^4.1.1", + "raw": "estraverse@^4.2.0", + "rawSpec": "^4.2.0", "scope": null, - "spec": ">=4.1.1 <5.0.0", + "spec": ">=4.2.0 <5.0.0", "type": "range" }, "_requiredBy": [ - "/eslint", - "/eslint/escope" + "/escope", + "/eslint" ], - "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", - "_shasum": "f6caca728933a850ef90661d0e17982ba47111a2", + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "_shasum": "0dee3fed31fcd469618ce7342099fc1afa0bdb13", "_shrinkwrap": null, - "_spec": "estraverse@^4.1.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "estraverse@^4.2.0", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "bugs": { "url": "https://github.com/estools/estraverse/issues" }, "dependencies": {}, "description": "ECMAScript JS AST traversal functions", "devDependencies": { + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.3.13", "chai": "^2.1.1", - "coffee-script": "^1.8.0", "espree": "^1.11.0", "gulp": "^3.8.10", "gulp-bump": "^0.2.2", @@ -53,13 +58,13 @@ }, "directories": {}, "dist": { - "shasum": "f6caca728933a850ef90661d0e17982ba47111a2", - "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz" + "shasum": "0dee3fed31fcd469618ce7342099fc1afa0bdb13", + "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" }, "engines": { "node": ">=0.10.0" }, - "gitHead": "bbcccbfe98296585e4311c8755e1d00dcd581e3c", + "gitHead": "6f6a4e99653908e859c7c10d04d9518bf4844ede", "homepage": "https://github.com/estools/estraverse", "license": "BSD-2-Clause", "main": "estraverse.js", @@ -87,7 +92,7 @@ "scripts": { "lint": "jshint estraverse.js", "test": "npm run-script lint && npm run-script unit-test", - "unit-test": "mocha --compilers coffee:coffee-script/register" + "unit-test": "mocha --compilers js:babel-register" }, - "version": "4.1.1" + "version": "4.2.0" } diff --git a/tools/eslint/node_modules/esutils/package.json b/tools/eslint/node_modules/esutils/package.json index 2df344559204f6..990e438b2ab352 100644 --- a/tools/eslint/node_modules/esutils/package.json +++ b/tools/eslint/node_modules/esutils/package.json @@ -2,14 +2,14 @@ "_args": [ [ "esutils@^2.0.2", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "esutils@>=2.0.2 <3.0.0", "_id": "esutils@2.0.2", "_inCache": true, "_installable": true, - "_location": "/eslint/esutils", + "_location": "/esutils", "_nodeVersion": "0.12.0", "_npmUser": { "email": "npm@michael.ficarra.me", @@ -32,7 +32,7 @@ "_shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", "_shrinkwrap": null, "_spec": "esutils@^2.0.2", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "bugs": { "url": "https://github.com/estools/esutils/issues" }, diff --git a/tools/eslint/node_modules/event-emitter/.npmignore b/tools/eslint/node_modules/event-emitter/.npmignore deleted file mode 100644 index 68ebfddd24fb33..00000000000000 --- a/tools/eslint/node_modules/event-emitter/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.DS_Store -/.lintcache -/node_modules diff --git a/tools/eslint/node_modules/event-emitter/.travis.yml b/tools/eslint/node_modules/event-emitter/.travis.yml deleted file mode 100644 index 628c3f34b5708a..00000000000000 --- a/tools/eslint/node_modules/event-emitter/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 2e5e8e7d761aef..00000000000000 --- a/tools/eslint/node_modules/event-emitter/CHANGES +++ /dev/null @@ -1,69 +0,0 @@ -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/event-emitter/README.md b/tools/eslint/node_modules/event-emitter/README.md index 5ad489c0f0c7e3..17f4524fd75403 100644 --- a/tools/eslint/node_modules/event-emitter/README.md +++ b/tools/eslint/node_modules/event-emitter/README.md @@ -4,7 +4,7 @@ ### 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 @@ -57,13 +57,13 @@ 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_. +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. +Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back. Non reversible. ```javascript diff --git a/tools/eslint/node_modules/event-emitter/benchmark/many-on.js b/tools/eslint/node_modules/event-emitter/benchmark/many-on.js deleted file mode 100644 index e09bfde8489386..00000000000000 --- a/tools/eslint/node_modules/event-emitter/benchmark/many-on.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -// Benchmark comparing performance of event emit for many listeners -// To run it, do following in memoizee package path: -// -// $ npm install eventemitter2 signals -// $ node benchmark/many-on.js - -var forEach = require('es5-ext/object/for-each') - , pad = require('es5-ext/string/#/pad') - - , now = Date.now - - , time, count = 1000000, i, data = {} - , ee, native, ee2, signals, a = {}, b = {}; - -ee = (function () { - var ee = require('../')(); - ee.on('test', function () { return arguments; }); - ee.on('test', function () { return arguments; }); - return ee.on('test', function () { return arguments; }); -}()); - -native = (function () { - var ee = require('events'); - ee = new ee.EventEmitter(); - ee.on('test', function () { return arguments; }); - ee.on('test', function () { return arguments; }); - return ee.on('test', function () { return arguments; }); -}()); - -ee2 = (function () { - var ee = require('eventemitter2'); - ee = new ee.EventEmitter2(); - ee.on('test', function () { return arguments; }); - ee.on('test', function () { return arguments; }); - return ee.on('test', function () { return arguments; }); -}()); - -signals = (function () { - var Signal = require('signals') - , ee = { test: new Signal() }; - ee.test.add(function () { return arguments; }); - ee.test.add(function () { return arguments; }); - ee.test.add(function () { return arguments; }); - return ee; -}()); - -console.log("Emit for 3 listeners", "x" + count + ":\n"); - -i = count; -time = now(); -while (i--) { - ee.emit('test', a, b); -} -data["event-emitter (this implementation)"] = now() - time; - -i = count; -time = now(); -while (i--) { - native.emit('test', a, b); -} -data["EventEmitter (Node.js native)"] = now() - time; - -i = count; -time = now(); -while (i--) { - ee2.emit('test', a, b); -} -data.EventEmitter2 = now() - time; - -i = count; -time = now(); -while (i--) { - signals.test.dispatch(a, b); -} -data.Signals = now() - time; - -forEach(data, function (value, name, obj, index) { - console.log(index + 1 + ":", pad.call(value, " ", 5), name); -}, null, function (a, b) { - return this[a] - this[b]; -}); diff --git a/tools/eslint/node_modules/event-emitter/benchmark/single-on.js b/tools/eslint/node_modules/event-emitter/benchmark/single-on.js deleted file mode 100644 index 99decbdae72566..00000000000000 --- a/tools/eslint/node_modules/event-emitter/benchmark/single-on.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -// Benchmark comparing performance of event emit for single listener -// To run it, do following in memoizee package path: -// -// $ npm install eventemitter2 signals -// $ node benchmark/single-on.js - -var forEach = require('es5-ext/object/for-each') - , pad = require('es5-ext/string/#/pad') - - , now = Date.now - - , time, count = 1000000, i, data = {} - , ee, native, ee2, signals, a = {}, b = {}; - -ee = (function () { - var ee = require('../'); - return ee().on('test', function () { return arguments; }); -}()); - -native = (function () { - var ee = require('events'); - return (new ee.EventEmitter()).on('test', function () { return arguments; }); -}()); - -ee2 = (function () { - var ee = require('eventemitter2'); - return (new ee.EventEmitter2()).on('test', function () { return arguments; }); -}()); - -signals = (function () { - var Signal = require('signals') - , ee = { test: new Signal() }; - ee.test.add(function () { return arguments; }); - return ee; -}()); - -console.log("Emit for single listener", "x" + count + ":\n"); - -i = count; -time = now(); -while (i--) { - ee.emit('test', a, b); -} -data["event-emitter (this implementation)"] = now() - time; - -i = count; -time = now(); -while (i--) { - native.emit('test', a, b); -} -data["EventEmitter (Node.js native)"] = now() - time; - -i = count; -time = now(); -while (i--) { - ee2.emit('test', a, b); -} -data.EventEmitter2 = now() - time; - -i = count; -time = now(); -while (i--) { - signals.test.dispatch(a, b); -} -data.Signals = now() - time; - -forEach(data, function (value, name, obj, index) { - console.log(index + 1 + ":", pad.call(value, " ", 5), name); -}, null, function (a, b) { - return this[a] - this[b]; -}); diff --git a/tools/eslint/node_modules/event-emitter/package.json b/tools/eslint/node_modules/event-emitter/package.json index 47195fee0d32f1..29b02cc8e83343 100644 --- a/tools/eslint/node_modules/event-emitter/package.json +++ b/tools/eslint/node_modules/event-emitter/package.json @@ -2,14 +2,14 @@ "_args": [ [ "event-emitter@~0.3.4", - "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + "/Users/trott/io.js/tools/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", + "_location": "/event-emitter", "_nodeVersion": "4.1.1", "_npmUser": { "email": "medikoo+npm@medikoo.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/es6-map", - "/eslint/es6-set" + "/es6-map", + "/es6-set" ], "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz", "_shasum": "8d63ddfb4cfe1fae3b32ca265c4c720222080bb5", "_shrinkwrap": null, "_spec": "event-emitter@~0.3.4", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/es6-map", + "_where": "/Users/trott/io.js/tools/node_modules/es6-map", "author": { "email": "medyk@medikoo.com", "name": "Mariusz Nowak", @@ -55,7 +55,7 @@ "directories": {}, "dist": { "shasum": "8d63ddfb4cfe1fae3b32ca265c4c720222080bb5", - "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz" + "tarball": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz" }, "gitHead": "adc27b543a53528b9af8a82f7c88db3292f0faa0", "homepage": "https://github.com/medikoo/event-emitter#readme", diff --git a/tools/eslint/node_modules/event-emitter/test/all-off.js b/tools/eslint/node_modules/event-emitter/test/all-off.js deleted file mode 100644 index 8aa872e9c9478d..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/all-off.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -var ee = require('../'); - -module.exports = function (t, a) { - var x, count, count2; - - x = ee(); - count = 0; - count2 = 0; - x.on('foo', function () { - ++count; - }); - x.on('foo', function () { - ++count; - }); - x.on('bar', function () { - ++count2; - }); - x.on('bar', function () { - ++count2; - }); - t(x, 'foo'); - x.emit('foo'); - x.emit('bar'); - a(count, 0, "All off: type"); - a(count2, 2, "All off: ohter type"); - - count = 0; - count2 = 0; - x.on('foo', function () { - ++count; - }); - x.on('foo', function () { - ++count; - }); - x.on('bar', function () { - ++count2; - }); - x.on('bar', function () { - ++count2; - }); - t(x); - x.emit('foo'); - x.emit('bar'); - a(count, 0, "All off: type"); - a(count2, 0, "All off: other type"); -}; diff --git a/tools/eslint/node_modules/event-emitter/test/emit-error.js b/tools/eslint/node_modules/event-emitter/test/emit-error.js deleted file mode 100644 index edac350afb56ce..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/emit-error.js +++ /dev/null @@ -1,14 +0,0 @@ -'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/event-emitter/test/has-listeners.js b/tools/eslint/node_modules/event-emitter/test/has-listeners.js deleted file mode 100644 index 875b048a4193cb..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/has-listeners.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var ee = require('../'); - -module.exports = function (t) { - var x, y; - return { - Any: function (a) { - a(t(true), false, "Primitive"); - a(t({ events: [] }), false, "Other object"); - a(t(x = ee()), false, "Emitter: empty"); - - x.on('test', y = function () {}); - a(t(x), true, "Emitter: full"); - x.off('test', y); - a(t(x), false, "Emitter: empty but touched"); - x.once('test', y = function () {}); - a(t(x), true, "Emitter: full: Once"); - x.off('test', y); - a(t(x), false, "Emitter: empty but touched by once"); - }, - Specific: function (a) { - a(t(true, 'test'), false, "Primitive"); - a(t({ events: [] }, 'test'), false, "Other object"); - a(t(x = ee(), 'test'), false, "Emitter: empty"); - - x.on('test', y = function () {}); - a(t(x, 'test'), true, "Emitter: full"); - a(t(x, 'foo'), false, "Emitter: full, other event"); - x.off('test', y); - a(t(x, 'test'), false, "Emitter: empty but touched"); - a(t(x, 'foo'), false, "Emitter: empty but touched, other event"); - - x.once('test', y = function () {}); - a(t(x, 'test'), true, "Emitter: full: Once"); - a(t(x, 'foo'), false, "Emitter: full: Once, other event"); - x.off('test', y); - a(t(x, 'test'), false, "Emitter: empty but touched by once"); - a(t(x, 'foo'), false, "Emitter: empty but touched by once, other event"); - } - }; -}; diff --git a/tools/eslint/node_modules/event-emitter/test/index.js b/tools/eslint/node_modules/event-emitter/test/index.js deleted file mode 100644 index c7c3f24c476862..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict'; - -module.exports = function (t, a) { - var x = t(), y, count, count2, count3, count4, test, listener1, listener2; - - x.emit('none'); - - test = "Once: "; - count = 0; - x.once('foo', function (a1, a2, a3) { - a(this, x, test + "Context"); - a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); - ++count; - }); - - x.emit('foobar'); - a(count, 0, test + "Not invoked on other event"); - x.emit('foo', 'foo', x, 15); - a(count, 1, test + "Emitted"); - x.emit('foo'); - a(count, 1, test + "Emitted once"); - - test = "On & Once: "; - count = 0; - x.on('foo', listener1 = function (a1, a2, a3) { - a(this, x, test + "Context"); - a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); - ++count; - }); - count2 = 0; - x.once('foo', listener2 = function (a1, a2, a3) { - a(this, x, test + "Context"); - a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); - ++count2; - }); - - x.emit('foobar'); - a(count, 0, test + "Not invoked on other event"); - x.emit('foo', 'foo', x, 15); - a(count, 1, test + "Emitted"); - x.emit('foo', 'foo', x, 15); - a(count, 2, test + "Emitted twice"); - a(count2, 1, test + "Emitted once"); - x.off('foo', listener1); - x.emit('foo'); - a(count, 2, test + "Not emitter after off"); - - count = 0; - x.once('foo', listener1 = function () { ++count; }); - - x.off('foo', listener1); - x.emit('foo'); - a(count, 0, "Once Off: Not emitted"); - - count = 0; - x.on('foo', listener2 = function () {}); - x.once('foo', listener1 = function () { ++count; }); - - x.off('foo', listener1); - x.emit('foo'); - a(count, 0, "Once Off (multi): Not emitted"); - x.off('foo', listener2); - - test = "Prototype Share: "; - - y = Object.create(x); - - count = 0; - count2 = 0; - count3 = 0; - count4 = 0; - x.on('foo', function () { - ++count; - }); - y.on('foo', function () { - ++count2; - }); - x.once('foo', function () { - ++count3; - }); - y.once('foo', function () { - ++count4; - }); - x.emit('foo'); - a(count, 1, test + "x on count"); - a(count2, 0, test + "y on count"); - a(count3, 1, test + "x once count"); - a(count4, 0, test + "y once count"); - - y.emit('foo'); - a(count, 1, test + "x on count"); - a(count2, 1, test + "y on count"); - a(count3, 1, test + "x once count"); - a(count4, 1, test + "y once count"); - - x.emit('foo'); - a(count, 2, test + "x on count"); - a(count2, 1, test + "y on count"); - a(count3, 1, test + "x once count"); - a(count4, 1, test + "y once count"); - - y.emit('foo'); - a(count, 2, test + "x on count"); - a(count2, 2, test + "y on count"); - a(count3, 1, test + "x once count"); - a(count4, 1, test + "y once count"); -}; diff --git a/tools/eslint/node_modules/event-emitter/test/pipe.js b/tools/eslint/node_modules/event-emitter/test/pipe.js deleted file mode 100644 index 9d15d6dae308dc..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/pipe.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var ee = require('../'); - -module.exports = function (t, a) { - var x = {}, y = {}, z = {}, count, count2, count3, pipe; - - ee(x); - x = Object.create(x); - ee(y); - ee(z); - - count = 0; - count2 = 0; - count3 = 0; - x.on('foo', function () { - ++count; - }); - y.on('foo', function () { - ++count2; - }); - z.on('foo', function () { - ++count3; - }); - - x.emit('foo'); - a(count, 1, "Pre pipe, x"); - a(count2, 0, "Pre pipe, y"); - a(count3, 0, "Pre pipe, z"); - - pipe = t(x, y); - x.emit('foo'); - a(count, 2, "Post pipe, x"); - a(count2, 1, "Post pipe, y"); - a(count3, 0, "Post pipe, z"); - - y.emit('foo'); - a(count, 2, "Post pipe, on y, x"); - a(count2, 2, "Post pipe, on y, y"); - a(count3, 0, "Post pipe, on y, z"); - - t(x, z); - x.emit('foo'); - a(count, 3, "Post pipe z, x"); - a(count2, 3, "Post pipe z, y"); - a(count3, 1, "Post pipe z, z"); - - pipe.close(); - x.emit('foo'); - a(count, 4, "Close pipe y, x"); - a(count2, 3, "Close pipe y, y"); - a(count3, 2, "Close pipe y, z"); -}; diff --git a/tools/eslint/node_modules/event-emitter/test/unify.js b/tools/eslint/node_modules/event-emitter/test/unify.js deleted file mode 100644 index 69295e0657ad50..00000000000000 --- a/tools/eslint/node_modules/event-emitter/test/unify.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -var ee = require('../'); - -module.exports = function (t) { - - return { - "": function (a) { - var x = {}, y = {}, z = {}, count, count2, count3; - - ee(x); - ee(y); - ee(z); - - count = 0; - count2 = 0; - count3 = 0; - x.on('foo', function () { ++count; }); - y.on('foo', function () { ++count2; }); - z.on('foo', function () { ++count3; }); - - x.emit('foo'); - a(count, 1, "Pre unify, x"); - a(count2, 0, "Pre unify, y"); - a(count3, 0, "Pre unify, z"); - - t(x, y); - a(x.__ee__, y.__ee__, "Post unify y"); - x.emit('foo'); - a(count, 2, "Post unify, x"); - a(count2, 1, "Post unify, y"); - a(count3, 0, "Post unify, z"); - - y.emit('foo'); - a(count, 3, "Post unify, on y, x"); - a(count2, 2, "Post unify, on y, y"); - a(count3, 0, "Post unify, on y, z"); - - t(x, z); - a(x.__ee__, x.__ee__, "Post unify z"); - x.emit('foo'); - a(count, 4, "Post unify z, x"); - a(count2, 3, "Post unify z, y"); - a(count3, 1, "Post unify z, z"); - }, - "On empty": function (a) { - var x = {}, y = {}, z = {}, count, count2, count3; - - ee(x); - ee(y); - ee(z); - - count = 0; - count2 = 0; - count3 = 0; - y.on('foo', function () { ++count2; }); - x.emit('foo'); - a(count, 0, "Pre unify, x"); - a(count2, 0, "Pre unify, y"); - a(count3, 0, "Pre unify, z"); - - t(x, y); - a(x.__ee__, y.__ee__, "Post unify y"); - x.on('foo', function () { ++count; }); - x.emit('foo'); - a(count, 1, "Post unify, x"); - a(count2, 1, "Post unify, y"); - a(count3, 0, "Post unify, z"); - - y.emit('foo'); - a(count, 2, "Post unify, on y, x"); - a(count2, 2, "Post unify, on y, y"); - a(count3, 0, "Post unify, on y, z"); - - t(x, z); - a(x.__ee__, z.__ee__, "Post unify z"); - z.on('foo', function () { ++count3; }); - x.emit('foo'); - a(count, 3, "Post unify z, x"); - a(count2, 3, "Post unify z, y"); - a(count3, 1, "Post unify z, z"); - }, - Many: function (a) { - var x = {}, y = {}, z = {}, count, count2, count3; - - ee(x); - ee(y); - ee(z); - - count = 0; - count2 = 0; - count3 = 0; - x.on('foo', function () { ++count; }); - y.on('foo', function () { ++count2; }); - y.on('foo', function () { ++count2; }); - z.on('foo', function () { ++count3; }); - - x.emit('foo'); - a(count, 1, "Pre unify, x"); - a(count2, 0, "Pre unify, y"); - a(count3, 0, "Pre unify, z"); - - t(x, y); - a(x.__ee__, y.__ee__, "Post unify y"); - x.emit('foo'); - a(count, 2, "Post unify, x"); - a(count2, 2, "Post unify, y"); - a(count3, 0, "Post unify, z"); - - y.emit('foo'); - a(count, 3, "Post unify, on y, x"); - a(count2, 4, "Post unify, on y, y"); - a(count3, 0, "Post unify, on y, z"); - - t(x, z); - a(x.__ee__, x.__ee__, "Post unify z"); - x.emit('foo'); - a(count, 4, "Post unify z, x"); - a(count2, 6, "Post unify z, y"); - a(count3, 1, "Post unify z, z"); - } - }; -}; diff --git a/tools/eslint/node_modules/exit-hook/package.json b/tools/eslint/node_modules/exit-hook/package.json index 43411de64dce5c..5169705168ac00 100644 --- a/tools/eslint/node_modules/exit-hook/package.json +++ b/tools/eslint/node_modules/exit-hook/package.json @@ -2,14 +2,14 @@ "_args": [ [ "exit-hook@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/restore-cursor" + "/Users/trott/io.js/tools/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", + "_location": "/exit-hook", "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/restore-cursor" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/restore-cursor", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/fast-levenshtein/LICENSE.md b/tools/eslint/node_modules/fast-levenshtein/LICENSE.md index 79b86692645bc2..6212406b413b7a 100644 --- a/tools/eslint/node_modules/fast-levenshtein/LICENSE.md +++ b/tools/eslint/node_modules/fast-levenshtein/LICENSE.md @@ -22,3 +22,4 @@ 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/fast-levenshtein/levenshtein.js b/tools/eslint/node_modules/fast-levenshtein/levenshtein.js index 9d8cdc87f7ebd9..850626de687d59 100644 --- a/tools/eslint/node_modules/fast-levenshtein/levenshtein.js +++ b/tools/eslint/node_modules/fast-levenshtein/levenshtein.js @@ -208,3 +208,4 @@ window.Levenshtein = Levenshtein; } }()); + diff --git a/tools/eslint/node_modules/fast-levenshtein/package.json b/tools/eslint/node_modules/fast-levenshtein/package.json index 5acd6fe7782c49..c0e13d4e2c278c 100644 --- a/tools/eslint/node_modules/fast-levenshtein/package.json +++ b/tools/eslint/node_modules/fast-levenshtein/package.json @@ -2,14 +2,14 @@ "_args": [ [ "fast-levenshtein@^1.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/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", + "_location": "/fast-levenshtein", "_nodeVersion": "0.12.9", "_npmUser": { "email": "ram@hiddentao.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/optionator" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "ram@hiddentao.com", "name": "Ramesh Nair", diff --git a/tools/eslint/node_modules/figures/index.js b/tools/eslint/node_modules/figures/index.js index aabd817a9c7fa3..edfeff273d8e26 100644 --- a/tools/eslint/node_modules/figures/index.js +++ b/tools/eslint/node_modules/figures/index.js @@ -8,6 +8,7 @@ var main = { square: '▇', squareSmall: '◻', squareSmallFilled: '◼', + play: '▶', circle: '◯', circleFilled: '◉', circleDotted: '◌', @@ -48,6 +49,7 @@ var win = { square: '█', squareSmall: '[ ]', squareSmallFilled: '[█]', + play: '►', circle: '( )', circleFilled: '(*)', circleDotted: '( )', diff --git a/tools/eslint/node_modules/figures/package.json b/tools/eslint/node_modules/figures/package.json index 359795b913a78d..94c00cb4e0fe93 100644 --- a/tools/eslint/node_modules/figures/package.json +++ b/tools/eslint/node_modules/figures/package.json @@ -2,20 +2,24 @@ "_args": [ [ "figures@^1.3.5", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "figures@>=1.3.5 <2.0.0", - "_id": "figures@1.4.0", + "_id": "figures@1.5.0", "_inCache": true, "_installable": true, - "_location": "/eslint/figures", - "_nodeVersion": "4.1.0", + "_location": "/figures", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/figures-1.5.0.tgz_1458741326698_0.9015887144487351" + }, "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" }, - "_npmVersion": "2.14.3", + "_npmVersion": "3.6.0", "_phantomChildren": {}, "_requested": { "name": "figures", @@ -26,17 +30,17 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/inquirer" ], - "_resolved": "https://registry.npmjs.org/figures/-/figures-1.4.0.tgz", - "_shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", + "_resolved": "https://registry.npmjs.org/figures/-/figures-1.5.0.tgz", + "_shasum": "56d8a0949c19643af764d573a648d384218da737", "_shrinkwrap": null, "_spec": "figures@^1.3.5", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" + "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/figures/issues" @@ -44,12 +48,13 @@ "dependencies": {}, "description": "Unicode symbols with Windows CMD fallbacks", "devDependencies": { - "ava": "0.0.4" + "ava": "*", + "xo": "*" }, "directories": {}, "dist": { - "shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", - "tarball": "http://registry.npmjs.org/figures/-/figures-1.4.0.tgz" + "shasum": "56d8a0949c19643af764d573a648d384218da737", + "tarball": "http://registry.npmjs.org/figures/-/figures-1.5.0.tgz" }, "engines": { "node": ">=0.10.0" @@ -57,7 +62,7 @@ "files": [ "index.js" ], - "gitHead": "6b8b7482290192d6eeb3e80508f59ad33bc012f7", + "gitHead": "0f0ec0620de08ed4e1b1ab7073cb2e1104c246e8", "homepage": "https://github.com/sindresorhus/figures#readme", "keywords": [ "unicode", @@ -87,7 +92,7 @@ "url": "git+https://github.com/sindresorhus/figures.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "1.4.0" + "version": "1.5.0" } diff --git a/tools/eslint/node_modules/figures/readme.md b/tools/eslint/node_modules/figures/readme.md index bb7ddf0054bded..88e2531d7b41c6 100644 --- a/tools/eslint/node_modules/figures/readme.md +++ b/tools/eslint/node_modules/figures/readme.md @@ -21,7 +21,7 @@ $ npm install --save figures See the [source](index.js) for supported symbols. ```js -var figures = require('figures'); +const figures = require('figures'); console.log(figures.tick); // On real OSes: ✔︎ diff --git a/tools/eslint/node_modules/file-entry-cache/LICENSE b/tools/eslint/node_modules/file-entry-cache/LICENSE index 7394b8ff84b090..c58c339631271d 100644 --- a/tools/eslint/node_modules/file-entry-cache/LICENSE +++ b/tools/eslint/node_modules/file-entry-cache/LICENSE @@ -19,3 +19,4 @@ 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 index 842ef1e158fb00..0ea7e7a092e68c 100644 --- a/tools/eslint/node_modules/file-entry-cache/README.md +++ b/tools/eslint/node_modules/file-entry-cache/README.md @@ -1,5 +1,5 @@ # file-entry-cache -> Super simple cache for file metadata, useful for process that work o a given series of files +> 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) @@ -14,7 +14,7 @@ npm i --save file-entry-cache ## Usage ```js -// loads the cache, if one does not exists for the given +// 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'); @@ -25,18 +25,18 @@ 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 +// 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(); +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); +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 @@ -64,21 +64,21 @@ entry = { ## 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 +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 +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 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 +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. @@ -89,6 +89,8 @@ In the worst case scenario all the files will be processed. In the best case sce - 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 +## License MIT + + diff --git a/tools/eslint/node_modules/file-entry-cache/changelog.md b/tools/eslint/node_modules/file-entry-cache/changelog.md index 46fcd57bc82b5a..8cc876141e5146 100644 --- a/tools/eslint/node_modules/file-entry-cache/changelog.md +++ b/tools/eslint/node_modules/file-entry-cache/changelog.md @@ -4,54 +4,56 @@ - **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 index 57bb4b6e411c85..0d28ea6c726411 100644 --- a/tools/eslint/node_modules/file-entry-cache/package.json +++ b/tools/eslint/node_modules/file-entry-cache/package.json @@ -2,14 +2,14 @@ "_args": [ [ "file-entry-cache@^1.1.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/file-entry-cache", "_nodeVersion": "0.12.0", "_npmUser": { "email": "royriojas@gmail.com", @@ -32,7 +32,7 @@ "_shasum": "9a586072c69365a7ef7ec72a7c2b9046de091e9c", "_shrinkwrap": null, "_spec": "file-entry-cache@^1.1.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" diff --git a/tools/eslint/node_modules/flat-cache/LICENSE b/tools/eslint/node_modules/flat-cache/LICENSE index 7394b8ff84b090..c58c339631271d 100644 --- a/tools/eslint/node_modules/flat-cache/LICENSE +++ b/tools/eslint/node_modules/flat-cache/LICENSE @@ -19,3 +19,4 @@ 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 index d0eddf2e9c8832..33a315fb344da8 100644 --- a/tools/eslint/node_modules/flat-cache/README.md +++ b/tools/eslint/node_modules/flat-cache/README.md @@ -65,3 +65,4 @@ MIT ## Changelog [changelog](./changelog.md) + diff --git a/tools/eslint/node_modules/flat-cache/changelog.md b/tools/eslint/node_modules/flat-cache/changelog.md index 571757c9d9ba6d..6ba9ef745cdf10 100644 --- a/tools/eslint/node_modules/flat-cache/changelog.md +++ b/tools/eslint/node_modules/flat-cache/changelog.md @@ -4,69 +4,71 @@ - **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 index 429417ded8ed79..3c923ffe8428c1 100644 --- a/tools/eslint/node_modules/flat-cache/package.json +++ b/tools/eslint/node_modules/flat-cache/package.json @@ -2,14 +2,14 @@ "_args": [ [ "flat-cache@^1.0.9", - "/Users/trott/test/node_modules/eslint/node_modules/file-entry-cache" + "/Users/trott/io.js/tools/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", + "_location": "/flat-cache", "_nodeVersion": "0.12.0", "_npmUser": { "email": "royriojas@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/file-entry-cache" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/file-entry-cache", "author": { "name": "Roy Riojas", "url": "http://royriojas.com" diff --git a/tools/eslint/node_modules/generate-function/.npmignore b/tools/eslint/node_modules/generate-function/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/tools/eslint/node_modules/generate-function/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tools/eslint/node_modules/generate-function/.travis.yml b/tools/eslint/node_modules/generate-function/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/tools/eslint/node_modules/generate-function/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/tools/eslint/node_modules/generate-function/package.json b/tools/eslint/node_modules/generate-function/package.json index a7cde9f4e3699a..2ef064b45f85d1 100644 --- a/tools/eslint/node_modules/generate-function/package.json +++ b/tools/eslint/node_modules/generate-function/package.json @@ -2,14 +2,14 @@ "_args": [ [ "generate-function@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/is-my-json-valid" + "/Users/trott/io.js/tools/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", + "_location": "/generate-function", "_npmUser": { "email": "mathiasbuus@gmail.com", "name": "mafintosh" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/is-my-json-valid" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/is-my-json-valid", "author": { "name": "Mathias Buus" }, diff --git a/tools/eslint/node_modules/generate-function/test.js b/tools/eslint/node_modules/generate-function/test.js deleted file mode 100644 index 2768893eb15066..00000000000000 --- a/tools/eslint/node_modules/generate-function/test.js +++ /dev/null @@ -1,33 +0,0 @@ -var tape = require('tape') -var genfun = require('./') - -tape('generate add function', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', 42) - ('}') - - t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') - t.same(fn.toFunction()(10), 52, 'function works') - t.end() -}) - -tape('generate function + closed variables', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d + number', 42) - ('}') - - var notGood = fn.toFunction() - var good = fn.toFunction({number:10}) - - try { - notGood(10) - t.ok(false, 'function should not work') - } catch (err) { - t.same(err.message, 'number is not defined', 'throws reference error') - } - - t.same(good(11), 63, 'function with closed var works') - t.end() -}) \ No newline at end of file diff --git a/tools/eslint/node_modules/generate-object-property/.npmignore b/tools/eslint/node_modules/generate-object-property/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/tools/eslint/node_modules/generate-object-property/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tools/eslint/node_modules/generate-object-property/.travis.yml b/tools/eslint/node_modules/generate-object-property/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/tools/eslint/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/generate-object-property/package.json b/tools/eslint/node_modules/generate-object-property/package.json index eaf984971b540b..3d8e68caff43c2 100644 --- a/tools/eslint/node_modules/generate-object-property/package.json +++ b/tools/eslint/node_modules/generate-object-property/package.json @@ -2,14 +2,14 @@ "_args": [ [ "generate-object-property@^1.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/is-my-json-valid" + "/Users/trott/io.js/tools/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", + "_location": "/generate-object-property", "_nodeVersion": "2.0.1", "_npmUser": { "email": "mathiasbuus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/is-my-json-valid" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/is-my-json-valid", "author": { "name": "Mathias Buus", "url": "@mafintosh" diff --git a/tools/eslint/node_modules/generate-object-property/test.js b/tools/eslint/node_modules/generate-object-property/test.js deleted file mode 100644 index 6c299c67fd3165..00000000000000 --- a/tools/eslint/node_modules/generate-object-property/test.js +++ /dev/null @@ -1,12 +0,0 @@ -var tape = require('tape') -var gen = require('./') - -tape('valid', function(t) { - t.same(gen('a', 'b'), 'a.b') - t.end() -}) - -tape('invalid', function(t) { - t.same(gen('a', '-b'), 'a["-b"]') - t.end() -}) \ No newline at end of file diff --git a/tools/eslint/node_modules/glob/README.md b/tools/eslint/node_modules/glob/README.md index 6960483bac63c6..9dd9384fa143c3 100644 --- a/tools/eslint/node_modules/glob/README.md +++ b/tools/eslint/node_modules/glob/README.md @@ -11,6 +11,12 @@ library to do its matching. ## Usage +Install with npm + +``` +npm i glob +``` + ```javascript var glob = require("glob") diff --git a/tools/eslint/node_modules/glob/changelog.md b/tools/eslint/node_modules/glob/changelog.md new file mode 100644 index 00000000000000..41636771e3a7cd --- /dev/null +++ b/tools/eslint/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/tools/eslint/node_modules/glob/common.js b/tools/eslint/node_modules/glob/common.js index c9127eb334f18b..58dc41e6632160 100644 --- a/tools/eslint/node_modules/glob/common.js +++ b/tools/eslint/node_modules/glob/common.js @@ -93,8 +93,8 @@ function setopts (self, pattern, options) { if (!ownProp(options, "cwd")) self.cwd = cwd else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") @@ -102,6 +102,7 @@ function setopts (self, pattern, options) { if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") + self.cwdAbs = makeAbs(self, self.cwd) self.nomount = !!options.nomount // disable comments and negation in Minimatch. @@ -153,7 +154,11 @@ function finish (self) { } if (self.nodir) { all = all.filter(function (e) { - return !(/\/$/.test(e)) + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir }) } } @@ -201,6 +206,10 @@ function makeAbs (self, f) { } else { abs = path.resolve(f) } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + return abs } diff --git a/tools/eslint/node_modules/glob/glob.js b/tools/eslint/node_modules/glob/glob.js index a62da27ebd507a..4dba04adec43c4 100644 --- a/tools/eslint/node_modules/glob/glob.js +++ b/tools/eslint/node_modules/glob/glob.js @@ -162,14 +162,23 @@ function Glob (pattern, options, cb) { if (n === 0) return done() + var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } + sync = false function done () { --self._processing - if (self._processing <= 0) - self._finish() + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } } } @@ -571,7 +580,15 @@ Glob.prototype._readdirError = function (f, er, cb) { switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } break case 'ENOENT': // not terribly unusual diff --git a/tools/eslint/node_modules/glob/package.json b/tools/eslint/node_modules/glob/package.json index 90a9c38820841e..e27d6909e68abd 100644 --- a/tools/eslint/node_modules/glob/package.json +++ b/tools/eslint/node_modules/glob/package.json @@ -1,39 +1,43 @@ { "_args": [ [ - "glob@^6.0.4", - "/Users/trott/test/node_modules/eslint" + "glob@^7.0.3", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "glob@>=6.0.4 <7.0.0", - "_id": "glob@6.0.4", + "_from": "glob@>=7.0.3 <8.0.0", + "_id": "glob@7.0.3", "_inCache": true, "_installable": true, - "_location": "/eslint/glob", - "_nodeVersion": "4.0.0", + "_location": "/glob", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/glob-7.0.3.tgz_1457166529288_0.7840580905321985" + }, "_npmUser": { "email": "i@izs.me", "name": "isaacs" }, - "_npmVersion": "2.14.15", + "_npmVersion": "3.7.3", "_phantomChildren": {}, "_requested": { "name": "glob", - "raw": "glob@^6.0.4", - "rawSpec": "^6.0.4", + "raw": "glob@^7.0.3", + "rawSpec": "^7.0.3", "scope": null, - "spec": ">=6.0.4 <7.0.0", + "spec": ">=7.0.3 <8.0.0", "type": "range" }, "_requiredBy": [ "/eslint", - "/eslint/globby" + "/rimraf" ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz", + "_shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", "_shrinkwrap": null, - "_spec": "glob@^6.0.4", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "glob@^7.0.3", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", @@ -53,13 +57,13 @@ "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", - "tap": "^5.0.0", + "tap": "^5.7.0", "tick": "0.0.6" }, "directories": {}, "dist": { - "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + "shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz" }, "engines": { "node": "*" @@ -69,7 +73,7 @@ "sync.js", "common.js" ], - "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "gitHead": "2fc2278ab857c7df117213a2fb431de090be6353", "homepage": "https://github.com/isaacs/node-glob#readme", "license": "ISC", "main": "glob.js", @@ -95,5 +99,5 @@ "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "version": "6.0.4" + "version": "7.0.3" } diff --git a/tools/eslint/node_modules/glob/sync.js b/tools/eslint/node_modules/glob/sync.js index 09883d2ce0c9de..301577ab5f228f 100644 --- a/tools/eslint/node_modules/glob/sync.js +++ b/tools/eslint/node_modules/glob/sync.js @@ -305,7 +305,14 @@ GlobSync.prototype._readdirError = function (f, er) { switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } break case 'ENOENT': // not terribly unusual diff --git a/tools/eslint/node_modules/globals/globals.json b/tools/eslint/node_modules/globals/globals.json index 38a7d72e997870..1a9f5aaf942e8d 100644 --- a/tools/eslint/node_modules/globals/globals.json +++ b/tools/eslint/node_modules/globals/globals.json @@ -72,8 +72,6 @@ "escape": false, "eval": false, "EvalError": false, - "Float32Array": false, - "Float64Array": false, "Function": false, "hasOwnProperty": false, "Infinity": false, @@ -165,7 +163,13 @@ "addEventListener": false, "alert": false, "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, "applicationCache": false, "ApplicationCache": false, "ApplicationCacheErrorEvent": false, @@ -217,6 +221,7 @@ "Crypto": false, "CryptoKey": false, "CSS": false, + "CSSAnimation": false, "CSSFontFaceRule": false, "CSSImportRule": false, "CSSKeyframeRule": false, @@ -229,6 +234,7 @@ "CSSStyleRule": false, "CSSStyleSheet": false, "CSSSupportsRule": false, + "CSSTransition": false, "CSSUnknownRule": false, "CSSViewportRule": false, "CustomEvent": false, @@ -246,6 +252,7 @@ "document": false, "Document": false, "DocumentFragment": false, + "DocumentTimeline": false, "DocumentType": false, "DOMError": false, "DOMException": false, @@ -389,6 +396,8 @@ "InputMethodContext": false, "Intl": false, "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, "length": false, "localStorage": false, "location": false, @@ -523,6 +532,7 @@ "setInterval": false, "setTimeout": false, "ShadowRoot": false, + "SharedKeyframeList": false, "SharedWorker": false, "showModalDialog": false, "speechSynthesis": false, @@ -719,6 +729,7 @@ "TreeWalker": false, "UIEvent": false, "URL": false, + "URLSearchParams": false, "ValidityState": false, "VTTCue": false, "WaveShaperNode": false, @@ -817,6 +828,7 @@ "TextDecoder": false, "TextEncoder": false, "URL": false, + "URLSearchParams": false, "WebSocket": false, "Worker": false, "XMLHttpRequest": false @@ -833,6 +845,7 @@ "exports": true, "GLOBAL": false, "global": false, + "Intl": false, "module": false, "process": false, "require": false, @@ -1082,6 +1095,9 @@ "$": false, "_": false, "Accounts": false, + "AccountsClient": false, + "AccountsServer": false, + "AccountsCommon": false, "App": false, "Assets": false, "Blaze": false, @@ -1089,6 +1105,7 @@ "Cordova": false, "DDP": false, "DDPServer": false, + "DDPRateLimiter": false, "Deps": false, "EJSON": false, "Email": false, @@ -1106,6 +1123,7 @@ "ReactiveDict": false, "ReactiveVar": false, "Router": false, + "ServiceConfiguration": false, "Session": false, "share": false, "Spacebars": false, diff --git a/tools/eslint/node_modules/globals/package.json b/tools/eslint/node_modules/globals/package.json index c14975e90c2de2..6bbc4540577e8c 100644 --- a/tools/eslint/node_modules/globals/package.json +++ b/tools/eslint/node_modules/globals/package.json @@ -1,38 +1,42 @@ { "_args": [ [ - "globals@^8.18.0", - "/Users/trott/test/node_modules/eslint" + "globals@^9.2.0", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "globals@>=8.18.0 <9.0.0", - "_id": "globals@8.18.0", + "_from": "globals@>=9.2.0 <10.0.0", + "_id": "globals@9.5.0", "_inCache": true, "_installable": true, - "_location": "/eslint/globals", - "_nodeVersion": "5.3.0", + "_location": "/globals", + "_nodeVersion": "4.4.2", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/globals-9.5.0.tgz_1460995392428_0.6166578873526305" + }, "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { "name": "globals", - "raw": "globals@^8.18.0", - "rawSpec": "^8.18.0", + "raw": "globals@^9.2.0", + "rawSpec": "^9.2.0", "scope": null, - "spec": ">=8.18.0 <9.0.0", + "spec": ">=9.2.0 <10.0.0", "type": "range" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", - "_shasum": "93d4a62bdcac38cfafafc47d6b034768cb0ffcb4", + "_resolved": "https://registry.npmjs.org/globals/-/globals-9.5.0.tgz", + "_shasum": "8d0244dbc03e1e71ee0290ff805eff9af37b176c", "_shrinkwrap": null, - "_spec": "globals@^8.18.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "globals@^9.2.0", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -48,8 +52,8 @@ }, "directories": {}, "dist": { - "shasum": "93d4a62bdcac38cfafafc47d6b034768cb0ffcb4", - "tarball": "http://registry.npmjs.org/globals/-/globals-8.18.0.tgz" + "shasum": "8d0244dbc03e1e71ee0290ff805eff9af37b176c", + "tarball": "https://registry.npmjs.org/globals/-/globals-9.5.0.tgz" }, "engines": { "node": ">=0.10.0" @@ -58,8 +62,8 @@ "index.js", "globals.json" ], - "gitHead": "d929a0c638008d4cbf87cc7faac5bc5169e2b86d", - "homepage": "https://github.com/sindresorhus/globals", + "gitHead": "ddd67eee82aed52cdba7a28b09b9c3f1dea0f0c7", + "homepage": "https://github.com/sindresorhus/globals#readme", "keywords": [ "globals", "global", @@ -99,5 +103,5 @@ "scripts": { "test": "mocha" }, - "version": "8.18.0" + "version": "9.5.0" } diff --git a/tools/eslint/node_modules/globals/readme.md b/tools/eslint/node_modules/globals/readme.md index 3eb024e5a5b190..5314bbb93a401d 100644 --- a/tools/eslint/node_modules/globals/readme.md +++ b/tools/eslint/node_modules/globals/readme.md @@ -6,6 +6,8 @@ Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb It's just a [JSON file](globals.json), so use it in whatever environment you like. +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + ## Install diff --git a/tools/eslint/node_modules/globby/node_modules/glob/LICENSE b/tools/eslint/node_modules/globby/node_modules/glob/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/README.md b/tools/eslint/node_modules/globby/node_modules/glob/README.md similarity index 100% rename from tools/eslint/node_modules/rimraf/node_modules/glob/README.md rename to tools/eslint/node_modules/globby/node_modules/glob/README.md diff --git a/tools/eslint/node_modules/globby/node_modules/glob/common.js b/tools/eslint/node_modules/globby/node_modules/glob/common.js new file mode 100644 index 00000000000000..c9127eb334f18b --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/glob.js b/tools/eslint/node_modules/globby/node_modules/glob/glob.js similarity index 98% rename from tools/eslint/node_modules/rimraf/node_modules/glob/glob.js rename to tools/eslint/node_modules/globby/node_modules/glob/glob.js index 804cde53f0d276..a62da27ebd507a 100644 --- a/tools/eslint/node_modules/rimraf/node_modules/glob/glob.js +++ b/tools/eslint/node_modules/globby/node_modules/glob/glob.js @@ -572,13 +572,6 @@ Glob.prototype._readdirError = function (f, er, cb) { 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 diff --git a/tools/eslint/node_modules/globby/node_modules/glob/package.json b/tools/eslint/node_modules/globby/node_modules/glob/package.json new file mode 100644 index 00000000000000..74c0889c9f3efb --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "glob@^6.0.1", + "/Users/trott/io.js/tools/node_modules/globby" + ] + ], + "_from": "glob@>=6.0.1 <7.0.0", + "_id": "glob@6.0.4", + "_inCache": true, + "_installable": true, + "_location": "/globby/glob", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^6.0.1", + "rawSpec": "^6.0.1", + "scope": null, + "spec": ">=6.0.1 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/globby" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_shrinkwrap": null, + "_spec": "glob@^6.0.1", + "_where": "/Users/trott/io.js/tools/node_modules/globby", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "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/globby/node_modules/glob/sync.js b/tools/eslint/node_modules/globby/node_modules/glob/sync.js new file mode 100644 index 00000000000000..09883d2ce0c9de --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/tools/eslint/node_modules/globby/package.json b/tools/eslint/node_modules/globby/package.json index 2aeef7e15b3ce8..13b99b1562e4af 100644 --- a/tools/eslint/node_modules/globby/package.json +++ b/tools/eslint/node_modules/globby/package.json @@ -2,21 +2,27 @@ "_args": [ [ "globby@^4.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/node_modules/del" ] ], "_from": "globby@>=4.0.0 <5.0.0", "_id": "globby@4.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/globby", + "_location": "/globby", "_nodeVersion": "4.2.1", "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" }, "_npmVersion": "2.14.7", - "_phantomChildren": {}, + "_phantomChildren": { + "inflight": "1.0.4", + "inherits": "2.0.1", + "minimatch": "3.0.0", + "once": "1.3.3", + "path-is-absolute": "1.0.0" + }, "_requested": { "name": "globby", "raw": "globby@^4.0.0", @@ -26,13 +32,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -61,7 +67,7 @@ "directories": {}, "dist": { "shasum": "36ff06c5a9dc1dbc201f700074992882857e9817", - "tarball": "http://registry.npmjs.org/globby/-/globby-4.0.0.tgz" + "tarball": "https://registry.npmjs.org/globby/-/globby-4.0.0.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/graceful-fs/package.json b/tools/eslint/node_modules/graceful-fs/package.json index 7e4829d35746f3..efd7876ac6f40f 100644 --- a/tools/eslint/node_modules/graceful-fs/package.json +++ b/tools/eslint/node_modules/graceful-fs/package.json @@ -2,14 +2,14 @@ "_args": [ [ "graceful-fs@^4.1.2", - "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + "/Users/trott/io.js/tools/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", + "_location": "/graceful-fs", "_nodeVersion": "4.0.0", "_npmOperationalInternal": { "host": "packages-6-west.internal.npmjs.com", @@ -30,14 +30,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/flat-cache", - "/eslint/read-json-sync" + "/flat-cache", + "/read-json-sync" ], "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz", "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", "_shrinkwrap": null, "_spec": "graceful-fs@^4.1.2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/flat-cache", + "_where": "/Users/trott/io.js/tools/node_modules/flat-cache", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -53,7 +53,7 @@ }, "dist": { "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" }, "engines": { "node": ">=0.4.0" diff --git a/tools/eslint/node_modules/has-ansi/package.json b/tools/eslint/node_modules/has-ansi/package.json index 9c1a14915bb31d..098c3ad692929c 100644 --- a/tools/eslint/node_modules/has-ansi/package.json +++ b/tools/eslint/node_modules/has-ansi/package.json @@ -2,14 +2,14 @@ "_args": [ [ "has-ansi@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/chalk" + "/Users/trott/io.js/tools/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", + "_location": "/has-ansi", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/chalk" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/ignore/LICENSE-MIT b/tools/eslint/node_modules/ignore/LICENSE-MIT old mode 100644 new mode 100755 diff --git a/tools/eslint/node_modules/ignore/README.md b/tools/eslint/node_modules/ignore/README.md old mode 100644 new mode 100755 index 43dc2ff8fc7b19..cd4518febfffd9 --- a/tools/eslint/node_modules/ignore/README.md +++ b/tools/eslint/node_modules/ignore/README.md @@ -1,34 +1,40 @@ -# ignore - -[![NPM version](https://badge.fury.io/js/ignore.png)](http://badge.fury.io/js/ignore) +[![Build Status](https://travis-ci.org/kaelzhang/node-ignore.svg?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/node-ignore) [![npm module downloads per month](http://img.shields.io/npm/dm/ignore.svg)](https://www.npmjs.org/package/ignore) -[![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 `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 +##### Tested on - npm install ignore --save +- Linux + Node: `0.8` - `5.x` +- Windows + Node: `0.10` - `5.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +## Table Of Main Contents + +- [Usage](#usage) +- [Guide for 2.x -> 3.x](#upgrade-2x---3x) +- [Contributing](#contributing) ## Usage ```js -var ignore = require('ignore'); -var ig = ignore(options).addPattern(['.abc/*', '!.abc/d/']); +const ignore = require('ignore') +var ig = ignore().add(['.abc/*', '!.abc/d/']) ``` ### Filter the given paths ```js var paths = [ - '.abc/a.js', // filtered out - '.abc/d/e.js' // included -]; + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] -ig.filter(paths); // ['.abc/d/e.js'] +ig.filter(paths) // ['.abc/d/e.js'] ``` ### As the filter function @@ -37,18 +43,12 @@ ig.filter(paths); // ['.abc/d/e.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. +### Win32 paths will be handled ```js -ignore().addIgnoreFile( - ignore.select([ - '.xxxignore', - '.gitignore', - '.ignore' - ]) -); +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] ``` ## Why another ignore? @@ -56,53 +56,66 @@ ignore().addIgnoreFile( 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. + - `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. - - + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - prevent re-including a file if a parent directory of that file is excluded. + - handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` ## Methods -### .addPattern(pattern) +### .add(pattern) +### .add(patterns) + +- pattern `String|Ignore` An ignore pattern string, or the `Ignore` instance +- patterns `Array.` Array of ignore patterns. Adds a rule or several rules to the current manager. -#### Returns `this` +Returns `this` -#### pattern `String|Array.` +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. -The ignore rule or a array of rules. +```js +ignore().add('#abc').filter(['#abc']) // ['#abc'] +ignore().add('\#abc').filter(['#abc']) // [] +``` -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. +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: ```js -ignore().addPattern('#abc').filter(['#abc']); // ['#abc'] -ignore().addPattern('\#abc').filter(['#abc']); // [] +ignore().add(fs.readFileSync(filenameOfGitignore).toString()).filter(filenames) ``` +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +### .addIgnoreFile(path) -### .addIgnoreFile(path) +REMOVED in `3.x` for now. -Adds rules from a ignore file or several files +To upgrade `ignore@2.x` up to `3.x`, use + +```js +const fs = require('fs') -#### Returns `this` +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` -#### Rule `String|Array.` +instead. ### .filter(paths) Filters the given array of pathnames, and returns the filtered array. -#### paths `Array.` - -The array of paths to be filtered. +- 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: @@ -121,64 +134,55 @@ Then the `paths` might be like this: ```js [ - 'a/a.js' - '.b', - '.c/.DS_store' + '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: +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` 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); - } -}); +const glob = require('glob') + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + var filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) ``` ### .createFilter() Creates a filter function which could filter an array of paths with `Array.prototype.filter`. -#### Returns `function(path)` +Returns `function(path)` the filter function. -The filter function. +**** +## Upgrade 2.x -> 3.x -## Constructor: ignore.Ignore +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. -```js -new ignore.Ignore(options); -ignore(options); -``` +**** -#### options.matchCase `boolean=false` +## Contributing -By default, all ignore rules will be treated as case-insensitive ones as well as the git does. +The code of `node-ignore` is based on es6 and babel, but babel and its preset is not included in the `dependencies` field of package.json, so that the installation process of test cases will not fail in older versions of node. -#### options.twoGlobstars `boolean=false` +So use `bash install.sh` to install dependencies and `bash test.sh` to run test cases in your local machine. -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: [] -}); -``` +#### Collaborators -You can also use `.addPattern()` method to do this. +- [SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [JanMattner](https://github.com/JanMattner) *Jan Mattner* diff --git a/tools/eslint/node_modules/ignore/ignore.js b/tools/eslint/node_modules/ignore/ignore.js new file mode 100644 index 00000000000000..e1529f12b1b70c --- /dev/null +++ b/tools/eslint/node_modules/ignore/ignore.js @@ -0,0 +1,386 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +module.exports = function () { + return new IgnoreBase(); +}; + +// A simple implementation of make-array +function make_array(subject) { + return Array.isArray(subject) ? subject : [subject]; +} + +var REGEX_BLANK_LINE = /^\s+$/; +var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\\!/; +var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var SLASH = '/'; + +var IgnoreBase = function () { + function IgnoreBase() { + _classCallCheck(this, IgnoreBase); + + this._rules = []; + this._initCache(); + } + + _createClass(IgnoreBase, [{ + key: '_initCache', + value: function _initCache() { + this._cache = {}; + } + + // @param {Array.|string|Ignore} pattern + + }, { + key: 'add', + value: function add(pattern) { + this._added = false; + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g); + } + + make_array(pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + + return this; + } + + // legacy + + }, { + key: 'addPattern', + value: function addPattern(pattern) { + return this.add(pattern); + } + }, { + key: '_addPattern', + value: function _addPattern(pattern) { + if (pattern instanceof IgnoreBase) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + + if (this._checkPattern(pattern)) { + var rule = this._createRule(pattern); + this._added = true; + this._rules.push(rule); + } + } + }, { + key: '_checkPattern', + value: function _checkPattern(pattern) { + // > A blank line matches no files, so it can serve as a separator for readability. + return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; + } + }, { + key: 'filter', + value: function filter(paths) { + var _this = this; + + return make_array(paths).filter(function (path) { + return _this._filter(path); + }); + } + }, { + key: 'createFilter', + value: function createFilter() { + var _this2 = this; + + return function (path) { + return _this2._filter(path); + }; + } + }, { + key: '_createRule', + value: function _createRule(pattern) { + var rule_object = { + origin: pattern + }; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + rule_object.negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + + rule_object.pattern = pattern; + rule_object.regex = regex(pattern); + + return rule_object; + } + }, { + key: '_filter', + value: function _filter(path, slices) { + if (!path) { + return false; + } + + if (path in this._cache) { + return this._cache[path]; + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + + // '/b/a.js' -> ['', 'b', 'a.js'] -> [''] + if (slices.length && !slices[0]) { + slices = slices.slice(1); + slices[0] = SLASH + slices[0]; + } + } + + slices.pop(); + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) + + // Or only test the path + : this._test(path); + } + + // @returns {Boolean} true if a file is NOT ignored + + }, { + key: '_test', + value: function _test(path) { + // Explicitly define variable type by setting matched to `0` + var matched = 0; + + this._rules.forEach(function (rule) { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path); + } + }); + + return !matched; + } + }]); + + return IgnoreBase; +}(); + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' + + +var REPLACERS = [ + +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a \ ) -> (a ) +/\\?\s+$/, function (match) { + return match.indexOf('\\') === 0 ? ' ' : ''; +}], + +// replace (\ ) with ' ' +[/\\\s/g, function (match) { + return ' '; +}], + +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\\^$.|?*+()\[{]/g, function (match) { + return '\\' + match; +}], + +// leading slash +[ + +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], + +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, + +// '**/foo' <-> 'foo' +// just remove it +function () { + return '^(?:.*\\/)?'; +}], + +// 'f' +// matches +// - /f(end) +// - /f/ +// - (start)f(end) +// - (start)f/ +// doesn't match +// - oof +// - foo +// pseudo: +// -> (^|/)f(/|$) + +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*\/])$/, function (match) { + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + return match + '(?=$|\\/)'; +}], + +// starting +[ +// there will be no leading '/' (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^\^])/, function (match) { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) + : '^'; +}], + +// two globstars +[/\\\/\\\*\\\*(?=\\\/|$)/g, + +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer +function (m, index, str) { + + // Check if it is not the last `'/**'` + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], + +// intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule +/(^|[^\\]+)\\\*(?=.+)/g, function (match, p1) { + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + return p1 + '[^\\/]*'; +}], + +// trailing wildcard +[/(\\\/)?\\\*$/, function (m, p1) { + return p1 === '\\/' + // 'a/*' does not match 'a/' + // 'a/*' matches 'a/a' + // 'a/' + ? '\\/[^/]+' + + // or it will match everything after + : ''; +}], [ +// unescape +/\\\\\\/g, function () { + return '\\'; +}]]; + +// A simple cache, because an ignore rule only has only one certain meaning +var cache = {}; + +// @param {pattern} +function regex(pattern) { + var r = cache[pattern]; + if (r) { + return r; + } + + var source = REPLACERS.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + + return cache[pattern] = new RegExp(source, 'i'); +} + +// Windows +// -------------------------------------------------------------- +if (process.env.IGNORE_TEST_WIN32 || process.platform === 'win32') { + (function () { + + var filter = IgnoreBase.prototype._filter; + var make_posix = function make_posix(str) { + return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') + ); + }; + + IgnoreBase.prototype._filter = function (path, slices) { + path = make_posix(path); + return filter.call(this, path, slices); + }; + })(); +} diff --git a/tools/eslint/node_modules/ignore/index.js b/tools/eslint/node_modules/ignore/index.js deleted file mode 100644 index 4b9585e30950a9..00000000000000 --- a/tools/eslint/node_modules/ignore/index.js +++ /dev/null @@ -1,364 +0,0 @@ -'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 index 60c9e0665121b2..a6ad86dfbb977a 100644 --- a/tools/eslint/node_modules/ignore/package.json +++ b/tools/eslint/node_modules/ignore/package.json @@ -1,38 +1,42 @@ { "_args": [ [ - "ignore@^2.2.19", - "/Users/trott/test/node_modules/eslint" + "ignore@^3.1.2", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "ignore@>=2.2.19 <3.0.0", - "_id": "ignore@2.2.19", + "_from": "ignore@>=3.1.2 <4.0.0", + "_id": "ignore@3.1.2", "_inCache": true, "_installable": true, - "_location": "/eslint/ignore", - "_nodeVersion": "0.12.1", + "_location": "/ignore", + "_nodeVersion": "5.10.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/ignore-3.1.2.tgz_1461812650504_0.7420230738352984" + }, "_npmUser": { "email": "i@kael.me", "name": "kael" }, - "_npmVersion": "3.3.9", + "_npmVersion": "3.8.3", "_phantomChildren": {}, "_requested": { "name": "ignore", - "raw": "ignore@^2.2.19", - "rawSpec": "^2.2.19", + "raw": "ignore@^3.1.2", + "rawSpec": "^3.1.2", "scope": null, - "spec": ">=2.2.19 <3.0.0", + "spec": ">=3.1.2 <4.0.0", "type": "range" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/ignore/-/ignore-2.2.19.tgz", - "_shasum": "4c845a61f7e50b4a410f6156aaa38b6ad95e0c8f", + "_resolved": "https://registry.npmjs.org/ignore/-/ignore-3.1.2.tgz", + "_shasum": "dd17765e9233b4019762ba82b892202b0980161b", "_shrinkwrap": null, - "_spec": "ignore@^2.2.19", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "ignore@^3.1.2", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "name": "kael" }, @@ -47,14 +51,14 @@ }, "directories": {}, "dist": { - "shasum": "4c845a61f7e50b4a410f6156aaa38b6ad95e0c8f", - "tarball": "http://registry.npmjs.org/ignore/-/ignore-2.2.19.tgz" + "shasum": "dd17765e9233b4019762ba82b892202b0980161b", + "tarball": "https://registry.npmjs.org/ignore/-/ignore-3.1.2.tgz" }, "files": [ - "index.js", + "ignore.js", "LICENSE-MIT" ], - "gitHead": "97df28de4e8401e08c620986156924c1c0f3f37e", + "gitHead": "3bfb96869396873cc08ab6239f0f08fbd43863f5", "homepage": "https://github.com/kaelzhang/node-ignore#readme", "keywords": [ "ignore", @@ -66,10 +70,13 @@ "filter", "regexp", "regex", + "fnmatch", + "glob", + "asterisks", "regular-expression" ], "license": "MIT", - "main": "index.js", + "main": "./ignore.js", "maintainers": [ { "email": "i@kael.me", @@ -86,5 +93,5 @@ "scripts": { "test": "mocha --reporter spec ./test/ignore.js" }, - "version": "2.2.19" + "version": "3.1.2" } diff --git a/tools/eslint/node_modules/imurmurhash/README.md b/tools/eslint/node_modules/imurmurhash/README.md new file mode 100644 index 00000000000000..f35b20a0ef5bfe --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/eslint/node_modules/imurmurhash/imurmurhash.js b/tools/eslint/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 00000000000000..e63146a2b7e70b --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js b/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 00000000000000..dc0ee88d6b69c9 --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/tools/eslint/node_modules/imurmurhash/package.json b/tools/eslint/node_modules/imurmurhash/package.json new file mode 100644 index 00000000000000..fa90f7ee6f2bc9 --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + "imurmurhash@^0.1.4", + "/Users/trott/io.js/tools/node_modules/eslint" + ] + ], + "_from": "imurmurhash@>=0.1.4 <0.2.0", + "_id": "imurmurhash@0.1.4", + "_inCache": true, + "_installable": true, + "_location": "/imurmurhash", + "_npmUser": { + "email": "jensyt@gmail.com", + "name": "jensyt" + }, + "_npmVersion": "1.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "imurmurhash", + "raw": "imurmurhash@^0.1.4", + "rawSpec": "^0.1.4", + "scope": null, + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_shrinkwrap": null, + "_spec": "imurmurhash@^0.1.4", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", + "author": { + "email": "jensyt@gmail.com", + "name": "Jens Taylor", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "dependencies": {}, + "description": "An incremental implementation of MurmurHash3", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + }, + "engines": { + "node": ">=0.8.19" + }, + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "homepage": "https://github.com/jensyt/imurmurhash-js", + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "license": "MIT", + "main": "imurmurhash.js", + "maintainers": [ + { + "email": "jensyt@gmail.com", + "name": "jensyt" + } + ], + "name": "imurmurhash", + "optionalDependencies": {}, + "readme": "iMurmurHash.js\n==============\n\nAn incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).\n\nThis version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.\n\nInstallation\n------------\n\nTo use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.\n\n```html\n\n\n```\n\n---\n\nTo use iMurmurHash in Node.js, install the module using NPM:\n\n```bash\nnpm install imurmurhash\n```\n\nThen simply include it in your scripts:\n\n```javascript\nMurmurHash3 = require('imurmurhash');\n```\n\nQuick Example\n-------------\n\n```javascript\n// Create the initial hash\nvar hashState = MurmurHash3('string');\n\n// Incrementally add text\nhashState.hash('more strings');\nhashState.hash('even more strings');\n\n// All calls can be chained if desired\nhashState.hash('and').hash('some').hash('more');\n\n// Get a result\nhashState.result();\n// returns 0xe4ccfe6b\n```\n\nFunctions\n---------\n\n### MurmurHash3 ([string], [seed])\nGet a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:\n\n```javascript\n// Use the cached object, calling the function again will return the same\n// object (but reset, so the current state would be lost)\nhashState = MurmurHash3();\n...\n\n// Create a new object that can be safely used however you wish. Calling the\n// function again will simply return a new state object, and no state loss\n// will occur, at the cost of creating more objects.\nhashState = new MurmurHash3();\n```\n\nBoth methods can be mixed however you like if you have different use cases.\n\n---\n\n### MurmurHash3.prototype.hash (string)\nIncrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.\n\n---\n\n### MurmurHash3.prototype.result ()\nGet the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.\n\n```javascript\n// Do the whole string at once\nMurmurHash3('this is a test string').result();\n// 0x70529328\n\n// Do part of the string, get a result, then the other part\nvar m = MurmurHash3('this is a');\nm.result();\n// 0xbfc4f834\nm.hash(' test string').result();\n// 0x70529328 (same as above)\n```\n\n---\n\n### MurmurHash3.prototype.reset ([seed])\nReset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.\n\n---\n\nLicense (MIT)\n-------------\nCopyright (c) 2013 Gary Court, Jens Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "version": "0.1.4" +} diff --git a/tools/eslint/node_modules/inflight/.eslintrc b/tools/eslint/node_modules/inflight/.eslintrc deleted file mode 100644 index b7a1550efc2b2c..00000000000000 --- a/tools/eslint/node_modules/inflight/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/package.json b/tools/eslint/node_modules/inflight/package.json index 7db3e9ddab6b30..14b27930d3622e 100644 --- a/tools/eslint/node_modules/inflight/package.json +++ b/tools/eslint/node_modules/inflight/package.json @@ -2,14 +2,14 @@ "_args": [ [ "inflight@^1.0.4", - "/Users/trott/test/node_modules/eslint/node_modules/glob" + "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob" ] ], "_from": "inflight@>=1.0.4 <2.0.0", "_id": "inflight@1.0.4", "_inCache": true, "_installable": true, - "_location": "/eslint/inflight", + "_location": "/inflight", "_nodeVersion": "0.10.32", "_npmUser": { "email": "ogd@aoaioxxysz.net", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/glob", - "/eslint/rimraf/glob" + "/glob", + "/globby/glob" ], "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", "_shrinkwrap": null, "_spec": "inflight@^1.0.4", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/glob", + "_where": "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", diff --git a/tools/eslint/node_modules/inflight/test.js b/tools/eslint/node_modules/inflight/test.js deleted file mode 100644 index 2bb75b38814a60..00000000000000 --- a/tools/eslint/node_modules/inflight/test.js +++ /dev/null @@ -1,97 +0,0 @@ -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 index 052085c436514a..dea3013d6710ee 100644 --- a/tools/eslint/node_modules/inherits/LICENSE +++ b/tools/eslint/node_modules/inherits/LICENSE @@ -13,3 +13,4 @@ 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/inherits/package.json b/tools/eslint/node_modules/inherits/package.json index 57448988915c7b..7e0bcfeb985cfd 100644 --- a/tools/eslint/node_modules/inherits/package.json +++ b/tools/eslint/node_modules/inherits/package.json @@ -2,14 +2,14 @@ "_args": [ [ "inherits@~2.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + "/Users/trott/io.js/tools/node_modules/concat-stream" ] ], "_from": "inherits@>=2.0.1 <2.1.0", "_id": "inherits@2.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/inherits", + "_location": "/inherits", "_npmUser": { "email": "i@izs.me", "name": "isaacs" @@ -25,16 +25,16 @@ "type": "range" }, "_requiredBy": [ - "/eslint/concat-stream", - "/eslint/glob", - "/eslint/readable-stream", - "/eslint/rimraf/glob" + "/concat-stream", + "/glob", + "/globby/glob", + "/readable-stream" ], "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "_shrinkwrap": null, "_spec": "inherits@~2.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/concat-stream", + "_where": "/Users/trott/io.js/tools/node_modules/concat-stream", "browser": "./inherits_browser.js", "bugs": { "url": "https://github.com/isaacs/inherits/issues" @@ -45,7 +45,7 @@ "directories": {}, "dist": { "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ diff --git a/tools/eslint/node_modules/inherits/test.js b/tools/eslint/node_modules/inherits/test.js deleted file mode 100644 index fc53012d31c0cd..00000000000000 --- a/tools/eslint/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/tools/eslint/node_modules/inquirer/package.json b/tools/eslint/node_modules/inquirer/package.json index 654a767f7e5fad..e00360eda2b4fd 100644 --- a/tools/eslint/node_modules/inquirer/package.json +++ b/tools/eslint/node_modules/inquirer/package.json @@ -2,14 +2,14 @@ "_args": [ [ "inquirer@^0.12.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "inquirer@>=0.12.0 <0.13.0", "_id": "inquirer@0.12.0", "_inCache": true, "_installable": true, - "_location": "/eslint/inquirer", + "_location": "/inquirer", "_nodeVersion": "5.2.0", "_npmOperationalInternal": { "host": "packages-9-west.internal.npmjs.com", @@ -36,7 +36,7 @@ "_shasum": "1ef2bfd63504df0bc75785fff8c2c41df12f077e", "_shrinkwrap": null, "_spec": "inquirer@^0.12.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "admin@simonboudrias.com", "name": "Simon Boudrias" @@ -74,7 +74,7 @@ "directories": {}, "dist": { "shasum": "1ef2bfd63504df0bc75785fff8c2c41df12f077e", - "tarball": "http://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz" + "tarball": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz" }, "files": [ "lib" diff --git a/tools/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/eslint/node_modules/is-fullwidth-code-point/package.json index f2869d6d675099..3605118ec32313 100644 --- a/tools/eslint/node_modules/is-fullwidth-code-point/package.json +++ b/tools/eslint/node_modules/is-fullwidth-code-point/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-fullwidth-code-point@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/readline2" + "/Users/trott/io.js/tools/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", + "_location": "/is-fullwidth-code-point", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readline2", - "/eslint/string-width" + "/readline2", + "/string-width" ], "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", "_shrinkwrap": null, "_spec": "is-fullwidth-code-point@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/readline2", + "_where": "/Users/trott/io.js/tools/node_modules/readline2", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/is-my-json-valid/.npmignore b/tools/eslint/node_modules/is-my-json-valid/.npmignore deleted file mode 100644 index dbb0721ce547c1..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -cosmicrealms.com diff --git a/tools/eslint/node_modules/is-my-json-valid/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/.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/README.md b/tools/eslint/node_modules/is-my-json-valid/README.md index cbf2b20d336045..104a425ad204ed 100644 --- a/tools/eslint/node_modules/is-my-json-valid/README.md +++ b/tools/eslint/node_modules/is-my-json-valid/README.md @@ -40,7 +40,7 @@ console.log(validate.errors) You can also pass the schema as a string ``` js -var validate = validate('{"type": ... }') +var validate = validator('{"type": ... }') ``` Optionally you can use the require submodule to load a schema from `__dirname` @@ -128,7 +128,7 @@ var validate = validator({ }) validate({hello: 100}); -console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100} +console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100, type: 'string'} ``` ## Greedy mode tries to validate as much as possible diff --git a/tools/eslint/node_modules/is-my-json-valid/index.js b/tools/eslint/node_modules/is-my-json-valid/index.js index f24db9b1c9062b..f929bb75394944 100644 --- a/tools/eslint/node_modules/is-my-json-valid/index.js +++ b/tools/eslint/node_modules/is-my-json-valid/index.js @@ -5,7 +5,6 @@ var xtend = require('xtend') var formats = require('./formats') var get = function(obj, additionalSchemas, ptr) { - if (/^https?:\/\//.test(ptr)) return null var visit = function(sub) { if (sub && sub.id === ptr) return sub @@ -98,13 +97,25 @@ var unique = function(array) { return true } +var isMultipleOf = function(name, multipleOf) { + var res; + var factor = ((multipleOf | 0) !== multipleOf) ? Math.pow(10, multipleOf.toString().split('.').pop().length) : 1 + if (factor > 1) { + var factorName = ((name | 0) !== name) ? Math.pow(10, name.toString().split('.').pop().length) : 1 + if (factorName > factor) res = true + else res = Math.round(factor * name) % (factor * multipleOf) + } + else res = name % multipleOf; + return !res; +} + var toType = function(node) { return node.type } var compile = function(schema, cache, root, reporter, opts) { var fmts = opts ? xtend(formats, opts.formats) : formats - var scope = {unique:unique, formats:fmts} + var scope = {unique:unique, formats:fmts, isMultipleOf:isMultipleOf} var verbose = opts ? !!opts.verbose : false; var greedy = opts && opts.greedy !== undefined ? opts.greedy : false; @@ -150,7 +161,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (reporter === true) { validate('if (validate.errors === null) validate.errors = []') if (verbose) { - validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name) + validate('validate.errors.push({field:%s,message:%s,value:%s,type:%s})', formatName(prop || name), JSON.stringify(msg), value || name, JSON.stringify(type)) } else { validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg)) } @@ -434,9 +445,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.multipleOf !== undefined) { if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name)) - var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1 - if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf) - else validate('if (%s % %d) {', name, node.multipleOf) + validate('if (!isMultipleOf(%s, %d)) {', name, node.multipleOf) error('has a remainder') validate('}') 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 929ada2ba28d34..3f3a5207062cac 100644 --- a/tools/eslint/node_modules/is-my-json-valid/package.json +++ b/tools/eslint/node_modules/is-my-json-valid/package.json @@ -2,15 +2,19 @@ "_args": [ [ "is-my-json-valid@^2.10.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "is-my-json-valid@>=2.10.0 <3.0.0", - "_id": "is-my-json-valid@2.12.4", + "_id": "is-my-json-valid@2.13.1", "_inCache": true, "_installable": true, - "_location": "/eslint/is-my-json-valid", + "_location": "/is-my-json-valid", "_nodeVersion": "4.2.3", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773" + }, "_npmUser": { "email": "mathiasbuus@gmail.com", "name": "mafintosh" @@ -28,11 +32,11 @@ "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz", - "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", + "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz", + "_shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", "_shrinkwrap": null, "_spec": "is-my-json-valid@^2.10.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "name": "Mathias Buus" }, @@ -51,10 +55,10 @@ }, "directories": {}, "dist": { - "shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", - "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz" + "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", + "tarball": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" }, - "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb", + "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396", "homepage": "https://github.com/mafintosh/is-my-json-valid", "keywords": [ "json", @@ -92,5 +96,5 @@ "scripts": { "test": "tape test/*.js" }, - "version": "2.12.4" + "version": "2.13.1" } diff --git a/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js deleted file mode 100644 index 4e0a34b210c52b..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js +++ /dev/null @@ -1,84 +0,0 @@ -exports.valid = { - fullName : "John Doe", - age : 47, - state : "Massachusetts", - city : "Boston", - zip : 16417, - married : false, - dozen : 12, - dozenOrBakersDozen : 13, - favoriteEvenNumber : 14, - topThreeFavoriteColors : [ "red", "blue", "green" ], - favoriteSingleDigitWholeNumbers : [ 7 ], - favoriteFiveLetterWord : "coder", - emailAddresses : - [ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org", - "01234567890@numbers-in-local.net", - "&'*+-./=?^_{}~@other-valid-characters-in-local.net", - "mixed-1234-in-{+^}-local@sld.net", - "a@single-character-in-local.org", - "\"quoted\"@sld.com", - "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com", - "\"quoted-at-sign@sld.org\"@sld.com", - "\"escaped\\\"quote\"@sld.com", - "\"back\\slash\"@sld.com", - "one-character-third-level@a.example.com", - "single-character-in-sld@x.org", - "local@dash-in-sld.com", - "letters-in-sld@123.com", - "one-letter-sld@x.org", - "uncommon-tld@sld.museum", - "uncommon-tld@sld.travel", - "uncommon-tld@sld.mobi", - "country-code-tld@sld.uk", - "country-code-tld@sld.rw", - "local@sld.newTLD", - "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org", - "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com", - "local@sub.domains.com" - ], - ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ] -} - -exports.invalid = { - fullName : null, - age : -1, - state : 47, - city : false, - zip : [null], - married : "yes", - dozen : 50, - dozenOrBakersDozen : "over 9000", - favoriteEvenNumber : 15, - topThreeFavoriteColors : [ "red", 5 ], - favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ], - favoriteFiveLetterWord : "codernaut", - emailAddresses : [], - ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ] -} - -exports.schema = { // from cosmic thingy - name : "test", - type : "object", - additionalProperties : false, - required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"], - properties : - { - fullName : { type : "string" }, - age : { type : "integer", minimum : 0 }, - optionalItem : { type : "string" }, - state : { type : "string" }, - city : { type : "string" }, - zip : { type : "integer", minimum : 0, maximum : 99999 }, - married : { type : "boolean" }, - dozen : { type : "integer", minimum : 12, maximum : 12 }, - dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 }, - favoriteEvenNumber : { type : "integer", multipleOf : 2 }, - topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }}, - favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }}, - favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 }, - emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }}, - ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }}, - } - } \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json deleted file mode 100644 index 521745c8d6ed50..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "description": "additionalItems as schema", - "schema": { - "items": [{}], - "additionalItems": {"type": "integer"} - }, - "tests": [ - { - "description": "additional items match schema", - "data": [ null, 2, 3, 4 ], - "valid": true - }, - { - "description": "additional items do not match schema", - "data": [ null, 2, 3, "foo" ], - "valid": false - } - ] - }, - { - "description": "items is schema, no additionalItems", - "schema": { - "items": {}, - "additionalItems": false - }, - "tests": [ - { - "description": "all items match schema", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - } - ] - }, - { - "description": "array of items with no additionalItems", - "schema": { - "items": [{}, {}, {}], - "additionalItems": false - }, - "tests": [ - { - "description": "no additional items present", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "additional items are not permitted", - "data": [ 1, 2, 3, 4 ], - "valid": false - } - ] - }, - { - "description": "additionalItems as false without items", - "schema": {"additionalItems": false}, - "tests": [ - { - "description": - "items defaults to empty schema so everything is valid", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "additionalItems are allowed by default", - "schema": {"items": [{"type": "integer"}]}, - "tests": [ - { - "description": "only the first item is validated", - "data": [1, "foo", false], - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json deleted file mode 100644 index 40831f9e9aa135..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "description": - "additionalProperties being false does not allow other properties", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "patternProperties": { "^v": {} }, - "additionalProperties": false - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": [1, 2, 3], - "valid": true - }, - { - "description": "patternProperties are not additional properties", - "data": {"foo":1, "vroom": 2}, - "valid": true - } - ] - }, - { - "description": - "additionalProperties allows a schema which should validate", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional valid property is valid", - "data": {"foo" : 1, "bar" : 2, "quux" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : 12}, - "valid": false - } - ] - }, - { - "description": - "additionalProperties can exist by itself", - "schema": { - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "an additional valid property is valid", - "data": {"foo" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1}, - "valid": false - } - ] - }, - { - "description": "additionalProperties are allowed by default", - "schema": {"properties": {"foo": {}, "bar": {}}}, - "tests": [ - { - "description": "additional properties are allowed", - "data": {"foo": 1, "bar": 2, "quux": true}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json deleted file mode 100644 index bbb5f89e4bc5e1..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - { - "description": "allOf", - "schema": { - "allOf": [ - { - "properties": { - "bar": {"type": "integer"} - }, - "required": ["bar"] - }, - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - } - ] - }, - "tests": [ - { - "description": "allOf", - "data": {"foo": "baz", "bar": 2}, - "valid": true - }, - { - "description": "mismatch second", - "data": {"foo": "baz"}, - "valid": false - }, - { - "description": "mismatch first", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "wrong type", - "data": {"foo": "baz", "bar": "quux"}, - "valid": false - } - ] - }, - { - "description": "allOf with base schema", - "schema": { - "properties": {"bar": {"type": "integer"}}, - "required": ["bar"], - "allOf" : [ - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - }, - { - "properties": { - "baz": {"type": "null"} - }, - "required": ["baz"] - } - ] - }, - "tests": [ - { - "description": "valid", - "data": {"foo": "quux", "bar": 2, "baz": null}, - "valid": true - }, - { - "description": "mismatch base schema", - "data": {"foo": "quux", "baz": null}, - "valid": false - }, - { - "description": "mismatch first allOf", - "data": {"bar": 2, "baz": null}, - "valid": false - }, - { - "description": "mismatch second allOf", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "mismatch both", - "data": {"bar": 2}, - "valid": false - } - ] - }, - { - "description": "allOf simple types", - "schema": { - "allOf": [ - {"maximum": 30}, - {"minimum": 20} - ] - }, - "tests": [ - { - "description": "valid", - "data": 25, - "valid": true - }, - { - "description": "mismatch one", - "data": 35, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json deleted file mode 100644 index a58714afd89277..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "anyOf", - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first anyOf valid", - "data": 1, - "valid": true - }, - { - "description": "second anyOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both anyOf valid", - "data": 3, - "valid": true - }, - { - "description": "neither anyOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "anyOf with base schema", - "schema": { - "type": "string", - "anyOf" : [ - { - "maxLength": 2 - }, - { - "minLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one anyOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both anyOf invalid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json deleted file mode 100644 index ccc7c17fe8d504..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json +++ /dev/null @@ -1,107 +0,0 @@ -[ - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a bignum is an integer", - "data": 12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a bignum is a number", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a negative bignum is an integer", - "data": -12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a negative bignum is a number", - "data": -98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "string", - "schema": {"type": "string"}, - "tests": [ - { - "description": "a bignum is not a string", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"maximum": 18446744073709551615}, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision", - "schema": { - "maximum": 972783798187987123879878123.18878137, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 972783798187987123879878123.188781371, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"minimum": -18446744073709551615}, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision on negative numbers", - "schema": { - "minimum": -972783798187987123879878123.18878137, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -972783798187987123879878123.188781371, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json deleted file mode 100644 index 17629779fbeabe..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "description": "invalid type for default", - "schema": { - "properties": { - "foo": { - "type": "integer", - "default": [] - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"foo": 13}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - }, - { - "description": "invalid string value for default", - "schema": { - "properties": { - "bar": { - "type": "string", - "minLength": 4, - "default": "bad" - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"bar": "good"}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json deleted file mode 100644 index cf935a321532a6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "description": "valid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "valid definition schema", - "data": { - "definitions": { - "foo": {"type": "integer"} - } - }, - "valid": true - } - ] - }, - { - "description": "invalid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "invalid definition schema", - "data": { - "definitions": { - "foo": {"type": 1} - } - }, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json deleted file mode 100644 index 7b9b16a7e125ff..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json +++ /dev/null @@ -1,113 +0,0 @@ -[ - { - "description": "dependencies", - "schema": { - "dependencies": {"bar": ["foo"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependant", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "with dependency", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "multiple dependencies", - "schema": { - "dependencies": {"quux": ["foo", "bar"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependants", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "with dependencies", - "data": {"foo": 1, "bar": 2, "quux": 3}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"foo": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing other dependency", - "data": {"bar": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing both dependencies", - "data": {"quux": 1}, - "valid": false - } - ] - }, - { - "description": "multiple dependencies subschema", - "schema": { - "dependencies": { - "bar": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "integer"} - } - } - } - }, - "tests": [ - { - "description": "valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "no dependency", - "data": {"foo": "quux"}, - "valid": true - }, - { - "description": "wrong type", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "wrong type other", - "data": {"foo": 2, "bar": "quux"}, - "valid": false - }, - { - "description": "wrong type both", - "data": {"foo": "quux", "bar": "quux"}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json deleted file mode 100644 index f124436a7d9040..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "description": "simple enum validation", - "schema": {"enum": [1, 2, 3]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": 1, - "valid": true - }, - { - "description": "something else is invalid", - "data": 4, - "valid": false - } - ] - }, - { - "description": "heterogeneous enum validation", - "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": [], - "valid": true - }, - { - "description": "something else is invalid", - "data": null, - "valid": false - }, - { - "description": "objects are deep compared", - "data": {"foo": false}, - "valid": false - } - ] - }, - { - "description": "enums in properties", - "schema": { - "type":"object", - "properties": { - "foo": {"enum":["foo"]}, - "bar": {"enum":["bar"]} - }, - "required": ["bar"] - }, - "tests": [ - { - "description": "both properties are valid", - "data": {"foo":"foo", "bar":"bar"}, - "valid": true - }, - { - "description": "missing optional property is valid", - "data": {"bar":"bar"}, - "valid": true - }, - { - "description": "missing required property is invalid", - "data": {"foo":"foo"}, - "valid": false - }, - { - "description": "missing all properties is invalid", - "data": {}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json deleted file mode 100644 index 53c5d2519056c6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json +++ /dev/null @@ -1,143 +0,0 @@ -[ - { - "description": "validation of date-time strings", - "schema": {"format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "an invalid date-time string", - "data": "06/19/1963 08:30:06 PST", - "valid": false - }, - { - "description": "only RFC3339 not all of ISO 8601 are valid", - "data": "2013-350T01:01:01", - "valid": false - } - ] - }, - { - "description": "validation of URIs", - "schema": {"format": "uri"}, - "tests": [ - { - "description": "a valid URI", - "data": "http://foo.bar/?baz=qux#quux", - "valid": true - }, - { - "description": "an invalid URI", - "data": "\\\\WINDOWS\\fileshare", - "valid": false - }, - { - "description": "an invalid URI though valid URI reference", - "data": "abc", - "valid": false - } - ] - }, - { - "description": "validation of e-mail addresses", - "schema": {"format": "email"}, - "tests": [ - { - "description": "a valid e-mail address", - "data": "joe.bloggs@example.com", - "valid": true - }, - { - "description": "an invalid e-mail address", - "data": "2962", - "valid": false - } - ] - }, - { - "description": "validation of IP addresses", - "schema": {"format": "ipv4"}, - "tests": [ - { - "description": "a valid IP address", - "data": "192.168.0.1", - "valid": true - }, - { - "description": "an IP address with too many components", - "data": "127.0.0.0.1", - "valid": false - }, - { - "description": "an IP address with out-of-range values", - "data": "256.256.256.256", - "valid": false - }, - { - "description": "an IP address without 4 components", - "data": "127.0", - "valid": false - }, - { - "description": "an IP address as an integer", - "data": "0x7f000001", - "valid": false - } - ] - }, - { - "description": "validation of IPv6 addresses", - "schema": {"format": "ipv6"}, - "tests": [ - { - "description": "a valid IPv6 address", - "data": "::1", - "valid": true - }, - { - "description": "an IPv6 address with out-of-range values", - "data": "12345::", - "valid": false - }, - { - "description": "an IPv6 address with too many components", - "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", - "valid": false - }, - { - "description": "an IPv6 address containing illegal characters", - "data": "::laptop", - "valid": false - } - ] - }, - { - "description": "validation of host names", - "schema": {"format": "hostname"}, - "tests": [ - { - "description": "a valid host name", - "data": "www.example.com", - "valid": true - }, - { - "description": "a host name starting with an illegal character", - "data": "-a-host-name-that-starts-with--", - "valid": false - }, - { - "description": "a host name containing illegal characters", - "data": "not_a_valid_host_name", - "valid": false - }, - { - "description": "a host name with a component too long", - "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json deleted file mode 100644 index f5e18a13848f71..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "description": "a schema given for items", - "schema": { - "items": {"type": "integer"} - }, - "tests": [ - { - "description": "valid items", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "wrong type of items", - "data": [1, "x"], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "an array of schemas for items", - "schema": { - "items": [ - {"type": "integer"}, - {"type": "string"} - ] - }, - "tests": [ - { - "description": "correct types", - "data": [ 1, "foo" ], - "valid": true - }, - { - "description": "wrong types", - "data": [ "foo", 1 ], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json deleted file mode 100644 index 3b53a6b371a7b6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxItems validation", - "schema": {"maxItems": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": [1], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "too long is invalid", - "data": [1, 2, 3], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json deleted file mode 100644 index 48eb1296d2e420..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxLength validation", - "schema": {"maxLength": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": "f", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too long is invalid", - "data": "foo", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 100, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json deleted file mode 100644 index d282446ad6978d..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxProperties validation", - "schema": {"maxProperties": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "too long is invalid", - "data": {"foo": 1, "bar": 2, "baz": 3}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json deleted file mode 100644 index 86c7b89c9a9047..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json deleted file mode 100644 index ed5118815ee933..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minItems validation", - "schema": {"minItems": 1}, - "tests": [ - { - "description": "longer is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1], - "valid": true - }, - { - "description": "too short is invalid", - "data": [], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json deleted file mode 100644 index e9c14b1723efd9..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minLength validation", - "schema": {"minLength": 2}, - "tests": [ - { - "description": "longer is valid", - "data": "foo", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too short is invalid", - "data": "f", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 1, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json deleted file mode 100644 index a72c7d293e6c3e..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minProperties validation", - "schema": {"minProperties": 1}, - "tests": [ - { - "description": "longer is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "too short is invalid", - "data": {}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json deleted file mode 100644 index d5bf000bcc66f8..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "minimum validation", - "schema": {"minimum": 1.1}, - "tests": [ - { - "description": "above the minimum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "below the minimum is invalid", - "data": 0.6, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMinimum validation", - "schema": { - "minimum": 1.1, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "above the minimum is still valid", - "data": 1.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 1.1, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json deleted file mode 100644 index ca3b7618053f49..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "description": "by int", - "schema": {"multipleOf": 2}, - "tests": [ - { - "description": "int by int", - "data": 10, - "valid": true - }, - { - "description": "int by int fail", - "data": 7, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "by number", - "schema": {"multipleOf": 1.5}, - "tests": [ - { - "description": "zero is multiple of anything", - "data": 0, - "valid": true - }, - { - "description": "4.5 is multiple of 1.5", - "data": 4.5, - "valid": true - }, - { - "description": "35 is not multiple of 1.5", - "data": 35, - "valid": false - } - ] - }, - { - "description": "by small number", - "schema": {"multipleOf": 0.0001}, - "tests": [ - { - "description": "0.0075 is multiple of 0.0001", - "data": 0.0075, - "valid": true - }, - { - "description": "0.00751 is not multiple of 0.0001", - "data": 0.00751, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json deleted file mode 100644 index f66690fe1bbff5..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - { - "description": "not", - "schema": { - "not": {"type": "integer"} - }, - "tests": [ - { - "description": "allowed", - "data": "foo", - "valid": true - }, - { - "description": "disallowed", - "data": 1, - "valid": false - } - ] - }, - { - "description": "not multiple types", - "schema": { - "not": {"type": ["integer", "boolean"]} - }, - "tests": [ - { - "description": "valid", - "data": "foo", - "valid": true - }, - { - "description": "mismatch", - "data": 1, - "valid": false - }, - { - "description": "other mismatch", - "data": true, - "valid": false - } - ] - }, - { - "description": "not more complex schema", - "schema": { - "not": { - "type": "object", - "properties": { - "foo": { - "type": "string" - } - } - } - }, - "tests": [ - { - "description": "match", - "data": 1, - "valid": true - }, - { - "description": "other match", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "mismatch", - "data": {"foo": "bar"}, - "valid": false - } - ] - }, - { - "description": "forbidden property", - "schema": { - "properties": { - "foo": { - "not": {} - } - } - }, - "tests": [ - { - "description": "property present", - "data": {"foo": 1, "bar": 2}, - "valid": false - }, - { - "description": "property absent", - "data": {"bar": 1, "baz": 2}, - "valid": true - } - ] - } - -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json deleted file mode 100644 index d7fce9f50907a0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "description": "validation of null and format", - "schema": {"type": ["null", "string"], "format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "allow null", - "data": null, - "valid": true - } - ] - } -] \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json deleted file mode 100644 index c65c02c36f9706..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "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-my-json-valid/test/json-schema-draft4/oneOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json deleted file mode 100644 index 1eaa4e47949dc3..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "oneOf", - "schema": { - "oneOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first oneOf valid", - "data": 1, - "valid": true - }, - { - "description": "second oneOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both oneOf valid", - "data": 3, - "valid": false - }, - { - "description": "neither oneOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "oneOf with base schema", - "schema": { - "type": "string", - "oneOf" : [ - { - "minLength": 2 - }, - { - "maxLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one oneOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both oneOf valid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json deleted file mode 100644 index befc4b560f7c33..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "description": "pattern validation", - "schema": {"pattern": "^a*$"}, - "tests": [ - { - "description": "a matching pattern is valid", - "data": "aaa", - "valid": true - }, - { - "description": "a non-matching pattern is invalid", - "data": "abc", - "valid": false - }, - { - "description": "ignores non-strings", - "data": true, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json deleted file mode 100644 index 18586e5daba602..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - { - "description": - "patternProperties validates properties matching a regex", - "schema": { - "patternProperties": { - "f.*o": {"type": "integer"} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "multiple valid matches is valid", - "data": {"foo": 1, "foooooo" : 2}, - "valid": true - }, - { - "description": "a single invalid match is invalid", - "data": {"foo": "bar", "fooooo": 2}, - "valid": false - }, - { - "description": "multiple invalid matches is invalid", - "data": {"foo": "bar", "foooooo" : "baz"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": 12, - "valid": true - } - ] - }, - { - "description": "multiple simultaneous patternProperties are validated", - "schema": { - "patternProperties": { - "a*": {"type": "integer"}, - "aaa*": {"maximum": 20} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"a": 21}, - "valid": true - }, - { - "description": "a simultaneous match is valid", - "data": {"aaaa": 18}, - "valid": true - }, - { - "description": "multiple matches is valid", - "data": {"a": 21, "aaaa": 18}, - "valid": true - }, - { - "description": "an invalid due to one is invalid", - "data": {"a": "bar"}, - "valid": false - }, - { - "description": "an invalid due to the other is invalid", - "data": {"aaaa": 31}, - "valid": false - }, - { - "description": "an invalid due to both is invalid", - "data": {"aaa": "foo", "aaaa": 31}, - "valid": false - } - ] - }, - { - "description": "regexes are not anchored by default and are case sensitive", - "schema": { - "patternProperties": { - "[0-9]{2,}": { "type": "boolean" }, - "X_": { "type": "string" } - } - }, - "tests": [ - { - "description": "non recognized members are ignored", - "data": { "answer 1": "42" }, - "valid": true - }, - { - "description": "recognized members are accounted for", - "data": { "a31b": null }, - "valid": false - }, - { - "description": "regexes are case sensitive", - "data": { "a_x_3": 3 }, - "valid": true - }, - { - "description": "regexes are case sensitive, 2", - "data": { "a_X_3": 3 }, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json deleted file mode 100644 index cd1644dcd91fe0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "description": "object properties validation", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "string"} - } - }, - "tests": [ - { - "description": "both properties present and valid is valid", - "data": {"foo": 1, "bar": "baz"}, - "valid": true - }, - { - "description": "one property invalid is invalid", - "data": {"foo": 1, "bar": {}}, - "valid": false - }, - { - "description": "both properties invalid is invalid", - "data": {"foo": [], "bar": {}}, - "valid": false - }, - { - "description": "doesn't invalidate other properties", - "data": {"quux": []}, - "valid": true - }, - { - "description": "ignores non-objects", - "data": [], - "valid": true - } - ] - }, - { - "description": - "properties, patternProperties, additionalProperties interaction", - "schema": { - "properties": { - "foo": {"type": "array", "maxItems": 3}, - "bar": {"type": "array"} - }, - "patternProperties": {"f.o": {"minItems": 2}}, - "additionalProperties": {"type": "integer"} - }, - "tests": [ - { - "description": "property validates property", - "data": {"foo": [1, 2]}, - "valid": true - }, - { - "description": "property invalidates property", - "data": {"foo": [1, 2, 3, 4]}, - "valid": false - }, - { - "description": "patternProperty invalidates property", - "data": {"foo": []}, - "valid": false - }, - { - "description": "patternProperty validates nonproperty", - "data": {"fxo": [1, 2]}, - "valid": true - }, - { - "description": "patternProperty invalidates nonproperty", - "data": {"fxo": []}, - "valid": false - }, - { - "description": "additionalProperty ignores property", - "data": {"bar": []}, - "valid": true - }, - { - "description": "additionalProperty validates others", - "data": {"quux": 3}, - "valid": true - }, - { - "description": "additionalProperty invalidates others", - "data": {"quux": "foo"}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json deleted file mode 100644 index d8214bc2b30c1f..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "description": "root pointer ref", - "schema": { - "properties": { - "foo": {"$ref": "#"} - }, - "additionalProperties": false - }, - "tests": [ - { - "description": "match", - "data": {"foo": false}, - "valid": true - }, - { - "description": "recursive match", - "data": {"foo": {"foo": false}}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": false}, - "valid": false - }, - { - "description": "recursive mismatch", - "data": {"foo": {"bar": false}}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to object", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"$ref": "#/properties/foo"} - } - }, - "tests": [ - { - "description": "match", - "data": {"bar": 3}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": true}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to array", - "schema": { - "items": [ - {"type": "integer"}, - {"$ref": "#/items/0"} - ] - }, - "tests": [ - { - "description": "match array", - "data": [1, 2], - "valid": true - }, - { - "description": "mismatch array", - "data": [1, "foo"], - "valid": false - } - ] - }, - { - "description": "escaped pointer ref", - "schema": { - "tilda~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, - "properties": { - "tilda": {"$ref": "#/tilda~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} - } - }, - "tests": [ - { - "description": "slash", - "data": {"slash": "aoeu"}, - "valid": false - }, - { - "description": "tilda", - "data": {"tilda": "aoeu"}, - "valid": false - }, - { - "description": "percent", - "data": {"percent": "aoeu"}, - "valid": false - } - ] - }, - { - "description": "nested refs", - "schema": { - "definitions": { - "a": {"type": "integer"}, - "b": {"$ref": "#/definitions/a"}, - "c": {"$ref": "#/definitions/b"} - }, - "$ref": "#/definitions/c" - }, - "tests": [ - { - "description": "nested ref valid", - "data": 5, - "valid": true - }, - { - "description": "nested ref invalid", - "data": "a", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json deleted file mode 100644 index 4ca804732c9754..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "description": "remote ref", - "schema": {"$ref": "http://localhost:1234/integer.json"}, - "tests": [ - { - "description": "remote ref valid", - "data": 1, - "valid": true - }, - { - "description": "remote ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, - "tests": [ - { - "description": "remote fragment valid", - "data": 1, - "valid": true - }, - { - "description": "remote fragment invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "ref within remote ref", - "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" - }, - "tests": [ - { - "description": "ref within ref valid", - "data": 1, - "valid": true - }, - { - "description": "ref within ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "change resolution scope", - "schema": { - "id": "http://localhost:1234/", - "items": { - "id": "folder/", - "items": {"$ref": "folderInteger.json"} - } - }, - "tests": [ - { - "description": "changed scope ref valid", - "data": [[1]], - "valid": true - }, - { - "description": "changed scope ref invalid", - "data": [["a"]], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json deleted file mode 100644 index 612f73f3472bc0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "description": "required validation", - "schema": { - "properties": { - "foo": {}, - "bar": {} - }, - "required": ["foo"] - }, - "tests": [ - { - "description": "present required property is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "non-present required property is invalid", - "data": {"bar": 1}, - "valid": false - } - ] - }, - { - "description": "required default validation", - "schema": { - "properties": { - "foo": {} - } - }, - "tests": [ - { - "description": "not required by default", - "data": {}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json deleted file mode 100644 index 257f05129279fa..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json +++ /dev/null @@ -1,330 +0,0 @@ -[ - { - "description": "integer type matches integers", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "an integer is an integer", - "data": 1, - "valid": true - }, - { - "description": "a float is not an integer", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an integer", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an integer", - "data": {}, - "valid": false - }, - { - "description": "an array is not an integer", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an integer", - "data": true, - "valid": false - }, - { - "description": "null is not an integer", - "data": null, - "valid": false - } - ] - }, - { - "description": "number type matches numbers", - "schema": {"type": "number"}, - "tests": [ - { - "description": "an integer is a number", - "data": 1, - "valid": true - }, - { - "description": "a float is a number", - "data": 1.1, - "valid": true - }, - { - "description": "a string is not a number", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a number", - "data": {}, - "valid": false - }, - { - "description": "an array is not a number", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a number", - "data": true, - "valid": false - }, - { - "description": "null is not a number", - "data": null, - "valid": false - } - ] - }, - { - "description": "string type matches strings", - "schema": {"type": "string"}, - "tests": [ - { - "description": "1 is not a string", - "data": 1, - "valid": false - }, - { - "description": "a float is not a string", - "data": 1.1, - "valid": false - }, - { - "description": "a string is a string", - "data": "foo", - "valid": true - }, - { - "description": "an object is not a string", - "data": {}, - "valid": false - }, - { - "description": "an array is not a string", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a string", - "data": true, - "valid": false - }, - { - "description": "null is not a string", - "data": null, - "valid": false - } - ] - }, - { - "description": "object type matches objects", - "schema": {"type": "object"}, - "tests": [ - { - "description": "an integer is not an object", - "data": 1, - "valid": false - }, - { - "description": "a float is not an object", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an object", - "data": "foo", - "valid": false - }, - { - "description": "an object is an object", - "data": {}, - "valid": true - }, - { - "description": "an array is not an object", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an object", - "data": true, - "valid": false - }, - { - "description": "null is not an object", - "data": null, - "valid": false - } - ] - }, - { - "description": "array type matches arrays", - "schema": {"type": "array"}, - "tests": [ - { - "description": "an integer is not an array", - "data": 1, - "valid": false - }, - { - "description": "a float is not an array", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an array", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an array", - "data": {}, - "valid": false - }, - { - "description": "an array is not an array", - "data": [], - "valid": true - }, - { - "description": "a boolean is not an array", - "data": true, - "valid": false - }, - { - "description": "null is not an array", - "data": null, - "valid": false - } - ] - }, - { - "description": "boolean type matches booleans", - "schema": {"type": "boolean"}, - "tests": [ - { - "description": "an integer is not a boolean", - "data": 1, - "valid": false - }, - { - "description": "a float is not a boolean", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not a boolean", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a boolean", - "data": {}, - "valid": false - }, - { - "description": "an array is not a boolean", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a boolean", - "data": true, - "valid": true - }, - { - "description": "null is not a boolean", - "data": null, - "valid": false - } - ] - }, - { - "description": "null type matches only the null object", - "schema": {"type": "null"}, - "tests": [ - { - "description": "an integer is not null", - "data": 1, - "valid": false - }, - { - "description": "a float is not null", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not null", - "data": "foo", - "valid": false - }, - { - "description": "an object is not null", - "data": {}, - "valid": false - }, - { - "description": "an array is not null", - "data": [], - "valid": false - }, - { - "description": "a boolean is not null", - "data": true, - "valid": false - }, - { - "description": "null is null", - "data": null, - "valid": true - } - ] - }, - { - "description": "multiple types can be specified in an array", - "schema": {"type": ["integer", "string"]}, - "tests": [ - { - "description": "an integer is valid", - "data": 1, - "valid": true - }, - { - "description": "a string is valid", - "data": "foo", - "valid": true - }, - { - "description": "a float is invalid", - "data": 1.1, - "valid": false - }, - { - "description": "an object is invalid", - "data": {}, - "valid": false - }, - { - "description": "an array is invalid", - "data": [], - "valid": false - }, - { - "description": "a boolean is invalid", - "data": true, - "valid": false - }, - { - "description": "null is invalid", - "data": null, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json deleted file mode 100644 index c1f4ab99c9a485..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json +++ /dev/null @@ -1,79 +0,0 @@ -[ - { - "description": "uniqueItems validation", - "schema": {"uniqueItems": true}, - "tests": [ - { - "description": "unique array of integers is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "non-unique array of integers is invalid", - "data": [1, 1], - "valid": false - }, - { - "description": "numbers are unique if mathematically unequal", - "data": [1.0, 1.00, 1], - "valid": false - }, - { - "description": "unique array of objects is valid", - "data": [{"foo": "bar"}, {"foo": "baz"}], - "valid": true - }, - { - "description": "non-unique array of objects is invalid", - "data": [{"foo": "bar"}, {"foo": "bar"}], - "valid": false - }, - { - "description": "unique array of nested objects is valid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : false}}} - ], - "valid": true - }, - { - "description": "non-unique array of nested objects is invalid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : true}}} - ], - "valid": false - }, - { - "description": "unique array of arrays is valid", - "data": [["foo"], ["bar"]], - "valid": true - }, - { - "description": "non-unique array of arrays is invalid", - "data": [["foo"], ["foo"]], - "valid": false - }, - { - "description": "1 and true are unique", - "data": [1, true], - "valid": true - }, - { - "description": "0 and false are unique", - "data": [0, false], - "valid": true - }, - { - "description": "unique heterogeneous types are valid", - "data": [{}, [1], true, null, 1], - "valid": true - }, - { - "description": "non-unique heterogeneous types are invalid", - "data": [{}, [1], true, null, {}, 1], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js b/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js deleted file mode 100644 index e68a263a279218..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js +++ /dev/null @@ -1,23 +0,0 @@ -var tape = require('tape') -var fs = require('fs') -var validator = require('../') - -var files = fs.readdirSync(__dirname+'/json-schema-draft4') - .map(function(file) { - if (file === 'definitions.json') return null - if (file === 'refRemote.json') return null - return require('./json-schema-draft4/'+file) - }) - .filter(Boolean) - -files.forEach(function(file) { - file.forEach(function(f) { - tape('json-schema-test-suite '+f.description, function(t) { - var validate = validator(f.schema) - f.tests.forEach(function(test) { - t.same(validate(test.data), test.valid, test.description) - }) - t.end() - }) - }) -}) diff --git a/tools/eslint/node_modules/is-my-json-valid/test/misc.js b/tools/eslint/node_modules/is-my-json-valid/test/misc.js deleted file mode 100644 index b5109e576f26b9..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/misc.js +++ /dev/null @@ -1,429 +0,0 @@ -var tape = require('tape') -var cosmic = require('./fixtures/cosmic') -var validator = require('../') -var validatorRequire = require('../require') - -tape('simple', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.ok(validate({hello: 'world'}), 'should be valid') - t.notOk(validate(), 'should be invalid') - t.notOk(validate({}), 'should be invalid') - t.end() -}) - -tape('advanced', function(t) { - var validate = validator(cosmic.schema) - - t.ok(validate(cosmic.valid), 'should be valid') - t.notOk(validate(cosmic.invalid), 'should be invalid') - t.end() -}) - -tape('greedy/false', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.end(); -}); - -tape('greedy/true', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }, { - greedy: true - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.x') - t.strictEqual(validate.errors[1].message, 'is the wrong type') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.ok(validate({x: 1, y: 'value'}), 'should be invalid') - t.end(); -}); - -tape('additional props', function(t) { - var validate = validator({ - type: 'object', - additionalProperties: false - }, { - verbose: true - }) - - t.ok(validate({})) - t.notOk(validate({foo:'bar'})) - t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode') - t.end() -}) - -tape('array', function(t) { - var validate = validator({ - type: 'array', - required: true, - items: { - type: 'string' - } - }) - - t.notOk(validate({}), 'wrong type') - t.notOk(validate(), 'is required') - t.ok(validate(['test'])) - t.end() -}) - -tape('nested array', function(t) { - var validate = validator({ - type: 'object', - properties: { - list: { - type: 'array', - required: true, - items: { - type: 'string' - } - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({list:['test']})) - t.notOk(validate({list:[1]})) - t.end() -}) - -tape('enum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - required: true, - enum: [42] - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({foo:42})) - t.notOk(validate({foo:43})) - t.end() -}) - -tape('minimum/maximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 0, - maximum: 0 - } - } - }) - - t.notOk(validate({foo:-42})) - t.ok(validate({foo:0})) - t.notOk(validate({foo:42})) - t.end() -}) - -tape('exclusiveMinimum/exclusiveMaximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 10, - maximum: 20, - exclusiveMinimum: true, - exclusiveMaximum: true - } - } - }) - - t.notOk(validate({foo:10})) - t.ok(validate({foo:11})) - t.notOk(validate({foo:20})) - t.ok(validate({foo:19})) - t.end() -}) - -tape('custom format', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:/^a+$/}}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('custom format function', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:function(s) { return /^a+$/.test(s) } }}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('do not mutate schema', function(t) { - var sch = { - items: [ - {} - ], - additionalItems: { - type: 'integer' - } - } - - var copy = JSON.parse(JSON.stringify(sch)) - - validator(sch) - - t.same(sch, copy, 'did not mutate') - t.end() -}) - -tape('#toJSON()', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.deepEqual(validate.toJSON(), schema, 'should return original schema') - t.end() -}) - -tape('external schemas', function(t) { - var ext = {type: 'string'} - var schema = { - required: true, - $ref: '#ext' - } - - var validate = validator(schema, {schemas: {ext:ext}}) - - t.ok(validate('hello string'), 'is a string') - t.notOk(validate(42), 'not a string') - t.end() -}) - -tape('top-level external schema', function(t) { - var defs = { - "string": { - type: "string" - }, - "sex": { - type: "string", - enum: ["male", "female", "other"] - } - } - var schema = { - type: "object", - properties: { - "name": { $ref: "definitions.json#/string" }, - "sex": { $ref: "definitions.json#/sex" } - }, - required: ["name", "sex"] - } - - var validate = validator(schema, { - schemas: { - "definitions.json": defs - } - }) - t.ok(validate({name:"alice", sex:"female"}), 'is an object') - t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema') - t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema') - t.end() -}) - -tape('nested required array decl', function(t) { - var schema = { - properties: { - x: { - type: 'object', - properties: { - y: { - type: 'object', - properties: { - z: { - type: 'string' - } - }, - required: ['z'] - } - } - } - }, - required: ['x'] - } - - var validate = validator(schema) - - t.ok(validate({x: {}}), 'should be valid') - t.notOk(validate({}), 'should not be valid') - t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field') - t.end() -}) - -tape('verbose mode', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } - }; - - var validate = validator(schema, {verbose: true}) - - t.ok(validate({hello: 'string'}), 'should be valid') - t.notOk(validate({hello: 100}), 'should not be valid') - t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value') - t.end() -}) - -tape('additional props in verbose mode', function(t) { - var schema = { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - }, - 'hello world': { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - } - } - } - } - }; - - var validate = validator(schema, {verbose: true}) - - validate({'hello world': {bar: 'string'}}); - - t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error') - t.end() -}) - -tape('Date.now() is an integer', function(t) { - var schema = {type: 'integer'} - var validate = validator(schema) - - t.ok(validate(Date.now()), 'is integer') - t.end() -}) - -tape('field shows item index in arrays', function(t) { - var schema = { - type: 'array', - items: { - type: 'array', - items: { - properties: { - foo: { - type: 'string', - required: true - } - } - } - } - } - - var validate = validator(schema) - - validate([ - [ - { foo: 'test' }, - { foo: 'test' } - ], - [ - { foo: 'test' }, - { baz: 'test' } - ] - ]) - - t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error') - t.end() -}) diff --git a/tools/eslint/node_modules/is-path-cwd/package.json b/tools/eslint/node_modules/is-path-cwd/package.json index e3a6a3c7b1152d..66686a815fedd2 100644 --- a/tools/eslint/node_modules/is-path-cwd/package.json +++ b/tools/eslint/node_modules/is-path-cwd/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-path-cwd@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/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", + "_location": "/is-path-cwd", "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/is-path-in-cwd/package.json b/tools/eslint/node_modules/is-path-in-cwd/package.json index 25884ed6bcc8f4..11c494840f9379 100644 --- a/tools/eslint/node_modules/is-path-in-cwd/package.json +++ b/tools/eslint/node_modules/is-path-in-cwd/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-path-in-cwd@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/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", + "_location": "/is-path-in-cwd", "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/is-path-inside/package.json b/tools/eslint/node_modules/is-path-inside/package.json index fe03962cdd3ef1..52ddff568bedb3 100644 --- a/tools/eslint/node_modules/is-path-inside/package.json +++ b/tools/eslint/node_modules/is-path-inside/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-path-inside@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/is-path-in-cwd" + "/Users/trott/io.js/tools/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", + "_location": "/is-path-inside", "_npmUser": { "email": "sindresorhus@gmail.com", "name": "sindresorhus" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/is-path-in-cwd" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/is-path-in-cwd", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -50,7 +50,7 @@ "directories": {}, "dist": { "shasum": "fc06e5a1683fbda13de667aff717bbc10a48f37f", - "tarball": "http://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/is-property/.npmignore b/tools/eslint/node_modules/is-property/.npmignore deleted file mode 100644 index 8ecfa25a868d83..00000000000000 --- a/tools/eslint/node_modules/is-property/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules/* -*.DS_Store -test/* \ No newline at end of file diff --git a/tools/eslint/node_modules/is-property/README.md b/tools/eslint/node_modules/is-property/README.md index 9846a8bb9fc51b..ef1d00b62f8022 100644 --- a/tools/eslint/node_modules/is-property/README.md +++ b/tools/eslint/node_modules/is-property/README.md @@ -16,7 +16,7 @@ Install ------- npm install is-property - + ### `require("is-property")(str)` Checks if str is a property diff --git a/tools/eslint/node_modules/is-property/package.json b/tools/eslint/node_modules/is-property/package.json index 586bd1571f5d06..de06f2b2acf20a 100644 --- a/tools/eslint/node_modules/is-property/package.json +++ b/tools/eslint/node_modules/is-property/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-property@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/generate-object-property" + "/Users/trott/io.js/tools/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", + "_location": "/is-property", "_nodeVersion": "0.10.26", "_npmUser": { "email": "mikolalysenko@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/generate-object-property" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/generate-object-property", "author": { "name": "Mikola Lysenko" }, diff --git a/tools/eslint/node_modules/is-resolvable/README.md b/tools/eslint/node_modules/is-resolvable/README.md index 941c65e5cf7b5e..ac9da3120591fb 100755 --- a/tools/eslint/node_modules/is-resolvable/README.md +++ b/tools/eslint/node_modules/is-resolvable/README.md @@ -37,7 +37,7 @@ const isResolvable = require('is-resolvable'); ### isResolvable(*moduleId*) -*moduleId*: `String` (module ID) +*moduleId*: `String` (module ID) Return: `Boolean` It returns `true` if `require()` can load a file form a given module ID, otherwise `false`. diff --git a/tools/eslint/node_modules/is-resolvable/package.json b/tools/eslint/node_modules/is-resolvable/package.json index 3e53ca97816675..850f3878642832 100644 --- a/tools/eslint/node_modules/is-resolvable/package.json +++ b/tools/eslint/node_modules/is-resolvable/package.json @@ -2,14 +2,14 @@ "_args": [ [ "is-resolvable@^1.0.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/is-resolvable", "_nodeVersion": "2.4.0", "_npmUser": { "email": "snnskwtnb@gmail.com", @@ -32,7 +32,7 @@ "_shasum": "8df57c61ea2e3c501408d100fb013cf8d6e0cc62", "_shrinkwrap": null, "_spec": "is-resolvable@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "name": "Shinnosuke Watanabe", "url": "https://github.com/shinnn" diff --git a/tools/eslint/node_modules/isarray/Makefile b/tools/eslint/node_modules/isarray/Makefile new file mode 100644 index 00000000000000..787d56e1e982e4 --- /dev/null +++ b/tools/eslint/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/tools/eslint/node_modules/isarray/README.md b/tools/eslint/node_modules/isarray/README.md index 052a62b8d7b7ae..16d2c59c6195f9 100644 --- a/tools/eslint/node_modules/isarray/README.md +++ b/tools/eslint/node_modules/isarray/README.md @@ -3,6 +3,12 @@ `Array#isArray` for older browsers. +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + ## Usage ```js diff --git a/tools/eslint/node_modules/isarray/build/build.js b/tools/eslint/node_modules/isarray/build/build.js deleted file mode 100644 index e1856ef0943728..00000000000000 --- a/tools/eslint/node_modules/isarray/build/build.js +++ /dev/null @@ -1,208 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); diff --git a/tools/eslint/node_modules/isarray/index.js b/tools/eslint/node_modules/isarray/index.js index 5f5ad45d46dda9..a57f63495943a0 100644 --- a/tools/eslint/node_modules/isarray/index.js +++ b/tools/eslint/node_modules/isarray/index.js @@ -1,3 +1,5 @@ +var toString = {}.toString; + module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; + return toString.call(arr) == '[object Array]'; }; diff --git a/tools/eslint/node_modules/isarray/package.json b/tools/eslint/node_modules/isarray/package.json index 699ef751cc8680..fade22d0b8b6d3 100644 --- a/tools/eslint/node_modules/isarray/package.json +++ b/tools/eslint/node_modules/isarray/package.json @@ -1,38 +1,39 @@ { "_args": [ [ - "isarray@0.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + "isarray@~1.0.0", + "/Users/trott/io.js/tools/node_modules/readable-stream" ] ], - "_from": "isarray@0.0.1", - "_id": "isarray@0.0.1", + "_from": "isarray@>=1.0.0 <1.1.0", + "_id": "isarray@1.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/isarray", + "_location": "/isarray", + "_nodeVersion": "5.1.0", "_npmUser": { "email": "julian@juliangruber.com", "name": "juliangruber" }, - "_npmVersion": "1.2.18", + "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { "name": "isarray", - "raw": "isarray@0.0.1", - "rawSpec": "0.0.1", + "raw": "isarray@~1.0.0", + "rawSpec": "~1.0.0", "scope": null, - "spec": "0.0.1", - "type": "version" + "spec": ">=1.0.0 <1.1.0", + "type": "range" }, "_requiredBy": [ - "/eslint/doctrine", - "/eslint/readable-stream" + "/doctrine", + "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", "_shrinkwrap": null, - "_spec": "isarray@0.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/readable-stream", + "_spec": "isarray@~1.0.0", + "_where": "/Users/trott/io.js/tools/node_modules/readable-stream", "author": { "email": "mail@juliangruber.com", "name": "Julian Gruber", @@ -44,13 +45,14 @@ "dependencies": {}, "description": "Array#isArray for older browsers", "devDependencies": { - "tap": "*" + "tape": "~2.13.4" }, "directories": {}, "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", "homepage": "https://github.com/juliangruber/isarray", "keywords": [ "browser", @@ -73,7 +75,23 @@ "url": "git://github.com/juliangruber/isarray.git" }, "scripts": { - "test": "tap test/*.js" + "test": "tape test.js" }, - "version": "0.0.1" + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test.js" + }, + "version": "1.0.0" } diff --git a/tools/eslint/node_modules/js-yaml/CHANGELOG.md b/tools/eslint/node_modules/js-yaml/CHANGELOG.md deleted file mode 100644 index e7ff17185e53b8..00000000000000 --- a/tools/eslint/node_modules/js-yaml/CHANGELOG.md +++ /dev/null @@ -1,376 +0,0 @@ -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 ------------------- - -- Added `.sortKeys` dumper option, thanks to @rjmunro. -- Fixed astral characters support, #191. - - -3.3.0 / 2015-04-26 ------------------- - -- Significantly improved long strings formatting in dumper, thanks to @isaacs. -- Strip BOM if exists. - - -3.2.7 / 2015-02-19 ------------------- - -- Maintenance release. -- Updated dependencies. -- HISTORY.md -> CHANGELOG.md - - -3.2.6 / 2015-02-07 ------------------- - -- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). -- Fixed demo dates dump (#113, thanks to @Hypercubed). - - -3.2.5 / 2014-12-28 ------------------- - -- Fixed resolving of all built-in types on empty nodes. -- Fixed invalid warning on empty lines within quoted scalars and flow collections. -- Fixed bug: Tag on an empty node didn't resolve in some cases. - - -3.2.4 / 2014-12-19 ------------------- - -- Fixed resolving of !!null tag on an empty node. - - -3.2.3 / 2014-11-08 ------------------- - -- Implemented dumping of objects with circular and cross references. -- Partially fixed aliasing of constructed objects. (see issue #141 for details) - - -3.2.2 / 2014-09-07 ------------------- - -- Fixed infinite loop on unindented block scalars. -- Rewritten base64 encode/decode in binary type, to keep code licence clear. - - -3.2.1 / 2014-08-24 ------------------- - -- Nothig new. Just fix npm publish error. - - -3.2.0 / 2014-08-24 ------------------- - -- Added input piping support to CLI. -- Fixed typo, that could cause hand on initial indent (#139). - - -3.1.0 / 2014-07-07 ------------------- - -- 1.5x-2x speed boost. -- Removed deprecated `require('xxx.yml')` support. -- Significant code cleanup and refactoring. -- Internal API changed. If you used custom types - see updated examples. - Others are not affected. -- Even if the input string has no trailing line break character, - it will be parsed as if it has one. -- Added benchmark scripts. -- Moved bower files to /dist folder -- Bugfixes. - - -3.0.2 / 2014-02-27 ------------------- - -- Fixed bug: "constructor" string parsed as `null`. - - -3.0.1 / 2013-12-22 ------------------- - -- Fixed parsing of literal scalars. (issue #108) -- Prevented adding unnecessary spaces in object dumps. (issue #68) -- Fixed dumping of objects with very long (> 1024 in length) keys. - - -3.0.0 / 2013-12-16 ------------------- - -- Refactored code. Changed API for custom types. -- Removed output colors in CLI, dump json by default. -- Removed big dependencies from browser version (esprima, buffer) - - load `esprima` manually, if !!js/function needed - - !!bin now returns Array in browser -- AMD support. -- Don't quote dumped strings because of `-` & `?` (if not first char). -- __Deprecated__ loading yaml files via `require()`, as not recommended - behaviour for node. - - -2.1.3 / 2013-10-16 ------------------- - -- Fix wrong loading of empty block scalars. - - -2.1.2 / 2013-10-07 ------------------- - -- Fix unwanted line breaks in folded scalars. - - -2.1.1 / 2013-10-02 ------------------- - -- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 -- Fixed reader bug in JSON-like sequences/mappings. - - -2.1.0 / 2013-06-05 ------------------- - -- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), - JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). -- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` - and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. -- Bug fix: export `NIL` constant from the public interface. -- Add `skipInvalid` dumper option. -- Use `safeLoad` for `require` extension. - - -2.0.5 / 2013-04-26 ------------------- - -- Close security issue in !!js/function constructor. - Big thanks to @nealpoole for security audit. - - -2.0.4 / 2013-04-08 ------------------- - -- Updated .npmignore to reduce package size - - -2.0.3 / 2013-02-26 ------------------- - -- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) - - -2.0.2 / 2013-02-15 ------------------- - -- Fixed input validation: tabs are printable characters. - - -2.0.1 / 2013-02-09 ------------------- - -- Fixed error, when options not passed to function cass - - -2.0.0 / 2013-02-09 ------------------- - -- Full rewrite. New architecture. Fast one-stage parsing. -- Changed custom types API. -- Added YAML dumper. - - -1.0.3 / 2012-11-05 ------------------- - -- Fixed utf-8 files loading. - - -1.0.2 / 2012-08-02 ------------------- - -- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. -- Fix timstamps incorectly parsed in local time when no time part specified. - - -1.0.1 / 2012-07-07 ------------------- - -- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. -- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. - - -1.0.0 / 2012-07-01 ------------------- - -- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. - Fixes #42. -- `require(filename)` now returns a single document and throws an Error if - file contains more than one document. -- CLI was merged back from js-yaml.bin - - -0.3.7 / 2012-02-28 ------------------- - -- Fix export of `addConstructor()`. Closes #39. - - -0.3.6 / 2012-02-22 ------------------- - -- Removed AMD parts - too buggy to use. Need help to rewrite from scratch -- Removed YUI compressor warning (renamed `double` variable). Closes #40. - - -0.3.5 / 2012-01-10 ------------------- - -- Workagound for .npmignore fuckup under windows. Thanks to airportyh. - - -0.3.4 / 2011-12-24 ------------------- - -- Fixes str[] for oldIEs support. -- Adds better has change support for browserified demo. -- improves compact output of Error. Closes #33. - - -0.3.3 / 2011-12-20 ------------------- - -- jsyaml executable moved to separate module. -- adds `compact` stringification of Errors. - - -0.3.2 / 2011-12-16 ------------------- - -- Fixes ug with block style scalars. Closes #26. -- All sources are passing JSLint now. -- Fixes bug in Safari. Closes #28. -- Fixes bug in Opers. Closes #29. -- Improves browser support. Closes #20. -- Added jsyaml executable. -- Added !!js/function support. Closes #12. - - -0.3.1 / 2011-11-18 ------------------- - -- Added AMD support for browserified version. -- Wrapped browserified js-yaml into closure. -- Fixed the resolvement of non-specific tags. Closes #17. -- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. -- Added !!js/regexp and !!js/undefined types. Partially solves #12. -- Fixed !!set mapping. -- Fixed month parse in dates. Closes #19. - - -0.3.0 / 2011-11-09 ------------------- - -- Removed JS.Class dependency. Closes #3. -- Added browserified version. Closes #13. -- Added live demo of browserified version. -- Ported some of the PyYAML tests. See #14. -- Fixed timestamp bug when fraction was given. - - -0.2.2 / 2011-11-06 ------------------- - -- Fixed crash on docs without ---. Closes #8. -- Fixed miltiline string parse -- Fixed tests/comments for using array as key - - -0.2.1 / 2011-11-02 ------------------- - -- Fixed short file read (<4k). Closes #9. - - -0.2.0 / 2011-11-02 ------------------- - -- First public release diff --git a/tools/eslint/node_modules/js-yaml/README.md b/tools/eslint/node_modules/js-yaml/README.md index 2a595ef2327cf2..45c35020ce2998 100644 --- a/tools/eslint/node_modules/js-yaml/README.md +++ b/tools/eslint/node_modules/js-yaml/README.md @@ -180,6 +180,8 @@ options: function, use the function to sort the keys. - `lineWidth` _(default: `80`)_ - set max line width. - `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 styles: 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 87a0c994e05ce8..10b98b7e78eef4 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.5.3 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 checkpoint'); - er.position = position; - er.checkpoint = this.checkpoint; - throw er; - } - - this.result += this.source.slice(this.checkpoint, position); - this.checkpoint = position; - return this; -}; - -StringBuilder.prototype.escapeChar = function () { - var character, esc; - - character = this.source.charCodeAt(this.checkpoint); - esc = ESCAPE_SEQUENCES[character] || encodeHex(character); - this.result += esc; - this.checkpoint += 1; - - return this; -}; - -StringBuilder.prototype.finish = function () { - if (this.source.length > this.checkpoint) { - this.takeUpTo(this.source.length); - } -}; - -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 (object.length === 0) { - state.dump = "''"; - return; - } - - if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(object) !== -1) { - state.dump = "'" + object + "'"; - return; - } - - simple = true; - first = object.length ? object.charCodeAt(0) : 0; - spaceWrap = (CHAR_SPACE === first || - CHAR_SPACE === object.charCodeAt(object.length - 1)); - - // Simplified check for restricted first characters - // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29 - if (CHAR_MINUS === first || - CHAR_QUESTION === first || - CHAR_COMMERCIAL_AT === first || - CHAR_GRAVE_ACCENT === first) { - 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 = !iskey; - literal = !iskey; - } - - single = true; - double = new StringBuilder(object); - - sawLineFeed = false; - linePosition = 0; - longestLine = 0; - - indent = state.indent * level; - 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); - if (simple) { - // Characters that can never appear in the simple scalar - if (!simpleChar(character)) { - simple = false; - } else { - // Still simple. If we make it all the way through like - // this, then we can just dump the string as-is. - continue; +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + && c !== CHAR_COLON + && c !== CHAR_SHARP; +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; } + plain = plain && isPlainSafe(char); } - - if (single && character === CHAR_SINGLE_QUOTE) { - single = false; - } - - escapeSeq = ESCAPE_SEQUENCES[character]; - hexEsc = needsHexEscape(character); - - if (!escapeSeq && !hexEsc) { - continue; - } - - if (character !== CHAR_LINE_FEED && - character !== CHAR_DOUBLE_QUOTE && - character !== CHAR_SINGLE_QUOTE) { - folded = false; - literal = false; - } else if (character === CHAR_LINE_FEED) { - sawLineFeed = true; - single = false; - if (position > 0) { - previous = object.charCodeAt(position - 1); - if (previous === CHAR_SPACE) { - literal = false; - folded = false; + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; } - if (folded) { - lineLength = position - linePosition; - linePosition = position; - if (lineLength > longestLine) longestLine = lineLength; - } - } - - if (character !== CHAR_DOUBLE_QUOTE) single = false; - - double.takeUpTo(position); - double.escapeChar(); + plain = plain && isPlainSafe(char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (string[0] === ' ' && indentPerLevel > 9) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; } - if (simple && testImplicitResolving(state, object)) simple = false; - - modifier = ''; - if (folded || literal) { - trailingLineBreaks = 0; - if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - } - } - - if (trailingLineBreaks === 0) modifier = '-'; - else if (trailingLineBreaks === 2) modifier = '+'; - } - - 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; + return result; +} - if (simple) { - state.dump = object; - } else if (single) { - state.dump = '\'' + object + '\''; - } else if (folded) { - result = fold(object, max); - state.dump = '>' + modifier + '\n' + indentString(result, indent); - } else if (literal) { - if (!modifier) object = object.replace(/\n$/, ''); - state.dump = '|' + modifier + '\n' + indentString(object, indent); - } else if (double) { - double.finish(); - state.dump = '"' + double.result + '"'; +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); } else { - throw new Error('Failed to dump scalar value'); + result += line.slice(start); } - return; + return result.slice(1); // drop extra \n joiner } -// The `trailing` var is a regexp match of any trailing `\n` characters. -// -// There are three cases we care about: -// -// 1. One trailing `\n` on the string. Just use `|` or `>`. -// This is the assumed default. (trailing = null) -// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end. -// 3. More than one trailing `\n` on the string. Use `|+` or `>+`. -// -// In the case of `>+`, these line breaks are *not* doubled (like the line -// breaks within the string), so it's important to only end with the exact -// same number as we started. -function fold(object, max) { - var result = '', - position = 0, - length = object.length, - trailing = /\n+$/.exec(object), - newLine; +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char; + var escapeSeq; - if (trailing) { - length = trailing.index + 1; + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); } - while (position < length) { - newLine = object.indexOf('\n', position); - if (newLine > length || newLine === -1) { - if (result) result += '\n\n'; - result += foldLine(object.slice(position, length), max); - position = length; - - } else { - if (result) result += '\n\n'; - result += foldLine(object.slice(position, newLine), max); - position = newLine + 1; - } - } - - if (trailing && trailing[0] !== '\n') result += trailing[0]; - return result; } -function foldLine(line, max) { - if (line === '') return line; - - var foldRe = /[^\s] [^\s]/g, - result = '', - prevMatch = 0, - foldStart = 0, - match = foldRe.exec(line), - index, - foldEnd, - folded; - - while (match) { - index = match.index; - - // when we cross the max len, if the previous match would've - // 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 (result) result += '\n'; - folded = line.slice(foldStart, foldEnd); - result += folded; - foldStart = foldEnd + 1; - } - prevMatch = index + 1; - match = foldRe.exec(line); - } - - 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. - if (foldStart !== prevMatch && line.length - foldStart > max) { - result += line.slice(foldStart, prevMatch) + '\n' + - line.slice(prevMatch + 1); - } else { - result += line.slice(foldStart); - } - - return result; -} - -// Returns true if character can be found in a simple scalar -function simpleChar(character) { - return CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character && - CHAR_SHARP !== character && - CHAR_AMPERSAND !== character && - CHAR_ASTERISK !== character && - CHAR_EXCLAMATION !== character && - CHAR_VERTICAL_LINE !== character && - CHAR_GREATER_THAN !== character && - CHAR_SINGLE_QUOTE !== character && - CHAR_DOUBLE_QUOTE !== character && - CHAR_PERCENT !== character && - CHAR_COLON !== character && - !ESCAPE_SEQUENCES[character] && - !needsHexEscape(character); -} - -// Returns true if the character code needs to be escaped. -function needsHexEscape(character) { - return !((0x00020 <= character && character <= 0x00007E) || - (character === 0x00085) || - (0x000A0 <= character && character <= 0x00D7FF) || - (0x0E000 <= character && character <= 0x00FFFD) || - (0x10000 <= character && character <= 0x10FFFF)); -} - function writeFlowSequence(state, level, object) { var _result = '', _tag = state.tag, @@ -1703,6 +1695,7 @@ function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, + didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, @@ -1784,9 +1777,9 @@ function readBlockScalar(state, nodeIndent) { // Perform the chomping. if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', emptyLines); + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { - if (detectedIndent) { // i.e. only if the scalar is not empty. + if (didReadContent) { // i.e. only if the scalar is not empty. state.result += '\n'; } } @@ -1801,7 +1794,8 @@ function readBlockScalar(state, nodeIndent) { // Lines starting with white space characters (more-indented lines) are not folded. if (is_WHITE_SPACE(ch)) { atMoreIndented = true; - state.result += common.repeat('\n', emptyLines + 1); + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); // End of more-indented block. } else if (atMoreIndented) { @@ -1810,7 +1804,7 @@ function readBlockScalar(state, nodeIndent) { // Just one line break - perceive as the same line. } else if (emptyLines === 0) { - if (detectedIndent) { // i.e. only if we have already read some scalar content. + if (didReadContent) { // i.e. only if we have already read some scalar content. state.result += ' '; } @@ -1820,14 +1814,12 @@ function readBlockScalar(state, nodeIndent) { } // Literal style: just add exact number of line breaks between content lines. - } else if (detectedIndent) { - // If current line isn't the first one - count line break from the last content line. - 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); + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } + didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; @@ -2920,9 +2912,14 @@ module.exports = Type; /*eslint-disable no-bitwise*/ -// A trick for browserified version. -// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined -var NodeBuffer = require('buffer').Buffer; +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + var Type = require('../type'); @@ -3047,7 +3044,7 @@ module.exports = new Type('tag:yaml.org,2002:binary', { represent: representYamlBinary }); -},{"../type":13,"buffer":30}],15:[function(require,module,exports){ +},{"../type":13}],15:[function(require,module,exports){ 'use strict'; var Type = require('../type'); @@ -3756,29 +3753,36 @@ module.exports = new Type('tag:yaml.org,2002:str', { var Type = require('../type'); +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... + '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { if (data === null) return false; - if (YAML_TIMESTAMP_REGEXP.exec(data) === null) return false; - return true; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_TIMESTAMP_REGEXP.exec(data); + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error('Date resolve error'); @@ -3834,9 +3838,7 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', { represent: representYamlTimestamp }); -},{"../type":13}],30:[function(require,module,exports){ - -},{}],"/":[function(require,module,exports){ +},{"../type":13}],"/":[function(require,module,exports){ 'use strict'; 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 index 9da36310625613..2678b7f3bda348 100644 --- a/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js +++ b/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js @@ -1,3 +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}]},{},[])("/")}); +/* js-yaml 3.6.0 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&&L.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 N("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+F.repeat("0",i-t.length)+t}function o(e){this.schema=e.schema||M,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=F.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=i(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var n,i=F.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"+F.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){return e===q||e===D}function l(e){return e>=32&&126>=e||e>=161&&55295>=e&&8232!==e&&8233!==e||e>=57344&&65533>=e&&65279!==e||e>=65536&&1114111>=e}function p(e){return l(e)&&65279!==e&&e!==H&&e!==Q&&e!==X&&e!==te&&e!==ie&&e!==V&&e!==B}function f(e){return l(e)&&65279!==e&&!u(e)&&e!==G&&e!==z&&e!==V&&e!==H&&e!==Q&&e!==X&&e!==te&&e!==ie&&e!==B&&e!==W&&e!==$&&e!==Y&&e!==ne&&e!==Z&&e!==K&&e!==R&&e!==P&&e!==J&&e!==ee}function d(e,t,n,i,r){var o,a,s=!1,c=!1,d=-1!==i,h=-1,m=f(e.charCodeAt(0))&&!u(e.charCodeAt(e.length-1));if(t)for(o=0;oi&&" "!==e[h+1],h=o);else if(!l(a))return le;m=m&&p(a)}c=c||d&&o-h-1>i&&" "!==e[h+1]}return s||c?" "===e[0]&&n>9?le:c?ue:ce:m&&!r(e)?ae:se}function h(e,t,n,i){e.dump=function(){function r(t){return c(e,t)}if(0===t.length)return"''";if(!e.noCompatMode&&-1!==oe.indexOf(t))return"'"+t+"'";var o=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),u=i||e.flowLevel>-1&&n>=e.flowLevel;switch(d(t,u,e.indent,s,r)){case ae:return t;case se:return"'"+t.replace(/'/g,"''")+"'";case ce:return"|"+m(t,e.indent)+g(a(t,o));case ue:return">"+m(t,e.indent)+g(a(y(t,s),o));case le:return'"'+v(t,s)+'"';default:throw new N("impossible error: invalid scalar style")}}()}function m(e,t){var n=" "===e[0]?String(t):"",i="\n"===e[e.length-1],r=i&&("\n"===e[e.length-2]||"\n"===e),o=r?"+":i?"":"-";return n+o+"\n"}function g(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function y(e,t){for(var n,i,r=/(\n+)([^\n]*)/g,o=function(){var n=e.indexOf("\n");return n=-1!==n?n:e.length,r.lastIndex=n,x(e.slice(0,n),t)}(),a="\n"===e[0]||" "===e[0];i=r.exec(e);){var s=i[1],c=i[2];n=" "===c[0],o+=s+(a||n||""===c?"":"\n")+x(c,t),a=n}return o}function x(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,s=0,c="";n=r.exec(e);)s=n.index,s-o>t&&(i=a>o?a:s,c+="\n"+e.slice(o,i),o=i+1),a=s;return c+="\n",c+=e.length-o>t&&a>o?e.slice(o,a)+"\n"+e.slice(a+1):e.slice(o),c.slice(1)}function v(e){for(var t,n,i="",o=0;oi;i+=1)j(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function b(e,t,n,i){var r,o,a="",c=e.tag;for(r=0,o=n.length;o>r;r+=1)j(e,t+1,n[r],!0,!0)&&(i&&0===r||(a+=s(e,t)),a+="- "+e.dump);e.tag=c,e.dump=a||"[]"}function w(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],j(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",j(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function C(e,t,n,i){var r,o,a,c,u,l,p="",f=e.tag,d=Object.keys(n);if(e.sortKeys===!0)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new N("sortKeys must be a boolean or a function");for(r=0,o=d.length;o>r;r+=1)l="",i&&0===r||(l+=s(e,t)),a=d[r],c=n[a],j(e,t+1,a,!0,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(l+=e.dump&&U===e.dump.charCodeAt(0)?"?":"? "),l+=e.dump,u&&(l+=s(e,t)),j(e,t+1,c,!0,u)&&(l+=e.dump&&U===e.dump.charCodeAt(0)?":":": ",l+=e.dump,p+=l));e.tag=f,e.dump=p||"{}"}function k(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]"===T.call(s.represent))i=s.represent(t,c);else{if(!L.call(s.represent,c))throw new N("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function j(e,t,n,i,r,o){e.tag=null,e.dump=n,k(e,n,!1)||k(e,n,!0);var a=T.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?(C(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(w(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)i&&0!==e.dump.length?(b(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(A(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new N("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&h(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function I(e,t){var n,i,r=[],o=[];for(S(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function S(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)S(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)S(e[i[r]],t,n)}function O(e,t){t=t||{};var n=new o(t);return n.noRefs||I(e,n),j(n,0,e,!0,!0)?n.dump+"\n":""}function E(e,t){return O(e,F.extend({schema:_},t))}var F=e("./common"),N=e("./exception"),M=e("./schema/default_full"),_=e("./schema/default_safe"),T=Object.prototype.toString,L=Object.prototype.hasOwnProperty,D=9,U=10,q=32,Y=33,R=34,B=35,P=37,W=38,K=39,$=42,H=44,G=45,V=58,Z=62,z=63,J=64,Q=91,X=93,ee=96,te=123,ne=124,ie=125,re={};re[0]="\\0",re[7]="\\a",re[8]="\\b",re[9]="\\t",re[10]="\\n",re[11]="\\v",re[12]="\\f",re[13]="\\r",re[27]="\\e",re[34]='\\"',re[92]="\\\\",re[133]="\\N",re[160]="\\_",re[8232]="\\L",re[8233]="\\P";var oe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ae=1,se=2,ce=3,ue=4,le=5;t.exports.dump=O,t.exports.safeDump=E},{"./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 d(e,t){return new B(t,new P(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function h(e,t){throw d(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,d(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||h(e,"expected valid JSON character");else X.test(s)&&h(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)||h(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],$.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||$.call(n,r)||!$.call(t,r)||h(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++):h(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function A(e,t,n){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;r(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!i(a))break;for(v(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent1&&(e.result+=R.repeat("\n",t-1))}function C(e,t,n){var s,c,u,l,p,f,d,h,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,d=e.lineStart,h=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=d,e.lineIndent=h;break}}p&&(g(e,u,l,!1),w(e,e.line-f),u=l=e.position,p=!1),r(m)||(l=e.position+1),m=e.input.charCodeAt(++e.position)}return g(e,u,l,!1),e.result?!0:(e.kind=y,e.result=x,!1)}function k(e,t){var n,r,o;if(n=e.input.charCodeAt(e.position),39!==n)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(g(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),39!==n)return!0;r=o=e.position,e.position++}else i(n)?(g(e,r,o,!0),w(e,A(e,!1,t)),r=o=e.position):e.position===e.lineStart&&b(e)?h(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);h(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:h(e,"expected hexadecimal character");e.result+=p(a),e.position++}else h(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)?h(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}h(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,d,m=!0,g=e.tag,y=e.anchor,v={};if(d=e.input.charCodeAt(e.position),91===d)a=93,u=!1,i=[];else{if(123!==d)return!1;a=125,u=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),d=e.input.charCodeAt(++e.position);0!==d;){if(A(e,!0,t),d=e.input.charCodeAt(e.position),d===a)return e.position++,e.tag=g,e.anchor=y,e.kind=u?"mapping":"sequence",e.result=i,!0;m||h(e,"missed comma between flow collection entries"),p=l=f=null,s=c=!1,63===d&&(r=e.input.charCodeAt(e.position+1),o(r)&&(s=c=!0,e.position++,A(e,!0,t))),n=e.line,_(e,t,H,!1,!0),p=e.tag,l=e.result,A(e,!0,t),d=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),A(e,!0,t),_(e,t,H,!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),d=e.input.charCodeAt(e.position),44===d?(m=!0,d=e.input.charCodeAt(++e.position)):m=!1}h(e,"unexpected end of the stream within a flow collection")}function S(e,t){var n,o,a,s,c=z,l=!1,p=!1,f=t,d=0,m=!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:h(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?h(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):p?h(e,"repeat of an indentation width identifier"):(f=t+a-1,p=!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);(!p||e.lineIndentf&&(f=e.lineIndent),i(s))d++;else{if(e.lineIndentt)&&0!==r)h(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,d,m,g),d=m=g=null),A(e,!0,-1),c=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==c)h(e,"bad indentation of a mapping entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=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 $.call(e.typeMap,e.tag)?(l=e.typeMap[e.tag],null!==e.result&&l.kind!==e.kind&&h(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)):h(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):h(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function T(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&&h(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),$.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&&h(e,"directives end mark is expected"),_(e,e.lineIndent-1,Z,!1,!0),A(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(c,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&b(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,A(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function U(e,t){var n=L(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new B("expected a single document in the stream, but found more")}}function q(e,t,n){D(e,t,R.extend({schema:W},n))}function Y(e,t){return U(e,R.extend({schema:W},t))}for(var R=e("./common"),B=e("./exception"),P=e("./mark"),W=e("./schema/default_safe"),K=e("./schema/default_full"),$=Object.prototype.hasOwnProperty,H=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&&h(e,"duplication of %YAML directive"),1!==n.length&&h(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&h(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&h(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&&h(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],ne.test(i)||h(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,i)&&h(e,'there is a previously declared suffix for "'+i+'" tag handle'),ie.test(r)||h(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=p;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=p,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=p;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;try{var c=e;s=c("buffer").Buffer; +}catch(u){}var l=e("../type"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new l("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../type":13}],15:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function r(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var a=e("../type");t.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";function i(e){return null===e?!1:!!u.test(e)}function r(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function o(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),l.test(n)?n.replace("e",".e"):n}function a(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!==0||s.isNegativeZero(e))}var s=e("../common"),c=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),l=/^[-+]?[0-9]+e/;t.exports=new c("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";function i(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function r(e){return e>=48&&55>=e}function o(e){return e>=48&&57>=e}function a(e){if(null===e)return!1;var t,n=e.length,a=0,s=!1;if(!n)return!1;if(t=e[a],"-"!==t&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===n)return!0;if(t=e[++a],"b"===t){for(a++;n>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;n>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(t=e[a],"_"!==t){if(!r(e.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function s(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],"-"!==t&&"+"!==t||("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function c(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1===0&&!u.isNegativeZero(e)}var u=e("../common"),l=e("../type");t.exports=new l("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:c,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(i){return!1}}function r(e){var t,n="("+e+")",i=s.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function a(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{var c=e;s=c("esprima")}catch(u){"undefined"!=typeof window&&(s=window.esprima)}var l=e("../../type");t.exports=new l("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],19:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1}return!0}function r(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],20:[function(e,t,n){"use strict";function i(){return!0}function r(){}function o(){return""}function a(e){return"undefined"==typeof e}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],21:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t,n){"use strict";function i(e){return"<<"===e||null===e}var r=e("../type");t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i})},{"../type":13}],23:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function r(){return null}function o(e){return null===e}var a=e("../type");t.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n,i,r,o,c=[],u=e;for(t=0,n=u.length;n>t;t+=1){if(i=u[t],o=!1,"[object Object]"!==s.call(i))return!1;for(r in i)if(a.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==c.indexOf(r))return!1;c.push(r)}return!0}function r(e){return null!==e?e:[]}var o=e("../type"),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],25:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==a.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;o[t]=[r[0],i[r[0]]]}return!0}function r(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var o=e("../type"),a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],26:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n=e;for(t in n)if(a.call(n,t)&&null!==n[t])return!1;return!0}function r(e){return null!==e?e:{}}var o=e("../type"),a=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:r})},{"../type":13}],28:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t,n){"use strict";function i(e){return null===e?!1:null!==s.exec(e)?!0:null!==c.exec(e)}function r(e){var t,n,i,r,o,a,u,l,p,f,d=0,h=null;if(t=s.exec(e),null===t&&(t=c.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],u=+t[6],t[7]){for(d=t[7].slice(0,3);d.length<3;)d+="0";d=+d}return t[9]&&(l=+t[10],p=+(t[11]||0),h=6e4*(60*l+p),"-"===t[9]&&(h=-h)),f=new Date(Date.UTC(n,i,r,o,a,u,d)),h&&f.setTime(f.getTime()-h),f}function o(e){return e.toISOString()}var a=e("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),c=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:r,instanceOf:Date,represent:o})},{"../type":13}],"/":[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/lib/js-yaml/dumper.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js index 043d2bb47da7a8..41d3d457fd0529 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 @@ -12,7 +12,6 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var CHAR_TAB = 0x09; /* Tab */ var CHAR_LINE_FEED = 0x0A; /* LF */ -var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ var CHAR_SPACE = 0x20; /* Space */ var CHAR_EXCLAMATION = 0x21; /* ! */ var CHAR_DOUBLE_QUOTE = 0x22; /* " */ @@ -107,14 +106,15 @@ function encodeHex(character) { } function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; @@ -126,6 +126,7 @@ function State(options) { this.usedDuplicates = null; } +// Indents every line in a string. Empty lines (\n only) are not indented. function indentString(string, spaces) { var ind = common.repeat(' ', spaces), position = 0, @@ -170,317 +171,308 @@ function testImplicitResolving(state, str) { return false; } -function StringBuilder(source) { - this.source = source; - this.result = ''; - this.checkpoint = 0; +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; } -StringBuilder.prototype.takeUpTo = function (position) { - var er; - - if (position < this.checkpoint) { - er = new Error('position should be > checkpoint'); - er.position = position; - er.checkpoint = this.checkpoint; - throw er; - } - - this.result += this.source.slice(this.checkpoint, position); - this.checkpoint = position; - return this; -}; - -StringBuilder.prototype.escapeChar = function () { - var character, esc; - - character = this.source.charCodeAt(this.checkpoint); - esc = ESCAPE_SEQUENCES[character] || encodeHex(character); - this.result += esc; - this.checkpoint += 1; - - return this; -}; - -StringBuilder.prototype.finish = function () { - if (this.source.length > this.checkpoint) { - this.takeUpTo(this.source.length); - } -}; - -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 (object.length === 0) { - state.dump = "''"; - return; - } - - if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(object) !== -1) { - state.dump = "'" + object + "'"; - return; - } - - simple = true; - first = object.length ? object.charCodeAt(0) : 0; - spaceWrap = (CHAR_SPACE === first || - CHAR_SPACE === object.charCodeAt(object.length - 1)); - - // Simplified check for restricted first characters - // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29 - if (CHAR_MINUS === first || - CHAR_QUESTION === first || - CHAR_COMMERCIAL_AT === first || - CHAR_GRAVE_ACCENT === first) { - 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 = !iskey; - literal = !iskey; - } - - single = true; - double = new StringBuilder(object); - - sawLineFeed = false; - linePosition = 0; - longestLine = 0; - - indent = state.indent * level; - max = state.lineWidth; +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} - // Replace -1 with biggest ingeger number according to - // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 - if (max === -1) max = 9007199254740991; +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + && c !== CHAR_COLON + && c !== CHAR_SHARP; +} - if (indent < 40) max -= indent; - else max = 40; +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} - for (position = 0; position < object.length; position++) { - character = object.charCodeAt(position); - if (simple) { - // Characters that can never appear in the simple scalar - if (!simpleChar(character)) { - simple = false; - } else { - // Still simple. If we make it all the way through like - // this, then we can just dump the string as-is. - continue; +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; } + plain = plain && isPlainSafe(char); } - - if (single && character === CHAR_SINGLE_QUOTE) { - single = false; - } - - escapeSeq = ESCAPE_SEQUENCES[character]; - hexEsc = needsHexEscape(character); - - if (!escapeSeq && !hexEsc) { - continue; - } - - if (character !== CHAR_LINE_FEED && - character !== CHAR_DOUBLE_QUOTE && - character !== CHAR_SINGLE_QUOTE) { - folded = false; - literal = false; - } else if (character === CHAR_LINE_FEED) { - sawLineFeed = true; - single = false; - if (position > 0) { - previous = object.charCodeAt(position - 1); - if (previous === CHAR_SPACE) { - literal = false; - folded = false; + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; } - if (folded) { - lineLength = position - linePosition; - linePosition = position; - if (lineLength > longestLine) longestLine = lineLength; - } + plain = plain && isPlainSafe(char); } - - if (character !== CHAR_DOUBLE_QUOTE) single = false; - - double.takeUpTo(position); - double.escapeChar(); + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; } + // Edge case: block indentation indicator can only have one digit. + if (string[0] === ' ' && indentPerLevel > 9) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} - if (simple && testImplicitResolving(state, object)) simple = false; +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } - modifier = ''; - if (folded || literal) { - trailingLineBreaks = 0; - if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - } + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); } - if (trailingLineBreaks === 0) modifier = '-'; - else if (trailingLineBreaks === 2) modifier = '+'; - } + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} - if (literal && longestLine < max || state.tag !== null) { - folded = false; - } +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : ''; - // 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 (simple) { - state.dump = object; - } else if (single) { - state.dump = '\'' + object + '\''; - } else if (folded) { - result = fold(object, max); - state.dump = '>' + modifier + '\n' + indentString(result, indent); - } else if (literal) { - if (!modifier) object = object.replace(/\n$/, ''); - state.dump = '|' + modifier + '\n' + indentString(object, indent); - } else if (double) { - double.finish(); - state.dump = '"' + double.result + '"'; - } else { - throw new Error('Failed to dump scalar value'); - } + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); - return; + return indentIndicator + chomp + '\n'; } -// The `trailing` var is a regexp match of any trailing `\n` characters. -// -// There are three cases we care about: -// -// 1. One trailing `\n` on the string. Just use `|` or `>`. -// This is the assumed default. (trailing = null) -// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end. -// 3. More than one trailing `\n` on the string. Use `|+` or `>+`. -// -// In the case of `>+`, these line breaks are *not* doubled (like the line -// breaks within the string), so it's important to only end with the exact -// same number as we started. -function fold(object, max) { - var result = '', - position = 0, - length = object.length, - trailing = /\n+$/.exec(object), - newLine; - - if (trailing) { - length = trailing.index + 1; - } - - while (position < length) { - newLine = object.indexOf('\n', position); - if (newLine > length || newLine === -1) { - if (result) result += '\n\n'; - result += foldLine(object.slice(position, length), max); - position = length; +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} - } else { - if (result) result += '\n\n'; - result += foldLine(object.slice(position, newLine), max); - position = newLine + 1; - } +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; } - if (trailing && trailing[0] !== '\n') result += trailing[0]; - return result; } -function foldLine(line, max) { - if (line === '') return line; - - var foldRe = /[^\s] [^\s]/g, - result = '', - prevMatch = 0, - foldStart = 0, - match = foldRe.exec(line), - index, - foldEnd, - folded; - - while (match) { - index = match.index; - - // when we cross the max len, if the previous match would've - // 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 (result) result += '\n'; - folded = line.slice(foldStart, foldEnd); - result += folded; - foldStart = foldEnd + 1; +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 } - prevMatch = index + 1; - match = foldRe.exec(line); + curr = next; } - 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. - if (foldStart !== prevMatch && line.length - foldStart > max) { - result += line.slice(foldStart, prevMatch) + '\n' + - line.slice(prevMatch + 1); + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); } else { - result += line.slice(foldStart); + result += line.slice(start); } - return result; + return result.slice(1); // drop extra \n joiner } -// Returns true if character can be found in a simple scalar -function simpleChar(character) { - return CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character && - CHAR_SHARP !== character && - CHAR_AMPERSAND !== character && - CHAR_ASTERISK !== character && - CHAR_EXCLAMATION !== character && - CHAR_VERTICAL_LINE !== character && - CHAR_GREATER_THAN !== character && - CHAR_SINGLE_QUOTE !== character && - CHAR_DOUBLE_QUOTE !== character && - CHAR_PERCENT !== character && - CHAR_COLON !== character && - !ESCAPE_SEQUENCES[character] && - !needsHexEscape(character); -} +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } -// Returns true if the character code needs to be escaped. -function needsHexEscape(character) { - return !((0x00020 <= character && character <= 0x00007E) || - (character === 0x00085) || - (0x000A0 <= character && character <= 0x00D7FF) || - (0x0E000 <= character && character <= 0x00FFFD) || - (0x10000 <= character && character <= 0x10FFFF)); + return result; } function writeFlowSequence(state, level, object) { 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 1714022f435291..8966d6bda4caff 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 @@ -743,6 +743,7 @@ function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, + didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, @@ -824,9 +825,9 @@ function readBlockScalar(state, nodeIndent) { // Perform the chomping. if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', emptyLines); + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { - if (detectedIndent) { // i.e. only if the scalar is not empty. + if (didReadContent) { // i.e. only if the scalar is not empty. state.result += '\n'; } } @@ -841,7 +842,8 @@ function readBlockScalar(state, nodeIndent) { // Lines starting with white space characters (more-indented lines) are not folded. if (is_WHITE_SPACE(ch)) { atMoreIndented = true; - state.result += common.repeat('\n', emptyLines + 1); + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); // End of more-indented block. } else if (atMoreIndented) { @@ -850,7 +852,7 @@ function readBlockScalar(state, nodeIndent) { // Just one line break - perceive as the same line. } else if (emptyLines === 0) { - if (detectedIndent) { // i.e. only if we have already read some scalar content. + if (didReadContent) { // i.e. only if we have already read some scalar content. state.result += ' '; } @@ -860,14 +862,12 @@ function readBlockScalar(state, nodeIndent) { } // Literal style: just add exact number of line breaks between content lines. - } else if (detectedIndent) { - // If current line isn't the first one - count line break from the last content line. - 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); + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } + didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; 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 b2c32d914b4ed4..205629f744cf20 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 @@ -2,9 +2,14 @@ /*eslint-disable no-bitwise*/ -// A trick for browserified version. -// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined -var NodeBuffer = require('buffer').Buffer; +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + var Type = require('../type'); 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 a222a449ba3375..8fa9c5865697ed 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -2,29 +2,36 @@ var Type = require('../type'); +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... + '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { if (data === null) return false; - if (YAML_TIMESTAMP_REGEXP.exec(data) === null) return false; - return true; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_TIMESTAMP_REGEXP.exec(data); + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error('Date resolve error'); diff --git a/tools/eslint/node_modules/js-yaml/package.json b/tools/eslint/node_modules/js-yaml/package.json index 3c1fed557f87af..ba0ec9330e1d63 100644 --- a/tools/eslint/node_modules/js-yaml/package.json +++ b/tools/eslint/node_modules/js-yaml/package.json @@ -2,24 +2,24 @@ "_args": [ [ "js-yaml@^3.5.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "js-yaml@>=3.5.1 <4.0.0", - "_id": "js-yaml@3.5.3", + "_id": "js-yaml@3.6.0", "_inCache": true, "_installable": true, - "_location": "/eslint/js-yaml", - "_nodeVersion": "4.3.0", + "_location": "/js-yaml", + "_nodeVersion": "4.4.1", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/js-yaml-3.5.3.tgz_1455175645225_0.033302413299679756" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/js-yaml-3.6.0.tgz_1460755132000_0.1514641239773482" }, "_npmUser": { "email": "vitaly@rcdesign.ru", "name": "vitaly" }, - "_npmVersion": "2.14.12", + "_npmVersion": "2.14.20", "_phantomChildren": {}, "_requested": { "name": "js-yaml", @@ -32,11 +32,11 @@ "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.3.tgz", - "_shasum": "e9ee6082b0657770e4346dfaf2a58c5992251f76", + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.0.tgz", + "_shasum": "3b7bf3256dd598f60f8b6f8ea75514a585a24dc6", "_shrinkwrap": null, "_spec": "js-yaml@^3.5.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "dervus.grim@gmail.com", "name": "Vladimir Zapparov" @@ -44,9 +44,6 @@ "bin": { "js-yaml": "bin/js-yaml.js" }, - "browser": { - "buffer": false - }, "bugs": { "url": "https://github.com/nodeca/js-yaml/issues" }, @@ -68,7 +65,7 @@ } ], "dependencies": { - "argparse": "^1.0.2", + "argparse": "^1.0.7", "esprima": "^2.6.0" }, "description": "YAML 1.2 parser and serializer", @@ -76,16 +73,16 @@ "ansi": "*", "benchmark": "*", "browserify": "^13.0.0", - "codemirror": "^5.10.0", - "eslint": "^2.0.0-rc.1", + "codemirror": "^5.13.4", + "eslint": "^2.8.0", "istanbul": "*", "mocha": "*", "uglify-js": "^2.6.1" }, "directories": {}, "dist": { - "shasum": "e9ee6082b0657770e4346dfaf2a58c5992251f76", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.5.3.tgz" + "shasum": "3b7bf3256dd598f60f8b6f8ea75514a585a24dc6", + "tarball": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.0.tgz" }, "files": [ "index.js", @@ -93,7 +90,7 @@ "bin/", "dist/" ], - "gitHead": "4a9e0a258586cff292cab63e0b76044fc1f4cb63", + "gitHead": "87e4cdc21deec3dda9b811366fb3a3af16c08f0d", "homepage": "https://github.com/nodeca/js-yaml", "keywords": [ "yaml", @@ -118,5 +115,5 @@ "scripts": { "test": "make test" }, - "version": "3.5.3" + "version": "3.6.0" } diff --git a/tools/eslint/node_modules/json-stable-stringify/.npmignore b/tools/eslint/node_modules/json-stable-stringify/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tools/eslint/node_modules/json-stable-stringify/example/key_cmp.js b/tools/eslint/node_modules/json-stable-stringify/example/key_cmp.js deleted file mode 100644 index d5f66752d82e15..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/example/key_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); diff --git a/tools/eslint/node_modules/json-stable-stringify/example/nested.js b/tools/eslint/node_modules/json-stable-stringify/example/nested.js deleted file mode 100644 index 9a672fc65fb0fc..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/example/nested.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); diff --git a/tools/eslint/node_modules/json-stable-stringify/example/str.js b/tools/eslint/node_modules/json-stable-stringify/example/str.js deleted file mode 100644 index 9b4b3cd289570e..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/example/str.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 6, b: [4,5], a: 3 }; -console.log(stringify(obj)); diff --git a/tools/eslint/node_modules/json-stable-stringify/example/value_cmp.js b/tools/eslint/node_modules/json-stable-stringify/example/value_cmp.js deleted file mode 100644 index 09f1c5f79b2167..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/example/value_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); diff --git a/tools/eslint/node_modules/json-stable-stringify/package.json b/tools/eslint/node_modules/json-stable-stringify/package.json index 7f0b68340d0d85..3ce6e06c1850c7 100644 --- a/tools/eslint/node_modules/json-stable-stringify/package.json +++ b/tools/eslint/node_modules/json-stable-stringify/package.json @@ -2,14 +2,14 @@ "_args": [ [ "json-stable-stringify@^1.0.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "json-stable-stringify@>=1.0.0 <2.0.0", "_id": "json-stable-stringify@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/json-stable-stringify", + "_location": "/json-stable-stringify", "_nodeVersion": "4.2.1", "_npmOperationalInternal": { "host": "packages-5-east.internal.npmjs.com", @@ -36,7 +36,7 @@ "_shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", "_shrinkwrap": null, "_spec": "json-stable-stringify@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "mail@substack.net", "name": "James Halliday", @@ -55,7 +55,7 @@ "directories": {}, "dist": { "shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", - "tarball": "http://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" + "tarball": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" }, "gitHead": "4a3ac9cc006a91e64901f8ebe78d23bf9fc9fbd0", "homepage": "https://github.com/substack/json-stable-stringify", diff --git a/tools/eslint/node_modules/json-stable-stringify/test/cmp.js b/tools/eslint/node_modules/json-stable-stringify/test/cmp.js deleted file mode 100644 index 2dbb39355c652b..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('custom comparison function', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; - }); - t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); -}); diff --git a/tools/eslint/node_modules/json-stable-stringify/test/nested.js b/tools/eslint/node_modules/json-stable-stringify/test/nested.js deleted file mode 100644 index e7f5a0e65b7648..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/nested.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('nested', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); -}); - -test('cyclic (default)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - try { - stringify(one); - } catch (ex) { - t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); - } -}); - -test('cyclic (specifically allowed)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); -}); - -test('repeated non-cyclic value', function(t) { - t.plan(1); - var one = { x: 1 }; - var two = { a: one, b: one }; - t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); -}); diff --git a/tools/eslint/node_modules/json-stable-stringify/test/replacer.js b/tools/eslint/node_modules/json-stable-stringify/test/replacer.js deleted file mode 100644 index 98802a72d65eff..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/replacer.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('replace root', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { return 'one'; }; - - t.equal(stringify(obj, { replacer: replacer }), '"one"'); -}); - -test('replace numbers', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(value === 1) return 'one'; - if(value === 2) return 'two'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}'); -}); - -test('replace with object', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(key === 'b') return { d: 1 }; - if(value === 1) return 'one'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}'); -}); - -test('replace with undefined', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(value === false) return; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}'); -}); - -test('replace with array', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(key === 'b') return ['one', 'two']; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}'); -}); - -test('replace array item', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: [1,2] }; - var replacer = function(key, value) { - if(value === 1) return 'one'; - if(value === 2) return 'two'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}'); -}); diff --git a/tools/eslint/node_modules/json-stable-stringify/test/space.js b/tools/eslint/node_modules/json-stable-stringify/test/space.js deleted file mode 100644 index 2621122ae3778c..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/space.js +++ /dev/null @@ -1,59 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('space parameter', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: ' '}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": 2\n' - + '}' - ); -}); - -test('space parameter (with tabs)', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: '\t'}), '' - + '{\n' - + '\t"one": 1,\n' - + '\t"two": 2\n' - + '}' - ); -}); - -test('space parameter (with a number)', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: 3}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": 2\n' - + '}' - ); -}); - -test('space parameter (nested objects)', function (t) { - t.plan(1); - var obj = { one: 1, two: { b: 4, a: [2,3] } }; - t.equal(stringify(obj, {space: ' '}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": {\n' - + ' "a": [\n' - + ' 2,\n' - + ' 3\n' - + ' ],\n' - + ' "b": 4\n' - + ' }\n' - + '}' - ); -}); - -test('space parameter (same as native)', function (t) { - t.plan(1); - // for this test, properties need to be in alphabetical order - var obj = { one: 1, two: { a: [2,3], b: 4 } }; - t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' ')); -}); diff --git a/tools/eslint/node_modules/json-stable-stringify/test/str.js b/tools/eslint/node_modules/json-stable-stringify/test/str.js deleted file mode 100644 index 67426b99e30b22..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/str.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('simple object', function (t) { - t.plan(1); - var obj = { c: 6, b: [4,5], a: 3, z: null }; - t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); -}); - -test('object with undefined', function (t) { - t.plan(1); - var obj = { a: 3, z: undefined }; - t.equal(stringify(obj), '{"a":3}'); -}); - -test('array with undefined', function (t) { - t.plan(1); - var obj = [4, undefined, 6]; - t.equal(stringify(obj), '[4,null,6]'); -}); - -test('object with empty string', function (t) { - t.plan(1); - var obj = { a: 3, z: '' }; - t.equal(stringify(obj), '{"a":3,"z":""}'); -}); - -test('array with empty string', function (t) { - t.plan(1); - var obj = [4, '', 6]; - t.equal(stringify(obj), '[4,"",6]'); -}); diff --git a/tools/eslint/node_modules/json-stable-stringify/test/to-json.js b/tools/eslint/node_modules/json-stable-stringify/test/to-json.js deleted file mode 100644 index ef9a980929ae90..00000000000000 --- a/tools/eslint/node_modules/json-stable-stringify/test/to-json.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('toJSON function', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; - t.equal(stringify(obj), '{"one":1}' ); -}); - -test('toJSON returns string', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; - t.equal(stringify(obj), '"one"'); -}); - -test('toJSON returns array', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; - t.equal(stringify(obj), '["one"]'); -}); diff --git a/tools/eslint/node_modules/jsonify/lib/parse.js b/tools/eslint/node_modules/jsonify/lib/parse.js index 2b88cfff0b11da..30e2f014363514 100644 --- a/tools/eslint/node_modules/jsonify/lib/parse.js +++ b/tools/eslint/node_modules/jsonify/lib/parse.js @@ -21,26 +21,26 @@ var at, // The index of the current character text: text }; }, - + next = function (c) { // If a c parameter is provided, verify that it matches the current character. if (c && c !== ch) { error("Expected '" + c + "' instead of '" + ch + "'"); } - + // Get the next character. When there are no more characters, // return the empty string. - + ch = text.charAt(at); at += 1; return ch; }, - + number = function () { // Parse a number value. var number, string = ''; - + if (ch === '-') { string = '-'; next('-'); @@ -74,14 +74,14 @@ var at, // The index of the current character return number; } }, - + string = function () { // Parse a string value. var hex, i, string = '', uffff; - + // When parsing for string values, we must look for " and \ characters. if (ch === '"') { while (next()) { @@ -238,7 +238,7 @@ value = function () { module.exports = function (source, reviver) { var result; - + text = source; at = 0; ch = ' '; diff --git a/tools/eslint/node_modules/jsonify/lib/stringify.js b/tools/eslint/node_modules/jsonify/lib/stringify.js index e88fb834065b81..13458708144dea 100644 --- a/tools/eslint/node_modules/jsonify/lib/stringify.js +++ b/tools/eslint/node_modules/jsonify/lib/stringify.js @@ -18,7 +18,7 @@ function quote(string) { // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. - + escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; @@ -36,47 +36,47 @@ function str(key, holder) { mind = gap, partial, value = holder[key]; - + // If the value has a toJSON method, call it to obtain a replacement value. if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } - + // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if (typeof rep === 'function') { value = rep.call(holder, key, value); } - + // What happens next depends on the value's type. switch (typeof value) { case 'string': return quote(value); - + case 'number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null'; - + case 'boolean': case 'null': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value); - + case 'object': if (!value) return 'null'; gap += indent; partial = []; - + // Array.isArray if (Object.prototype.toString.apply(value) === '[object Array]') { length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; } - + // Join all of the elements together, separated with commas, and // wrap them in brackets. v = partial.length === 0 ? '[]' : gap ? @@ -85,7 +85,7 @@ function str(key, holder) { gap = mind; return v; } - + // If the replacer is an array, use it to select the members to be // stringified. if (rep && typeof rep === 'object') { @@ -111,7 +111,7 @@ function str(key, holder) { } } } - + // Join all of the member texts together, separated with commas, // and wrap them in braces. @@ -127,7 +127,7 @@ module.exports = function (value, replacer, space) { var i; gap = ''; indent = ''; - + // If the space parameter is a number, make an indent string containing that // many spaces. if (typeof space === 'number') { @@ -147,7 +147,7 @@ module.exports = function (value, replacer, space) { && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } - + // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return str('', {'': value}); diff --git a/tools/eslint/node_modules/jsonify/package.json b/tools/eslint/node_modules/jsonify/package.json index f5f79370bc4e6f..c431a7560e0c07 100644 --- a/tools/eslint/node_modules/jsonify/package.json +++ b/tools/eslint/node_modules/jsonify/package.json @@ -2,7 +2,7 @@ "_args": [ [ "jsonify@~0.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/json-stable-stringify" + "/Users/trott/io.js/tools/node_modules/json-stable-stringify" ] ], "_defaultsLoaded": true, @@ -11,7 +11,7 @@ "_id": "jsonify@0.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/jsonify", + "_location": "/jsonify", "_nodeVersion": "v0.5.0-pre", "_npmVersion": "1.0.10", "_phantomChildren": {}, @@ -24,13 +24,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/json-stable-stringify" + "/json-stable-stringify" ], "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", "_shrinkwrap": null, "_spec": "jsonify@~0.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/json-stable-stringify", + "_where": "/Users/trott/io.js/tools/node_modules/json-stable-stringify", "author": { "name": "Douglas Crockford", "url": "http://crockford.com/" diff --git a/tools/eslint/node_modules/jsonify/test/parse.js b/tools/eslint/node_modules/jsonify/test/parse.js deleted file mode 100644 index d23de157e198a4..00000000000000 --- a/tools/eslint/node_modules/jsonify/test/parse.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('parse', function (t) { - for (var i = 0; i < 50; i++) { - var s = JSON.stringify(garbage(50)); - - t.deepEqual( - json.parse(s), - JSON.parse(s) - ); - } - - t.end(); -}); diff --git a/tools/eslint/node_modules/jsonify/test/stringify.js b/tools/eslint/node_modules/jsonify/test/stringify.js deleted file mode 100644 index 72de91f2b6dec6..00000000000000 --- a/tools/eslint/node_modules/jsonify/test/stringify.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('stringify', function (t) { - for (var i = 0; i < 50; i++) { - var obj = garbage(50); - t.equal( - json.stringify(obj), - JSON.stringify(obj) - ); - } - - t.end(); -}); diff --git a/tools/eslint/node_modules/jsonpointer/.travis.yml b/tools/eslint/node_modules/jsonpointer/.travis.yml deleted file mode 100644 index 9338bf147031df..00000000000000 --- a/tools/eslint/node_modules/jsonpointer/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: "node_js" -node_js: - - 0.6 - - 0.8 - - 0.10 - - 0.11 - - 0.12 - - iojs-v1.0 - - iojs-v2.0 - - iojs diff --git a/tools/eslint/node_modules/jsonpointer/package.json b/tools/eslint/node_modules/jsonpointer/package.json index 05d6424e2a1527..db8ac7c3f44ef7 100644 --- a/tools/eslint/node_modules/jsonpointer/package.json +++ b/tools/eslint/node_modules/jsonpointer/package.json @@ -2,14 +2,14 @@ "_args": [ [ "jsonpointer@2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/is-my-json-valid" + "/Users/trott/io.js/tools/node_modules/is-my-json-valid" ] ], "_from": "jsonpointer@2.0.0", "_id": "jsonpointer@2.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/jsonpointer", + "_location": "/jsonpointer", "_nodeVersion": "0.10.36", "_npmUser": { "email": "marc.brookman@gmail.com", @@ -26,13 +26,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/is-my-json-valid" + "/is-my-json-valid" ], "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", "_shrinkwrap": null, "_spec": "jsonpointer@2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/is-my-json-valid", + "_where": "/Users/trott/io.js/tools/node_modules/is-my-json-valid", "author": { "email": "jan@apache.org", "name": "Jan Lehnardt" @@ -52,7 +52,7 @@ "directories": {}, "dist": { "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + "tarball": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, "engines": { "node": ">=0.6.0" diff --git a/tools/eslint/node_modules/jsonpointer/test.js b/tools/eslint/node_modules/jsonpointer/test.js deleted file mode 100644 index 1c67d7f7efc898..00000000000000 --- a/tools/eslint/node_modules/jsonpointer/test.js +++ /dev/null @@ -1,98 +0,0 @@ -var assert = require("assert"); -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(){ jsonpointer.get(obj, "a"); }, validateError); -assert.throws(function(){ jsonpointer.get(obj, "a/"); }, validateError); - -function validateError(err) { - if ( (err instanceof Error) && /Invalid JSON pointer/.test(err.message) ) { - return true; - } -} - -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.equal(jsonpointer.get(complexKeys, "/a/b/c"), null); -assert.equal(jsonpointer.get(complexKeys, "/~1"), null); - -// draft-ietf-appsawg-json-pointer-08 has special array rules -var ary = [ "zero", "one", "two" ]; -assert.equal(jsonpointer.get(ary, "/01"), null); - -//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/levn/package.json b/tools/eslint/node_modules/levn/package.json index c6d86622d91c04..6719ca8ca955ef 100644 --- a/tools/eslint/node_modules/levn/package.json +++ b/tools/eslint/node_modules/levn/package.json @@ -2,14 +2,14 @@ "_args": [ [ "levn@~0.3.0", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/node_modules/optionator" ] ], "_from": "levn@>=0.3.0 <0.4.0", "_id": "levn@0.3.0", "_inCache": true, "_installable": true, - "_location": "/eslint/levn", + "_location": "/levn", "_nodeVersion": "4.2.4", "_npmUser": { "email": "z@georgezahariev.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/optionator" + "/optionator" ], "_resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "_shasum": "3b09924edf9f083c0490fdd4c0bc4421e04764ee", "_shrinkwrap": null, "_spec": "levn@~0.3.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/optionator", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "z@georgezahariev.com", "name": "George Zahariev" diff --git a/tools/eslint/node_modules/lodash/LICENSE b/tools/eslint/node_modules/lodash/LICENSE index bcbe13d67a9621..e0c69d56032d15 100644 --- a/tools/eslint/node_modules/lodash/LICENSE +++ b/tools/eslint/node_modules/lodash/LICENSE @@ -1,23 +1,47 @@ -The MIT License (MIT) +Copyright jQuery Foundation and other contributors -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +Based on Underscore.js, copyright 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. +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/tools/eslint/node_modules/lodash/README.md b/tools/eslint/node_modules/lodash/README.md index 33a7ef26ef2e58..5990a7059c06d5 100644 --- a/tools/eslint/node_modules/lodash/README.md +++ b/tools/eslint/node_modules/lodash/README.md @@ -1,6 +1,6 @@ -# lodash v4.3.0 +# lodash v4.11.1 -The [lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. ## Installation @@ -12,29 +12,29 @@ $ npm i --save lodash In Node.js: ```js -// load the full build +// Load the full build. var _ = require('lodash'); -// load the core build +// Load the core build. var _ = require('lodash/core'); -// load the fp build for immutable auto-curried iteratee-first data-last methods -var _ = require('lodash/fp'); +// Load the fp build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); -// or a method category +// Load a method category. var array = require('lodash/array'); var object = require('lodash/fp/object'); -// or method for smaller builds with browserify/rollup/webpack +// Load a single method for smaller builds with browserify/rollup/webpack. var chunk = require('lodash/chunk'); var extend = require('lodash/fp/extend'); ``` -See the [package source](https://github.com/lodash/lodash/tree/4.3.0-npm) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.11.1-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. +Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default. ## Support -Tested in Chrome 47-48, Firefox 43-44, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8.
    +Tested in Chrome 48-49, Firefox 44-45, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8.
    Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/tools/eslint/node_modules/lodash/_DataView.js b/tools/eslint/node_modules/lodash/_DataView.js new file mode 100644 index 00000000000000..ac2d57ca67c9cb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/tools/eslint/node_modules/lodash/_Hash.js b/tools/eslint/node_modules/lodash/_Hash.js index 25108ad7fd7c34..7f4c3ba933a744 100644 --- a/tools/eslint/node_modules/lodash/_Hash.js +++ b/tools/eslint/node_modules/lodash/_Hash.js @@ -4,9 +4,10 @@ var nativeCreate = require('./_nativeCreate'); var objectProto = Object.prototype; /** - * Creates an hash object. + * Creates a hash object. * * @private + * @constructor * @returns {Object} Returns the new hash object. */ function Hash() {} diff --git a/tools/eslint/node_modules/lodash/_LazyWrapper.js b/tools/eslint/node_modules/lodash/_LazyWrapper.js index 3c14d805c925a7..81786c7f1e4940 100644 --- a/tools/eslint/node_modules/lodash/_LazyWrapper.js +++ b/tools/eslint/node_modules/lodash/_LazyWrapper.js @@ -8,6 +8,7 @@ var MAX_ARRAY_LENGTH = 4294967295; * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private + * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { @@ -20,6 +21,7 @@ function LazyWrapper(value) { this.__views__ = []; } +// Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; diff --git a/tools/eslint/node_modules/lodash/_LodashWrapper.js b/tools/eslint/node_modules/lodash/_LodashWrapper.js index 7c255b2dd1500c..c1e4d9df762b40 100644 --- a/tools/eslint/node_modules/lodash/_LodashWrapper.js +++ b/tools/eslint/node_modules/lodash/_LodashWrapper.js @@ -6,7 +6,7 @@ var baseCreate = require('./_baseCreate'), * * @private * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; diff --git a/tools/eslint/node_modules/lodash/_MapCache.js b/tools/eslint/node_modules/lodash/_MapCache.js index 734324be552a68..4c6fa99949d0f2 100644 --- a/tools/eslint/node_modules/lodash/_MapCache.js +++ b/tools/eslint/node_modules/lodash/_MapCache.js @@ -8,6 +8,7 @@ var mapClear = require('./_mapClear'), * Creates a map cache object to store key-value pairs. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function MapCache(values) { @@ -21,7 +22,7 @@ function MapCache(values) { } } -// Add functions to the `MapCache`. +// Add methods to `MapCache`. MapCache.prototype.clear = mapClear; MapCache.prototype['delete'] = mapDelete; MapCache.prototype.get = mapGet; diff --git a/tools/eslint/node_modules/lodash/_Promise.js b/tools/eslint/node_modules/lodash/_Promise.js new file mode 100644 index 00000000000000..247b9e1bacac64 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/tools/eslint/node_modules/lodash/_SetCache.js b/tools/eslint/node_modules/lodash/_SetCache.js index 66b8b614b0f3e1..6fd915bdc181a7 100644 --- a/tools/eslint/node_modules/lodash/_SetCache.js +++ b/tools/eslint/node_modules/lodash/_SetCache.js @@ -6,6 +6,7 @@ var MapCache = require('./_MapCache'), * Creates a set cache object to store unique values. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { @@ -18,7 +19,7 @@ function SetCache(values) { } } -// Add functions to the `SetCache`. +// Add methods to `SetCache`. SetCache.prototype.push = cachePush; module.exports = SetCache; diff --git a/tools/eslint/node_modules/lodash/_Stack.js b/tools/eslint/node_modules/lodash/_Stack.js index 7c3c2f318fac53..414cd5295d14b1 100644 --- a/tools/eslint/node_modules/lodash/_Stack.js +++ b/tools/eslint/node_modules/lodash/_Stack.js @@ -8,6 +8,7 @@ var stackClear = require('./_stackClear'), * Creates a stack cache object to store key-value pairs. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function Stack(values) { @@ -21,7 +22,7 @@ function Stack(values) { } } -// Add functions to the `Stack` cache. +// Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; diff --git a/tools/eslint/node_modules/lodash/_addMapEntry.js b/tools/eslint/node_modules/lodash/_addMapEntry.js index c76dc3fddb7384..0112ef74425759 100644 --- a/tools/eslint/node_modules/lodash/_addMapEntry.js +++ b/tools/eslint/node_modules/lodash/_addMapEntry.js @@ -7,6 +7,7 @@ * @returns {Object} Returns `map`. */ function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. map.set(pair[0], pair[1]); return map; } diff --git a/tools/eslint/node_modules/lodash/_apply.js b/tools/eslint/node_modules/lodash/_apply.js index 22d4f8a70315f6..d000f046079f31 100644 --- a/tools/eslint/node_modules/lodash/_apply.js +++ b/tools/eslint/node_modules/lodash/_apply.js @@ -5,7 +5,7 @@ * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. + * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { diff --git a/tools/eslint/node_modules/lodash/_arrayEvery.js b/tools/eslint/node_modules/lodash/_arrayEvery.js index d3ba018f66816b..8d89fb102d890c 100644 --- a/tools/eslint/node_modules/lodash/_arrayEvery.js +++ b/tools/eslint/node_modules/lodash/_arrayEvery.js @@ -5,7 +5,8 @@ * @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`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. */ function arrayEvery(array, predicate) { var index = -1, diff --git a/tools/eslint/node_modules/lodash/_arrayFilter.js b/tools/eslint/node_modules/lodash/_arrayFilter.js index 297083b4a2aa02..7b61ba6f9eea59 100644 --- a/tools/eslint/node_modules/lodash/_arrayFilter.js +++ b/tools/eslint/node_modules/lodash/_arrayFilter.js @@ -10,13 +10,13 @@ function arrayFilter(array, predicate) { var index = -1, length = array.length, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { - result[++resIndex] = value; + result[resIndex++] = value; } } return result; diff --git a/tools/eslint/node_modules/lodash/_arrayIncludesWith.js b/tools/eslint/node_modules/lodash/_arrayIncludesWith.js index a360d3a75ceb9d..88ea23719b4c99 100644 --- a/tools/eslint/node_modules/lodash/_arrayIncludesWith.js +++ b/tools/eslint/node_modules/lodash/_arrayIncludesWith.js @@ -1,6 +1,5 @@ /** - * A specialized version of `_.includesWith` for arrays without support for - * specifying an index to search from. + * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} array The array to search. diff --git a/tools/eslint/node_modules/lodash/_arrayReduce.js b/tools/eslint/node_modules/lodash/_arrayReduce.js index 6a355bce82f77c..41bea2cf07a5fb 100644 --- a/tools/eslint/node_modules/lodash/_arrayReduce.js +++ b/tools/eslint/node_modules/lodash/_arrayReduce.js @@ -6,7 +6,8 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { diff --git a/tools/eslint/node_modules/lodash/_arrayReduceRight.js b/tools/eslint/node_modules/lodash/_arrayReduceRight.js index b33a2d086cf365..038e0fa7890e5d 100644 --- a/tools/eslint/node_modules/lodash/_arrayReduceRight.js +++ b/tools/eslint/node_modules/lodash/_arrayReduceRight.js @@ -6,7 +6,8 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { diff --git a/tools/eslint/node_modules/lodash/_arraySome.js b/tools/eslint/node_modules/lodash/_arraySome.js index b93d53129867f3..e6e657b8f9b9de 100644 --- a/tools/eslint/node_modules/lodash/_arraySome.js +++ b/tools/eslint/node_modules/lodash/_arraySome.js @@ -5,7 +5,8 @@ * @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`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ function arraySome(array, predicate) { var index = -1, diff --git a/tools/eslint/node_modules/lodash/_assignMergeValue.js b/tools/eslint/node_modules/lodash/_assignMergeValue.js index 1c493b0651af22..61dd5832905f16 100644 --- a/tools/eslint/node_modules/lodash/_assignMergeValue.js +++ b/tools/eslint/node_modules/lodash/_assignMergeValue.js @@ -1,7 +1,8 @@ var eq = require('./eq'); /** - * This function is like `assignValue` except that it doesn't assign `undefined` values. + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. * * @private * @param {Object} object The object to modify. diff --git a/tools/eslint/node_modules/lodash/_assignValue.js b/tools/eslint/node_modules/lodash/_assignValue.js index 7563b604e957d5..35d49f04e88c40 100644 --- a/tools/eslint/node_modules/lodash/_assignValue.js +++ b/tools/eslint/node_modules/lodash/_assignValue.js @@ -18,8 +18,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; */ function assignValue(object, key, value) { var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } diff --git a/tools/eslint/node_modules/lodash/_assocDelete.js b/tools/eslint/node_modules/lodash/_assocDelete.js index 709a04a9c69cb3..49f61e830f10be 100644 --- a/tools/eslint/node_modules/lodash/_assocDelete.js +++ b/tools/eslint/node_modules/lodash/_assocDelete.js @@ -10,7 +10,7 @@ var splice = arrayProto.splice; * Removes `key` and its value from the associative array. * * @private - * @param {Array} array The array to query. + * @param {Array} array The array to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ diff --git a/tools/eslint/node_modules/lodash/_assocIndexOf.js b/tools/eslint/node_modules/lodash/_assocIndexOf.js index 958c8d8f58f830..8f2c41fbcda558 100644 --- a/tools/eslint/node_modules/lodash/_assocIndexOf.js +++ b/tools/eslint/node_modules/lodash/_assocIndexOf.js @@ -1,8 +1,7 @@ var eq = require('./eq'); /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. + * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to search. diff --git a/tools/eslint/node_modules/lodash/_baseClone.js b/tools/eslint/node_modules/lodash/_baseClone.js index 42d90a95c62915..b1079edd8be28c 100644 --- a/tools/eslint/node_modules/lodash/_baseClone.js +++ b/tools/eslint/node_modules/lodash/_baseClone.js @@ -2,10 +2,10 @@ var Stack = require('./_Stack'), arrayEach = require('./_arrayEach'), assignValue = require('./_assignValue'), baseAssign = require('./_baseAssign'), - baseForOwn = require('./_baseForOwn'), cloneBuffer = require('./_cloneBuffer'), copyArray = require('./_copyArray'), copySymbols = require('./_copySymbols'), + getAllKeys = require('./_getAllKeys'), getTag = require('./_getTag'), initCloneArray = require('./_initCloneArray'), initCloneByTag = require('./_initCloneByTag'), @@ -13,7 +13,8 @@ var Stack = require('./_Stack'), isArray = require('./isArray'), isBuffer = require('./isBuffer'), isHostObject = require('./_isHostObject'), - isObject = require('./isObject'); + isObject = require('./isObject'), + keys = require('./keys'); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', @@ -33,6 +34,7 @@ var argsTag = '[object Arguments]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', @@ -46,16 +48,16 @@ var arrayBufferTag = '[object ArrayBuffer]', /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = -cloneableTags[dateTag] = cloneableTags[float32Tag] = -cloneableTags[float64Tag] = cloneableTags[int8Tag] = -cloneableTags[int16Tag] = cloneableTags[int32Tag] = -cloneableTags[mapTag] = cloneableTags[numberTag] = -cloneableTags[objectTag] = cloneableTags[regexpTag] = -cloneableTags[setTag] = cloneableTags[stringTag] = -cloneableTags[symbolTag] = cloneableTags[uint8Tag] = -cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = -cloneableTags[uint32Tag] = true; +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; @@ -66,13 +68,14 @@ cloneableTags[weakMapTag] = false; * @private * @param {*} value The value to clone. * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ -function baseClone(value, isDeep, customizer, key, object, stack) { +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { var result; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); @@ -105,9 +108,10 @@ function baseClone(value, isDeep, customizer, key, object, stack) { return copySymbols(value, baseAssign(result, value)); } } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); } } // Check for circular references and return its corresponding clone. @@ -118,11 +122,18 @@ function baseClone(value, isDeep, customizer, key, object, stack) { } stack.set(value, result); + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); - return isArr ? result : copySymbols(value, result); + return result; } module.exports = baseClone; diff --git a/tools/eslint/node_modules/lodash/_baseConforms.js b/tools/eslint/node_modules/lodash/_baseConforms.js index 888434d620e203..973aa6d4397af9 100644 --- a/tools/eslint/node_modules/lodash/_baseConforms.js +++ b/tools/eslint/node_modules/lodash/_baseConforms.js @@ -21,7 +21,8 @@ function baseConforms(source) { predicate = source[key], value = object[key]; - if ((value === undefined && !(key in Object(object))) || !predicate(value)) { + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { return false; } } diff --git a/tools/eslint/node_modules/lodash/_baseCreate.js b/tools/eslint/node_modules/lodash/_baseCreate.js index 64d53eccca290c..4372cad2b2aaef 100644 --- a/tools/eslint/node_modules/lodash/_baseCreate.js +++ b/tools/eslint/node_modules/lodash/_baseCreate.js @@ -1,5 +1,8 @@ var isObject = require('./isObject'); +/** Built-in value references. */ +var objectCreate = Object.create; + /** * The base implementation of `_.create` without support for assigning * properties to the created object. @@ -8,16 +11,8 @@ var isObject = require('./isObject'); * @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 = undefined; - } - return result || {}; - }; -}()); +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} module.exports = baseCreate; diff --git a/tools/eslint/node_modules/lodash/_baseDifference.js b/tools/eslint/node_modules/lodash/_baseDifference.js index b266d7e3bea457..a49bdffa5a620f 100644 --- a/tools/eslint/node_modules/lodash/_baseDifference.js +++ b/tools/eslint/node_modules/lodash/_baseDifference.js @@ -9,8 +9,8 @@ var SetCache = require('./_SetCache'), var LARGE_ARRAY_SIZE = 200; /** - * The base implementation of methods like `_.difference` without support for - * excluding multiple arrays or iteratee shorthands. + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. diff --git a/tools/eslint/node_modules/lodash/_baseEvery.js b/tools/eslint/node_modules/lodash/_baseEvery.js index aafa00dade230a..fa52f7bc7d6b77 100644 --- a/tools/eslint/node_modules/lodash/_baseEvery.js +++ b/tools/eslint/node_modules/lodash/_baseEvery.js @@ -6,7 +6,8 @@ var baseEach = require('./_baseEach'); * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` */ function baseEvery(collection, predicate) { var result = true; diff --git a/tools/eslint/node_modules/lodash/_baseFind.js b/tools/eslint/node_modules/lodash/_baseFind.js index 535f7f35379b23..338f932c443b07 100644 --- a/tools/eslint/node_modules/lodash/_baseFind.js +++ b/tools/eslint/node_modules/lodash/_baseFind.js @@ -7,7 +7,8 @@ * @param {Array|Object} collection The collection to search. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. + * @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) { diff --git a/tools/eslint/node_modules/lodash/_baseFlatten.js b/tools/eslint/node_modules/lodash/_baseFlatten.js index 8a4cb460d71195..4b1e009b150cbf 100644 --- a/tools/eslint/node_modules/lodash/_baseFlatten.js +++ b/tools/eslint/node_modules/lodash/_baseFlatten.js @@ -1,31 +1,30 @@ var arrayPush = require('./_arrayPush'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLikeObject = require('./isArrayLikeObject'); + isFlattenable = require('./_isFlattenable'); /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ -function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - +function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index < length) { var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { + if (depth > 0 && predicate(value)) { + if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } diff --git a/tools/eslint/node_modules/lodash/_baseFor.js b/tools/eslint/node_modules/lodash/_baseFor.js index 97b70c9e0db71c..d946590f8adf70 100644 --- a/tools/eslint/node_modules/lodash/_baseFor.js +++ b/tools/eslint/node_modules/lodash/_baseFor.js @@ -1,10 +1,9 @@ var createBaseFor = require('./_createBaseFor'); /** - * 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`. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. diff --git a/tools/eslint/node_modules/lodash/_baseForIn.js b/tools/eslint/node_modules/lodash/_baseForIn.js deleted file mode 100644 index 4dcfdaf1e36974..00000000000000 --- a/tools/eslint/node_modules/lodash/_baseForIn.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseFor = require('./_baseFor'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.forIn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForIn(object, iteratee) { - return object == null ? object : baseFor(object, iteratee, keysIn); -} - -module.exports = baseForIn; diff --git a/tools/eslint/node_modules/lodash/_baseGet.js b/tools/eslint/node_modules/lodash/_baseGet.js index d11de17bf3aa6c..9d58a4c8646de5 100644 --- a/tools/eslint/node_modules/lodash/_baseGet.js +++ b/tools/eslint/node_modules/lodash/_baseGet.js @@ -1,4 +1,4 @@ -var baseToPath = require('./_baseToPath'), +var castPath = require('./_castPath'), isKey = require('./_isKey'); /** @@ -10,7 +10,7 @@ var baseToPath = require('./_baseToPath'), * @returns {*} Returns the resolved value. */ function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); var index = 0, length = path.length; diff --git a/tools/eslint/node_modules/lodash/_baseGetAllKeys.js b/tools/eslint/node_modules/lodash/_baseGetAllKeys.js new file mode 100644 index 00000000000000..7f8b38bd4c1f94 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,22 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) + ? result + : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/tools/eslint/node_modules/lodash/_baseHas.js b/tools/eslint/node_modules/lodash/_baseHas.js index b3932069d8b341..1de5d841c2938d 100644 --- a/tools/eslint/node_modules/lodash/_baseHas.js +++ b/tools/eslint/node_modules/lodash/_baseHas.js @@ -1,12 +1,11 @@ +var getPrototype = require('./_getPrototype'); + /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** Built-in value references. */ -var getPrototypeOf = Object.getPrototypeOf; - /** * The base implementation of `_.has` without support for deep paths. * @@ -20,7 +19,7 @@ function baseHas(object, key) { // that are composed entirely of index properties, return `false` for // `hasOwnProperty` checks of them. return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); + (typeof object == 'object' && key in object && getPrototype(object) === null); } module.exports = baseHas; diff --git a/tools/eslint/node_modules/lodash/_baseIndexOfWith.js b/tools/eslint/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 00000000000000..8be568af269323 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/tools/eslint/node_modules/lodash/_baseIntersection.js b/tools/eslint/node_modules/lodash/_baseIntersection.js index 77e463f85ef8aa..7d129267ed355d 100644 --- a/tools/eslint/node_modules/lodash/_baseIntersection.js +++ b/tools/eslint/node_modules/lodash/_baseIntersection.js @@ -5,6 +5,9 @@ var SetCache = require('./_SetCache'), baseUnary = require('./_baseUnary'), cacheHas = require('./_cacheHas'); +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. @@ -17,9 +20,11 @@ var SetCache = require('./_SetCache'), */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), + maxLength = Infinity, result = []; while (othIndex--) { @@ -27,26 +32,32 @@ function baseIntersection(arrays, iteratee, comparator) { if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } - caches[othIndex] = !comparator && (iteratee || array.length >= 120) + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, - length = array.length, seen = caches[0]; outer: - while (++index < length) { + while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; - if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { - var othIndex = othLength; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; - if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { continue outer; } } diff --git a/tools/eslint/node_modules/lodash/_baseInvoke.js b/tools/eslint/node_modules/lodash/_baseInvoke.js index a19a5f8f8ac378..9b320214107c37 100644 --- a/tools/eslint/node_modules/lodash/_baseInvoke.js +++ b/tools/eslint/node_modules/lodash/_baseInvoke.js @@ -1,5 +1,5 @@ var apply = require('./_apply'), - baseToPath = require('./_baseToPath'), + castPath = require('./_castPath'), isKey = require('./_isKey'), last = require('./last'), parent = require('./_parent'); @@ -16,7 +16,7 @@ var apply = require('./_apply'), */ function baseInvoke(object, path, args) { if (!isKey(path, object)) { - path = baseToPath(path); + path = castPath(path); object = parent(object, path); path = last(path); } diff --git a/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js b/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js index 54eca35069a223..c18d6d1fcdbb5b 100644 --- a/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js +++ b/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js @@ -31,7 +31,8 @@ var hasOwnProperty = objectProto.hasOwnProperty; * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ @@ -43,41 +44,39 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { if (!objIsArr) { objTag = getTag(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } + objTag = objTag == argsTag ? objectTag : objTag; } if (!othIsArr) { othTag = getTag(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } + othTag = othTag == argsTag ? objectTag : othTag; } var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { 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, bitmask, stack); + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); - return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); } module.exports = baseIsEqualDeep; diff --git a/tools/eslint/node_modules/lodash/_baseIsMatch.js b/tools/eslint/node_modules/lodash/_baseIsMatch.js index c1dcafc89c1d2a..d36c8785191183 100644 --- a/tools/eslint/node_modules/lodash/_baseIsMatch.js +++ b/tools/eslint/node_modules/lodash/_baseIsMatch.js @@ -44,9 +44,10 @@ function baseIsMatch(object, source, matchData, customizer) { return false; } } else { - var stack = new Stack, - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result diff --git a/tools/eslint/node_modules/lodash/_baseIteratee.js b/tools/eslint/node_modules/lodash/_baseIteratee.js index 19531af3b9ae8c..995c2575672c85 100644 --- a/tools/eslint/node_modules/lodash/_baseIteratee.js +++ b/tools/eslint/node_modules/lodash/_baseIteratee.js @@ -12,14 +12,15 @@ var baseMatches = require('./_baseMatches'), * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { return value; } if (value == null) { return identity; } - if (type == 'object') { + if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); diff --git a/tools/eslint/node_modules/lodash/_baseKeys.js b/tools/eslint/node_modules/lodash/_baseKeys.js index 4b747d50fa2b74..2c8ccb912ce9ed 100644 --- a/tools/eslint/node_modules/lodash/_baseKeys.js +++ b/tools/eslint/node_modules/lodash/_baseKeys.js @@ -6,7 +6,6 @@ var nativeKeys = Object.keys; * property of prototypes or treat sparse arrays as dense. * * @private - * @type Function * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ diff --git a/tools/eslint/node_modules/lodash/_baseLodash.js b/tools/eslint/node_modules/lodash/_baseLodash.js index 15b79d3f7b9a70..f76c790e2e1196 100644 --- a/tools/eslint/node_modules/lodash/_baseLodash.js +++ b/tools/eslint/node_modules/lodash/_baseLodash.js @@ -1,5 +1,5 @@ /** - * The function whose prototype all chaining wrappers inherit from. + * The function whose prototype chain sequence wrappers inherit from. * * @private */ diff --git a/tools/eslint/node_modules/lodash/_baseMatches.js b/tools/eslint/node_modules/lodash/_baseMatches.js index 56c72e6ca2467d..ba9012f946c21c 100644 --- a/tools/eslint/node_modules/lodash/_baseMatches.js +++ b/tools/eslint/node_modules/lodash/_baseMatches.js @@ -1,5 +1,6 @@ var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); /** * The base implementation of `_.matches` which doesn't clone `source`. @@ -11,16 +12,7 @@ var baseIsMatch = require('./_baseIsMatch'), 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 Object(object))); - }; + return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); diff --git a/tools/eslint/node_modules/lodash/_baseMatchesProperty.js b/tools/eslint/node_modules/lodash/_baseMatchesProperty.js index 256ad65f3f1f7b..88afd67e141708 100644 --- a/tools/eslint/node_modules/lodash/_baseMatchesProperty.js +++ b/tools/eslint/node_modules/lodash/_baseMatchesProperty.js @@ -1,6 +1,9 @@ var baseIsEqual = require('./_baseIsEqual'), get = require('./get'), - hasIn = require('./hasIn'); + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'); /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, @@ -15,6 +18,9 @@ var UNORDERED_COMPARE_FLAG = 1, * @returns {Function} Returns the new function. */ function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(path, srcValue); + } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) diff --git a/tools/eslint/node_modules/lodash/_baseMean.js b/tools/eslint/node_modules/lodash/_baseMean.js new file mode 100644 index 00000000000000..ac99a42317d70f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array ? array.length : 0; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/tools/eslint/node_modules/lodash/_baseMerge.js b/tools/eslint/node_modules/lodash/_baseMerge.js index 97784648496820..e18d3bf750a3ac 100644 --- a/tools/eslint/node_modules/lodash/_baseMerge.js +++ b/tools/eslint/node_modules/lodash/_baseMerge.js @@ -15,13 +15,16 @@ var Stack = require('./_Stack'), * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } - var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source); + if (!(isArray(source) || isTypedArray(source))) { + var props = keysIn(source); + } arrayEach(props || source, function(srcValue, key) { if (props) { key = srcValue; @@ -32,7 +35,10 @@ function baseMerge(object, source, srcIndex, customizer, stack) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { - var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + if (newValue === undefined) { newValue = srcValue; } diff --git a/tools/eslint/node_modules/lodash/_baseMergeDeep.js b/tools/eslint/node_modules/lodash/_baseMergeDeep.js index d5caf3fffe720b..062f004c23ac93 100644 --- a/tools/eslint/node_modules/lodash/_baseMergeDeep.js +++ b/tools/eslint/node_modules/lodash/_baseMergeDeep.js @@ -22,7 +22,8 @@ var assignMergeValue = require('./_assignMergeValue'), * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], @@ -33,21 +34,24 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta assignMergeValue(object, key, stacked); return; } - var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined, - isCommon = newValue === undefined; + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; if (isCommon) { newValue = srcValue; if (isArray(srcValue) || isTypedArray(srcValue)) { if (isArray(objValue)) { - newValue = srcIndex ? copyArray(objValue) : objValue; + newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else { isCommon = false; - newValue = baseClone(srcValue); + newValue = baseClone(srcValue, true); } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { @@ -56,10 +60,10 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { isCommon = false; - newValue = baseClone(srcValue); + newValue = baseClone(srcValue, true); } else { - newValue = srcIndex ? baseClone(objValue) : objValue; + newValue = objValue; } } else { @@ -72,6 +76,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta // Recursively merge objects and arrays (susceptible to call stack limits). mergeFunc(newValue, srcValue, srcIndex, customizer, stack); } + stack['delete'](srcValue); assignMergeValue(object, key, newValue); } diff --git a/tools/eslint/node_modules/lodash/_baseNth.js b/tools/eslint/node_modules/lodash/_baseNth.js new file mode 100644 index 00000000000000..6978a651da0867 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseNth.js @@ -0,0 +1,20 @@ +var isIndex = require('./_isIndex'); + +/** + * The base implementation of `_.nth` which doesn't coerce `n` to an integer. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ +function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; +} + +module.exports = baseNth; diff --git a/tools/eslint/node_modules/lodash/_baseOrderBy.js b/tools/eslint/node_modules/lodash/_baseOrderBy.js index 46186806407a75..d8a46ab20a2c5d 100644 --- a/tools/eslint/node_modules/lodash/_baseOrderBy.js +++ b/tools/eslint/node_modules/lodash/_baseOrderBy.js @@ -2,7 +2,9 @@ var arrayMap = require('./_arrayMap'), baseIteratee = require('./_baseIteratee'), baseMap = require('./_baseMap'), baseSortBy = require('./_baseSortBy'), - compareMultiple = require('./_compareMultiple'); + baseUnary = require('./_baseUnary'), + compareMultiple = require('./_compareMultiple'), + identity = require('./identity'); /** * The base implementation of `_.orderBy` without param guards. @@ -14,12 +16,8 @@ var arrayMap = require('./_arrayMap'), * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { - var index = -1, - toIteratee = baseIteratee; - - iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) { - return toIteratee(iteratee); - }); + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { diff --git a/tools/eslint/node_modules/lodash/_basePick.js b/tools/eslint/node_modules/lodash/_basePick.js index e2ce7229f83731..7272548307c101 100644 --- a/tools/eslint/node_modules/lodash/_basePick.js +++ b/tools/eslint/node_modules/lodash/_basePick.js @@ -2,11 +2,11 @@ var arrayReduce = require('./_arrayReduce'); /** * The base implementation of `_.pick` without support for individual - * property names. + * property identifiers. * * @private * @param {Object} object The source object. - * @param {string[]} props The property names to pick. + * @param {string[]} props The property identifiers to pick. * @returns {Object} Returns the new object. */ function basePick(object, props) { diff --git a/tools/eslint/node_modules/lodash/_basePickBy.js b/tools/eslint/node_modules/lodash/_basePickBy.js index 37c4943ba19f45..56ffa5f5d7f60d 100644 --- a/tools/eslint/node_modules/lodash/_basePickBy.js +++ b/tools/eslint/node_modules/lodash/_basePickBy.js @@ -1,4 +1,4 @@ -var baseForIn = require('./_baseForIn'); +var getAllKeysIn = require('./_getAllKeysIn'); /** * The base implementation of `_.pickBy` without support for iteratee shorthands. @@ -9,12 +9,19 @@ var baseForIn = require('./_baseForIn'); * @returns {Object} Returns the new object. */ function basePickBy(object, predicate) { - var result = {}; - baseForIn(object, function(value, key) { + var index = -1, + props = getAllKeysIn(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + if (predicate(value, key)) { result[key] = value; } - }); + } return result; } diff --git a/tools/eslint/node_modules/lodash/_basePullAll.js b/tools/eslint/node_modules/lodash/_basePullAll.js index d54d2b130d1e5f..3c07c994cfd426 100644 --- a/tools/eslint/node_modules/lodash/_basePullAll.js +++ b/tools/eslint/node_modules/lodash/_basePullAll.js @@ -1,15 +1,47 @@ -var basePullAllBy = require('./_basePullAllBy'); +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; /** - * The base implementation of `_.pullAll`. + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ -function basePullAll(array, values) { - return basePullAllBy(array, values); +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; } module.exports = basePullAll; diff --git a/tools/eslint/node_modules/lodash/_basePullAllBy.js b/tools/eslint/node_modules/lodash/_basePullAllBy.js deleted file mode 100644 index 00167fad646752..00000000000000 --- a/tools/eslint/node_modules/lodash/_basePullAllBy.js +++ /dev/null @@ -1,43 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIndexOf = require('./_baseIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns `array`. - */ -function basePullAllBy(array, values, iteratee) { - var index = -1, - length = values.length, - seen = array; - - if (iteratee) { - seen = arrayMap(array, function(value) { return iteratee(value); }); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = basePullAllBy; diff --git a/tools/eslint/node_modules/lodash/_basePullAt.js b/tools/eslint/node_modules/lodash/_basePullAt.js index 206b1965f57034..fc9130f4ac51f7 100644 --- a/tools/eslint/node_modules/lodash/_basePullAt.js +++ b/tools/eslint/node_modules/lodash/_basePullAt.js @@ -1,4 +1,4 @@ -var baseToPath = require('./_baseToPath'), +var castPath = require('./_castPath'), isIndex = require('./_isIndex'), isKey = require('./_isKey'), last = require('./last'), @@ -31,7 +31,7 @@ function basePullAt(array, indexes) { splice.call(array, index, 1); } else if (!isKey(index, array)) { - var path = baseToPath(index), + var path = castPath(index), object = parent(array, path); if (object != null) { diff --git a/tools/eslint/node_modules/lodash/_baseReduce.js b/tools/eslint/node_modules/lodash/_baseReduce.js index 6ec544251dbb59..5a1f8b57f1f86a 100644 --- a/tools/eslint/node_modules/lodash/_baseReduce.js +++ b/tools/eslint/node_modules/lodash/_baseReduce.js @@ -6,7 +6,8 @@ * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ diff --git a/tools/eslint/node_modules/lodash/_baseRepeat.js b/tools/eslint/node_modules/lodash/_baseRepeat.js new file mode 100644 index 00000000000000..ee44c31ab0c4b1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/tools/eslint/node_modules/lodash/_baseSet.js b/tools/eslint/node_modules/lodash/_baseSet.js index 07b18406de78e5..dd535693107737 100644 --- a/tools/eslint/node_modules/lodash/_baseSet.js +++ b/tools/eslint/node_modules/lodash/_baseSet.js @@ -1,5 +1,5 @@ var assignValue = require('./_assignValue'), - baseToPath = require('./_baseToPath'), + castPath = require('./_castPath'), isIndex = require('./_isIndex'), isKey = require('./_isKey'), isObject = require('./isObject'); @@ -15,7 +15,7 @@ var assignValue = require('./_assignValue'), * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); var index = -1, length = path.length, @@ -30,7 +30,9 @@ function baseSet(object, path, value, customizer) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { - newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue; + newValue = objValue == null + ? (isIndex(path[index + 1]) ? [] : {}) + : objValue; } } assignValue(nested, key, newValue); diff --git a/tools/eslint/node_modules/lodash/_baseSome.js b/tools/eslint/node_modules/lodash/_baseSome.js index 8b6aa0a265eba6..58f3f447a34ecc 100644 --- a/tools/eslint/node_modules/lodash/_baseSome.js +++ b/tools/eslint/node_modules/lodash/_baseSome.js @@ -6,7 +6,8 @@ var baseEach = require('./_baseEach'); * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ function baseSome(collection, predicate) { var result; diff --git a/tools/eslint/node_modules/lodash/_baseSortBy.js b/tools/eslint/node_modules/lodash/_baseSortBy.js index fec0afeb78f10e..a25c92eda6ebd2 100644 --- a/tools/eslint/node_modules/lodash/_baseSortBy.js +++ b/tools/eslint/node_modules/lodash/_baseSortBy.js @@ -1,7 +1,7 @@ /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. + * 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. diff --git a/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js b/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js index 6e295f92fe7bbe..c0c7d66a2adacf 100644 --- a/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js +++ b/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js @@ -16,7 +16,8 @@ var nativeFloor = Math.floor, * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); diff --git a/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js b/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js index c95a83f24342f0..81e7ae1bc339b4 100644 --- a/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js +++ b/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js @@ -15,7 +15,7 @@ function baseSortedUniqBy(array, iteratee) { value = array[0], computed = iteratee ? iteratee(value) : value, seen = computed, - resIndex = 0, + resIndex = 1, result = [value]; while (++index < length) { @@ -24,7 +24,7 @@ function baseSortedUniqBy(array, iteratee) { if (!eq(computed, seen)) { seen = computed; - result[++resIndex] = value; + result[resIndex++] = value; } } return result; diff --git a/tools/eslint/node_modules/lodash/_baseSum.js b/tools/eslint/node_modules/lodash/_baseSum.js index 348b5e8c0aabac..a9e84c13c9098c 100644 --- a/tools/eslint/node_modules/lodash/_baseSum.js +++ b/tools/eslint/node_modules/lodash/_baseSum.js @@ -1,5 +1,6 @@ /** - * The base implementation of `_.sum` without support for iteratee shorthands. + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. diff --git a/tools/eslint/node_modules/lodash/_baseToPath.js b/tools/eslint/node_modules/lodash/_baseToPath.js deleted file mode 100644 index eb45827cac4142..00000000000000 --- a/tools/eslint/node_modules/lodash/_baseToPath.js +++ /dev/null @@ -1,16 +0,0 @@ -var isArray = require('./isArray'), - stringToPath = require('./_stringToPath'); - -/** - * The base implementation of `_.toPath` which only converts `value` to a - * path if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ -function baseToPath(value) { - return isArray(value) ? value : stringToPath(value); -} - -module.exports = baseToPath; diff --git a/tools/eslint/node_modules/lodash/_baseUnset.js b/tools/eslint/node_modules/lodash/_baseUnset.js index 2be1c1270814a0..bff4d4c4f02d87 100644 --- a/tools/eslint/node_modules/lodash/_baseUnset.js +++ b/tools/eslint/node_modules/lodash/_baseUnset.js @@ -1,4 +1,4 @@ -var baseToPath = require('./_baseToPath'), +var castPath = require('./_castPath'), has = require('./has'), isKey = require('./_isKey'), last = require('./last'), @@ -13,7 +13,7 @@ var baseToPath = require('./_baseToPath'), * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); object = parent(object, path); var key = last(path); return (object != null && has(object, key)) ? delete object[key] : true; diff --git a/tools/eslint/node_modules/lodash/_baseUpdate.js b/tools/eslint/node_modules/lodash/_baseUpdate.js new file mode 100644 index 00000000000000..ec1b338366d8eb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/tools/eslint/node_modules/lodash/_baseZipObject.js b/tools/eslint/node_modules/lodash/_baseZipObject.js index c8a3e833ed5ac2..401f85be20b458 100644 --- a/tools/eslint/node_modules/lodash/_baseZipObject.js +++ b/tools/eslint/node_modules/lodash/_baseZipObject.js @@ -2,7 +2,7 @@ * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private - * @param {Array} props The property names. + * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. @@ -14,7 +14,8 @@ function baseZipObject(props, values, assignFunc) { result = {}; while (++index < length) { - assignFunc(result, props[index], index < valsLength ? values[index] : undefined); + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); } return result; } diff --git a/tools/eslint/node_modules/lodash/_castArrayLikeObject.js b/tools/eslint/node_modules/lodash/_castArrayLikeObject.js new file mode 100644 index 00000000000000..92c75fa1a9151a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_castArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; diff --git a/tools/eslint/node_modules/lodash/_castFunction.js b/tools/eslint/node_modules/lodash/_castFunction.js new file mode 100644 index 00000000000000..98c91ae6378b98 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_castFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; diff --git a/tools/eslint/node_modules/lodash/_castPath.js b/tools/eslint/node_modules/lodash/_castPath.js new file mode 100644 index 00000000000000..4f38f95d39b1ea --- /dev/null +++ b/tools/eslint/node_modules/lodash/_castPath.js @@ -0,0 +1,15 @@ +var isArray = require('./isArray'), + stringToPath = require('./_stringToPath'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +module.exports = castPath; diff --git a/tools/eslint/node_modules/lodash/_castSlice.js b/tools/eslint/node_modules/lodash/_castSlice.js new file mode 100644 index 00000000000000..071faeba525380 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_castSlice.js @@ -0,0 +1,18 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; diff --git a/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js b/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js index a7ed50cddbed20..c3d8f6e39a61ad 100644 --- a/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js +++ b/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js @@ -8,11 +8,8 @@ var Uint8Array = require('./_Uint8Array'); * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { - var Ctor = arrayBuffer.constructor, - result = new Ctor(arrayBuffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(arrayBuffer)); + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } diff --git a/tools/eslint/node_modules/lodash/_cloneBuffer.js b/tools/eslint/node_modules/lodash/_cloneBuffer.js index 58a4e2bdd857ee..247d4106f7f3c1 100644 --- a/tools/eslint/node_modules/lodash/_cloneBuffer.js +++ b/tools/eslint/node_modules/lodash/_cloneBuffer.js @@ -10,9 +10,7 @@ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } - var Ctor = buffer.constructor, - result = new Ctor(buffer.length); - + var result = new buffer.constructor(buffer.length); buffer.copy(result); return result; } diff --git a/tools/eslint/node_modules/lodash/_cloneDataView.js b/tools/eslint/node_modules/lodash/_cloneDataView.js new file mode 100644 index 00000000000000..9c9b7b054d5e2c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/tools/eslint/node_modules/lodash/_cloneMap.js b/tools/eslint/node_modules/lodash/_cloneMap.js index 1b5af07f8b3453..b51983d24c7bec 100644 --- a/tools/eslint/node_modules/lodash/_cloneMap.js +++ b/tools/eslint/node_modules/lodash/_cloneMap.js @@ -7,11 +7,13 @@ var addMapEntry = require('./_addMapEntry'), * * @private * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned map. */ -function cloneMap(map) { - var Ctor = map.constructor; - return arrayReduce(mapToArray(map), addMapEntry, new Ctor); +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); } module.exports = cloneMap; diff --git a/tools/eslint/node_modules/lodash/_cloneRegExp.js b/tools/eslint/node_modules/lodash/_cloneRegExp.js index f36fd5730aa4c4..64a30dfb4ac39a 100644 --- a/tools/eslint/node_modules/lodash/_cloneRegExp.js +++ b/tools/eslint/node_modules/lodash/_cloneRegExp.js @@ -9,9 +9,7 @@ var reFlags = /\w*$/; * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { - var Ctor = regexp.constructor, - result = new Ctor(regexp.source, reFlags.exec(regexp)); - + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } diff --git a/tools/eslint/node_modules/lodash/_cloneSet.js b/tools/eslint/node_modules/lodash/_cloneSet.js index a6fa4a2f86e9db..dc1db95c618d3d 100644 --- a/tools/eslint/node_modules/lodash/_cloneSet.js +++ b/tools/eslint/node_modules/lodash/_cloneSet.js @@ -7,11 +7,13 @@ var addSetEntry = require('./_addSetEntry'), * * @private * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned set. */ -function cloneSet(set) { - var Ctor = set.constructor; - return arrayReduce(setToArray(set), addSetEntry, new Ctor); +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); } module.exports = cloneSet; diff --git a/tools/eslint/node_modules/lodash/_cloneSymbol.js b/tools/eslint/node_modules/lodash/_cloneSymbol.js index ac0217d74e056b..bede39f50a6fcd 100644 --- a/tools/eslint/node_modules/lodash/_cloneSymbol.js +++ b/tools/eslint/node_modules/lodash/_cloneSymbol.js @@ -2,7 +2,7 @@ var Symbol = require('./_Symbol'); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined; + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * Creates a clone of the `symbol` object. @@ -12,7 +12,7 @@ var symbolProto = Symbol ? Symbol.prototype : undefined, * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { - return Symbol ? Object(symbolValueOf.call(symbol)) : {}; + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } module.exports = cloneSymbol; diff --git a/tools/eslint/node_modules/lodash/_cloneTypedArray.js b/tools/eslint/node_modules/lodash/_cloneTypedArray.js index 8a2d0f7e65810b..7aad84d4fec4bc 100644 --- a/tools/eslint/node_modules/lodash/_cloneTypedArray.js +++ b/tools/eslint/node_modules/lodash/_cloneTypedArray.js @@ -9,10 +9,8 @@ var cloneArrayBuffer = require('./_cloneArrayBuffer'); * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { - var buffer = typedArray.buffer, - Ctor = typedArray.constructor; - - return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } module.exports = cloneTypedArray; diff --git a/tools/eslint/node_modules/lodash/_compareMultiple.js b/tools/eslint/node_modules/lodash/_compareMultiple.js index a3f2d8b9a3e065..ad61f0fbcaa404 100644 --- a/tools/eslint/node_modules/lodash/_compareMultiple.js +++ b/tools/eslint/node_modules/lodash/_compareMultiple.js @@ -37,7 +37,7 @@ function compareMultiple(object, other, orders) { // 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. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } diff --git a/tools/eslint/node_modules/lodash/_composeArgs.js b/tools/eslint/node_modules/lodash/_composeArgs.js index 863f71f7e09a9b..07398e78409486 100644 --- a/tools/eslint/node_modules/lodash/_composeArgs.js +++ b/tools/eslint/node_modules/lodash/_composeArgs.js @@ -9,23 +9,28 @@ var nativeMax = Math.max; * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ -function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, - result = Array(leftLength + argsLength); + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } } - while (argsLength--) { + while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; diff --git a/tools/eslint/node_modules/lodash/_composeArgsRight.js b/tools/eslint/node_modules/lodash/_composeArgsRight.js index 4bb639b86c4689..18cfae0340efdc 100644 --- a/tools/eslint/node_modules/lodash/_composeArgsRight.js +++ b/tools/eslint/node_modules/lodash/_composeArgsRight.js @@ -9,18 +9,21 @@ var nativeMax = Math.max; * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ -function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, - result = Array(argsLength + rightLength); + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; - while (++argsIndex < argsLength) { + while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; @@ -28,7 +31,9 @@ function composeArgsRight(args, partials, holders) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } } return result; } diff --git a/tools/eslint/node_modules/lodash/_copyObject.js b/tools/eslint/node_modules/lodash/_copyObject.js index f8406b6547b62d..474d17bb877255 100644 --- a/tools/eslint/node_modules/lodash/_copyObject.js +++ b/tools/eslint/node_modules/lodash/_copyObject.js @@ -1,16 +1,31 @@ -var copyObjectWith = require('./_copyObjectWith'); +var assignValue = require('./_assignValue'); /** * 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 {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; } module.exports = copyObject; diff --git a/tools/eslint/node_modules/lodash/_copyObjectWith.js b/tools/eslint/node_modules/lodash/_copyObjectWith.js deleted file mode 100644 index ac5b9d3be81e37..00000000000000 --- a/tools/eslint/node_modules/lodash/_copyObjectWith.js +++ /dev/null @@ -1,29 +0,0 @@ -var assignValue = require('./_assignValue'); - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; -} - -module.exports = copyObjectWith; diff --git a/tools/eslint/node_modules/lodash/_countHolders.js b/tools/eslint/node_modules/lodash/_countHolders.js new file mode 100644 index 00000000000000..8cc95e6e0e6d6f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + result++; + } + } + return result; +} + +module.exports = countHolders; diff --git a/tools/eslint/node_modules/lodash/_createAssigner.js b/tools/eslint/node_modules/lodash/_createAssigner.js index 72c3039e5a3067..1e81db9319a10d 100644 --- a/tools/eslint/node_modules/lodash/_createAssigner.js +++ b/tools/eslint/node_modules/lodash/_createAssigner.js @@ -15,7 +15,10 @@ function createAssigner(assigner) { customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; diff --git a/tools/eslint/node_modules/lodash/_createBaseFor.js b/tools/eslint/node_modules/lodash/_createBaseFor.js index bc84c037a5b819..94cbf297aa2031 100644 --- a/tools/eslint/node_modules/lodash/_createBaseFor.js +++ b/tools/eslint/node_modules/lodash/_createBaseFor.js @@ -1,5 +1,5 @@ /** - * Creates a base function for methods like `_.forIn`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. diff --git a/tools/eslint/node_modules/lodash/_createBaseWrapper.js b/tools/eslint/node_modules/lodash/_createBaseWrapper.js index fd3bb9a695ee39..c365621bd747e3 100644 --- a/tools/eslint/node_modules/lodash/_createBaseWrapper.js +++ b/tools/eslint/node_modules/lodash/_createBaseWrapper.js @@ -10,7 +10,8 @@ var BIND_FLAG = 1; * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ diff --git a/tools/eslint/node_modules/lodash/_createCaseFirst.js b/tools/eslint/node_modules/lodash/_createCaseFirst.js index 5718f6f4aa8ef3..9296b1d7811f50 100644 --- a/tools/eslint/node_modules/lodash/_createCaseFirst.js +++ b/tools/eslint/node_modules/lodash/_createCaseFirst.js @@ -1,18 +1,8 @@ -var stringToArray = require('./_stringToArray'), +var castSlice = require('./_castSlice'), + reHasComplexSymbol = require('./_reHasComplexSymbol'), + stringToArray = require('./_stringToArray'), toString = require('./toString'); -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - /** * Creates a function like `_.lowerFirst`. * @@ -24,9 +14,17 @@ function createCaseFirst(methodName) { return function(string) { string = toString(string); - var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined, - chr = strSymbols ? strSymbols[0] : string.charAt(0), - trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); + var strSymbols = reHasComplexSymbol.test(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); return chr[methodName]() + trailing; }; diff --git a/tools/eslint/node_modules/lodash/_createCompounder.js b/tools/eslint/node_modules/lodash/_createCompounder.js index bfa4ee5fe8c8d7..8d4cee2cd3e388 100644 --- a/tools/eslint/node_modules/lodash/_createCompounder.js +++ b/tools/eslint/node_modules/lodash/_createCompounder.js @@ -2,6 +2,12 @@ var arrayReduce = require('./_arrayReduce'), deburr = require('./deburr'), words = require('./words'); +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + /** * Creates a function like `_.camelCase`. * @@ -11,7 +17,7 @@ var arrayReduce = require('./_arrayReduce'), */ function createCompounder(callback) { return function(string) { - return arrayReduce(words(deburr(string)), callback, ''); + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } diff --git a/tools/eslint/node_modules/lodash/_createCtorWrapper.js b/tools/eslint/node_modules/lodash/_createCtorWrapper.js index a0a7f83d70e760..17e1bd8314f420 100644 --- a/tools/eslint/node_modules/lodash/_createCtorWrapper.js +++ b/tools/eslint/node_modules/lodash/_createCtorWrapper.js @@ -11,8 +11,8 @@ var baseCreate = require('./_baseCreate'), */ function createCtorWrapper(Ctor) { return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { diff --git a/tools/eslint/node_modules/lodash/_createCurryWrapper.js b/tools/eslint/node_modules/lodash/_createCurryWrapper.js index 2fc9f7e6c9716c..c48ba62402ab3d 100644 --- a/tools/eslint/node_modules/lodash/_createCurryWrapper.js +++ b/tools/eslint/node_modules/lodash/_createCurryWrapper.js @@ -2,6 +2,7 @@ var apply = require('./_apply'), createCtorWrapper = require('./_createCtorWrapper'), createHybridWrapper = require('./_createHybridWrapper'), createRecurryWrapper = require('./_createRecurryWrapper'), + getPlaceholder = require('./_getPlaceholder'), replaceHolders = require('./_replaceHolders'), root = require('./_root'); @@ -10,7 +11,8 @@ var apply = require('./_apply'), * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ @@ -19,10 +21,9 @@ function createCurryWrapper(func, bitmask, arity) { function wrapper() { var length = arguments.length, - index = length, args = Array(length), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, - placeholder = wrapper.placeholder; + index = length, + placeholder = getPlaceholder(wrapper); while (index--) { args[index] = arguments[index]; @@ -32,9 +33,13 @@ function createCurryWrapper(func, bitmask, arity) { : replaceHolders(args, placeholder); length -= holders.length; - return length < arity - ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) - : apply(fn, this, args); + if (length < arity) { + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); } return wrapper; } diff --git a/tools/eslint/node_modules/lodash/_createFlow.js b/tools/eslint/node_modules/lodash/_createFlow.js index 1d5e5f18137b9f..6b5ee54be1ef50 100644 --- a/tools/eslint/node_modules/lodash/_createFlow.js +++ b/tools/eslint/node_modules/lodash/_createFlow.js @@ -6,18 +6,18 @@ var LodashWrapper = require('./_LodashWrapper'), isLaziable = require('./_isLaziable'), rest = require('./rest'); -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8, - PARTIAL_FLAG = 32, - ARY_FLAG = 128, - REARG_FLAG = 256; - /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; +/** Used to compose bitmasks for wrapper metadata. */ +var CURRY_FLAG = 8, + PARTIAL_FLAG = 32, + ARY_FLAG = 128, + REARG_FLAG = 256; + /** * Creates a `_.flow` or `_.flowRight` function. * @@ -27,7 +27,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; */ function createFlow(fromRight) { return rest(function(funcs) { - funcs = baseFlatten(funcs); + funcs = baseFlatten(funcs, 1); var length = funcs.length, index = length, @@ -52,17 +52,23 @@ function createFlow(fromRight) { var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { + 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); + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; - if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + if (wrapper && args.length == 1 && + isArray(value) && value.length >= LARGE_ARRAY_SIZE) { return wrapper.plant(value).value(); } var index = 0, diff --git a/tools/eslint/node_modules/lodash/_createHybridWrapper.js b/tools/eslint/node_modules/lodash/_createHybridWrapper.js index 7d34c74916548f..144a90d7931b40 100644 --- a/tools/eslint/node_modules/lodash/_createHybridWrapper.js +++ b/tools/eslint/node_modules/lodash/_createHybridWrapper.js @@ -1,7 +1,9 @@ var composeArgs = require('./_composeArgs'), composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), createCtorWrapper = require('./_createCtorWrapper'), createRecurryWrapper = require('./_createRecurryWrapper'), + getPlaceholder = require('./_getPlaceholder'), reorder = require('./_reorder'), replaceHolders = require('./_replaceHolders'), root = require('./_root'); @@ -20,11 +22,14 @@ var BIND_FLAG = 1, * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [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} [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`. @@ -35,8 +40,7 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, + isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), isFlip = bitmask & FLIP_FLAG, Ctor = isBindKey ? undefined : createCtorWrapper(func); @@ -48,30 +52,34 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials while (index--) { args[index] = arguments[index]; } + if (isCurried) { + var placeholder = getPlaceholder(wrapper), + holdersCount = countHolders(args, placeholder); + } if (partials) { - args = composeArgs(args, partials, holders); + args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); - } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; + length = args.length; if (argPos) { args = reorder(args, argPos); - } else if (isFlip && args.length > 1) { + } else if (isFlip && length > 1) { args.reverse(); } - if (isAry && ary < args.length) { + if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { diff --git a/tools/eslint/node_modules/lodash/_createMathOperation.js b/tools/eslint/node_modules/lodash/_createMathOperation.js new file mode 100644 index 00000000000000..56a4d447d0b367 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,24 @@ +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return 0; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + result = result === undefined ? other : operator(result, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/tools/eslint/node_modules/lodash/_createOver.js b/tools/eslint/node_modules/lodash/_createOver.js index 62fed02167cfcd..0d42c2716c3be2 100644 --- a/tools/eslint/node_modules/lodash/_createOver.js +++ b/tools/eslint/node_modules/lodash/_createOver.js @@ -2,6 +2,9 @@ var apply = require('./_apply'), arrayMap = require('./_arrayMap'), baseFlatten = require('./_baseFlatten'), baseIteratee = require('./_baseIteratee'), + baseUnary = require('./_baseUnary'), + isArray = require('./isArray'), + isFlattenableIteratee = require('./_isFlattenableIteratee'), rest = require('./rest'); /** @@ -13,7 +16,10 @@ var apply = require('./_apply'), */ function createOver(arrayFunc) { return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees), baseIteratee); + iteratees = (iteratees.length == 1 && isArray(iteratees[0])) + ? arrayMap(iteratees[0], baseUnary(baseIteratee)) + : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(baseIteratee)); + return rest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { diff --git a/tools/eslint/node_modules/lodash/_createPadding.js b/tools/eslint/node_modules/lodash/_createPadding.js index e59cc5212e748e..c30f6ff0725cd1 100644 --- a/tools/eslint/node_modules/lodash/_createPadding.js +++ b/tools/eslint/node_modules/lodash/_createPadding.js @@ -1,19 +1,8 @@ -var repeat = require('./repeat'), +var baseRepeat = require('./_baseRepeat'), + castSlice = require('./_castSlice'), + reHasComplexSymbol = require('./_reHasComplexSymbol'), stringSize = require('./_stringSize'), - stringToArray = require('./_stringToArray'), - toInteger = require('./toInteger'); - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + stringToArray = require('./_stringToArray'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil; @@ -23,25 +12,21 @@ var nativeCeil = Math.ceil; * 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 {number} length 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; +function createPadding(length, chars) { chars = chars === undefined ? ' ' : (chars + ''); - var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return reHasComplexSymbol.test(chars) - ? stringToArray(result).slice(0, padLength).join('') - : result.slice(0, padLength); + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); } module.exports = createPadding; diff --git a/tools/eslint/node_modules/lodash/_createPartialWrapper.js b/tools/eslint/node_modules/lodash/_createPartialWrapper.js index 1fc3a9b01eb783..cc4314ef9f5db1 100644 --- a/tools/eslint/node_modules/lodash/_createPartialWrapper.js +++ b/tools/eslint/node_modules/lodash/_createPartialWrapper.js @@ -6,15 +6,16 @@ var apply = require('./_apply'), var BIND_FLAG = 1; /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartialWrapper(func, bitmask, thisArg, partials) { diff --git a/tools/eslint/node_modules/lodash/_createRecurryWrapper.js b/tools/eslint/node_modules/lodash/_createRecurryWrapper.js index 2e3f10a89e9438..63c096ad73e341 100644 --- a/tools/eslint/node_modules/lodash/_createRecurryWrapper.js +++ b/tools/eslint/node_modules/lodash/_createRecurryWrapper.js @@ -1,5 +1,4 @@ -var copyArray = require('./_copyArray'), - isLaziable = require('./_isLaziable'), +var isLaziable = require('./_isLaziable'), setData = require('./_setData'); /** Used to compose bitmasks for wrapper metadata. */ @@ -15,11 +14,13 @@ var BIND_FLAG = 1, * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder to replace. + * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. @@ -28,8 +29,7 @@ var BIND_FLAG = 1, */ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & CURRY_FLAG, - newArgPos = argPos ? copyArray(argPos) : undefined, - newsHolders = isCurry ? holders : undefined, + newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; @@ -40,9 +40,12 @@ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, par if (!(bitmask & CURRY_BOUND_FLAG)) { bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity], - result = wrapFunc.apply(undefined, newData); + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } diff --git a/tools/eslint/node_modules/lodash/_createWrapper.js b/tools/eslint/node_modules/lodash/_createWrapper.js index f391c1a359940c..7b573b2f133f64 100644 --- a/tools/eslint/node_modules/lodash/_createWrapper.js +++ b/tools/eslint/node_modules/lodash/_createWrapper.js @@ -8,6 +8,9 @@ var baseSetData = require('./_baseSetData'), setData = require('./_setData'), toInteger = require('./toInteger'); +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, @@ -16,9 +19,6 @@ var BIND_FLAG = 1, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64; -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -67,8 +67,12 @@ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, a partials = holders = undefined; } - var data = isBindKey ? undefined : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; if (data) { mergeData(newData, data); diff --git a/tools/eslint/node_modules/lodash/_equalArrays.js b/tools/eslint/node_modules/lodash/_equalArrays.js index f789ee5887cead..323c67cc8d4335 100644 --- a/tools/eslint/node_modules/lodash/_equalArrays.js +++ b/tools/eslint/node_modules/lodash/_equalArrays.js @@ -12,9 +12,10 @@ var UNORDERED_COMPARE_FLAG = 1, * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { @@ -55,12 +56,16 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { // Recursively compare arrays (susceptible to call stack limits). if (isUnordered) { if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); })) { result = false; break; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { result = false; break; } diff --git a/tools/eslint/node_modules/lodash/_equalByTag.js b/tools/eslint/node_modules/lodash/_equalByTag.js index bc503f3f5c2cf2..b3e37bd8a5f322 100644 --- a/tools/eslint/node_modules/lodash/_equalByTag.js +++ b/tools/eslint/node_modules/lodash/_equalByTag.js @@ -1,5 +1,6 @@ var Symbol = require('./_Symbol'), Uint8Array = require('./_Uint8Array'), + equalArrays = require('./_equalArrays'), mapToArray = require('./_mapToArray'), setToArray = require('./_setToArray'); @@ -18,11 +19,12 @@ var boolTag = '[object Boolean]', stringTag = '[object String]', symbolTag = '[object Symbol]'; -var arrayBufferTag = '[object ArrayBuffer]'; +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined; + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * A specialized version of `baseIsEqualDeep` for comparing objects of @@ -36,12 +38,22 @@ var symbolProto = Symbol ? Symbol.prototype : undefined, * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ -function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { @@ -51,8 +63,9 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { 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. + // 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: @@ -64,8 +77,9 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { 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. + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. return object == (other + ''); case mapTag: @@ -75,12 +89,24 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { var isPartial = bitmask & PARTIAL_COMPARE_FLAG; convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + // Recursively compare objects (susceptible to call stack limits). - return (isPartial || object.size == other.size) && - equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); case symbolTag: - return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } } return false; } diff --git a/tools/eslint/node_modules/lodash/_equalObjects.js b/tools/eslint/node_modules/lodash/_equalObjects.js index 8e4a8547b05c57..9a5d17fac1bed0 100644 --- a/tools/eslint/node_modules/lodash/_equalObjects.js +++ b/tools/eslint/node_modules/lodash/_equalObjects.js @@ -12,9 +12,10 @@ var PARTIAL_COMPARE_FLAG = 2; * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { diff --git a/tools/eslint/node_modules/lodash/_getAllKeys.js b/tools/eslint/node_modules/lodash/_getAllKeys.js new file mode 100644 index 00000000000000..a9ce6995a6ad27 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/tools/eslint/node_modules/lodash/_getAllKeysIn.js b/tools/eslint/node_modules/lodash/_getAllKeysIn.js new file mode 100644 index 00000000000000..1b4667841db49a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/tools/eslint/node_modules/lodash/_getLength.js b/tools/eslint/node_modules/lodash/_getLength.js index 1848d490183617..54071653aadbe9 100644 --- a/tools/eslint/node_modules/lodash/_getLength.js +++ b/tools/eslint/node_modules/lodash/_getLength.js @@ -3,8 +3,9 @@ var baseProperty = require('./_baseProperty'); /** * Gets the "length" property value of `object`. * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. + * **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. diff --git a/tools/eslint/node_modules/lodash/_getNative.js b/tools/eslint/node_modules/lodash/_getNative.js index b85007aee81dac..f6ff7f19b97122 100644 --- a/tools/eslint/node_modules/lodash/_getNative.js +++ b/tools/eslint/node_modules/lodash/_getNative.js @@ -9,7 +9,7 @@ var isNative = require('./isNative'); * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { - var value = object == null ? undefined : object[key]; + var value = object[key]; return isNative(value) ? value : undefined; } diff --git a/tools/eslint/node_modules/lodash/_getPlaceholder.js b/tools/eslint/node_modules/lodash/_getPlaceholder.js new file mode 100644 index 00000000000000..4bbcda25ecb6db --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getPlaceholder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getPlaceholder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getPlaceholder; diff --git a/tools/eslint/node_modules/lodash/_getPrototype.js b/tools/eslint/node_modules/lodash/_getPrototype.js new file mode 100644 index 00000000000000..1ef6d927e31c09 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getPrototype.js @@ -0,0 +1,15 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetPrototype = Object.getPrototypeOf; + +/** + * Gets the `[[Prototype]]` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {null|Object} Returns the `[[Prototype]]`. + */ +function getPrototype(value) { + return nativeGetPrototype(Object(value)); +} + +module.exports = getPrototype; diff --git a/tools/eslint/node_modules/lodash/_getSymbols.js b/tools/eslint/node_modules/lodash/_getSymbols.js index 266906a027fe3a..63df71742d6a50 100644 --- a/tools/eslint/node_modules/lodash/_getSymbols.js +++ b/tools/eslint/node_modules/lodash/_getSymbols.js @@ -2,14 +2,23 @@ var getOwnPropertySymbols = Object.getOwnPropertySymbols; /** - * Creates an array of the own symbol properties of `object`. + * Creates an array of the own enumerable symbol properties of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ -var getSymbols = getOwnPropertySymbols || function() { - return []; -}; +function getSymbols(object) { + // Coerce `object` to an object to avoid non-object errors in V8. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. + return getOwnPropertySymbols(Object(object)); +} + +// Fallback for IE < 11. +if (!getOwnPropertySymbols) { + getSymbols = function() { + return []; + }; +} module.exports = getSymbols; diff --git a/tools/eslint/node_modules/lodash/_getSymbolsIn.js b/tools/eslint/node_modules/lodash/_getSymbolsIn.js new file mode 100644 index 00000000000000..3a3729f05b78c1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'); + +/** Built-in value references. */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbol properties + * of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/tools/eslint/node_modules/lodash/_getTag.js b/tools/eslint/node_modules/lodash/_getTag.js index 1516eca3923a1e..0d1a455c1bd33f 100644 --- a/tools/eslint/node_modules/lodash/_getTag.js +++ b/tools/eslint/node_modules/lodash/_getTag.js @@ -1,29 +1,35 @@ -var Map = require('./_Map'), +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), Set = require('./_Set'), - WeakMap = require('./_WeakMap'); + WeakMap = require('./_WeakMap'), + toSource = require('./_toSource'); /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', + promiseTag = '[object Promise]', setTag = '[object Set]', weakMapTag = '[object WeakMap]'; +var dataViewTag = '[object DataView]'; + /** Used for built-in method references. */ var objectProto = Object.prototype; -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Used to detect maps, sets, and weakmaps. */ -var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** * Gets the `toStringTag` of `value`. @@ -36,18 +42,23 @@ function getTag(value) { return objectToString.call(value); } -// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. -if ((Map && getTag(new Map) != mapTag) || +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { + case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } diff --git a/tools/eslint/node_modules/lodash/_hasPath.js b/tools/eslint/node_modules/lodash/_hasPath.js index c063592ce9a5fc..a3994297594039 100644 --- a/tools/eslint/node_modules/lodash/_hasPath.js +++ b/tools/eslint/node_modules/lodash/_hasPath.js @@ -1,12 +1,10 @@ -var baseToPath = require('./_baseToPath'), +var castPath = require('./_castPath'), isArguments = require('./isArguments'), isArray = require('./isArray'), isIndex = require('./_isIndex'), isKey = require('./_isKey'), isLength = require('./isLength'), - isString = require('./isString'), - last = require('./last'), - parent = require('./_parent'); + isString = require('./isString'); /** * Checks if `path` exists on `object`. @@ -18,23 +16,25 @@ var baseToPath = require('./_baseToPath'), * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseToPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = path[index]; + if (!(result = object != null && hasFunc(object, key))) { + break; } + object = object[key]; + } + if (result) { + return result; } - var length = object ? object.length : undefined; - return result || ( - !!length && isLength(length) && isIndex(path, length) && - (isArray(object) || isString(object) || isArguments(object)) - ); + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isString(object) || isArguments(object)); } module.exports = hasPath; diff --git a/tools/eslint/node_modules/lodash/_initCloneByTag.js b/tools/eslint/node_modules/lodash/_initCloneByTag.js index 5d21cda7f6ca25..e7b77edc696e4a 100644 --- a/tools/eslint/node_modules/lodash/_initCloneByTag.js +++ b/tools/eslint/node_modules/lodash/_initCloneByTag.js @@ -1,4 +1,5 @@ var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), cloneMap = require('./_cloneMap'), cloneRegExp = require('./_cloneRegExp'), cloneSet = require('./_cloneSet'), @@ -16,6 +17,7 @@ var boolTag = '[object Boolean]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', @@ -35,10 +37,11 @@ var arrayBufferTag = '[object ArrayBuffer]', * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ -function initCloneByTag(object, tag, isDeep) { +function initCloneByTag(object, tag, cloneFunc, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: @@ -48,13 +51,16 @@ function initCloneByTag(object, tag, isDeep) { case dateTag: return new Ctor(+object); + case dataViewTag: + return cloneDataView(object, isDeep); + case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: - return cloneMap(object); + return cloneMap(object, isDeep, cloneFunc); case numberTag: case stringTag: @@ -64,7 +70,7 @@ function initCloneByTag(object, tag, isDeep) { return cloneRegExp(object); case setTag: - return cloneSet(object); + return cloneSet(object, isDeep, cloneFunc); case symbolTag: return cloneSymbol(object); diff --git a/tools/eslint/node_modules/lodash/_initCloneObject.js b/tools/eslint/node_modules/lodash/_initCloneObject.js index b1da6cb7a747aa..5a13e64a5266d7 100644 --- a/tools/eslint/node_modules/lodash/_initCloneObject.js +++ b/tools/eslint/node_modules/lodash/_initCloneObject.js @@ -1,5 +1,5 @@ var baseCreate = require('./_baseCreate'), - isFunction = require('./isFunction'), + getPrototype = require('./_getPrototype'), isPrototype = require('./_isPrototype'); /** @@ -10,11 +10,9 @@ var baseCreate = require('./_baseCreate'), * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { - if (isPrototype(object)) { - return {}; - } - var Ctor = object.constructor; - return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; } module.exports = initCloneObject; diff --git a/tools/eslint/node_modules/lodash/_isFlattenable.js b/tools/eslint/node_modules/lodash/_isFlattenable.js new file mode 100644 index 00000000000000..847ad1fa0e046d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,16 @@ +var isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); +} + +module.exports = isFlattenable; diff --git a/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js b/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js new file mode 100644 index 00000000000000..f7ede3e22a12cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js @@ -0,0 +1,16 @@ +var isArray = require('./isArray'), + isFunction = require('./isFunction'); + +/** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); +} + +module.exports = isFlattenableIteratee; diff --git a/tools/eslint/node_modules/lodash/_isIterateeCall.js b/tools/eslint/node_modules/lodash/_isIterateeCall.js index b422b486942ea7..a0bb5a9cf60533 100644 --- a/tools/eslint/node_modules/lodash/_isIterateeCall.js +++ b/tools/eslint/node_modules/lodash/_isIterateeCall.js @@ -10,7 +10,8 @@ var eq = require('./eq'), * @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`. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { @@ -18,8 +19,9 @@ function isIterateeCall(value, index, object) { } var type = typeof index; if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { return eq(object[index], value); } return false; diff --git a/tools/eslint/node_modules/lodash/_isKey.js b/tools/eslint/node_modules/lodash/_isKey.js index 0e34576fa5e6db..a907950add8048 100644 --- a/tools/eslint/node_modules/lodash/_isKey.js +++ b/tools/eslint/node_modules/lodash/_isKey.js @@ -1,4 +1,5 @@ -var isArray = require('./isArray'); +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, @@ -13,11 +14,12 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { - if (typeof value == 'number') { + var type = typeof value; + if (type == 'number' || type == 'symbol') { return true; } return !isArray(value) && - (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object))); } diff --git a/tools/eslint/node_modules/lodash/_isKeyable.js b/tools/eslint/node_modules/lodash/_isKeyable.js index a2521b2da94299..5df83c0e97226e 100644 --- a/tools/eslint/node_modules/lodash/_isKeyable.js +++ b/tools/eslint/node_modules/lodash/_isKeyable.js @@ -8,7 +8,7 @@ function isKeyable(value) { var type = typeof value; return type == 'number' || type == 'boolean' || - (type == 'string' && value !== '__proto__') || value == null; + (type == 'string' && value != '__proto__') || value == null; } module.exports = isKeyable; diff --git a/tools/eslint/node_modules/lodash/_isLaziable.js b/tools/eslint/node_modules/lodash/_isLaziable.js index faa17b9fbd8453..a57c4f2dc72b57 100644 --- a/tools/eslint/node_modules/lodash/_isLaziable.js +++ b/tools/eslint/node_modules/lodash/_isLaziable.js @@ -8,7 +8,8 @@ var LazyWrapper = require('./_LazyWrapper'), * * @private * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), diff --git a/tools/eslint/node_modules/lodash/_lazyValue.js b/tools/eslint/node_modules/lodash/_lazyValue.js index cc6ebcff1269ef..09bf14b43a7737 100644 --- a/tools/eslint/node_modules/lodash/_lazyValue.js +++ b/tools/eslint/node_modules/lodash/_lazyValue.js @@ -36,7 +36,8 @@ function lazyValue() { resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); - if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { + if (!isArr || arrLength < LARGE_ARRAY_SIZE || + (arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; diff --git a/tools/eslint/node_modules/lodash/_mapClear.js b/tools/eslint/node_modules/lodash/_mapClear.js index c8ca3ef7c4346e..296f41794d6cfb 100644 --- a/tools/eslint/node_modules/lodash/_mapClear.js +++ b/tools/eslint/node_modules/lodash/_mapClear.js @@ -9,7 +9,11 @@ var Hash = require('./_Hash'), * @memberOf MapCache */ function mapClear() { - this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash }; + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; } module.exports = mapClear; diff --git a/tools/eslint/node_modules/lodash/_mapSet.js b/tools/eslint/node_modules/lodash/_mapSet.js index 7a587861eae6f0..23b075fc6e96e4 100644 --- a/tools/eslint/node_modules/lodash/_mapSet.js +++ b/tools/eslint/node_modules/lodash/_mapSet.js @@ -11,7 +11,7 @@ var Map = require('./_Map'), * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. + * @returns {Object} Returns the map cache instance. */ function mapSet(key, value) { var data = this.__data__; diff --git a/tools/eslint/node_modules/lodash/_matchesStrictComparable.js b/tools/eslint/node_modules/lodash/_matchesStrictComparable.js new file mode 100644 index 00000000000000..70375e0e5dcfc3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/tools/eslint/node_modules/lodash/_mergeData.js b/tools/eslint/node_modules/lodash/_mergeData.js index 3be23cefa199ac..911e6ae7ad4426 100644 --- a/tools/eslint/node_modules/lodash/_mergeData.js +++ b/tools/eslint/node_modules/lodash/_mergeData.js @@ -1,8 +1,10 @@ var composeArgs = require('./_composeArgs'), composeArgsRight = require('./_composeArgsRight'), - copyArray = require('./_copyArray'), replaceHolders = require('./_replaceHolders'); +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, @@ -11,9 +13,6 @@ var BIND_FLAG = 1, ARY_FLAG = 128, REARG_FLAG = 256; -/** Used as the internal argument placeholder. */ -var PLACEHOLDER = '__lodash_placeholder__'; - /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; @@ -22,10 +21,11 @@ var nativeMin = Math.min; * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * modify function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * combined case where curried functions have `_.ary` and or `_.rearg` applied. + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. @@ -39,9 +39,9 @@ function mergeData(data, source) { isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); var isCombo = - (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) || - (srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); + ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) || + ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { @@ -51,26 +51,26 @@ function mergeData(data, source) { if (srcBitmask & BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; + newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { - data[7] = copyArray(value); + data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & ARY_FLAG) { diff --git a/tools/eslint/node_modules/lodash/_mergeDefaults.js b/tools/eslint/node_modules/lodash/_mergeDefaults.js index b09c66b43d9d37..33375cc5bb42c6 100644 --- a/tools/eslint/node_modules/lodash/_mergeDefaults.js +++ b/tools/eslint/node_modules/lodash/_mergeDefaults.js @@ -10,13 +10,13 @@ var baseMerge = require('./_baseMerge'), * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. * @returns {*} Returns the value to assign. */ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); } return objValue; } diff --git a/tools/eslint/node_modules/lodash/_parent.js b/tools/eslint/node_modules/lodash/_parent.js index e04ff6e2a9cb09..81d94d0de08443 100644 --- a/tools/eslint/node_modules/lodash/_parent.js +++ b/tools/eslint/node_modules/lodash/_parent.js @@ -1,5 +1,5 @@ -var baseSlice = require('./_baseSlice'), - get = require('./get'); +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); /** * Gets the parent value at `path` of `object`. @@ -10,7 +10,7 @@ var baseSlice = require('./_baseSlice'), * @returns {*} Returns the parent value. */ function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); + return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); } module.exports = parent; diff --git a/tools/eslint/node_modules/lodash/_reHasComplexSymbol.js b/tools/eslint/node_modules/lodash/_reHasComplexSymbol.js new file mode 100644 index 00000000000000..be78c4bf006f3e --- /dev/null +++ b/tools/eslint/node_modules/lodash/_reHasComplexSymbol.js @@ -0,0 +1,13 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +module.exports = reHasComplexSymbol; diff --git a/tools/eslint/node_modules/lodash/_replaceHolders.js b/tools/eslint/node_modules/lodash/_replaceHolders.js index 3089e75e94d339..74360ec4d3bbf8 100644 --- a/tools/eslint/node_modules/lodash/_replaceHolders.js +++ b/tools/eslint/node_modules/lodash/_replaceHolders.js @@ -13,13 +13,14 @@ var PLACEHOLDER = '__lodash_placeholder__'; function replaceHolders(array, placeholder) { var index = -1, length = array.length, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { - if (array[index] === placeholder) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; - result[++resIndex] = index; + result[resIndex++] = index; } } return result; diff --git a/tools/eslint/node_modules/lodash/_root.js b/tools/eslint/node_modules/lodash/_root.js index b491ca4e6c7258..d2cfd311491c5d 100644 --- a/tools/eslint/node_modules/lodash/_root.js +++ b/tools/eslint/node_modules/lodash/_root.js @@ -7,10 +7,14 @@ var objectTypes = { }; /** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; /** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; +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); @@ -30,6 +34,8 @@ var thisGlobal = checkGlobal(objectTypes[typeof this] && this); * 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')(); +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); module.exports = root; diff --git a/tools/eslint/node_modules/lodash/_setData.js b/tools/eslint/node_modules/lodash/_setData.js index 8b2efca0feb93c..d86c61086e5053 100644 --- a/tools/eslint/node_modules/lodash/_setData.js +++ b/tools/eslint/node_modules/lodash/_setData.js @@ -9,8 +9,9 @@ var HOT_COUNT = 150, * 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) + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private diff --git a/tools/eslint/node_modules/lodash/_stackSet.js b/tools/eslint/node_modules/lodash/_stackSet.js index 0194d100f432de..76ca89a8df2b84 100644 --- a/tools/eslint/node_modules/lodash/_stackSet.js +++ b/tools/eslint/node_modules/lodash/_stackSet.js @@ -12,7 +12,7 @@ var LARGE_ARRAY_SIZE = 200; * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. + * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__, diff --git a/tools/eslint/node_modules/lodash/_stringSize.js b/tools/eslint/node_modules/lodash/_stringSize.js index 7aa9f4125ad362..c64c7ff4202632 100644 --- a/tools/eslint/node_modules/lodash/_stringSize.js +++ b/tools/eslint/node_modules/lodash/_stringSize.js @@ -1,3 +1,5 @@ +var reHasComplexSymbol = require('./_reHasComplexSymbol'); + /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', @@ -24,9 +26,6 @@ var reOptMod = rsModifier + '?', /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - /** * Gets the number of symbols in `string`. * diff --git a/tools/eslint/node_modules/lodash/_stringToPath.js b/tools/eslint/node_modules/lodash/_stringToPath.js index a8fd82ab71e61b..b6a1fc28aceea4 100644 --- a/tools/eslint/node_modules/lodash/_stringToPath.js +++ b/tools/eslint/node_modules/lodash/_stringToPath.js @@ -1,4 +1,5 @@ -var toString = require('./toString'); +var memoize = require('./memoize'), + toString = require('./toString'); /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; @@ -13,12 +14,12 @@ var reEscapeChar = /\\(\\)?/g; * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ -function stringToPath(string) { +var stringToPath = memoize(function(string) { var result = []; toString(string).replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; -} +}); module.exports = stringToPath; diff --git a/tools/eslint/node_modules/lodash/_toArrayLikeObject.js b/tools/eslint/node_modules/lodash/_toArrayLikeObject.js deleted file mode 100644 index be01dabc7b11bd..00000000000000 --- a/tools/eslint/node_modules/lodash/_toArrayLikeObject.js +++ /dev/null @@ -1,14 +0,0 @@ -var isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the array-like object. - */ -function toArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; -} - -module.exports = toArrayLikeObject; diff --git a/tools/eslint/node_modules/lodash/_toFunction.js b/tools/eslint/node_modules/lodash/_toFunction.js deleted file mode 100644 index 4fa85d17165f2f..00000000000000 --- a/tools/eslint/node_modules/lodash/_toFunction.js +++ /dev/null @@ -1,14 +0,0 @@ -var identity = require('./identity'); - -/** - * Converts `value` to a function if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. - */ -function toFunction(value) { - return typeof value == 'function' ? value : identity; -} - -module.exports = toFunction; diff --git a/tools/eslint/node_modules/lodash/_toKey.js b/tools/eslint/node_modules/lodash/_toKey.js new file mode 100644 index 00000000000000..b2fbc90a254af4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_toKey.js @@ -0,0 +1,14 @@ +var isSymbol = require('./isSymbol'); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(key) { + return (typeof key == 'string' || isSymbol(key)) ? key : (key + ''); +} + +module.exports = toKey; diff --git a/tools/eslint/node_modules/lodash/_toSource.js b/tools/eslint/node_modules/lodash/_toSource.js new file mode 100644 index 00000000000000..43f3ff8bf9f583 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_toSource.js @@ -0,0 +1,23 @@ +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/tools/eslint/node_modules/lodash/add.js b/tools/eslint/node_modules/lodash/add.js index d09785022c3d6f..d82c6522ae3e15 100644 --- a/tools/eslint/node_modules/lodash/add.js +++ b/tools/eslint/node_modules/lodash/add.js @@ -1,8 +1,11 @@ +var createMathOperation = require('./_createMathOperation'); + /** * Adds two numbers. * * @static * @memberOf _ + * @since 3.4.0 * @category Math * @param {number} augend The first number in an addition. * @param {number} addend The second number in an addition. @@ -12,18 +15,8 @@ * _.add(6, 4); * // => 10 */ -function add(augend, addend) { - var result; - if (augend === undefined && addend === undefined) { - return 0; - } - if (augend !== undefined) { - result = augend; - } - if (addend !== undefined) { - result = result === undefined ? addend : (result + addend); - } - return result; -} +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}); module.exports = add; diff --git a/tools/eslint/node_modules/lodash/after.js b/tools/eslint/node_modules/lodash/after.js index 41b01461423218..910923a9a61317 100644 --- a/tools/eslint/node_modules/lodash/after.js +++ b/tools/eslint/node_modules/lodash/after.js @@ -9,6 +9,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. @@ -24,7 +25,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); - * // => logs 'done saving!' after the two async saves have completed + * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { diff --git a/tools/eslint/node_modules/lodash/array.js b/tools/eslint/node_modules/lodash/array.js index 01c121671791cd..06eda2934476c1 100644 --- a/tools/eslint/node_modules/lodash/array.js +++ b/tools/eslint/node_modules/lodash/array.js @@ -14,6 +14,7 @@ module.exports = { 'findLastIndex': require('./findLastIndex'), 'flatten': require('./flatten'), 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), 'fromPairs': require('./fromPairs'), 'head': require('./head'), 'indexOf': require('./indexOf'), @@ -24,9 +25,11 @@ module.exports = { 'join': require('./join'), 'last': require('./last'), 'lastIndexOf': require('./lastIndexOf'), + 'nth': require('./nth'), 'pull': require('./pull'), 'pullAll': require('./pullAll'), 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), 'pullAt': require('./pullAt'), 'remove': require('./remove'), 'reverse': require('./reverse'), diff --git a/tools/eslint/node_modules/lodash/ary.js b/tools/eslint/node_modules/lodash/ary.js index b3906acb3c77bd..e901f1b9db0db5 100644 --- a/tools/eslint/node_modules/lodash/ary.js +++ b/tools/eslint/node_modules/lodash/ary.js @@ -4,15 +4,16 @@ var createWrapper = require('./_createWrapper'); var ARY_FLAG = 128; /** - * Creates a function that accepts up to `n` arguments, ignoring any - * additional arguments. + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new function. * @example * diff --git a/tools/eslint/node_modules/lodash/assign.js b/tools/eslint/node_modules/lodash/assign.js index d766dd0c4a5a89..281e8acf1453b9 100644 --- a/tools/eslint/node_modules/lodash/assign.js +++ b/tools/eslint/node_modules/lodash/assign.js @@ -1,17 +1,33 @@ -var copyObject = require('./_copyObject'), +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), keys = require('./keys'); +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ + * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. @@ -33,7 +49,15 @@ var copyObject = require('./_copyObject'), * // => { 'a': 1, 'c': 3, 'e': 5 } */ var assign = createAssigner(function(object, source) { - copyObject(source, keys(source), object); + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } }); module.exports = assign; diff --git a/tools/eslint/node_modules/lodash/assignIn.js b/tools/eslint/node_modules/lodash/assignIn.js index b4177e6ab9372e..f48e92558f756f 100644 --- a/tools/eslint/node_modules/lodash/assignIn.js +++ b/tools/eslint/node_modules/lodash/assignIn.js @@ -1,7 +1,19 @@ -var copyObject = require('./_copyObject'), +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), keysIn = require('./keysIn'); +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. @@ -10,6 +22,7 @@ var copyObject = require('./_copyObject'), * * @static * @memberOf _ + * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. @@ -32,7 +45,13 @@ var copyObject = require('./_copyObject'), * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } */ var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keysIn(source), object); + return; + } + for (var key in source) { + assignValue(object, key, source[key]); + } }); module.exports = assignIn; diff --git a/tools/eslint/node_modules/lodash/assignInWith.js b/tools/eslint/node_modules/lodash/assignInWith.js index da73ef7c017264..2b68c82ffbff03 100644 --- a/tools/eslint/node_modules/lodash/assignInWith.js +++ b/tools/eslint/node_modules/lodash/assignInWith.js @@ -1,17 +1,18 @@ -var copyObjectWith = require('./_copyObjectWith'), +var copyObject = require('./_copyObject'), createAssigner = require('./_createAssigner'), keysIn = require('./keysIn'); /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. @@ -30,7 +31,7 @@ var copyObjectWith = require('./_copyObjectWith'), * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); + copyObject(source, keysIn(source), object, customizer); }); module.exports = assignInWith; diff --git a/tools/eslint/node_modules/lodash/assignWith.js b/tools/eslint/node_modules/lodash/assignWith.js index eb7915b508d45a..d5c8f0070d22a9 100644 --- a/tools/eslint/node_modules/lodash/assignWith.js +++ b/tools/eslint/node_modules/lodash/assignWith.js @@ -1,17 +1,18 @@ -var copyObjectWith = require('./_copyObjectWith'), +var copyObject = require('./_copyObject'), createAssigner = require('./_createAssigner'), keys = require('./keys'); /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. @@ -29,7 +30,7 @@ var copyObjectWith = require('./_copyObjectWith'), * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keys(source), object, customizer); + copyObject(source, keys(source), object, customizer); }); module.exports = assignWith; diff --git a/tools/eslint/node_modules/lodash/at.js b/tools/eslint/node_modules/lodash/at.js index cc361883543c1c..59b197c5f2c0aa 100644 --- a/tools/eslint/node_modules/lodash/at.js +++ b/tools/eslint/node_modules/lodash/at.js @@ -7,10 +7,10 @@ var baseAt = require('./_baseAt'), * * @static * @memberOf _ + * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. + * @param {...(string|string[])} [paths] The property paths of elements to pick. * @returns {Array} Returns the new array of picked elements. * @example * @@ -23,7 +23,7 @@ var baseAt = require('./_baseAt'), * // => ['a', 'c'] */ var at = rest(function(object, paths) { - return baseAt(object, baseFlatten(paths)); + return baseAt(object, baseFlatten(paths, 1)); }); module.exports = at; diff --git a/tools/eslint/node_modules/lodash/attempt.js b/tools/eslint/node_modules/lodash/attempt.js index 322bf2fd10e6c7..e65b2e6f5ff105 100644 --- a/tools/eslint/node_modules/lodash/attempt.js +++ b/tools/eslint/node_modules/lodash/attempt.js @@ -1,5 +1,5 @@ var apply = require('./_apply'), - isObject = require('./isObject'), + isError = require('./isError'), rest = require('./rest'); /** @@ -8,8 +8,10 @@ var apply = require('./_apply'), * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * @@ -26,7 +28,7 @@ var attempt = rest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { - return isObject(e) ? e : new Error(e); + return isError(e) ? e : new Error(e); } }); diff --git a/tools/eslint/node_modules/lodash/before.js b/tools/eslint/node_modules/lodash/before.js index 47148b1fe09af4..a495adcbdc2cdd 100644 --- a/tools/eslint/node_modules/lodash/before.js +++ b/tools/eslint/node_modules/lodash/before.js @@ -10,6 +10,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. diff --git a/tools/eslint/node_modules/lodash/bind.js b/tools/eslint/node_modules/lodash/bind.js index bd89d1f03b12f0..a41b94619ca6fb 100644 --- a/tools/eslint/node_modules/lodash/bind.js +++ b/tools/eslint/node_modules/lodash/bind.js @@ -1,4 +1,5 @@ var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), replaceHolders = require('./_replaceHolders'), rest = require('./rest'); @@ -8,8 +9,7 @@ var BIND_FLAG = 1, /** * 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. + * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. @@ -19,6 +19,7 @@ var BIND_FLAG = 1, * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. @@ -44,9 +45,7 @@ var BIND_FLAG = 1, var bind = rest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { - var placeholder = bind.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(bind)); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); diff --git a/tools/eslint/node_modules/lodash/bindAll.js b/tools/eslint/node_modules/lodash/bindAll.js index d5bde424951662..55f3b216833efe 100644 --- a/tools/eslint/node_modules/lodash/bindAll.js +++ b/tools/eslint/node_modules/lodash/bindAll.js @@ -10,11 +10,11 @@ var arrayEach = require('./_arrayEach'), * **Note:** This method doesn't set the "length" property of bound functions. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} methodNames The object method names to bind, - * specified individually or in arrays. + * @param {...(string|string[])} methodNames The object method names to bind. * @returns {Object} Returns `object`. * @example * @@ -27,10 +27,10 @@ var arrayEach = require('./_arrayEach'), * * _.bindAll(view, 'onClick'); * jQuery(element).on('click', view.onClick); - * // => logs 'clicked docs' when clicked + * // => Logs 'clicked docs' when clicked. */ var bindAll = rest(function(object, methodNames) { - arrayEach(baseFlatten(methodNames), function(key) { + arrayEach(baseFlatten(methodNames, 1), function(key) { object[key] = bind(object[key], object); }); return object; diff --git a/tools/eslint/node_modules/lodash/bindKey.js b/tools/eslint/node_modules/lodash/bindKey.js index 5cefad3ed80e61..364dd698122c9b 100644 --- a/tools/eslint/node_modules/lodash/bindKey.js +++ b/tools/eslint/node_modules/lodash/bindKey.js @@ -1,4 +1,5 @@ var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), replaceHolders = require('./_replaceHolders'), rest = require('./rest'); @@ -8,12 +9,12 @@ var BIND_FLAG = 1, 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. + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * 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 @@ -21,6 +22,7 @@ var BIND_FLAG = 1, * * @static * @memberOf _ + * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. @@ -54,9 +56,7 @@ var BIND_FLAG = 1, var bindKey = rest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { - var placeholder = bindKey.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(bindKey)); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); diff --git a/tools/eslint/node_modules/lodash/camelCase.js b/tools/eslint/node_modules/lodash/camelCase.js index 00239e3c816afc..d7390def558f67 100644 --- a/tools/eslint/node_modules/lodash/camelCase.js +++ b/tools/eslint/node_modules/lodash/camelCase.js @@ -6,6 +6,7 @@ var capitalize = require('./capitalize'), * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. @@ -14,10 +15,10 @@ var capitalize = require('./capitalize'), * _.camelCase('Foo Bar'); * // => 'fooBar' * - * _.camelCase('--foo-bar'); + * _.camelCase('--foo-bar--'); * // => 'fooBar' * - * _.camelCase('__foo_bar__'); + * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { diff --git a/tools/eslint/node_modules/lodash/capitalize.js b/tools/eslint/node_modules/lodash/capitalize.js index 4daec0354c1941..3e1600e7d9e919 100644 --- a/tools/eslint/node_modules/lodash/capitalize.js +++ b/tools/eslint/node_modules/lodash/capitalize.js @@ -7,6 +7,7 @@ var toString = require('./toString'), * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. diff --git a/tools/eslint/node_modules/lodash/castArray.js b/tools/eslint/node_modules/lodash/castArray.js new file mode 100644 index 00000000000000..e470bdb9b9156a --- /dev/null +++ b/tools/eslint/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/tools/eslint/node_modules/lodash/ceil.js b/tools/eslint/node_modules/lodash/ceil.js index ecf2f12321b223..56c8722cfc7cec 100644 --- a/tools/eslint/node_modules/lodash/ceil.js +++ b/tools/eslint/node_modules/lodash/ceil.js @@ -5,6 +5,7 @@ var createRound = require('./_createRound'); * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round up. * @param {number} [precision=0] The precision to round up to. diff --git a/tools/eslint/node_modules/lodash/chain.js b/tools/eslint/node_modules/lodash/chain.js index 3300933e09bf94..f6cd6475ffdf17 100644 --- a/tools/eslint/node_modules/lodash/chain.js +++ b/tools/eslint/node_modules/lodash/chain.js @@ -1,11 +1,13 @@ var lodash = require('./wrapperLodash'); /** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. * * @static * @memberOf _ + * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. diff --git a/tools/eslint/node_modules/lodash/chunk.js b/tools/eslint/node_modules/lodash/chunk.js index b4bbc7bef16f6e..f2094743700775 100644 --- a/tools/eslint/node_modules/lodash/chunk.js +++ b/tools/eslint/node_modules/lodash/chunk.js @@ -1,4 +1,5 @@ var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), toInteger = require('./toInteger'); /* Built-in method references for those with the same name as other `lodash` methods. */ @@ -12,9 +13,11 @@ var nativeCeil = Math.ceil, * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to process. - * @param {number} [size=0] The length of each chunk. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array containing chunks. * @example * @@ -24,19 +27,22 @@ var nativeCeil = Math.ceil, * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ -function chunk(array, size) { - size = nativeMax(toInteger(size), 0); - +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } var length = array ? array.length : 0; if (!length || size < 1) { return []; } var index = 0, - resIndex = -1, + resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); + result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } diff --git a/tools/eslint/node_modules/lodash/clamp.js b/tools/eslint/node_modules/lodash/clamp.js index 9e186d8182a5d3..91a72c9782dc92 100644 --- a/tools/eslint/node_modules/lodash/clamp.js +++ b/tools/eslint/node_modules/lodash/clamp.js @@ -6,6 +6,7 @@ var baseClamp = require('./_baseClamp'), * * @static * @memberOf _ + * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. diff --git a/tools/eslint/node_modules/lodash/clone.js b/tools/eslint/node_modules/lodash/clone.js index 08e9744f2df73e..d33799250abdd1 100644 --- a/tools/eslint/node_modules/lodash/clone.js +++ b/tools/eslint/node_modules/lodash/clone.js @@ -13,6 +13,7 @@ var baseClone = require('./_baseClone'); * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. @@ -25,7 +26,7 @@ var baseClone = require('./_baseClone'); * // => true */ function clone(value) { - return baseClone(value); + return baseClone(value, false, true); } module.exports = clone; diff --git a/tools/eslint/node_modules/lodash/cloneDeep.js b/tools/eslint/node_modules/lodash/cloneDeep.js index 9fbf338b3452e1..037002eef5f7d3 100644 --- a/tools/eslint/node_modules/lodash/cloneDeep.js +++ b/tools/eslint/node_modules/lodash/cloneDeep.js @@ -5,6 +5,7 @@ var baseClone = require('./_baseClone'); * * @static * @memberOf _ + * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. @@ -17,7 +18,7 @@ var baseClone = require('./_baseClone'); * // => false */ function cloneDeep(value) { - return baseClone(value, true); + return baseClone(value, true, true); } module.exports = cloneDeep; diff --git a/tools/eslint/node_modules/lodash/cloneDeepWith.js b/tools/eslint/node_modules/lodash/cloneDeepWith.js index be5bb57296d1f6..581ab9fa83b96f 100644 --- a/tools/eslint/node_modules/lodash/cloneDeepWith.js +++ b/tools/eslint/node_modules/lodash/cloneDeepWith.js @@ -5,6 +5,7 @@ var baseClone = require('./_baseClone'); * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. @@ -27,7 +28,7 @@ var baseClone = require('./_baseClone'); * // => 20 */ function cloneDeepWith(value, customizer) { - return baseClone(value, true, customizer); + return baseClone(value, true, true, customizer); } module.exports = cloneDeepWith; diff --git a/tools/eslint/node_modules/lodash/cloneWith.js b/tools/eslint/node_modules/lodash/cloneWith.js index 1bc6035a211de8..df731c7af62661 100644 --- a/tools/eslint/node_modules/lodash/cloneWith.js +++ b/tools/eslint/node_modules/lodash/cloneWith.js @@ -2,12 +2,13 @@ var baseClone = require('./_baseClone'); /** * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` + * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. @@ -30,7 +31,7 @@ var baseClone = require('./_baseClone'); * // => 0 */ function cloneWith(value, customizer) { - return baseClone(value, false, customizer); + return baseClone(value, false, true, customizer); } module.exports = cloneWith; diff --git a/tools/eslint/node_modules/lodash/collection.js b/tools/eslint/node_modules/lodash/collection.js index 6d37b3fd12bbe3..22b0c8bce7a097 100644 --- a/tools/eslint/node_modules/lodash/collection.js +++ b/tools/eslint/node_modules/lodash/collection.js @@ -8,6 +8,8 @@ module.exports = { 'find': require('./find'), 'findLast': require('./findLast'), 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), 'forEach': require('./forEach'), 'forEachRight': require('./forEachRight'), 'groupBy': require('./groupBy'), diff --git a/tools/eslint/node_modules/lodash/commit.js b/tools/eslint/node_modules/lodash/commit.js index 1f87f505250338..fe4db71783bd99 100644 --- a/tools/eslint/node_modules/lodash/commit.js +++ b/tools/eslint/node_modules/lodash/commit.js @@ -1,10 +1,11 @@ var LodashWrapper = require('./_LodashWrapper'); /** - * Executes the chained sequence and returns the wrapped result. + * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ + * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example diff --git a/tools/eslint/node_modules/lodash/compact.js b/tools/eslint/node_modules/lodash/compact.js index 1dc1c55e8f1efb..790f31199ba101 100644 --- a/tools/eslint/node_modules/lodash/compact.js +++ b/tools/eslint/node_modules/lodash/compact.js @@ -4,6 +4,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. @@ -15,13 +16,13 @@ function compact(array) { var index = -1, length = array ? array.length : 0, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { - result[++resIndex] = value; + result[resIndex++] = value; } } return result; diff --git a/tools/eslint/node_modules/lodash/concat.js b/tools/eslint/node_modules/lodash/concat.js index a3a78df0ec7a5b..de9270b4828954 100644 --- a/tools/eslint/node_modules/lodash/concat.js +++ b/tools/eslint/node_modules/lodash/concat.js @@ -1,7 +1,7 @@ var arrayConcat = require('./_arrayConcat'), baseFlatten = require('./_baseFlatten'), - isArray = require('./isArray'), - rest = require('./rest'); + castArray = require('./castArray'), + copyArray = require('./_copyArray'); /** * Creates a new array concatenating `array` with any additional arrays @@ -9,6 +9,7 @@ var arrayConcat = require('./_arrayConcat'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. @@ -24,12 +25,18 @@ var arrayConcat = require('./_arrayConcat'), * console.log(array); * // => [1] */ -var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; +function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; + } + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; } - values = baseFlatten(values); - return arrayConcat(array, values); -}); + return arrayConcat(array, baseFlatten(args, 1)); +} module.exports = concat; diff --git a/tools/eslint/node_modules/lodash/cond.js b/tools/eslint/node_modules/lodash/cond.js index 593ac9e2e1c483..0ba36de21bdc39 100644 --- a/tools/eslint/node_modules/lodash/cond.js +++ b/tools/eslint/node_modules/lodash/cond.js @@ -7,13 +7,14 @@ var apply = require('./_apply'), var FUNC_ERROR_TEXT = 'Expected a function'; /** - * Creates a function that iterates over `pairs` invoking the corresponding + * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created * function. * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new function. @@ -35,13 +36,14 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * // => 'no match' */ function cond(pairs) { - var length = pairs ? pairs.length : 0; + var length = pairs ? pairs.length : 0, + toIteratee = baseIteratee; pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - return [baseIteratee(pair[0]), pair[1]]; + return [toIteratee(pair[0]), pair[1]]; }); return rest(function(args) { diff --git a/tools/eslint/node_modules/lodash/conforms.js b/tools/eslint/node_modules/lodash/conforms.js index 2bfeca2502fa4d..6ec590f30b7d20 100644 --- a/tools/eslint/node_modules/lodash/conforms.js +++ b/tools/eslint/node_modules/lodash/conforms.js @@ -8,6 +8,7 @@ var baseClone = require('./_baseClone'), * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/constant.js b/tools/eslint/node_modules/lodash/constant.js index 584480451a7722..59bcb420263b8d 100644 --- a/tools/eslint/node_modules/lodash/constant.js +++ b/tools/eslint/node_modules/lodash/constant.js @@ -3,6 +3,7 @@ * * @static * @memberOf _ + * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/core.js b/tools/eslint/node_modules/lodash/core.js index ee2a004e74702d..27b87a17aea109 100644 --- a/tools/eslint/node_modules/lodash/core.js +++ b/tools/eslint/node_modules/lodash/core.js @@ -1,11 +1,11 @@ /** * @license - * lodash 4.3.0 (Custom Build) + * lodash 4.11.1 (Custom Build) * Build: `lodash core -o ./dist/lodash.core.js` - * Copyright 2012-2016 The Dojo Foundation + * Copyright jQuery Foundation and other contributors + * Released under MIT license * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { @@ -13,7 +13,10 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.3.0'; + var VERSION = '4.11.1'; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -23,11 +26,9 @@ var UNORDERED_COMPARE_FLAG = 1, PARTIAL_COMPARE_FLAG = 2; - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', @@ -66,10 +67,19 @@ }; /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; /** Detect free variable `global` from Node.js. */ var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); @@ -80,9 +90,6 @@ /** Detect free variable `window`. */ var freeWindow = checkGlobal(objectTypes[typeof window] && window); - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - /** Detect `this` as the global object. */ var thisGlobal = checkGlobal(objectTypes[typeof this] && this); @@ -92,7 +99,9 @@ * 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')(); + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); /*--------------------------------------------------------------------------*/ @@ -117,13 +126,7 @@ * @returns {Array} Returns `array`. */ function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } + array.push.apply(array, values); return array; } @@ -165,7 +168,8 @@ * @param {Array|Object} collection The collection to search. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. + * @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) { @@ -187,7 +191,8 @@ * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ @@ -352,7 +357,8 @@ var idCounter = 0; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -365,6 +371,7 @@ Symbol = root.Symbol, Uint8Array = root.Uint8Array, enumerate = Reflect ? Reflect.enumerate : undefined, + objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ @@ -372,29 +379,32 @@ nativeKeys = Object.keys, nativeMax = Math.max; + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. @@ -413,51 +423,55 @@ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, - * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, - * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, - * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, - * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, - * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, - * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, - * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, - * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, - * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, - * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, - * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, - * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, - * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`, * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, - * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, - * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, - * `upperCase`, `upperFirst`, `value`, and `words` + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ * @constructor @@ -486,15 +500,9 @@ * // => true */ function lodash(value) { - if (isObjectLike(value) && !isArray(value)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); } /** @@ -502,7 +510,7 @@ * * @private * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; @@ -510,6 +518,9 @@ this.__chain__ = !!chainAll; } + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + /*------------------------------------------------------------------------*/ /** @@ -542,8 +553,7 @@ */ function assignValue(object, key, value) { var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } @@ -557,17 +567,9 @@ * @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 = undefined; - } - return result || {}; - }; - }()); + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } /** * The base implementation of `_.delay` and `_.defer` which accepts an array @@ -602,7 +604,8 @@ * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` */ function baseEvery(collection, predicate) { var result = true; @@ -636,24 +639,25 @@ * * @private * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ - function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - + function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index < length) { var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { + if (depth > 0 && predicate(value)) { + if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } @@ -665,10 +669,9 @@ } /** - * 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`. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. @@ -740,7 +743,8 @@ * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ @@ -752,44 +756,48 @@ if (!objIsArr) { objTag = objectToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } + objTag = objTag == argsTag ? objectTag : objTag; } if (!othIsArr) { othTag = objectToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } + othTag = othTag == argsTag ? objectTag : othTag; } var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); + stack || (stack = []); + var stacked = find(stack, function(entry) { + return entry[0] === object; + }); + if (stacked && stacked[1]) { + return stacked[1] == other; + } + stack.push([object, other]); + if (isSameTag && !objIsObj) { + var result = (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + stack.pop(); + return result; } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { 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, bitmask, stack); + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + stack.pop(); + return result; } } if (!isSameTag) { return false; } - stack || (stack = []); - var stacked = find(stack, function(entry) { - return entry[0] === object; - }); - if (stacked && stacked[1]) { - return stacked[1] == other; - } - stack.push([object, other]); - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); + var result = equalObjects(object, other, equalFunc, customizer, bitmask, stack); stack.pop(); return result; } @@ -802,13 +810,13 @@ * @returns {Function} Returns the iteratee. */ function baseIteratee(func) { - var type = typeof func; - if (type == 'function') { + if (typeof func == 'function') { return func; } - return func == null - ? identity - : (type == 'object' ? baseMatches : baseProperty)(func); + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); } /** @@ -816,7 +824,6 @@ * property of prototypes or treat sparse arrays as dense. * * @private - * @type Function * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ @@ -896,11 +903,11 @@ /** * The base implementation of `_.pick` without support for individual - * property names. + * property identifiers. * * @private * @param {Object} object The source object. - * @param {string[]} props The property names to pick. + * @param {string[]} props The property identifiers to pick. * @returns {Object} Returns the new object. */ function basePick(object, props) { @@ -974,7 +981,8 @@ * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ function baseSome(collection, predicate) { var result; @@ -1008,32 +1016,23 @@ * * @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`. - */ - var copyObject = copyObjectWith; - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. + * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ - function copyObjectWith(source, props, object, customizer) { + function copyObject(source, props, object, customizer) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; assignValue(object, key, newValue); } @@ -1053,7 +1052,10 @@ length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined; - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + object = Object(object); while (++index < length) { var source = sources[index]; @@ -1095,7 +1097,7 @@ } /** - * Creates a base function for methods like `_.forIn`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. @@ -1128,8 +1130,8 @@ */ function createCtorWrapper(Ctor) { return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; var thisBinding = baseCreate(Ctor.prototype), @@ -1142,15 +1144,16 @@ } /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartialWrapper(func, bitmask, thisArg, partials) { @@ -1187,9 +1190,10 @@ * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { @@ -1220,12 +1224,16 @@ // Recursively compare arrays (susceptible to call stack limits). if (isUnordered) { if (!baseSome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); })) { result = false; break; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { result = false; break; } @@ -1245,17 +1253,20 @@ * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { switch (tag) { case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + // 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: @@ -1267,8 +1278,9 @@ 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. + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. return object == (other + ''); } @@ -1283,9 +1295,10 @@ * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { @@ -1342,8 +1355,9 @@ /** * 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. + * **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. @@ -1369,41 +1383,28 @@ } /** - * Checks if `value` is likely a prototype object. + * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); } /** - * Converts `value` to a function if it's not one. + * Checks if `value` is likely a prototype object. * * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ - function toFunction(value) { - return typeof value == 'function' ? value : identity; - } + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - return result; + return value === proto; } /*------------------------------------------------------------------------*/ @@ -1414,6 +1415,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. @@ -1432,6 +1434,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. @@ -1447,48 +1450,56 @@ * console.log(array); * // => [1] */ - var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; + function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; } - values = baseFlatten(values); - return arrayConcat(array, values); - }); + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); + } /** - * Flattens `array` a single level. + * Flattens `array` a single level deep. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; + return length ? baseFlatten(array, 1) : []; } /** - * This method is like `_.flatten` except that it recursively flattens `array`. + * Recursively flattens `array`. * * @static * @memberOf _ + * @since 3.0.0 * @category Array - * @param {Array} array The array to recursively flatten. + * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; + return length ? baseFlatten(array, INFINITY) : []; } /** @@ -1496,6 +1507,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. @@ -1509,17 +1521,18 @@ * // => undefined */ function head(array) { - return array ? array[0] : undefined; + return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -1558,6 +1571,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. @@ -1574,11 +1588,13 @@ /** * Creates a slice of `array` from `start` up to, but not including, `end`. * - * **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) - * to ensure dense arrays are returned. + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. @@ -1595,11 +1611,13 @@ /*------------------------------------------------------------------------*/ /** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. * * @static * @memberOf _ + * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. @@ -1630,10 +1648,11 @@ /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain in order to modify intermediate results. + * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ + * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. @@ -1657,10 +1676,11 @@ /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain. + * results in a method chain sequence. * * @static * @memberOf _ + * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. @@ -1681,10 +1701,11 @@ } /** - * Enables explicit method chaining on the wrapper object. + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ + * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example @@ -1711,10 +1732,11 @@ } /** - * Executes the chained sequence to extract the unwrapped value. + * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ + * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. @@ -1736,19 +1758,22 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. @@ -1770,14 +1795,16 @@ /** * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @example * @@ -1807,14 +1834,16 @@ /** * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -1844,16 +1873,17 @@ } /** - * Iterates over elements of `collection` invoking `iteratee` for each element. + * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. * * @static * @memberOf _ + * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. @@ -1864,19 +1894,19 @@ * _([1, 2]).forEach(function(value) { * console.log(value); * }); - * // => logs `1` then `2` + * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { - return baseEach(collection, toFunction(iteratee)); + return baseEach(collection, baseIteratee(iteratee)); } /** - * Creates an array of values by running each element in `collection` through + * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * @@ -1884,16 +1914,18 @@ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -1922,9 +1954,9 @@ /** * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive + * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not given the first element of `collection` is used as the initial + * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -1937,6 +1969,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -1961,10 +1994,11 @@ /** * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. + * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @returns {number} Returns the collection size. @@ -1994,11 +2028,14 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); @@ -2028,36 +2065,37 @@ /** * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method + * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, + * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] * * _.sortBy(users, 'user', function(o) { * return Math.floor(o.age / 10); * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function sortBy(collection, iteratee) { var index = 0; @@ -2079,6 +2117,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. @@ -2107,8 +2146,7 @@ /** * 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. + * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. @@ -2118,6 +2156,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. @@ -2150,6 +2189,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. @@ -2159,7 +2199,7 @@ * _.defer(function(text) { * console.log(text); * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds + * // => Logs 'deferred' after one or more milliseconds. */ var defer = rest(function(func, args) { return baseDelay(func, 1, args); @@ -2171,6 +2211,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. @@ -2181,7 +2222,7 @@ * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); - * // => logs 'later' after one second + * // => Logs 'later' after one second. */ var delay = rest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); @@ -2194,6 +2235,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new function. @@ -2222,6 +2264,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. @@ -2238,12 +2281,15 @@ /** * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. + * created function and arguments from `start` and beyond provided as + * an array. * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. @@ -2284,6 +2330,47 @@ /*------------------------------------------------------------------------*/ + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + /** * Creates a shallow clone of `value`. * @@ -2297,6 +2384,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. @@ -2316,11 +2404,13 @@ } /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. @@ -2354,10 +2444,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. * @example * * _.gt(3, 1); @@ -2378,9 +2470,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArguments(function() { return arguments; }()); @@ -2400,10 +2494,12 @@ * * @static * @memberOf _ - * @type Function + * @since 0.1.0 + * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArray([1, 2, 3]); @@ -2427,7 +2523,7 @@ * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. @@ -2446,8 +2542,7 @@ * // => false */ function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); + return value != null && isLength(getLength(value)) && !isFunction(value); } /** @@ -2456,10 +2551,11 @@ * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); @@ -2483,9 +2579,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isBoolean(false); @@ -2504,9 +2602,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isDate(new Date); @@ -2520,14 +2620,20 @@ } /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang - * @param {Array|Object|string} value The value to inspect. + * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * @@ -2548,7 +2654,8 @@ */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { return !value.length; } for (var key in value) { @@ -2556,7 +2663,7 @@ return false; } } - return true; + return !(nonEnumShadows && keys(value).length); } /** @@ -2571,10 +2678,12 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. * @example * * var object = { 'user': 'fred' }; @@ -2593,13 +2702,16 @@ /** * Checks if `value` is a finite primitive number. * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. * @example * * _.isFinite(3); @@ -2623,9 +2735,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isFunction(_); @@ -2636,8 +2750,8 @@ */ 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. + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -2645,13 +2759,16 @@ /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. * @example * * _.isLength(3); @@ -2667,15 +2784,18 @@ * // => false */ function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. @@ -2704,6 +2824,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. @@ -2728,11 +2849,14 @@ /** * 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. + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. @@ -2752,7 +2876,8 @@ */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. return isNumber(value) && value != +value; } @@ -2761,6 +2886,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. @@ -2779,14 +2905,16 @@ /** * 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. + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isNumber(3); @@ -2811,9 +2939,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isRegExp(/abc/); @@ -2830,10 +2960,12 @@ * Checks if `value` is classified as a `String` primitive or object. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isString('abc'); @@ -2851,6 +2983,7 @@ * Checks if `value` is `undefined`. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. @@ -2872,10 +3005,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. * @example * * _.lt(1, 3); @@ -2895,6 +3030,7 @@ * Converts `value` to an array. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. @@ -2923,10 +3059,12 @@ /** * Converts `value` to an integer. * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. @@ -2951,6 +3089,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. @@ -2971,11 +3110,12 @@ var toNumber = Number; /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. @@ -3000,15 +3140,16 @@ /*------------------------------------------------------------------------*/ /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ + * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. @@ -3041,6 +3182,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. @@ -3067,15 +3209,16 @@ }); /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. @@ -3094,15 +3237,17 @@ * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); + copyObject(source, keysIn(source), object, customizer); }); /** - * Creates an object that inherits from the `prototype` object. If a `properties` - * object is given its own enumerable properties are assigned to the created object. + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. * * @static * @memberOf _ + * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. @@ -3135,14 +3280,15 @@ } /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. @@ -3162,6 +3308,7 @@ * Checks if `path` is a direct property of `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -3169,16 +3316,16 @@ * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * - * _.has(object, 'a.b.c'); + * _.has(object, 'a.b'); * // => true * - * _.has(object, ['a', 'b', 'c']); + * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); @@ -3196,6 +3343,7 @@ * for more details. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -3242,6 +3390,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. @@ -3281,11 +3430,11 @@ * Creates an object composed of the picked `object` properties. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. + * @param {...(string|string[])} [props] The property identifiers to pick. * @returns {Object} Returns the new object. * @example * @@ -3295,20 +3444,21 @@ * // => { 'a': 1, 'c': 3 } */ var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, baseFlatten(props)); + return object == null ? {} : basePick(object, baseFlatten(props, 1)); }); /** - * This method is like `_.get` except that if the resolved value is a function - * it's invoked with the `this` binding of its parent object and its result - * is returned. + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * @@ -3335,11 +3485,12 @@ } /** - * Creates an array of the own enumerable property values of `object`. + * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -3374,20 +3525,22 @@ * * 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) + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in IE < 9, they can break out of * attribute values or HTML comments. See [#59](https://html5sec.org/#59), * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. + * [#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. + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. * * @static + * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. @@ -3410,6 +3563,7 @@ * This method returns the first argument given to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. @@ -3427,11 +3581,13 @@ /** * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. * * @static + * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. @@ -3439,32 +3595,45 @@ * @example * * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); * }; * }); * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] */ var iteratee = baseIteratee; /** - * Creates a function that performs a deep partial comparison between a given + * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. + * property values, else `false`. The created function is equivalent to + * `_.isMatch` with a `source` partially applied. * * **Note:** This method supports comparing the same values as `_.isEqual`. * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new function. @@ -3483,21 +3652,21 @@ } /** - * Adds all own enumerable function properties of a source object to the - * destination object. If `object` is a function then methods are added to - * its prototype as well. + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. - * @param {Object} [options] The options object. - * @param {boolean} [options.chain=true] Specify whether the functions added - * are chainable. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * @@ -3529,7 +3698,7 @@ object = this; methodNames = baseFunctions(source, keys(source)); } - var chain = (isObject(options) && 'chain' in options) ? options.chain : true, + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); baseEach(methodNames, function(methodName) { @@ -3559,6 +3728,7 @@ * the `lodash` function. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @returns {Function} Returns the `lodash` function. @@ -3579,6 +3749,7 @@ * * @static * @memberOf _ + * @since 2.3.0 * @category Util * @example * @@ -3592,12 +3763,13 @@ } /** - * Generates a unique ID. If `prefix` is given the ID is appended to it. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util - * @param {string} [prefix] The value to prefix the ID with. + * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * @@ -3615,10 +3787,11 @@ /*------------------------------------------------------------------------*/ /** - * Computes the maximum value of `array`. If `array` is empty or falsey + * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. @@ -3638,10 +3811,11 @@ } /** - * Computes the minimum value of `array`. If `array` is empty or falsey + * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. @@ -3662,10 +3836,7 @@ /*------------------------------------------------------------------------*/ - LodashWrapper.prototype = baseCreate(lodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - // Add functions that return wrapped values when chaining. + // Add methods that return wrapped values in chain sequences. lodash.assignIn = assignIn; lodash.before = before; lodash.bind = bind; @@ -3697,12 +3868,12 @@ // Add aliases. lodash.extend = assignIn; - // Add functions to `lodash.prototype`. + // Add methods to `lodash.prototype`. mixin(lodash, lodash); /*------------------------------------------------------------------------*/ - // Add functions that return unwrapped values when chaining. + // Add methods that return unwrapped values in chain sequences. lodash.clone = clone; lodash.escape = escape; lodash.every = every; @@ -3759,11 +3930,11 @@ * * @static * @memberOf _ - * @type string + * @type {string} */ lodash.VERSION = VERSION; - // Add `Array` and `String` methods to `lodash.prototype`. + // Add `Array` methods to `lodash.prototype`. baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', @@ -3772,15 +3943,16 @@ lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { - return func.apply(this.value(), args); + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value) { - return func.apply(value, args); + return func.apply(isArray(value) ? value : [], args); }); }; }); - // Add chaining functions to the `lodash` wrapper. + // Add chain sequence methods to the `lodash` wrapper. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; /*--------------------------------------------------------------------------*/ diff --git a/tools/eslint/node_modules/lodash/core.min.js b/tools/eslint/node_modules/lodash/core.min.js new file mode 100644 index 00000000000000..5f6cbf43dd5c4b --- /dev/null +++ b/tools/eslint/node_modules/lodash/core.min.js @@ -0,0 +1,30 @@ +/** + * @license + * lodash 4.11.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){for(var e=-1,u=n.length;++e-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){return n instanceof l?n:new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function s(n){return Z(n)?Bn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){ +n.apply(pn,r)},t)}function v(n,t){var r=true;return Cn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return Cn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function g(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=C),o||(o=[]);++i0&&e(f)?r>1?g(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function b(n,t){return n&&Gn(n,t,on)}function _(n,t){return y(t,function(t){return X(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Z(n)&&!nn(t)?n!==n&&t!==t:d(n,t,j,r,e,u); +}function d(n,t,r,e,u,o){var i=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";i||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t),l=a==l;o||(o=[]);var s=M(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=i||isTypedArray(n)?I(n,t,r,e,u,o):$(n,t,a),o.pop(),r):2&u||(i=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!i&&!a)?l?(r=q(n,t,r,e,u,o), +o.pop(),r):false:(i=i?n.value():n,t=a?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?x:E)(n)}function O(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=W(n)?Array(n.length):[];return Cn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],pn,3)))return false}return true}}function A(n,t){ +return n=Object(n),U(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?pn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,Cn)}function V(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); +return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function H(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++et}function Q(n){return nn(n)&&W(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n)); +}function W(n){return null!=n&&Y(Jn(n))&&!X(n)}function X(n){return n=Z(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Y(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Z(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function nn(n){return!!n&&typeof n=="object"}function tn(n){return typeof n=="number"||nn(n)&&"[object Number]"==Sn.call(n)}function rn(n){return typeof n=="string"||!Vn(n)&&nn(n)&&"[object String]"==Sn.call(n)}function en(n,t){ +return t>n}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=G(n);if(!t&&!W(n))return $n(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=G(n),e=O(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={ +"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,jn=bn[typeof module]&&module&&!module.nodeType?module:pn,dn=jn&&jn.exports===_n?_n:pn,mn=o(bn[typeof self]&&self),On=o(bn[typeof window]&&window),wn=o(bn[typeof this]&&this),xn=o(_n&&jn&&typeof global=="object"&&global)||On!==(wn&&wn.window)&&On||mn||wn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=xn._,Fn=xn.Reflect,Rn=Fn?Fn.f:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=xn.isFinite,$n=Object.keys,qn=Math.max,zn=!Dn.call({ +valueOf:1},"valueOf");l.prototype=s(a.prototype),l.prototype.constructor=l;var Cn=function(n,t){return function(r,e){if(null==r)return r;if(!W(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++ot)return t?N(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return g(e,1),n(N(r),fn)},a.create=function(n,t){var r=s(n);return t?Ln(r,t):r},a.defaults=Xn,a.defer=Pn,a.delay=Un,a.filter=function(n,t){return y(n,m(t))},a.flatten=function(n){return n&&n.length?g(n,1):[]},a.flattenDeep=function(n){return n&&n.length?g(n,sn):[]},a.iteratee=Zn,a.keys=on,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){ +return x(Ln({},n))},a.mixin=ln,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return V(2,n)},a.pick=Yn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===pn,i=r===r,c=null===e,f=e===pn,a=e===e; +if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return W(n)?n.length?N(n):[]:fn(n)},a.values=fn,a.extend=Qn,ln(a,a),a.clone=function(n){return Z(n)?Vn(n)?N(n):F(n,on(n)):n},a.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,i):n},a.every=function(n,t,r){return t=r?pn:t,v(n,m(t))},a.find=M,a.forEach=P,a.has=function(n,t){return null!=n&&kn.call(n,t); +},a.head=J,a.identity=an,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); } - function flush() { - if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) { - result = func.apply(thisArg, args); + function trailingEdge(time) { + clearTimeout(timerId); + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); } - cancel(); + lastArgs = lastThis = undefined; return result; } - function maxDelayed() { - complete(trailing, timeoutId); + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastCallTime = lastInvokeTime = 0; + lastArgs = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); } function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!lastCalled && !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); + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); } } - 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 = undefined; + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); } return result; } diff --git a/tools/eslint/node_modules/lodash/deburr.js b/tools/eslint/node_modules/lodash/deburr.js index 7e75034716cb71..6862072121b676 100644 --- a/tools/eslint/node_modules/lodash/deburr.js +++ b/tools/eslint/node_modules/lodash/deburr.js @@ -18,11 +18,14 @@ var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; var reComboMark = RegExp(rsCombo, 'g'); /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * Deburrs `string` by converting + * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. diff --git a/tools/eslint/node_modules/lodash/defaults.js b/tools/eslint/node_modules/lodash/defaults.js index eded2845c53c5e..f35301abcf260d 100644 --- a/tools/eslint/node_modules/lodash/defaults.js +++ b/tools/eslint/node_modules/lodash/defaults.js @@ -4,14 +4,15 @@ var apply = require('./_apply'), rest = require('./rest'); /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. diff --git a/tools/eslint/node_modules/lodash/defaultsDeep.js b/tools/eslint/node_modules/lodash/defaultsDeep.js index c495aee4d9e6e6..c12d7293b567c4 100644 --- a/tools/eslint/node_modules/lodash/defaultsDeep.js +++ b/tools/eslint/node_modules/lodash/defaultsDeep.js @@ -11,6 +11,7 @@ var apply = require('./_apply'), * * @static * @memberOf _ + * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. diff --git a/tools/eslint/node_modules/lodash/defer.js b/tools/eslint/node_modules/lodash/defer.js index f492b3df7ae851..b096f71b5fa89a 100644 --- a/tools/eslint/node_modules/lodash/defer.js +++ b/tools/eslint/node_modules/lodash/defer.js @@ -7,6 +7,7 @@ var baseDelay = require('./_baseDelay'), * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. @@ -16,7 +17,7 @@ var baseDelay = require('./_baseDelay'), * _.defer(function(text) { * console.log(text); * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds + * // => Logs 'deferred' after one or more milliseconds. */ var defer = rest(function(func, args) { return baseDelay(func, 1, args); diff --git a/tools/eslint/node_modules/lodash/delay.js b/tools/eslint/node_modules/lodash/delay.js index 28d070c697f32b..cac90a9bce51ee 100644 --- a/tools/eslint/node_modules/lodash/delay.js +++ b/tools/eslint/node_modules/lodash/delay.js @@ -8,6 +8,7 @@ var baseDelay = require('./_baseDelay'), * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. @@ -18,7 +19,7 @@ var baseDelay = require('./_baseDelay'), * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); - * // => logs 'later' after one second + * // => Logs 'later' after one second. */ var delay = rest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); diff --git a/tools/eslint/node_modules/lodash/difference.js b/tools/eslint/node_modules/lodash/difference.js index 5036d8ef7a50b0..ae34b208bb1884 100644 --- a/tools/eslint/node_modules/lodash/difference.js +++ b/tools/eslint/node_modules/lodash/difference.js @@ -4,12 +4,14 @@ var baseDifference = require('./_baseDifference'), rest = require('./rest'); /** - * Creates an array of unique `array` values not included in the other - * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. + * Creates an array of unique `array` values not included in the other given + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. @@ -21,7 +23,7 @@ var baseDifference = require('./_baseDifference'), */ var difference = rest(function(array, values) { return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); diff --git a/tools/eslint/node_modules/lodash/differenceBy.js b/tools/eslint/node_modules/lodash/differenceBy.js index 550ccfa0f9d5ba..7ec2ae8a21c8ec 100644 --- a/tools/eslint/node_modules/lodash/differenceBy.js +++ b/tools/eslint/node_modules/lodash/differenceBy.js @@ -8,14 +8,17 @@ var baseDifference = require('./_baseDifference'), /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * @@ -32,7 +35,7 @@ var differenceBy = rest(function(array, values) { iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), baseIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee)) : []; }); diff --git a/tools/eslint/node_modules/lodash/differenceWith.js b/tools/eslint/node_modules/lodash/differenceWith.js index b60f3a06811559..6ae89865e82f3f 100644 --- a/tools/eslint/node_modules/lodash/differenceWith.js +++ b/tools/eslint/node_modules/lodash/differenceWith.js @@ -6,11 +6,13 @@ var baseDifference = require('./_baseDifference'), /** * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The comparator - * is invoked with two arguments: (arrVal, othVal). + * which is invoked to compare elements of `array` to `values`. Result values + * are chosen from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. @@ -29,7 +31,7 @@ var differenceWith = rest(function(array, values) { comparator = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), undefined, comparator) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); diff --git a/tools/eslint/node_modules/lodash/divide.js b/tools/eslint/node_modules/lodash/divide.js new file mode 100644 index 00000000000000..2889d79928ede4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}); + +module.exports = divide; diff --git a/tools/eslint/node_modules/lodash/drop.js b/tools/eslint/node_modules/lodash/drop.js index 3094995c945f58..6124ef76933fa0 100644 --- a/tools/eslint/node_modules/lodash/drop.js +++ b/tools/eslint/node_modules/lodash/drop.js @@ -6,10 +6,11 @@ var baseSlice = require('./_baseSlice'), * * @static * @memberOf _ + * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/dropRight.js b/tools/eslint/node_modules/lodash/dropRight.js index 61e12682bc4934..8aa3576e3fb4d0 100644 --- a/tools/eslint/node_modules/lodash/dropRight.js +++ b/tools/eslint/node_modules/lodash/dropRight.js @@ -6,10 +6,11 @@ var baseSlice = require('./_baseSlice'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/dropRightWhile.js b/tools/eslint/node_modules/lodash/dropRightWhile.js index 0c04ed25af50c0..98f457b8112a62 100644 --- a/tools/eslint/node_modules/lodash/dropRightWhile.js +++ b/tools/eslint/node_modules/lodash/dropRightWhile.js @@ -8,9 +8,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/dropWhile.js b/tools/eslint/node_modules/lodash/dropWhile.js index 72f94484cee278..94f76e01924549 100644 --- a/tools/eslint/node_modules/lodash/dropWhile.js +++ b/tools/eslint/node_modules/lodash/dropWhile.js @@ -8,9 +8,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/endsWith.js b/tools/eslint/node_modules/lodash/endsWith.js index 5da6b5e3072a57..204d61e9d4baee 100644 --- a/tools/eslint/node_modules/lodash/endsWith.js +++ b/tools/eslint/node_modules/lodash/endsWith.js @@ -7,11 +7,13 @@ var baseClamp = require('./_baseClamp'), * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. * @example * * _.endsWith('abc', 'c'); diff --git a/tools/eslint/node_modules/lodash/entries.js b/tools/eslint/node_modules/lodash/entries.js new file mode 100644 index 00000000000000..7a88df2044638c --- /dev/null +++ b/tools/eslint/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/tools/eslint/node_modules/lodash/entriesIn.js b/tools/eslint/node_modules/lodash/entriesIn.js new file mode 100644 index 00000000000000..f6c6331c1de93f --- /dev/null +++ b/tools/eslint/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/tools/eslint/node_modules/lodash/eq.js b/tools/eslint/node_modules/lodash/eq.js index 5df222d844d26f..e9445d4fa32237 100644 --- a/tools/eslint/node_modules/lodash/eq.js +++ b/tools/eslint/node_modules/lodash/eq.js @@ -1,9 +1,11 @@ /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. diff --git a/tools/eslint/node_modules/lodash/escape.js b/tools/eslint/node_modules/lodash/escape.js index 62857ed2e5916f..176417c4c1e930 100644 --- a/tools/eslint/node_modules/lodash/escape.js +++ b/tools/eslint/node_modules/lodash/escape.js @@ -14,20 +14,22 @@ var reUnescapedHtml = /[&<>"'`]/g, * * 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) + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in IE < 9, they can break out of * attribute values or HTML comments. See [#59](https://html5sec.org/#59), * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. + * [#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. + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. * * @static + * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. diff --git a/tools/eslint/node_modules/lodash/escapeRegExp.js b/tools/eslint/node_modules/lodash/escapeRegExp.js index 52878c1d84738e..fe5196046bf19f 100644 --- a/tools/eslint/node_modules/lodash/escapeRegExp.js +++ b/tools/eslint/node_modules/lodash/escapeRegExp.js @@ -1,6 +1,9 @@ var toString = require('./toString'); -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); @@ -10,6 +13,7 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. diff --git a/tools/eslint/node_modules/lodash/every.js b/tools/eslint/node_modules/lodash/every.js index d100d0dbe670a8..14f68e744ff0a8 100644 --- a/tools/eslint/node_modules/lodash/every.js +++ b/tools/eslint/node_modules/lodash/every.js @@ -11,19 +11,22 @@ var arrayEvery = require('./_arrayEvery'), * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. diff --git a/tools/eslint/node_modules/lodash/fill.js b/tools/eslint/node_modules/lodash/fill.js index 4c0119fed30f94..5730b7d1296df4 100644 --- a/tools/eslint/node_modules/lodash/fill.js +++ b/tools/eslint/node_modules/lodash/fill.js @@ -9,6 +9,7 @@ var baseFill = require('./_baseFill'), * * @static * @memberOf _ + * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. diff --git a/tools/eslint/node_modules/lodash/filter.js b/tools/eslint/node_modules/lodash/filter.js index 1df81c4cc7a295..f6a71a58f484fa 100644 --- a/tools/eslint/node_modules/lodash/filter.js +++ b/tools/eslint/node_modules/lodash/filter.js @@ -5,14 +5,16 @@ var arrayFilter = require('./_arrayFilter'), /** * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @example * diff --git a/tools/eslint/node_modules/lodash/find.js b/tools/eslint/node_modules/lodash/find.js index c2ba356a0e97c4..83f0dbad0d9f11 100644 --- a/tools/eslint/node_modules/lodash/find.js +++ b/tools/eslint/node_modules/lodash/find.js @@ -6,14 +6,16 @@ var baseEach = require('./_baseEach'), /** * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {*} Returns the matched element, else `undefined`. * @example * diff --git a/tools/eslint/node_modules/lodash/findIndex.js b/tools/eslint/node_modules/lodash/findIndex.js index 5343fd124d38c9..84acc7464282ea 100644 --- a/tools/eslint/node_modules/lodash/findIndex.js +++ b/tools/eslint/node_modules/lodash/findIndex.js @@ -7,9 +7,11 @@ var baseFindIndex = require('./_baseFindIndex'), * * @static * @memberOf _ + * @since 1.1.0 * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {number} Returns the index of the found element, else `-1`. * @example * diff --git a/tools/eslint/node_modules/lodash/findKey.js b/tools/eslint/node_modules/lodash/findKey.js index 95d01f392507de..16a9fd9ae8ef54 100644 --- a/tools/eslint/node_modules/lodash/findKey.js +++ b/tools/eslint/node_modules/lodash/findKey.js @@ -8,10 +8,13 @@ var baseFind = require('./_baseFind'), * * @static * @memberOf _ + * @since 1.1.0 * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * * var users = { diff --git a/tools/eslint/node_modules/lodash/findLast.js b/tools/eslint/node_modules/lodash/findLast.js index 0e5d5932badf58..d222a5588fab46 100644 --- a/tools/eslint/node_modules/lodash/findLast.js +++ b/tools/eslint/node_modules/lodash/findLast.js @@ -10,9 +10,11 @@ var baseEachRight = require('./_baseEachRight'), * * @static * @memberOf _ + * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {*} Returns the matched element, else `undefined`. * @example * diff --git a/tools/eslint/node_modules/lodash/findLastIndex.js b/tools/eslint/node_modules/lodash/findLastIndex.js index 2e62b367687b95..bf397d8fff559c 100644 --- a/tools/eslint/node_modules/lodash/findLastIndex.js +++ b/tools/eslint/node_modules/lodash/findLastIndex.js @@ -7,9 +7,11 @@ var baseFindIndex = require('./_baseFindIndex'), * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {number} Returns the index of the found element, else `-1`. * @example * diff --git a/tools/eslint/node_modules/lodash/findLastKey.js b/tools/eslint/node_modules/lodash/findLastKey.js index 0380b07ce4cd00..fb915df4644b03 100644 --- a/tools/eslint/node_modules/lodash/findLastKey.js +++ b/tools/eslint/node_modules/lodash/findLastKey.js @@ -8,10 +8,13 @@ var baseFind = require('./_baseFind'), * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * * var users = { diff --git a/tools/eslint/node_modules/lodash/flatMap.js b/tools/eslint/node_modules/lodash/flatMap.js index 1aaf28c4bc793e..f8307495f8cde3 100644 --- a/tools/eslint/node_modules/lodash/flatMap.js +++ b/tools/eslint/node_modules/lodash/flatMap.js @@ -2,15 +2,17 @@ var baseFlatten = require('./_baseFlatten'), map = require('./map'); /** - * Creates an array of flattened values by running each element in `collection` - * through `iteratee` and concating its result to the other mapped values. - * The iteratee is invoked with three arguments: (value, index|key, collection). + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * @@ -22,7 +24,7 @@ var baseFlatten = require('./_baseFlatten'), * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee)); + return baseFlatten(map(collection, iteratee), 1); } module.exports = flatMap; diff --git a/tools/eslint/node_modules/lodash/flatMapDeep.js b/tools/eslint/node_modules/lodash/flatMapDeep.js new file mode 100644 index 00000000000000..3808262aab0f80 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,32 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/tools/eslint/node_modules/lodash/flatMapDepth.js b/tools/eslint/node_modules/lodash/flatMapDepth.js new file mode 100644 index 00000000000000..d528bff265c493 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,32 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/tools/eslint/node_modules/lodash/flatten.js b/tools/eslint/node_modules/lodash/flatten.js index 6a6b8cf7c69698..bd4f439789ac2a 100644 --- a/tools/eslint/node_modules/lodash/flatten.js +++ b/tools/eslint/node_modules/lodash/flatten.js @@ -1,21 +1,22 @@ var baseFlatten = require('./_baseFlatten'); /** - * Flattens `array` a single level. + * Flattens `array` a single level deep. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; + return length ? baseFlatten(array, 1) : []; } module.exports = flatten; diff --git a/tools/eslint/node_modules/lodash/flattenDeep.js b/tools/eslint/node_modules/lodash/flattenDeep.js index 3daab79e14009e..c20c781a84b6a5 100644 --- a/tools/eslint/node_modules/lodash/flattenDeep.js +++ b/tools/eslint/node_modules/lodash/flattenDeep.js @@ -1,21 +1,25 @@ var baseFlatten = require('./_baseFlatten'); +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + /** - * This method is like `_.flatten` except that it recursively flattens `array`. + * Recursively flattens `array`. * * @static * @memberOf _ + * @since 3.0.0 * @category Array - * @param {Array} array The array to recursively flatten. + * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; + return length ? baseFlatten(array, INFINITY) : []; } module.exports = flattenDeep; diff --git a/tools/eslint/node_modules/lodash/flattenDepth.js b/tools/eslint/node_modules/lodash/flattenDepth.js new file mode 100644 index 00000000000000..a0f4b5259a556d --- /dev/null +++ b/tools/eslint/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/tools/eslint/node_modules/lodash/flip.js b/tools/eslint/node_modules/lodash/flip.js index 6e14896fa8395e..82f796c240aed9 100644 --- a/tools/eslint/node_modules/lodash/flip.js +++ b/tools/eslint/node_modules/lodash/flip.js @@ -8,6 +8,7 @@ var FLIP_FLAG = 512; * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/floor.js b/tools/eslint/node_modules/lodash/floor.js index 9bbf097b43e69d..ab6dfa28a4c591 100644 --- a/tools/eslint/node_modules/lodash/floor.js +++ b/tools/eslint/node_modules/lodash/floor.js @@ -5,6 +5,7 @@ var createRound = require('./_createRound'); * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round down. * @param {number} [precision=0] The precision to round down to. diff --git a/tools/eslint/node_modules/lodash/flow.js b/tools/eslint/node_modules/lodash/flow.js index b773405f6a9b6b..004cda01a495c8 100644 --- a/tools/eslint/node_modules/lodash/flow.js +++ b/tools/eslint/node_modules/lodash/flow.js @@ -7,6 +7,7 @@ var createFlow = require('./_createFlow'); * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/flowRight.js b/tools/eslint/node_modules/lodash/flowRight.js index e844822bdac2cc..f543f252f1a908 100644 --- a/tools/eslint/node_modules/lodash/flowRight.js +++ b/tools/eslint/node_modules/lodash/flowRight.js @@ -5,6 +5,7 @@ var createFlow = require('./_createFlow'); * invokes the given functions from right to left. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. diff --git a/tools/eslint/node_modules/lodash/forEach.js b/tools/eslint/node_modules/lodash/forEach.js index e7bde6dee8b915..0c598f65086cab 100644 --- a/tools/eslint/node_modules/lodash/forEach.js +++ b/tools/eslint/node_modules/lodash/forEach.js @@ -1,19 +1,20 @@ var arrayEach = require('./_arrayEach'), baseEach = require('./_baseEach'), - isArray = require('./isArray'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); /** - * Iterates over elements of `collection` invoking `iteratee` for each element. + * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. * * @static * @memberOf _ + * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. @@ -24,17 +25,17 @@ var arrayEach = require('./_arrayEach'), * _([1, 2]).forEach(function(value) { * console.log(value); * }); - * // => logs `1` then `2` + * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { return (typeof iteratee == 'function' && isArray(collection)) ? arrayEach(collection, iteratee) - : baseEach(collection, toFunction(iteratee)); + : baseEach(collection, baseIteratee(iteratee)); } module.exports = forEach; diff --git a/tools/eslint/node_modules/lodash/forEachRight.js b/tools/eslint/node_modules/lodash/forEachRight.js index 68f2e2f2c5cc6e..17a7137cbd1256 100644 --- a/tools/eslint/node_modules/lodash/forEachRight.js +++ b/tools/eslint/node_modules/lodash/forEachRight.js @@ -1,7 +1,7 @@ var arrayEachRight = require('./_arrayEachRight'), baseEachRight = require('./_baseEachRight'), - isArray = require('./isArray'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); /** * This method is like `_.forEach` except that it iterates over elements of @@ -9,6 +9,7 @@ var arrayEachRight = require('./_arrayEachRight'), * * @static * @memberOf _ + * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. @@ -19,12 +20,12 @@ var arrayEachRight = require('./_arrayEachRight'), * _.forEachRight([1, 2], function(value) { * console.log(value); * }); - * // => logs `2` then `1` + * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { return (typeof iteratee == 'function' && isArray(collection)) ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, toFunction(iteratee)); + : baseEachRight(collection, baseIteratee(iteratee)); } module.exports = forEachRight; diff --git a/tools/eslint/node_modules/lodash/forIn.js b/tools/eslint/node_modules/lodash/forIn.js index d68dd3ada05bfe..74a9615065f5f9 100644 --- a/tools/eslint/node_modules/lodash/forIn.js +++ b/tools/eslint/node_modules/lodash/forIn.js @@ -1,15 +1,16 @@ var baseFor = require('./_baseFor'), - keysIn = require('./keysIn'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'), + keysIn = require('./keysIn'); /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by explicitly - * returning `false`. + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. * * @static * @memberOf _ + * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -26,10 +27,12 @@ var baseFor = require('./_baseFor'), * _.forIn(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed) + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { - return object == null ? object : baseFor(object, toFunction(iteratee), keysIn); + return object == null + ? object + : baseFor(object, baseIteratee(iteratee), keysIn); } module.exports = forIn; diff --git a/tools/eslint/node_modules/lodash/forInRight.js b/tools/eslint/node_modules/lodash/forInRight.js index 9dedc259de2753..00b73a7c1a9440 100644 --- a/tools/eslint/node_modules/lodash/forInRight.js +++ b/tools/eslint/node_modules/lodash/forInRight.js @@ -1,6 +1,6 @@ var baseForRight = require('./_baseForRight'), - keysIn = require('./keysIn'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'), + keysIn = require('./keysIn'); /** * This method is like `_.forIn` except that it iterates over properties of @@ -8,6 +8,7 @@ var baseForRight = require('./_baseForRight'), * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -24,10 +25,12 @@ var baseForRight = require('./_baseForRight'), * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c' + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { - return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn); + return object == null + ? object + : baseForRight(object, baseIteratee(iteratee), keysIn); } module.exports = forInRight; diff --git a/tools/eslint/node_modules/lodash/forOwn.js b/tools/eslint/node_modules/lodash/forOwn.js index ee066cc7c8416b..126d43f0d3f970 100644 --- a/tools/eslint/node_modules/lodash/forOwn.js +++ b/tools/eslint/node_modules/lodash/forOwn.js @@ -1,14 +1,15 @@ var baseForOwn = require('./_baseForOwn'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'); /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by - * explicitly returning `false`. + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. * * @static * @memberOf _ + * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -25,10 +26,10 @@ var baseForOwn = require('./_baseForOwn'), * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { - return object && baseForOwn(object, toFunction(iteratee)); + return object && baseForOwn(object, baseIteratee(iteratee)); } module.exports = forOwn; diff --git a/tools/eslint/node_modules/lodash/forOwnRight.js b/tools/eslint/node_modules/lodash/forOwnRight.js index 1016195b97b123..5605475f48465b 100644 --- a/tools/eslint/node_modules/lodash/forOwnRight.js +++ b/tools/eslint/node_modules/lodash/forOwnRight.js @@ -1,5 +1,5 @@ var baseForOwnRight = require('./_baseForOwnRight'), - toFunction = require('./_toFunction'); + baseIteratee = require('./_baseIteratee'); /** * This method is like `_.forOwn` except that it iterates over properties of @@ -7,6 +7,7 @@ var baseForOwnRight = require('./_baseForOwnRight'), * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -23,10 +24,10 @@ var baseForOwnRight = require('./_baseForOwnRight'), * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b' + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, toFunction(iteratee)); + return object && baseForOwnRight(object, baseIteratee(iteratee)); } module.exports = forOwnRight; diff --git a/tools/eslint/node_modules/lodash/fp.js b/tools/eslint/node_modules/lodash/fp.js index d8887e0fe778ae..e372dbbdf6d539 100644 --- a/tools/eslint/node_modules/lodash/fp.js +++ b/tools/eslint/node_modules/lodash/fp.js @@ -1,2 +1,2 @@ -var _ = require('./lodash').noConflict().runInContext(); -module.exports = require('./fp/convert')(_); +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/tools/eslint/node_modules/lodash/fp/__.js b/tools/eslint/node_modules/lodash/fp/__.js new file mode 100644 index 00000000000000..4af98deb4e9cca --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/tools/eslint/node_modules/lodash/fp/_baseConvert.js b/tools/eslint/node_modules/lodash/fp/_baseConvert.js index 76cc02ce86388b..e7e631ce4bbb01 100644 --- a/tools/eslint/node_modules/lodash/fp/_baseConvert.js +++ b/tools/eslint/node_modules/lodash/fp/_baseConvert.js @@ -1,14 +1,99 @@ var mapping = require('./_mapping'), mutateMap = mapping.mutate, - placeholder = {}; + fallbackHolder = require('./placeholder'); + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function immutWrap(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return result; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} /** * The base implementation of `convert` which accepts a `util` object of methods * required to perform conversions. * * @param {Object} util The util object. - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. * @param {Object} [options] The options object. * @param {boolean} [options.cap=true] Specify capping iteratee arguments. * @param {boolean} [options.curry=true] Specify currying. @@ -18,15 +103,20 @@ var mapping = require('./_mapping'), * @returns {Function|Object} Returns the converted function or object. */ function baseConvert(util, name, func, options) { - options || (options = {}); + var setPlaceholder, + isLib = typeof name == 'function', + isObj = name === Object(name); - if (typeof func != 'function') { + if (isObj) { + options = func; func = name; name = undefined; } if (func == null) { throw new TypeError; } + options || (options = {}); + var config = { 'cap': 'cap' in options ? options.cap : true, 'curry': 'curry' in options ? options.curry : true, @@ -35,103 +125,62 @@ function baseConvert(util, name, func, options) { 'rearg': 'rearg' in options ? options.rearg : true }; - var forceRearg = ('rearg' in options) && options.rearg; + var forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + placeholder = isLib ? func : fallbackHolder, + pristine = isLib ? func.runInContext() : undefined; - var isLib = name === undefined && typeof func.VERSION == 'string'; - - var _ = isLib ? func : { + var helpers = isLib ? func : { 'ary': util.ary, - 'cloneDeep': util.cloneDeep, + 'assign': util.assign, + 'clone': util.clone, 'curry': util.curry, 'forEach': util.forEach, + 'isArray': util.isArray, 'isFunction': util.isFunction, 'iteratee': util.iteratee, 'keys': util.keys, 'rearg': util.rearg, - 'spread': util.spread - }; - - var ary = _.ary, - cloneDeep = _.cloneDeep, - curry = _.curry, - each = _.forEach, - isFunction = _.isFunction, - keys = _.keys, - rearg = _.rearg, - spread = _.spread; - - var baseArity = function(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; - }; - - var baseAry = function(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; - }; - - var cloneArray = function(array) { - var length = array ? array.length : 0, - result = Array(length); - - while (length--) { - result[length] = array[length]; - } - return result; - }; - - var createCloner = function(func) { - return function(object) { - return func({}, object); - }; - }; - - var immutWrap = function(func, cloner) { - return overArg(func, cloner, true); - }; - - var iterateeAry = function(func, n) { - return overArg(func, function(func) { - return baseAry(func, n); - }); - }; - - var iterateeRearg = function(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); + 'spread': util.spread, + 'toPath': util.toPath }; - var overArg = function(func, iteratee, retArg) { - return function() { - var length = arguments.length, - args = Array(length); + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isFunction = helpers.isFunction, + keys = helpers.keys, + rearg = helpers.rearg, + spread = helpers.spread, + toPath = helpers.toPath; - while (length--) { - args[length] = arguments[length]; - } - args[0] = iteratee(args[0]); - var result = func.apply(undefined, args); - return retArg ? args[0] : result; - }; - }; + var aryMethodKeys = keys(mapping.aryMethod); var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, 'iteratee': function(iteratee) { return function() { var func = arguments[0], - arity = arguments[1]; + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; - if (!config.cap) { - return iteratee(func, arity); + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); } - arity = arity > 2 ? (arity - 2) : 1; - func = iteratee(func); - var length = func.length; - return (length && length <= arity) ? func : baseAry(func, arity); + return result; }; }, 'mixin': function(mixin) { @@ -166,19 +215,148 @@ function baseConvert(util, name, func, options) { }, 'runInContext': function(runInContext) { return function(context) { - return baseConvert(util, runInContext(context), undefined, options); + return baseConvert(util, runInContext(context), options); }; } }; - var wrap = function(name, func) { + /*--------------------------------------------------------------------------*/ + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null) { + nested[key] = clone(Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var oldOptions = options; + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[name] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, name, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument passed + * thru `transform`. + * + * @private + * @param {Function} func The function to wrap. + * @param {...Function} transform The functions to transform the first argument. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func) { name = mapping.aliasToReal[name] || name; - var wrapper = wrappers[name]; + + var result, + wrapped = func, + wrapper = wrappers[name]; + if (wrapper) { - return wrapper(func); + wrapped = wrapper(func); } - var wrapped = func; - if (config.immutable) { + else if (config.immutable) { if (mutateMap.array[name]) { wrapped = immutWrap(func, cloneArray); } @@ -186,24 +364,24 @@ function baseConvert(util, name, func, options) { wrapped = immutWrap(func, createCloner(func)); } else if (mutateMap.set[name]) { - wrapped = immutWrap(func, cloneDeep); + wrapped = immutWrap(func, cloneByPath); } } - var result; - each(mapping.caps, function(cap) { - each(mapping.aryMethod[cap], function(otherName) { + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { if (name == otherName) { var aryN = !isLib && mapping.iterateeAry[name], reargIndexes = mapping.iterateeRearg[name], spreadStart = mapping.methodSpread[name]; - if (config.fixed) { + result = wrapped; + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { result = spreadStart === undefined - ? ary(wrapped, cap) - : spread(wrapped, spreadStart); + ? ary(result, aryKey) + : spread(result, spreadStart); } - if (config.rearg && cap > 1 && (forceRearg || !mapping.skipRearg[name])) { - result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); + if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) { + result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]); } if (config.cap) { if (reargIndexes) { @@ -212,8 +390,9 @@ function baseConvert(util, name, func, options) { result = iterateeAry(result, aryN); } } - if (config.curry && cap > 1) { - result = curry(result, cap); + if (forceCurry || (config.curry && aryKey > 1)) { + forceCurry && console.log(forceCurry, name); + result = curry(result, aryKey); } return false; } @@ -221,36 +400,63 @@ function baseConvert(util, name, func, options) { return !result; }); - result || (result = func); + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(name, func); if (mapping.placeholder[name]) { - func.placeholder = result.placeholder = placeholder; + setPlaceholder = true; + result.placeholder = func.placeholder = placeholder; } return result; - }; + } - if (!isLib) { + /*--------------------------------------------------------------------------*/ + + if (!isObj) { return wrap(name, func); } - // Add placeholder. - _.placeholder = placeholder; + var _ = func; - // Iterate over methods for the current ary cap. + // Convert methods by ary cap. var pairs = []; - each(mapping.caps, function(cap) { - each(mapping.aryMethod[cap], function(key) { - var func = _[mapping.rename[key] || key]; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; if (func) { pairs.push([key, wrap(key, func)]); } }); }); + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. each(pairs, function(pair) { _[pair[0]] = pair[1]; }); - // Wrap the lodash method and its aliases. + _.convert = convertLib; + if (setPlaceholder) { + _.placeholder = placeholder; + } + // Assign aliases. each(keys(_), function(key) { each(mapping.realToAlias[key] || [], function(alias) { _[alias] = _[key]; diff --git a/tools/eslint/node_modules/lodash/fp/_convertBrowser.js b/tools/eslint/node_modules/lodash/fp/_convertBrowser.js index 0e69e66cda6c94..1874a5423cccb5 100644 --- a/tools/eslint/node_modules/lodash/fp/_convertBrowser.js +++ b/tools/eslint/node_modules/lodash/fp/_convertBrowser.js @@ -1,14 +1,18 @@ var baseConvert = require('./_baseConvert'); /** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last version. + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. * - * @param {Function} lodash The lodash function. + * @param {Function} lodash The lodash function to convert. * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function} Returns the converted `lodash`. */ function browserConvert(lodash, options) { - return baseConvert(lodash, lodash, undefined, options); + return baseConvert(lodash, lodash, options); } +if (typeof _ == 'function') { + _ = browserConvert(_.runInContext()); +} module.exports = browserConvert; diff --git a/tools/eslint/node_modules/lodash/fp/_falseOptions.js b/tools/eslint/node_modules/lodash/fp/_falseOptions.js new file mode 100644 index 00000000000000..773235e3437296 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/tools/eslint/node_modules/lodash/fp/_mapping.js b/tools/eslint/node_modules/lodash/fp/_mapping.js index 75f0babaa65b9a..18a3196d30dc7a 100644 --- a/tools/eslint/node_modules/lodash/fp/_mapping.js +++ b/tools/eslint/node_modules/lodash/fp/_mapping.js @@ -1,34 +1,48 @@ /** Used to map aliases to their real names. */ exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Ramda aliases. '__': 'placeholder', - 'all': 'some', + 'all': 'every', 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', 'apply': 'spread', 'assoc': 'set', 'assocPath': 'set', + 'complement': 'negate', 'compose': 'flowRight', 'contains': 'includes', 'dissoc': 'unset', 'dissocPath': 'unset', - 'each': 'forEach', - 'eachRight': 'forEachRight', 'equals': 'isEqual', - 'extend': 'assignIn', - 'extendWith': 'assignInWith', - 'first': 'head', + 'identical': 'eq', 'init': 'initial', - 'mapObj': 'mapValues', + 'invertObj': 'invert', + 'juxt': 'over', 'omitAll': 'omit', 'nAry': 'ary', 'path': 'get', 'pathEq': 'matchesProperty', 'pathOr': 'getOr', + 'paths': 'at', 'pickAll': 'pick', 'pipe': 'flow', + 'pluck': 'map', 'prop': 'get', - 'propOf': 'propertyOf', + 'propEq': 'matchesProperty', 'propOr': 'getOr', - 'somePass': 'overSome', + 'props': 'at', 'unapply': 'rest', 'unnest': 'flatten', 'useWith': 'overArgs', @@ -38,61 +52,59 @@ exports.aliasToReal = { /** Used to map ary to method names. */ exports.aryMethod = { - 1: [ - 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', - 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', - 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', - 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' - ], - 2: [ - 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey', - 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', - 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', - 'findLastKey', 'flatMap', 'forEach', 'forEachRight', 'forIn', 'forInRight', - 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', - 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', - 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', - 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit', - 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', - 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', - 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', - 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', - 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep' - ], - 3: [ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', - 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', - 'unionWith', 'xorBy', 'xorWith', 'zipWith' - ], - 4: [ - 'fill', 'setWith' - ] + '1': [ + 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', + 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', + 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', + 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', + 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', + 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', + 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', + 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', + 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', + 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', + 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth', + 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', + 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', + 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith', + 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', + 'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice', + 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', + 'update', 'xorBy', 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] }; /** Used to map ary to rearg configs. */ exports.aryRearg = { - 2: [1, 0], - 3: [2, 1, 0], - 4: [3, 2, 0, 1] + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] }; -/** Used to iterate `mapping.aryMethod` keys. */ -exports.caps = [1, 2, 3, 4]; - /** Used to map method names to their iteratee ary. */ exports.iterateeAry = { - 'assignWith': 2, - 'assignInWith': 2, - 'cloneDeepWith': 1, - 'cloneWith': 1, 'dropRightWhile': 1, 'dropWhile': 1, 'every': 1, @@ -104,14 +116,14 @@ exports.iterateeAry = { 'findLastIndex': 1, 'findLastKey': 1, 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, 'forEach': 1, 'forEachRight': 1, 'forIn': 1, 'forInRight': 1, 'forOwn': 1, 'forOwnRight': 1, - 'isEqualWith': 2, - 'isMatchWith': 2, 'map': 1, 'mapKeys': 1, 'mapValues': 1, @@ -129,8 +141,6 @@ exports.iterateeAry = { /** Used to map method names to iteratee rearg configs. */ exports.iterateeRearg = { - 'findKey': [1], - 'findLastKey': [1], 'mapKeys': [1] }; @@ -138,20 +148,29 @@ exports.iterateeRearg = { exports.methodRearg = { 'assignInWith': [1, 2, 0], 'assignWith': [1, 2, 0], - 'clamp': [2, 0, 1], + 'getOr': [2, 1, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], 'mergeWith': [1, 2, 0], - 'reduce': [2, 0, 1], - 'reduceRight': [2, 0, 1], - 'set': [2, 0, 1], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], 'setWith': [3, 1, 2, 0], - 'slice': [2, 0, 1], - 'transform': [2, 0, 1] + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'updateWith': [3, 1, 2, 0], + 'zipWith': [1, 2, 0] }; /** Used to map method names to spread configs. */ exports.methodSpread = { + 'invokeArgs': 2, + 'invokeArgsMap': 2, 'partial': 1, - 'partialRight': 1 + 'partialRight': 1, + 'without': 1 }; /** Used to identify methods which mutate arrays or objects. */ @@ -161,6 +180,7 @@ exports.mutate = { 'pull': true, 'pullAll': true, 'pullAllBy': true, + 'pullAllWith': true, 'pullAt': true, 'remove': true, 'reverse': true @@ -178,7 +198,9 @@ exports.mutate = { 'set': { 'set': true, 'setWith': true, - 'unset': true + 'unset': true, + 'update': true, + 'updateWith': true } }; @@ -210,34 +232,59 @@ exports.realToAlias = (function() { }()); /** Used to map method names to other names. */ -exports.rename = { +exports.remap = { 'curryN': 'curry', 'curryRightN': 'curryRight', 'getOr': 'get', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'restFrom': 'rest', + 'spreadFrom': 'spread', 'trimChars': 'trim', 'trimCharsEnd': 'trimEnd', 'trimCharsStart': 'trimStart' }; -/** Used to track methods that skip `_.rearg`. */ +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ exports.skipRearg = { 'add': true, 'assign': true, 'assignIn': true, + 'bind': true, + 'bindKey': true, 'concat': true, 'difference': true, + 'divide': true, + 'eq': true, 'gt': true, 'gte': true, + 'isEqual': true, 'lt': true, 'lte': true, 'matchesProperty': true, 'merge': true, + 'multiply': true, + 'overArgs': true, 'partial': true, 'partialRight': true, 'random': true, 'range': true, 'rangeRight': true, 'subtract': true, + 'without': true, 'zip': true, 'zipObject': true }; diff --git a/tools/eslint/node_modules/lodash/fp/_util.js b/tools/eslint/node_modules/lodash/fp/_util.js index e1baf3b0a05caa..d450396fc44804 100644 --- a/tools/eslint/node_modules/lodash/fp/_util.js +++ b/tools/eslint/node_modules/lodash/fp/_util.js @@ -1,11 +1,14 @@ module.exports = { 'ary': require('../ary'), - 'cloneDeep': require('../cloneDeep'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), 'curry': require('../curry'), 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), 'isFunction': require('../isFunction'), 'iteratee': require('../iteratee'), 'keys': require('../_baseKeys'), 'rearg': require('../rearg'), - 'spread': require('../spread') + 'spread': require('../spread'), + 'toPath': require('../toPath') }; diff --git a/tools/eslint/node_modules/lodash/fp/add.js b/tools/eslint/node_modules/lodash/fp/add.js index c51b8fa6a6f434..816eeece34bf25 100644 --- a/tools/eslint/node_modules/lodash/fp/add.js +++ b/tools/eslint/node_modules/lodash/fp/add.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('add', require('../add')); +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/after.js b/tools/eslint/node_modules/lodash/fp/after.js index 83691b7a59aecc..21a0167ab2dba5 100644 --- a/tools/eslint/node_modules/lodash/fp/after.js +++ b/tools/eslint/node_modules/lodash/fp/after.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('after', require('../after')); +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/all.js b/tools/eslint/node_modules/lodash/fp/all.js index 900ac25e836b2c..d0839f77ed712b 100644 --- a/tools/eslint/node_modules/lodash/fp/all.js +++ b/tools/eslint/node_modules/lodash/fp/all.js @@ -1 +1 @@ -module.exports = require('./some'); +module.exports = require('./every'); diff --git a/tools/eslint/node_modules/lodash/fp/always.js b/tools/eslint/node_modules/lodash/fp/always.js new file mode 100644 index 00000000000000..988770307bc639 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/tools/eslint/node_modules/lodash/fp/any.js b/tools/eslint/node_modules/lodash/fp/any.js new file mode 100644 index 00000000000000..900ac25e836b2c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/tools/eslint/node_modules/lodash/fp/somePass.js b/tools/eslint/node_modules/lodash/fp/anyPass.js similarity index 100% rename from tools/eslint/node_modules/lodash/fp/somePass.js rename to tools/eslint/node_modules/lodash/fp/anyPass.js diff --git a/tools/eslint/node_modules/lodash/fp/ary.js b/tools/eslint/node_modules/lodash/fp/ary.js index 0f75d18a316d79..8edf18778da3da 100644 --- a/tools/eslint/node_modules/lodash/fp/ary.js +++ b/tools/eslint/node_modules/lodash/fp/ary.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('ary', require('../ary')); +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assign.js b/tools/eslint/node_modules/lodash/fp/assign.js index ad02bcb84ed5bd..23f47af17e13f9 100644 --- a/tools/eslint/node_modules/lodash/fp/assign.js +++ b/tools/eslint/node_modules/lodash/fp/assign.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('assign', require('../assign')); +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignIn.js b/tools/eslint/node_modules/lodash/fp/assignIn.js index 1ed4f0d7e6c589..6e7c65fad8e312 100644 --- a/tools/eslint/node_modules/lodash/fp/assignIn.js +++ b/tools/eslint/node_modules/lodash/fp/assignIn.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('assignIn', require('../assignIn')); +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignInWith.js b/tools/eslint/node_modules/lodash/fp/assignInWith.js index 882145d9146db5..acb5923675eed7 100644 --- a/tools/eslint/node_modules/lodash/fp/assignInWith.js +++ b/tools/eslint/node_modules/lodash/fp/assignInWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('assignInWith', require('../assignInWith')); +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignWith.js b/tools/eslint/node_modules/lodash/fp/assignWith.js index 1ff052782f66b6..eb925212d522b5 100644 --- a/tools/eslint/node_modules/lodash/fp/assignWith.js +++ b/tools/eslint/node_modules/lodash/fp/assignWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('assignWith', require('../assignWith')); +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/at.js b/tools/eslint/node_modules/lodash/fp/at.js index 5da35250e07446..cc39d257c6bf88 100644 --- a/tools/eslint/node_modules/lodash/fp/at.js +++ b/tools/eslint/node_modules/lodash/fp/at.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('at', require('../at')); +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/attempt.js b/tools/eslint/node_modules/lodash/fp/attempt.js index d8a3be5234a696..26ca42ea04d354 100644 --- a/tools/eslint/node_modules/lodash/fp/attempt.js +++ b/tools/eslint/node_modules/lodash/fp/attempt.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('attempt', require('../attempt')); +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/before.js b/tools/eslint/node_modules/lodash/fp/before.js index f2954a62e3df89..7a2de65d27ecc1 100644 --- a/tools/eslint/node_modules/lodash/fp/before.js +++ b/tools/eslint/node_modules/lodash/fp/before.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('before', require('../before')); +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bind.js b/tools/eslint/node_modules/lodash/fp/bind.js index e054a486dad6fd..5cbe4f302fed07 100644 --- a/tools/eslint/node_modules/lodash/fp/bind.js +++ b/tools/eslint/node_modules/lodash/fp/bind.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('bind', require('../bind')); +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bindAll.js b/tools/eslint/node_modules/lodash/fp/bindAll.js index 495b75c6e4960d..6b4a4a0f270266 100644 --- a/tools/eslint/node_modules/lodash/fp/bindAll.js +++ b/tools/eslint/node_modules/lodash/fp/bindAll.js @@ -1 +1,5 @@ -module.exports = require('../bindAll'); +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bindKey.js b/tools/eslint/node_modules/lodash/fp/bindKey.js index 0b588c7a3ba247..6a46c6b19c5b75 100644 --- a/tools/eslint/node_modules/lodash/fp/bindKey.js +++ b/tools/eslint/node_modules/lodash/fp/bindKey.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('bindKey', require('../bindKey')); +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/camelCase.js b/tools/eslint/node_modules/lodash/fp/camelCase.js index 328041ec3b661a..87b77b49376e32 100644 --- a/tools/eslint/node_modules/lodash/fp/camelCase.js +++ b/tools/eslint/node_modules/lodash/fp/camelCase.js @@ -1 +1,5 @@ -module.exports = require('../camelCase'); +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/capitalize.js b/tools/eslint/node_modules/lodash/fp/capitalize.js index 186e6d98137e74..cac74e14f8ac58 100644 --- a/tools/eslint/node_modules/lodash/fp/capitalize.js +++ b/tools/eslint/node_modules/lodash/fp/capitalize.js @@ -1 +1,5 @@ -module.exports = require('../capitalize'); +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/castArray.js b/tools/eslint/node_modules/lodash/fp/castArray.js new file mode 100644 index 00000000000000..8681c099eaded1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/ceil.js b/tools/eslint/node_modules/lodash/fp/ceil.js index 7c3774bb506c70..f416b7294c453c 100644 --- a/tools/eslint/node_modules/lodash/fp/ceil.js +++ b/tools/eslint/node_modules/lodash/fp/ceil.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('ceil', require('../ceil')); +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/chain.js b/tools/eslint/node_modules/lodash/fp/chain.js index 2f139cc00ba0ca..604fe398b100c6 100644 --- a/tools/eslint/node_modules/lodash/fp/chain.js +++ b/tools/eslint/node_modules/lodash/fp/chain.js @@ -1 +1,5 @@ -module.exports = require('../chain'); +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/chunk.js b/tools/eslint/node_modules/lodash/fp/chunk.js index 9d32b8a31226fd..871ab08580b35e 100644 --- a/tools/eslint/node_modules/lodash/fp/chunk.js +++ b/tools/eslint/node_modules/lodash/fp/chunk.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('chunk', require('../chunk')); +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/clamp.js b/tools/eslint/node_modules/lodash/fp/clamp.js index 8ec3d9de54dd75..3b06c01ce139aa 100644 --- a/tools/eslint/node_modules/lodash/fp/clamp.js +++ b/tools/eslint/node_modules/lodash/fp/clamp.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('clamp', require('../clamp')); +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/clone.js b/tools/eslint/node_modules/lodash/fp/clone.js index afd2c156e6bea7..cadb59c917f86c 100644 --- a/tools/eslint/node_modules/lodash/fp/clone.js +++ b/tools/eslint/node_modules/lodash/fp/clone.js @@ -1 +1,5 @@ -module.exports = require('../clone'); +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneDeep.js b/tools/eslint/node_modules/lodash/fp/cloneDeep.js index a17a6f801dde7c..a6107aac9480c3 100644 --- a/tools/eslint/node_modules/lodash/fp/cloneDeep.js +++ b/tools/eslint/node_modules/lodash/fp/cloneDeep.js @@ -1 +1,5 @@ -module.exports = require('../cloneDeep'); +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js b/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js index 01c7fefdd53439..6f01e44a346d70 100644 --- a/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js +++ b/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('cloneDeepWith', require('../cloneDeepWith')); +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneWith.js b/tools/eslint/node_modules/lodash/fp/cloneWith.js index 9e9d7838ef2320..aa8857810e783d 100644 --- a/tools/eslint/node_modules/lodash/fp/cloneWith.js +++ b/tools/eslint/node_modules/lodash/fp/cloneWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('cloneWith', require('../cloneWith')); +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/commit.js b/tools/eslint/node_modules/lodash/fp/commit.js index 04e9eb94324ae9..130a894f89412a 100644 --- a/tools/eslint/node_modules/lodash/fp/commit.js +++ b/tools/eslint/node_modules/lodash/fp/commit.js @@ -1 +1,5 @@ -module.exports = require('../commit'); +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/compact.js b/tools/eslint/node_modules/lodash/fp/compact.js index b2ed9c7d812be8..ce8f7a1ac3e823 100644 --- a/tools/eslint/node_modules/lodash/fp/compact.js +++ b/tools/eslint/node_modules/lodash/fp/compact.js @@ -1 +1,5 @@ -module.exports = require('../compact'); +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/complement.js b/tools/eslint/node_modules/lodash/fp/complement.js new file mode 100644 index 00000000000000..93eb462b353923 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/tools/eslint/node_modules/lodash/fp/concat.js b/tools/eslint/node_modules/lodash/fp/concat.js index c13a92abd9dcb3..e59346ad9834ff 100644 --- a/tools/eslint/node_modules/lodash/fp/concat.js +++ b/tools/eslint/node_modules/lodash/fp/concat.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('concat', require('../concat')); +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cond.js b/tools/eslint/node_modules/lodash/fp/cond.js index a150a89eb99afa..6a0120efd408d0 100644 --- a/tools/eslint/node_modules/lodash/fp/cond.js +++ b/tools/eslint/node_modules/lodash/fp/cond.js @@ -1 +1,5 @@ -module.exports = require('../cond'); +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/conforms.js b/tools/eslint/node_modules/lodash/fp/conforms.js index 387dde1844d110..e193cd6c1fdec0 100644 --- a/tools/eslint/node_modules/lodash/fp/conforms.js +++ b/tools/eslint/node_modules/lodash/fp/conforms.js @@ -1 +1,5 @@ -module.exports = require('../conforms'); +var convert = require('./convert'), + func = convert('conforms', require('../conforms'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/constant.js b/tools/eslint/node_modules/lodash/fp/constant.js index 3bcd276866fec8..9e406fc09c1b10 100644 --- a/tools/eslint/node_modules/lodash/fp/constant.js +++ b/tools/eslint/node_modules/lodash/fp/constant.js @@ -1 +1,5 @@ -module.exports = require('../constant'); +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/convert.js b/tools/eslint/node_modules/lodash/fp/convert.js index a1d266fa6428c3..4795dc42460855 100644 --- a/tools/eslint/node_modules/lodash/fp/convert.js +++ b/tools/eslint/node_modules/lodash/fp/convert.js @@ -3,7 +3,8 @@ var baseConvert = require('./_baseConvert'), /** * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last - * version. If `name` is an object its methods will be converted. + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. * * @param {string} name The name of the function to wrap. * @param {Function} [func] The function to wrap. diff --git a/tools/eslint/node_modules/lodash/fp/countBy.js b/tools/eslint/node_modules/lodash/fp/countBy.js index ee4b942850e27e..dfa464326fe8dc 100644 --- a/tools/eslint/node_modules/lodash/fp/countBy.js +++ b/tools/eslint/node_modules/lodash/fp/countBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('countBy', require('../countBy')); +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/create.js b/tools/eslint/node_modules/lodash/fp/create.js index bdad77148c6321..752025fb83bb4c 100644 --- a/tools/eslint/node_modules/lodash/fp/create.js +++ b/tools/eslint/node_modules/lodash/fp/create.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('create', require('../create')); +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curry.js b/tools/eslint/node_modules/lodash/fp/curry.js index d64722c1321514..b0b4168c500134 100644 --- a/tools/eslint/node_modules/lodash/fp/curry.js +++ b/tools/eslint/node_modules/lodash/fp/curry.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('curry', require('../curry')); +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryN.js b/tools/eslint/node_modules/lodash/fp/curryN.js index f33f7fc3fe9171..2ae7d00a62a578 100644 --- a/tools/eslint/node_modules/lodash/fp/curryN.js +++ b/tools/eslint/node_modules/lodash/fp/curryN.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('curryN', require('../curry')); +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryRight.js b/tools/eslint/node_modules/lodash/fp/curryRight.js index 2e0470912cc216..cb619eb5d98b94 100644 --- a/tools/eslint/node_modules/lodash/fp/curryRight.js +++ b/tools/eslint/node_modules/lodash/fp/curryRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('curryRight', require('../curryRight')); +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryRightN.js b/tools/eslint/node_modules/lodash/fp/curryRightN.js index 510e4e40336576..2495afc89c3fce 100644 --- a/tools/eslint/node_modules/lodash/fp/curryRightN.js +++ b/tools/eslint/node_modules/lodash/fp/curryRightN.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('curryRightN', require('../curryRight')); +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/debounce.js b/tools/eslint/node_modules/lodash/fp/debounce.js index a6b0407a2c605e..26122293af3a6f 100644 --- a/tools/eslint/node_modules/lodash/fp/debounce.js +++ b/tools/eslint/node_modules/lodash/fp/debounce.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('debounce', require('../debounce')); +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/deburr.js b/tools/eslint/node_modules/lodash/fp/deburr.js index f8e1a49393677e..96463ab88e7e5a 100644 --- a/tools/eslint/node_modules/lodash/fp/deburr.js +++ b/tools/eslint/node_modules/lodash/fp/deburr.js @@ -1 +1,5 @@ -module.exports = require('../deburr'); +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defaults.js b/tools/eslint/node_modules/lodash/fp/defaults.js index 7c3b3ab96b430c..e1a8e6e7dbe936 100644 --- a/tools/eslint/node_modules/lodash/fp/defaults.js +++ b/tools/eslint/node_modules/lodash/fp/defaults.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('defaults', require('../defaults')); +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defaultsDeep.js b/tools/eslint/node_modules/lodash/fp/defaultsDeep.js index c7480e217976dc..1f172ff9442840 100644 --- a/tools/eslint/node_modules/lodash/fp/defaultsDeep.js +++ b/tools/eslint/node_modules/lodash/fp/defaultsDeep.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('defaultsDeep', require('../defaultsDeep')); +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defer.js b/tools/eslint/node_modules/lodash/fp/defer.js index 4126727cd6a405..ec7990fe224281 100644 --- a/tools/eslint/node_modules/lodash/fp/defer.js +++ b/tools/eslint/node_modules/lodash/fp/defer.js @@ -1 +1,5 @@ -module.exports = require('../defer'); +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/delay.js b/tools/eslint/node_modules/lodash/fp/delay.js index cd3b1c329437fa..556dbd568ee475 100644 --- a/tools/eslint/node_modules/lodash/fp/delay.js +++ b/tools/eslint/node_modules/lodash/fp/delay.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('delay', require('../delay')); +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/difference.js b/tools/eslint/node_modules/lodash/fp/difference.js index aea9ab8d16568a..2d0376542a7c24 100644 --- a/tools/eslint/node_modules/lodash/fp/difference.js +++ b/tools/eslint/node_modules/lodash/fp/difference.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('difference', require('../difference')); +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/differenceBy.js b/tools/eslint/node_modules/lodash/fp/differenceBy.js index ab65554afa176e..2f914910a987da 100644 --- a/tools/eslint/node_modules/lodash/fp/differenceBy.js +++ b/tools/eslint/node_modules/lodash/fp/differenceBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('differenceBy', require('../differenceBy')); +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/differenceWith.js b/tools/eslint/node_modules/lodash/fp/differenceWith.js index f932a2e478b685..bcf5ad2e1192c8 100644 --- a/tools/eslint/node_modules/lodash/fp/differenceWith.js +++ b/tools/eslint/node_modules/lodash/fp/differenceWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('differenceWith', require('../differenceWith')); +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/divide.js b/tools/eslint/node_modules/lodash/fp/divide.js new file mode 100644 index 00000000000000..82048c5e02a2ea --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/drop.js b/tools/eslint/node_modules/lodash/fp/drop.js index ccca2d0dad4a95..2fa9b4faa587f0 100644 --- a/tools/eslint/node_modules/lodash/fp/drop.js +++ b/tools/eslint/node_modules/lodash/fp/drop.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('drop', require('../drop')); +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropRight.js b/tools/eslint/node_modules/lodash/fp/dropRight.js index bd9a2bd7bd95b2..e98881fcd4479f 100644 --- a/tools/eslint/node_modules/lodash/fp/dropRight.js +++ b/tools/eslint/node_modules/lodash/fp/dropRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('dropRight', require('../dropRight')); +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropRightWhile.js b/tools/eslint/node_modules/lodash/fp/dropRightWhile.js index 2dbb2a3b665cd1..cacaa7019106cb 100644 --- a/tools/eslint/node_modules/lodash/fp/dropRightWhile.js +++ b/tools/eslint/node_modules/lodash/fp/dropRightWhile.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('dropRightWhile', require('../dropRightWhile')); +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropWhile.js b/tools/eslint/node_modules/lodash/fp/dropWhile.js index 17e46ff4ef429e..285f864d127a25 100644 --- a/tools/eslint/node_modules/lodash/fp/dropWhile.js +++ b/tools/eslint/node_modules/lodash/fp/dropWhile.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('dropWhile', require('../dropWhile')); +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/endsWith.js b/tools/eslint/node_modules/lodash/fp/endsWith.js index cbe8f8ca2aea07..17dc2a49511b3b 100644 --- a/tools/eslint/node_modules/lodash/fp/endsWith.js +++ b/tools/eslint/node_modules/lodash/fp/endsWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('endsWith', require('../endsWith')); +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/entries.js b/tools/eslint/node_modules/lodash/fp/entries.js new file mode 100644 index 00000000000000..7a88df2044638c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/tools/eslint/node_modules/lodash/fp/entriesIn.js b/tools/eslint/node_modules/lodash/fp/entriesIn.js new file mode 100644 index 00000000000000..f6c6331c1de93f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/tools/eslint/node_modules/lodash/fp/eq.js b/tools/eslint/node_modules/lodash/fp/eq.js index 518a54df7d1c89..9a3d21bf1d1114 100644 --- a/tools/eslint/node_modules/lodash/fp/eq.js +++ b/tools/eslint/node_modules/lodash/fp/eq.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('eq', require('../eq')); +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/escape.js b/tools/eslint/node_modules/lodash/fp/escape.js index e5de9f23100dac..52c1fbba609036 100644 --- a/tools/eslint/node_modules/lodash/fp/escape.js +++ b/tools/eslint/node_modules/lodash/fp/escape.js @@ -1 +1,5 @@ -module.exports = require('../escape'); +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/escapeRegExp.js b/tools/eslint/node_modules/lodash/fp/escapeRegExp.js index ab18963a16714d..369b2eff6e1216 100644 --- a/tools/eslint/node_modules/lodash/fp/escapeRegExp.js +++ b/tools/eslint/node_modules/lodash/fp/escapeRegExp.js @@ -1 +1,5 @@ -module.exports = require('../escapeRegExp'); +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/every.js b/tools/eslint/node_modules/lodash/fp/every.js index 965f889b6b055c..95c2776c33e06c 100644 --- a/tools/eslint/node_modules/lodash/fp/every.js +++ b/tools/eslint/node_modules/lodash/fp/every.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('every', require('../every')); +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/fill.js b/tools/eslint/node_modules/lodash/fp/fill.js index e16f8bf336a114..b2d47e84eb159b 100644 --- a/tools/eslint/node_modules/lodash/fp/fill.js +++ b/tools/eslint/node_modules/lodash/fp/fill.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('fill', require('../fill')); +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/filter.js b/tools/eslint/node_modules/lodash/fp/filter.js index 7191a822380532..796d501ce827ca 100644 --- a/tools/eslint/node_modules/lodash/fp/filter.js +++ b/tools/eslint/node_modules/lodash/fp/filter.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('filter', require('../filter')); +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/find.js b/tools/eslint/node_modules/lodash/fp/find.js index 5915bbd04d56dc..f805d336aa148e 100644 --- a/tools/eslint/node_modules/lodash/fp/find.js +++ b/tools/eslint/node_modules/lodash/fp/find.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('find', require('../find')); +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findIndex.js b/tools/eslint/node_modules/lodash/fp/findIndex.js index 6bf435c783d7f1..8c15fd11606166 100644 --- a/tools/eslint/node_modules/lodash/fp/findIndex.js +++ b/tools/eslint/node_modules/lodash/fp/findIndex.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('findIndex', require('../findIndex')); +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findKey.js b/tools/eslint/node_modules/lodash/fp/findKey.js index 3ff9844c1eea12..475bcfa8a5bc02 100644 --- a/tools/eslint/node_modules/lodash/fp/findKey.js +++ b/tools/eslint/node_modules/lodash/fp/findKey.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('findKey', require('../findKey')); +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLast.js b/tools/eslint/node_modules/lodash/fp/findLast.js index 31e169b382bfe5..093fe94e745e76 100644 --- a/tools/eslint/node_modules/lodash/fp/findLast.js +++ b/tools/eslint/node_modules/lodash/fp/findLast.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('findLast', require('../findLast')); +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLastIndex.js b/tools/eslint/node_modules/lodash/fp/findLastIndex.js index db41e8843006da..36986df0b8ae62 100644 --- a/tools/eslint/node_modules/lodash/fp/findLastIndex.js +++ b/tools/eslint/node_modules/lodash/fp/findLastIndex.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('findLastIndex', require('../findLastIndex')); +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLastKey.js b/tools/eslint/node_modules/lodash/fp/findLastKey.js index ffe9e2a11e3b3d..5f81b604e8174b 100644 --- a/tools/eslint/node_modules/lodash/fp/findLastKey.js +++ b/tools/eslint/node_modules/lodash/fp/findLastKey.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('findLastKey', require('../findLastKey')); +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatMap.js b/tools/eslint/node_modules/lodash/fp/flatMap.js index da249a883f43f4..d01dc4d0481c5b 100644 --- a/tools/eslint/node_modules/lodash/fp/flatMap.js +++ b/tools/eslint/node_modules/lodash/fp/flatMap.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('flatMap', require('../flatMap')); +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatMapDeep.js b/tools/eslint/node_modules/lodash/fp/flatMapDeep.js new file mode 100644 index 00000000000000..569c42eb9fa565 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatMapDepth.js b/tools/eslint/node_modules/lodash/fp/flatMapDepth.js new file mode 100644 index 00000000000000..6eb68fdeed81fe --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatten.js b/tools/eslint/node_modules/lodash/fp/flatten.js index f1c1a6223a567d..30425d896232d7 100644 --- a/tools/eslint/node_modules/lodash/fp/flatten.js +++ b/tools/eslint/node_modules/lodash/fp/flatten.js @@ -1 +1,5 @@ -module.exports = require('../flatten'); +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flattenDeep.js b/tools/eslint/node_modules/lodash/fp/flattenDeep.js index c2ff9879b44681..aed5db27c09f37 100644 --- a/tools/eslint/node_modules/lodash/fp/flattenDeep.js +++ b/tools/eslint/node_modules/lodash/fp/flattenDeep.js @@ -1 +1,5 @@ -module.exports = require('../flattenDeep'); +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flattenDepth.js b/tools/eslint/node_modules/lodash/fp/flattenDepth.js new file mode 100644 index 00000000000000..ad65e378eff98d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flip.js b/tools/eslint/node_modules/lodash/fp/flip.js index 730bbd1bb6b488..0547e7b4eade18 100644 --- a/tools/eslint/node_modules/lodash/fp/flip.js +++ b/tools/eslint/node_modules/lodash/fp/flip.js @@ -1 +1,5 @@ -module.exports = require('../flip'); +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/floor.js b/tools/eslint/node_modules/lodash/fp/floor.js index f130f8b5941f8f..a6cf3358ed315a 100644 --- a/tools/eslint/node_modules/lodash/fp/floor.js +++ b/tools/eslint/node_modules/lodash/fp/floor.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('floor', require('../floor')); +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flow.js b/tools/eslint/node_modules/lodash/fp/flow.js index d9943c6d0340ac..cd83677a62ca36 100644 --- a/tools/eslint/node_modules/lodash/fp/flow.js +++ b/tools/eslint/node_modules/lodash/fp/flow.js @@ -1 +1,5 @@ -module.exports = require('../flow'); +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flowRight.js b/tools/eslint/node_modules/lodash/fp/flowRight.js index 556dc378fb3965..972a5b9b1c2c06 100644 --- a/tools/eslint/node_modules/lodash/fp/flowRight.js +++ b/tools/eslint/node_modules/lodash/fp/flowRight.js @@ -1 +1,5 @@ -module.exports = require('../flowRight'); +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forEach.js b/tools/eslint/node_modules/lodash/fp/forEach.js index d715ea662e59a2..2f494521c86f42 100644 --- a/tools/eslint/node_modules/lodash/fp/forEach.js +++ b/tools/eslint/node_modules/lodash/fp/forEach.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forEach', require('../forEach')); +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forEachRight.js b/tools/eslint/node_modules/lodash/fp/forEachRight.js index 90dd8dd29aac48..3ff97336bbf2b9 100644 --- a/tools/eslint/node_modules/lodash/fp/forEachRight.js +++ b/tools/eslint/node_modules/lodash/fp/forEachRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forEachRight', require('../forEachRight')); +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forIn.js b/tools/eslint/node_modules/lodash/fp/forIn.js index 90a8f07bb19e71..9341749b1f7198 100644 --- a/tools/eslint/node_modules/lodash/fp/forIn.js +++ b/tools/eslint/node_modules/lodash/fp/forIn.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forIn', require('../forIn')); +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forInRight.js b/tools/eslint/node_modules/lodash/fp/forInRight.js index 505258f4426065..cecf8bbfa6cf82 100644 --- a/tools/eslint/node_modules/lodash/fp/forInRight.js +++ b/tools/eslint/node_modules/lodash/fp/forInRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forInRight', require('../forInRight')); +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forOwn.js b/tools/eslint/node_modules/lodash/fp/forOwn.js index 6fef1e3d508439..246449e9a832df 100644 --- a/tools/eslint/node_modules/lodash/fp/forOwn.js +++ b/tools/eslint/node_modules/lodash/fp/forOwn.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forOwn', require('../forOwn')); +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forOwnRight.js b/tools/eslint/node_modules/lodash/fp/forOwnRight.js index 11ff1fdaf88a98..c5e826e0d7dc8f 100644 --- a/tools/eslint/node_modules/lodash/fp/forOwnRight.js +++ b/tools/eslint/node_modules/lodash/fp/forOwnRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('forOwnRight', require('../forOwnRight')); +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/fromPairs.js b/tools/eslint/node_modules/lodash/fp/fromPairs.js index f5c3cb8d774763..f8cc5968cd2cff 100644 --- a/tools/eslint/node_modules/lodash/fp/fromPairs.js +++ b/tools/eslint/node_modules/lodash/fp/fromPairs.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('fromPairs', require('../fromPairs')); +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/functions.js b/tools/eslint/node_modules/lodash/fp/functions.js index bb1cb93b2c0ad0..09d1bb1baaebfe 100644 --- a/tools/eslint/node_modules/lodash/fp/functions.js +++ b/tools/eslint/node_modules/lodash/fp/functions.js @@ -1 +1,5 @@ -module.exports = require('../functions'); +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/functionsIn.js b/tools/eslint/node_modules/lodash/fp/functionsIn.js index d375213c4f683f..2cfeb83ebbc8e2 100644 --- a/tools/eslint/node_modules/lodash/fp/functionsIn.js +++ b/tools/eslint/node_modules/lodash/fp/functionsIn.js @@ -1 +1,5 @@ -module.exports = require('../functionsIn'); +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/get.js b/tools/eslint/node_modules/lodash/fp/get.js index a054c9d22cc74c..6d3a32863e72b5 100644 --- a/tools/eslint/node_modules/lodash/fp/get.js +++ b/tools/eslint/node_modules/lodash/fp/get.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('get', require('../get')); +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/getOr.js b/tools/eslint/node_modules/lodash/fp/getOr.js index c46f2e9e05791a..7dbf771f0c6b09 100644 --- a/tools/eslint/node_modules/lodash/fp/getOr.js +++ b/tools/eslint/node_modules/lodash/fp/getOr.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('getOr', require('../get')); +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/groupBy.js b/tools/eslint/node_modules/lodash/fp/groupBy.js index 6588856a9c9cb8..fc0bc78a57b930 100644 --- a/tools/eslint/node_modules/lodash/fp/groupBy.js +++ b/tools/eslint/node_modules/lodash/fp/groupBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('groupBy', require('../groupBy')); +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/gt.js b/tools/eslint/node_modules/lodash/fp/gt.js index 5b92de949d777a..9e57c8085a05e4 100644 --- a/tools/eslint/node_modules/lodash/fp/gt.js +++ b/tools/eslint/node_modules/lodash/fp/gt.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('gt', require('../gt')); +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/gte.js b/tools/eslint/node_modules/lodash/fp/gte.js index 3a4025067b6725..45847863894a29 100644 --- a/tools/eslint/node_modules/lodash/fp/gte.js +++ b/tools/eslint/node_modules/lodash/fp/gte.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('gte', require('../gte')); +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/has.js b/tools/eslint/node_modules/lodash/fp/has.js index e37db9ab5e3630..b901298398e4f7 100644 --- a/tools/eslint/node_modules/lodash/fp/has.js +++ b/tools/eslint/node_modules/lodash/fp/has.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('has', require('../has')); +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/hasIn.js b/tools/eslint/node_modules/lodash/fp/hasIn.js index 84d7815648228a..b3c3d1a3f3b375 100644 --- a/tools/eslint/node_modules/lodash/fp/hasIn.js +++ b/tools/eslint/node_modules/lodash/fp/hasIn.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('hasIn', require('../hasIn')); +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/head.js b/tools/eslint/node_modules/lodash/fp/head.js index bd97a7b2cc5050..2694f0a21d681e 100644 --- a/tools/eslint/node_modules/lodash/fp/head.js +++ b/tools/eslint/node_modules/lodash/fp/head.js @@ -1 +1,5 @@ -module.exports = require('../head'); +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/identical.js b/tools/eslint/node_modules/lodash/fp/identical.js new file mode 100644 index 00000000000000..85563f4a469964 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/tools/eslint/node_modules/lodash/fp/identity.js b/tools/eslint/node_modules/lodash/fp/identity.js index 6d007dc10ebd66..096415a5dec4a6 100644 --- a/tools/eslint/node_modules/lodash/fp/identity.js +++ b/tools/eslint/node_modules/lodash/fp/identity.js @@ -1 +1,5 @@ -module.exports = require('../identity'); +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/inRange.js b/tools/eslint/node_modules/lodash/fp/inRange.js index fc55e1c1ffcde6..202d940bae8d83 100644 --- a/tools/eslint/node_modules/lodash/fp/inRange.js +++ b/tools/eslint/node_modules/lodash/fp/inRange.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('inRange', require('../inRange')); +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/includes.js b/tools/eslint/node_modules/lodash/fp/includes.js index 91f1eec4d95491..11467805ce1e72 100644 --- a/tools/eslint/node_modules/lodash/fp/includes.js +++ b/tools/eslint/node_modules/lodash/fp/includes.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('includes', require('../includes')); +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/indexOf.js b/tools/eslint/node_modules/lodash/fp/indexOf.js index 65345cedc484ce..524658eb95f983 100644 --- a/tools/eslint/node_modules/lodash/fp/indexOf.js +++ b/tools/eslint/node_modules/lodash/fp/indexOf.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('indexOf', require('../indexOf')); +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/initial.js b/tools/eslint/node_modules/lodash/fp/initial.js index 9fc94e060fd4c7..b732ba0bd69f24 100644 --- a/tools/eslint/node_modules/lodash/fp/initial.js +++ b/tools/eslint/node_modules/lodash/fp/initial.js @@ -1 +1,5 @@ -module.exports = require('../initial'); +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersection.js b/tools/eslint/node_modules/lodash/fp/intersection.js index 784f4d1c3657da..52936d560c7cb6 100644 --- a/tools/eslint/node_modules/lodash/fp/intersection.js +++ b/tools/eslint/node_modules/lodash/fp/intersection.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('intersection', require('../intersection')); +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersectionBy.js b/tools/eslint/node_modules/lodash/fp/intersectionBy.js index 4aa93b6357205e..72629f277d7f82 100644 --- a/tools/eslint/node_modules/lodash/fp/intersectionBy.js +++ b/tools/eslint/node_modules/lodash/fp/intersectionBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('intersectionBy', require('../intersectionBy')); +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersectionWith.js b/tools/eslint/node_modules/lodash/fp/intersectionWith.js index 879fe9d44be4ff..e064f400f88bcc 100644 --- a/tools/eslint/node_modules/lodash/fp/intersectionWith.js +++ b/tools/eslint/node_modules/lodash/fp/intersectionWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('intersectionWith', require('../intersectionWith')); +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invert.js b/tools/eslint/node_modules/lodash/fp/invert.js index 231d5caf8102a1..2d5d1f0d45ba03 100644 --- a/tools/eslint/node_modules/lodash/fp/invert.js +++ b/tools/eslint/node_modules/lodash/fp/invert.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('invert', require('../invert')); +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invertBy.js b/tools/eslint/node_modules/lodash/fp/invertBy.js index 90820e6c379f96..63ca97ecb28ab7 100644 --- a/tools/eslint/node_modules/lodash/fp/invertBy.js +++ b/tools/eslint/node_modules/lodash/fp/invertBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('invertBy', require('../invertBy')); +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invertObj.js b/tools/eslint/node_modules/lodash/fp/invertObj.js new file mode 100644 index 00000000000000..f1d842e49b8eda --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/tools/eslint/node_modules/lodash/fp/invoke.js b/tools/eslint/node_modules/lodash/fp/invoke.js index a8635e8c38a9bf..fcf17f0d5721b8 100644 --- a/tools/eslint/node_modules/lodash/fp/invoke.js +++ b/tools/eslint/node_modules/lodash/fp/invoke.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('invoke', require('../invoke')); +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeArgs.js b/tools/eslint/node_modules/lodash/fp/invokeArgs.js new file mode 100644 index 00000000000000..d3f2953fa3b921 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js b/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js new file mode 100644 index 00000000000000..eaa9f84ffbb7f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeMap.js b/tools/eslint/node_modules/lodash/fp/invokeMap.js index 2691ae36ec80ba..6515fd73f16e75 100644 --- a/tools/eslint/node_modules/lodash/fp/invokeMap.js +++ b/tools/eslint/node_modules/lodash/fp/invokeMap.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('invokeMap', require('../invokeMap')); +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArguments.js b/tools/eslint/node_modules/lodash/fp/isArguments.js index 093aa354cf0e75..1d93c9e5994c86 100644 --- a/tools/eslint/node_modules/lodash/fp/isArguments.js +++ b/tools/eslint/node_modules/lodash/fp/isArguments.js @@ -1 +1,5 @@ -module.exports = require('../isArguments'); +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArray.js b/tools/eslint/node_modules/lodash/fp/isArray.js index ec7fad3c36dea5..ba7ade8ddc0a13 100644 --- a/tools/eslint/node_modules/lodash/fp/isArray.js +++ b/tools/eslint/node_modules/lodash/fp/isArray.js @@ -1 +1,5 @@ -module.exports = require('../isArray'); +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js b/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js index 655e85bac7fc51..5088513faf3e83 100644 --- a/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js +++ b/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js @@ -1 +1,5 @@ -module.exports = require('../isArrayBuffer'); +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayLike.js b/tools/eslint/node_modules/lodash/fp/isArrayLike.js index 1595b2f181891b..8f1856bf6f6b38 100644 --- a/tools/eslint/node_modules/lodash/fp/isArrayLike.js +++ b/tools/eslint/node_modules/lodash/fp/isArrayLike.js @@ -1 +1,5 @@ -module.exports = require('../isArrayLike'); +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js b/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js index 4d1d2028933dba..21084984bcecdd 100644 --- a/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js +++ b/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js @@ -1 +1,5 @@ -module.exports = require('../isArrayLikeObject'); +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isBoolean.js b/tools/eslint/node_modules/lodash/fp/isBoolean.js index 30d4a4aa02fc28..9339f75b1f198a 100644 --- a/tools/eslint/node_modules/lodash/fp/isBoolean.js +++ b/tools/eslint/node_modules/lodash/fp/isBoolean.js @@ -1 +1,5 @@ -module.exports = require('../isBoolean'); +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isBuffer.js b/tools/eslint/node_modules/lodash/fp/isBuffer.js index 15af9b634a28e4..e60b123818d12c 100644 --- a/tools/eslint/node_modules/lodash/fp/isBuffer.js +++ b/tools/eslint/node_modules/lodash/fp/isBuffer.js @@ -1 +1,5 @@ -module.exports = require('../isBuffer'); +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isDate.js b/tools/eslint/node_modules/lodash/fp/isDate.js index ac002f459060f5..dc41d089ec8b84 100644 --- a/tools/eslint/node_modules/lodash/fp/isDate.js +++ b/tools/eslint/node_modules/lodash/fp/isDate.js @@ -1 +1,5 @@ -module.exports = require('../isDate'); +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isElement.js b/tools/eslint/node_modules/lodash/fp/isElement.js index 458a3484d34376..18ee039a2da96f 100644 --- a/tools/eslint/node_modules/lodash/fp/isElement.js +++ b/tools/eslint/node_modules/lodash/fp/isElement.js @@ -1 +1,5 @@ -module.exports = require('../isElement'); +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEmpty.js b/tools/eslint/node_modules/lodash/fp/isEmpty.js index b1a04cd88324dd..0f4ae841e214f3 100644 --- a/tools/eslint/node_modules/lodash/fp/isEmpty.js +++ b/tools/eslint/node_modules/lodash/fp/isEmpty.js @@ -1 +1,5 @@ -module.exports = require('../isEmpty'); +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEqual.js b/tools/eslint/node_modules/lodash/fp/isEqual.js index 91b7d6654e94a2..41383865f28757 100644 --- a/tools/eslint/node_modules/lodash/fp/isEqual.js +++ b/tools/eslint/node_modules/lodash/fp/isEqual.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('isEqual', require('../isEqual')); +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEqualWith.js b/tools/eslint/node_modules/lodash/fp/isEqualWith.js index 37a6e3506c0920..029ff5cdaa0f33 100644 --- a/tools/eslint/node_modules/lodash/fp/isEqualWith.js +++ b/tools/eslint/node_modules/lodash/fp/isEqualWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('isEqualWith', require('../isEqualWith')); +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isError.js b/tools/eslint/node_modules/lodash/fp/isError.js index da2710c26199de..3dfd81ccc211cb 100644 --- a/tools/eslint/node_modules/lodash/fp/isError.js +++ b/tools/eslint/node_modules/lodash/fp/isError.js @@ -1 +1,5 @@ -module.exports = require('../isError'); +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isFinite.js b/tools/eslint/node_modules/lodash/fp/isFinite.js index a71e53de45b2e0..0b647b841ecc17 100644 --- a/tools/eslint/node_modules/lodash/fp/isFinite.js +++ b/tools/eslint/node_modules/lodash/fp/isFinite.js @@ -1 +1,5 @@ -module.exports = require('../isFinite'); +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isFunction.js b/tools/eslint/node_modules/lodash/fp/isFunction.js index 1fc73f62f00fe9..ff8e5c45853aba 100644 --- a/tools/eslint/node_modules/lodash/fp/isFunction.js +++ b/tools/eslint/node_modules/lodash/fp/isFunction.js @@ -1 +1,5 @@ -module.exports = require('../isFunction'); +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isInteger.js b/tools/eslint/node_modules/lodash/fp/isInteger.js index f990b011c53a1c..67af4ff6dbb05e 100644 --- a/tools/eslint/node_modules/lodash/fp/isInteger.js +++ b/tools/eslint/node_modules/lodash/fp/isInteger.js @@ -1 +1,5 @@ -module.exports = require('../isInteger'); +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isLength.js b/tools/eslint/node_modules/lodash/fp/isLength.js index f40c36235331d5..fc101c5a64b4e8 100644 --- a/tools/eslint/node_modules/lodash/fp/isLength.js +++ b/tools/eslint/node_modules/lodash/fp/isLength.js @@ -1 +1,5 @@ -module.exports = require('../isLength'); +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMap.js b/tools/eslint/node_modules/lodash/fp/isMap.js index 51fb7e2e9a1df2..a209aa66fcbae5 100644 --- a/tools/eslint/node_modules/lodash/fp/isMap.js +++ b/tools/eslint/node_modules/lodash/fp/isMap.js @@ -1 +1,5 @@ -module.exports = require('../isMap'); +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMatch.js b/tools/eslint/node_modules/lodash/fp/isMatch.js index 749c9033197b33..6264ca17fac37a 100644 --- a/tools/eslint/node_modules/lodash/fp/isMatch.js +++ b/tools/eslint/node_modules/lodash/fp/isMatch.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('isMatch', require('../isMatch')); +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMatchWith.js b/tools/eslint/node_modules/lodash/fp/isMatchWith.js index b1311fcf329c61..d95f319353fb80 100644 --- a/tools/eslint/node_modules/lodash/fp/isMatchWith.js +++ b/tools/eslint/node_modules/lodash/fp/isMatchWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('isMatchWith', require('../isMatchWith')); +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNaN.js b/tools/eslint/node_modules/lodash/fp/isNaN.js index 74daf0a08c2564..66a978f11194fc 100644 --- a/tools/eslint/node_modules/lodash/fp/isNaN.js +++ b/tools/eslint/node_modules/lodash/fp/isNaN.js @@ -1 +1,5 @@ -module.exports = require('../isNaN'); +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNative.js b/tools/eslint/node_modules/lodash/fp/isNative.js index 9eeded4a886a20..3d775ba953152e 100644 --- a/tools/eslint/node_modules/lodash/fp/isNative.js +++ b/tools/eslint/node_modules/lodash/fp/isNative.js @@ -1 +1,5 @@ -module.exports = require('../isNative'); +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNil.js b/tools/eslint/node_modules/lodash/fp/isNil.js index beace9db042520..5952c028a9bcdd 100644 --- a/tools/eslint/node_modules/lodash/fp/isNil.js +++ b/tools/eslint/node_modules/lodash/fp/isNil.js @@ -1 +1,5 @@ -module.exports = require('../isNil'); +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNull.js b/tools/eslint/node_modules/lodash/fp/isNull.js index 44689a783ce419..f201a354b43789 100644 --- a/tools/eslint/node_modules/lodash/fp/isNull.js +++ b/tools/eslint/node_modules/lodash/fp/isNull.js @@ -1 +1,5 @@ -module.exports = require('../isNull'); +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNumber.js b/tools/eslint/node_modules/lodash/fp/isNumber.js index d7e86155de17de..a2b5fa049fe9f7 100644 --- a/tools/eslint/node_modules/lodash/fp/isNumber.js +++ b/tools/eslint/node_modules/lodash/fp/isNumber.js @@ -1 +1,5 @@ -module.exports = require('../isNumber'); +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isObject.js b/tools/eslint/node_modules/lodash/fp/isObject.js index bb486300255110..231ace03bc50ed 100644 --- a/tools/eslint/node_modules/lodash/fp/isObject.js +++ b/tools/eslint/node_modules/lodash/fp/isObject.js @@ -1 +1,5 @@ -module.exports = require('../isObject'); +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isObjectLike.js b/tools/eslint/node_modules/lodash/fp/isObjectLike.js index 5ef6f62b1f5b7e..f16082e6fee9ee 100644 --- a/tools/eslint/node_modules/lodash/fp/isObjectLike.js +++ b/tools/eslint/node_modules/lodash/fp/isObjectLike.js @@ -1 +1,5 @@ -module.exports = require('../isObjectLike'); +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isPlainObject.js b/tools/eslint/node_modules/lodash/fp/isPlainObject.js index 2d34d86a4e3823..b5bea90d3a7f26 100644 --- a/tools/eslint/node_modules/lodash/fp/isPlainObject.js +++ b/tools/eslint/node_modules/lodash/fp/isPlainObject.js @@ -1 +1,5 @@ -module.exports = require('../isPlainObject'); +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isRegExp.js b/tools/eslint/node_modules/lodash/fp/isRegExp.js index 4d0727becd2c4b..12a1a3d71852e9 100644 --- a/tools/eslint/node_modules/lodash/fp/isRegExp.js +++ b/tools/eslint/node_modules/lodash/fp/isRegExp.js @@ -1 +1,5 @@ -module.exports = require('../isRegExp'); +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSafeInteger.js b/tools/eslint/node_modules/lodash/fp/isSafeInteger.js index ed08cab6645942..7230f5520aa776 100644 --- a/tools/eslint/node_modules/lodash/fp/isSafeInteger.js +++ b/tools/eslint/node_modules/lodash/fp/isSafeInteger.js @@ -1 +1,5 @@ -module.exports = require('../isSafeInteger'); +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSet.js b/tools/eslint/node_modules/lodash/fp/isSet.js index f8a0a498c23b50..35c01f6fa19338 100644 --- a/tools/eslint/node_modules/lodash/fp/isSet.js +++ b/tools/eslint/node_modules/lodash/fp/isSet.js @@ -1 +1,5 @@ -module.exports = require('../isSet'); +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isString.js b/tools/eslint/node_modules/lodash/fp/isString.js index 2f22d0e44baf98..1fd0679ef865e9 100644 --- a/tools/eslint/node_modules/lodash/fp/isString.js +++ b/tools/eslint/node_modules/lodash/fp/isString.js @@ -1 +1,5 @@ -module.exports = require('../isString'); +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSymbol.js b/tools/eslint/node_modules/lodash/fp/isSymbol.js index 9ce6731ec57e7a..38676956dac9dd 100644 --- a/tools/eslint/node_modules/lodash/fp/isSymbol.js +++ b/tools/eslint/node_modules/lodash/fp/isSymbol.js @@ -1 +1,5 @@ -module.exports = require('../isSymbol'); +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isTypedArray.js b/tools/eslint/node_modules/lodash/fp/isTypedArray.js index 72349c5f08dfbf..8567953875ffc4 100644 --- a/tools/eslint/node_modules/lodash/fp/isTypedArray.js +++ b/tools/eslint/node_modules/lodash/fp/isTypedArray.js @@ -1 +1,5 @@ -module.exports = require('../isTypedArray'); +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isUndefined.js b/tools/eslint/node_modules/lodash/fp/isUndefined.js index a65c5bec9c73fc..ddbca31ca70f09 100644 --- a/tools/eslint/node_modules/lodash/fp/isUndefined.js +++ b/tools/eslint/node_modules/lodash/fp/isUndefined.js @@ -1 +1,5 @@ -module.exports = require('../isUndefined'); +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isWeakMap.js b/tools/eslint/node_modules/lodash/fp/isWeakMap.js index dc622014ed6037..ef60c613c4bdc9 100644 --- a/tools/eslint/node_modules/lodash/fp/isWeakMap.js +++ b/tools/eslint/node_modules/lodash/fp/isWeakMap.js @@ -1 +1,5 @@ -module.exports = require('../isWeakMap'); +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isWeakSet.js b/tools/eslint/node_modules/lodash/fp/isWeakSet.js index 7646ca884187b1..c99bfaa6d9d288 100644 --- a/tools/eslint/node_modules/lodash/fp/isWeakSet.js +++ b/tools/eslint/node_modules/lodash/fp/isWeakSet.js @@ -1 +1,5 @@ -module.exports = require('../isWeakSet'); +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/iteratee.js b/tools/eslint/node_modules/lodash/fp/iteratee.js index 2884465d5ac17f..9f0f71738a01ba 100644 --- a/tools/eslint/node_modules/lodash/fp/iteratee.js +++ b/tools/eslint/node_modules/lodash/fp/iteratee.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('iteratee', require('../iteratee')); +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/join.js b/tools/eslint/node_modules/lodash/fp/join.js index fdaa488e39268c..a220e003c4009f 100644 --- a/tools/eslint/node_modules/lodash/fp/join.js +++ b/tools/eslint/node_modules/lodash/fp/join.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('join', require('../join')); +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/juxt.js b/tools/eslint/node_modules/lodash/fp/juxt.js new file mode 100644 index 00000000000000..f71e04e00028f5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/tools/eslint/node_modules/lodash/fp/kebabCase.js b/tools/eslint/node_modules/lodash/fp/kebabCase.js index f251a4d4813f35..60737f17cdbc85 100644 --- a/tools/eslint/node_modules/lodash/fp/kebabCase.js +++ b/tools/eslint/node_modules/lodash/fp/kebabCase.js @@ -1 +1,5 @@ -module.exports = require('../kebabCase'); +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keyBy.js b/tools/eslint/node_modules/lodash/fp/keyBy.js index ad9abacb1b051b..9a6a85d4226045 100644 --- a/tools/eslint/node_modules/lodash/fp/keyBy.js +++ b/tools/eslint/node_modules/lodash/fp/keyBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('keyBy', require('../keyBy')); +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keys.js b/tools/eslint/node_modules/lodash/fp/keys.js index 23dc6b7d96c5dd..e12bb07f13022e 100644 --- a/tools/eslint/node_modules/lodash/fp/keys.js +++ b/tools/eslint/node_modules/lodash/fp/keys.js @@ -1 +1,5 @@ -module.exports = require('../keys'); +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keysIn.js b/tools/eslint/node_modules/lodash/fp/keysIn.js index 2b738b99f099c0..f3eb36a8d20d6c 100644 --- a/tools/eslint/node_modules/lodash/fp/keysIn.js +++ b/tools/eslint/node_modules/lodash/fp/keysIn.js @@ -1 +1,5 @@ -module.exports = require('../keysIn'); +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/last.js b/tools/eslint/node_modules/lodash/fp/last.js index 222be23aaee39d..0f716993fc80d9 100644 --- a/tools/eslint/node_modules/lodash/fp/last.js +++ b/tools/eslint/node_modules/lodash/fp/last.js @@ -1 +1,5 @@ -module.exports = require('../last'); +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lastIndexOf.js b/tools/eslint/node_modules/lodash/fp/lastIndexOf.js index e27480e3739852..ddf39c30135edd 100644 --- a/tools/eslint/node_modules/lodash/fp/lastIndexOf.js +++ b/tools/eslint/node_modules/lodash/fp/lastIndexOf.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('lastIndexOf', require('../lastIndexOf')); +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lowerCase.js b/tools/eslint/node_modules/lodash/fp/lowerCase.js index 4da15cea6f656a..ea64bc15d6f337 100644 --- a/tools/eslint/node_modules/lodash/fp/lowerCase.js +++ b/tools/eslint/node_modules/lodash/fp/lowerCase.js @@ -1 +1,5 @@ -module.exports = require('../lowerCase'); +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lowerFirst.js b/tools/eslint/node_modules/lodash/fp/lowerFirst.js index afd1ba5472c80b..539720a3da3e0e 100644 --- a/tools/eslint/node_modules/lodash/fp/lowerFirst.js +++ b/tools/eslint/node_modules/lodash/fp/lowerFirst.js @@ -1 +1,5 @@ -module.exports = require('../lowerFirst'); +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lt.js b/tools/eslint/node_modules/lodash/fp/lt.js index dd4cba04f6fe11..a31d21ecc660da 100644 --- a/tools/eslint/node_modules/lodash/fp/lt.js +++ b/tools/eslint/node_modules/lodash/fp/lt.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('lt', require('../lt')); +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lte.js b/tools/eslint/node_modules/lodash/fp/lte.js index f9bf7254ffd24e..d795d10ee7c78f 100644 --- a/tools/eslint/node_modules/lodash/fp/lte.js +++ b/tools/eslint/node_modules/lodash/fp/lte.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('lte', require('../lte')); +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/map.js b/tools/eslint/node_modules/lodash/fp/map.js index b74c1a1cea15ba..cf98794362808b 100644 --- a/tools/eslint/node_modules/lodash/fp/map.js +++ b/tools/eslint/node_modules/lodash/fp/map.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('map', require('../map')); +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mapKeys.js b/tools/eslint/node_modules/lodash/fp/mapKeys.js index a8156c104dbd62..1684587099e281 100644 --- a/tools/eslint/node_modules/lodash/fp/mapKeys.js +++ b/tools/eslint/node_modules/lodash/fp/mapKeys.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('mapKeys', require('../mapKeys')); +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mapObj.js b/tools/eslint/node_modules/lodash/fp/mapObj.js deleted file mode 100644 index 9f1872de91fadb..00000000000000 --- a/tools/eslint/node_modules/lodash/fp/mapObj.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./mapValues'); diff --git a/tools/eslint/node_modules/lodash/fp/mapValues.js b/tools/eslint/node_modules/lodash/fp/mapValues.js index 9375d73e34ff4b..4004972751db88 100644 --- a/tools/eslint/node_modules/lodash/fp/mapValues.js +++ b/tools/eslint/node_modules/lodash/fp/mapValues.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('mapValues', require('../mapValues')); +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/matches.js b/tools/eslint/node_modules/lodash/fp/matches.js index eea59164369847..629399cb8dc93f 100644 --- a/tools/eslint/node_modules/lodash/fp/matches.js +++ b/tools/eslint/node_modules/lodash/fp/matches.js @@ -1 +1,5 @@ -module.exports = require('../matches'); +var convert = require('./convert'), + func = convert('matches', require('../matches'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/matchesProperty.js b/tools/eslint/node_modules/lodash/fp/matchesProperty.js index c4343a1710ba35..4575bd2431b7e4 100644 --- a/tools/eslint/node_modules/lodash/fp/matchesProperty.js +++ b/tools/eslint/node_modules/lodash/fp/matchesProperty.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('matchesProperty', require('../matchesProperty')); +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/max.js b/tools/eslint/node_modules/lodash/fp/max.js index f7258c6ec30ac0..a66acac220717a 100644 --- a/tools/eslint/node_modules/lodash/fp/max.js +++ b/tools/eslint/node_modules/lodash/fp/max.js @@ -1 +1,5 @@ -module.exports = require('../max'); +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/maxBy.js b/tools/eslint/node_modules/lodash/fp/maxBy.js index b81243fabcb67c..d083fd64fd2d59 100644 --- a/tools/eslint/node_modules/lodash/fp/maxBy.js +++ b/tools/eslint/node_modules/lodash/fp/maxBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('maxBy', require('../maxBy')); +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mean.js b/tools/eslint/node_modules/lodash/fp/mean.js index b78e427a9e4217..31172460c3b44a 100644 --- a/tools/eslint/node_modules/lodash/fp/mean.js +++ b/tools/eslint/node_modules/lodash/fp/mean.js @@ -1 +1,5 @@ -module.exports = require('../mean'); +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/meanBy.js b/tools/eslint/node_modules/lodash/fp/meanBy.js new file mode 100644 index 00000000000000..556f25edfe912f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/memoize.js b/tools/eslint/node_modules/lodash/fp/memoize.js index 1a45e09eb8ac29..638eec63bad1bb 100644 --- a/tools/eslint/node_modules/lodash/fp/memoize.js +++ b/tools/eslint/node_modules/lodash/fp/memoize.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('memoize', require('../memoize')); +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/merge.js b/tools/eslint/node_modules/lodash/fp/merge.js index 3dca64191add42..ac66adde1221e6 100644 --- a/tools/eslint/node_modules/lodash/fp/merge.js +++ b/tools/eslint/node_modules/lodash/fp/merge.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('merge', require('../merge')); +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mergeWith.js b/tools/eslint/node_modules/lodash/fp/mergeWith.js index ba456444d86868..00d44d5e1a2711 100644 --- a/tools/eslint/node_modules/lodash/fp/mergeWith.js +++ b/tools/eslint/node_modules/lodash/fp/mergeWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('mergeWith', require('../mergeWith')); +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/method.js b/tools/eslint/node_modules/lodash/fp/method.js index c2f95c3f17281e..f4060c6878e9be 100644 --- a/tools/eslint/node_modules/lodash/fp/method.js +++ b/tools/eslint/node_modules/lodash/fp/method.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('method', require('../method')); +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/methodOf.js b/tools/eslint/node_modules/lodash/fp/methodOf.js index 223f6516e266d9..61399056f36858 100644 --- a/tools/eslint/node_modules/lodash/fp/methodOf.js +++ b/tools/eslint/node_modules/lodash/fp/methodOf.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('methodOf', require('../methodOf')); +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/min.js b/tools/eslint/node_modules/lodash/fp/min.js index 10db02c0e9665f..d12c6b40d38285 100644 --- a/tools/eslint/node_modules/lodash/fp/min.js +++ b/tools/eslint/node_modules/lodash/fp/min.js @@ -1 +1,5 @@ -module.exports = require('../min'); +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/minBy.js b/tools/eslint/node_modules/lodash/fp/minBy.js index 10edfd40d9e715..fdb9e24d8adcf1 100644 --- a/tools/eslint/node_modules/lodash/fp/minBy.js +++ b/tools/eslint/node_modules/lodash/fp/minBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('minBy', require('../minBy')); +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mixin.js b/tools/eslint/node_modules/lodash/fp/mixin.js index 965f1808c90111..332e6fbfddadf1 100644 --- a/tools/eslint/node_modules/lodash/fp/mixin.js +++ b/tools/eslint/node_modules/lodash/fp/mixin.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('mixin', require('../mixin')); +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/multiply.js b/tools/eslint/node_modules/lodash/fp/multiply.js new file mode 100644 index 00000000000000..4dcf0b0d4afb64 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/negate.js b/tools/eslint/node_modules/lodash/fp/negate.js index 345b4250e6f7a4..8b6dc7c5b882c3 100644 --- a/tools/eslint/node_modules/lodash/fp/negate.js +++ b/tools/eslint/node_modules/lodash/fp/negate.js @@ -1 +1,5 @@ -module.exports = require('../negate'); +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/next.js b/tools/eslint/node_modules/lodash/fp/next.js index 5cad70e44bd312..140155e2321f8b 100644 --- a/tools/eslint/node_modules/lodash/fp/next.js +++ b/tools/eslint/node_modules/lodash/fp/next.js @@ -1 +1,5 @@ -module.exports = require('../next'); +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/noop.js b/tools/eslint/node_modules/lodash/fp/noop.js index ca1005047a3af6..b9e32cc8cd8729 100644 --- a/tools/eslint/node_modules/lodash/fp/noop.js +++ b/tools/eslint/node_modules/lodash/fp/noop.js @@ -1 +1,5 @@ -module.exports = require('../noop'); +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/now.js b/tools/eslint/node_modules/lodash/fp/now.js index aa5ed67a7bf33d..6de2068aacc53b 100644 --- a/tools/eslint/node_modules/lodash/fp/now.js +++ b/tools/eslint/node_modules/lodash/fp/now.js @@ -1 +1,5 @@ -module.exports = require('../now'); +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/nth.js b/tools/eslint/node_modules/lodash/fp/nth.js new file mode 100644 index 00000000000000..da4fda74092563 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/nth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nth', require('../nth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/nthArg.js b/tools/eslint/node_modules/lodash/fp/nthArg.js index dd47ac66672f60..8ccd8e60b1a812 100644 --- a/tools/eslint/node_modules/lodash/fp/nthArg.js +++ b/tools/eslint/node_modules/lodash/fp/nthArg.js @@ -1 +1,5 @@ -module.exports = require('../nthArg'); +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/omit.js b/tools/eslint/node_modules/lodash/fp/omit.js index 404b5516075e56..fd685291e64e29 100644 --- a/tools/eslint/node_modules/lodash/fp/omit.js +++ b/tools/eslint/node_modules/lodash/fp/omit.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('omit', require('../omit')); +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/omitBy.js b/tools/eslint/node_modules/lodash/fp/omitBy.js index 745efa54f03071..90df7380269d9b 100644 --- a/tools/eslint/node_modules/lodash/fp/omitBy.js +++ b/tools/eslint/node_modules/lodash/fp/omitBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('omitBy', require('../omitBy')); +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/once.js b/tools/eslint/node_modules/lodash/fp/once.js index 6bd0beb20f93ac..f8f0a5c73ecf0c 100644 --- a/tools/eslint/node_modules/lodash/fp/once.js +++ b/tools/eslint/node_modules/lodash/fp/once.js @@ -1 +1,5 @@ -module.exports = require('../once'); +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/orderBy.js b/tools/eslint/node_modules/lodash/fp/orderBy.js index b32244f18150ec..848e210754641a 100644 --- a/tools/eslint/node_modules/lodash/fp/orderBy.js +++ b/tools/eslint/node_modules/lodash/fp/orderBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('orderBy', require('../orderBy')); +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/over.js b/tools/eslint/node_modules/lodash/fp/over.js index 0a5a797a74dec0..01eba7b9847805 100644 --- a/tools/eslint/node_modules/lodash/fp/over.js +++ b/tools/eslint/node_modules/lodash/fp/over.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('over', require('../over')); +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overArgs.js b/tools/eslint/node_modules/lodash/fp/overArgs.js index 818838745d21a9..738556f0c0da92 100644 --- a/tools/eslint/node_modules/lodash/fp/overArgs.js +++ b/tools/eslint/node_modules/lodash/fp/overArgs.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('overArgs', require('../overArgs')); +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overEvery.js b/tools/eslint/node_modules/lodash/fp/overEvery.js index 36dc552b370b21..9f5a032dc7782c 100644 --- a/tools/eslint/node_modules/lodash/fp/overEvery.js +++ b/tools/eslint/node_modules/lodash/fp/overEvery.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('overEvery', require('../overEvery')); +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overSome.js b/tools/eslint/node_modules/lodash/fp/overSome.js index b02d464ac5f79d..15939d5865a2b4 100644 --- a/tools/eslint/node_modules/lodash/fp/overSome.js +++ b/tools/eslint/node_modules/lodash/fp/overSome.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('overSome', require('../overSome')); +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pad.js b/tools/eslint/node_modules/lodash/fp/pad.js index e59cfc93577099..f1dea4a98f6447 100644 --- a/tools/eslint/node_modules/lodash/fp/pad.js +++ b/tools/eslint/node_modules/lodash/fp/pad.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pad', require('../pad')); +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padChars.js b/tools/eslint/node_modules/lodash/fp/padChars.js new file mode 100644 index 00000000000000..d6e0804cd6ca96 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padCharsEnd.js b/tools/eslint/node_modules/lodash/fp/padCharsEnd.js new file mode 100644 index 00000000000000..d4ab79ad305f58 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padCharsStart.js b/tools/eslint/node_modules/lodash/fp/padCharsStart.js new file mode 100644 index 00000000000000..a08a30000a6617 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padEnd.js b/tools/eslint/node_modules/lodash/fp/padEnd.js index 0b6dbb786f80b7..a8522ec36a5fb6 100644 --- a/tools/eslint/node_modules/lodash/fp/padEnd.js +++ b/tools/eslint/node_modules/lodash/fp/padEnd.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('padEnd', require('../padEnd')); +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padStart.js b/tools/eslint/node_modules/lodash/fp/padStart.js index c97f098976d7d9..f4ca79d4af8ebd 100644 --- a/tools/eslint/node_modules/lodash/fp/padStart.js +++ b/tools/eslint/node_modules/lodash/fp/padStart.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('padStart', require('../padStart')); +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/parseInt.js b/tools/eslint/node_modules/lodash/fp/parseInt.js index 35be7137ea2457..27314ccbca67b4 100644 --- a/tools/eslint/node_modules/lodash/fp/parseInt.js +++ b/tools/eslint/node_modules/lodash/fp/parseInt.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('parseInt', require('../parseInt')); +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partial.js b/tools/eslint/node_modules/lodash/fp/partial.js index a687d0c8c39610..5d4601598bf83c 100644 --- a/tools/eslint/node_modules/lodash/fp/partial.js +++ b/tools/eslint/node_modules/lodash/fp/partial.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('partial', require('../partial')); +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partialRight.js b/tools/eslint/node_modules/lodash/fp/partialRight.js index 28428c0339cbc0..7f05fed0ab3bb8 100644 --- a/tools/eslint/node_modules/lodash/fp/partialRight.js +++ b/tools/eslint/node_modules/lodash/fp/partialRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('partialRight', require('../partialRight')); +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partition.js b/tools/eslint/node_modules/lodash/fp/partition.js index b1495e6760b817..2ebcacc1f4d5f3 100644 --- a/tools/eslint/node_modules/lodash/fp/partition.js +++ b/tools/eslint/node_modules/lodash/fp/partition.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('partition', require('../partition')); +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/paths.js b/tools/eslint/node_modules/lodash/fp/paths.js new file mode 100644 index 00000000000000..1eb7950ac0a6fe --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/paths.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/tools/eslint/node_modules/lodash/fp/pick.js b/tools/eslint/node_modules/lodash/fp/pick.js index e84b366d765ca5..197393de1d2241 100644 --- a/tools/eslint/node_modules/lodash/fp/pick.js +++ b/tools/eslint/node_modules/lodash/fp/pick.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pick', require('../pick')); +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pickBy.js b/tools/eslint/node_modules/lodash/fp/pickBy.js index 4d14a0b586c99f..d832d16b6c2b04 100644 --- a/tools/eslint/node_modules/lodash/fp/pickBy.js +++ b/tools/eslint/node_modules/lodash/fp/pickBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pickBy', require('../pickBy')); +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/placeholder.js b/tools/eslint/node_modules/lodash/fp/placeholder.js new file mode 100644 index 00000000000000..1ce17393b99c34 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/tools/eslint/node_modules/lodash/fp/plant.js b/tools/eslint/node_modules/lodash/fp/plant.js index c85596a0c4618c..eca8f32b4afa9f 100644 --- a/tools/eslint/node_modules/lodash/fp/plant.js +++ b/tools/eslint/node_modules/lodash/fp/plant.js @@ -1 +1,5 @@ -module.exports = require('../plant'); +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pluck.js b/tools/eslint/node_modules/lodash/fp/pluck.js new file mode 100644 index 00000000000000..0d1e1abfaf9700 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/tools/eslint/node_modules/lodash/fp/propEq.js b/tools/eslint/node_modules/lodash/fp/propEq.js new file mode 100644 index 00000000000000..36c027a38343f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/propEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/tools/eslint/node_modules/lodash/fp/propOf.js b/tools/eslint/node_modules/lodash/fp/propOf.js deleted file mode 100644 index cf0d197c62ce0c..00000000000000 --- a/tools/eslint/node_modules/lodash/fp/propOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./propertyOf'); diff --git a/tools/eslint/node_modules/lodash/fp/property.js b/tools/eslint/node_modules/lodash/fp/property.js index fab6f239f83fb3..d832fbba322ad3 100644 --- a/tools/eslint/node_modules/lodash/fp/property.js +++ b/tools/eslint/node_modules/lodash/fp/property.js @@ -1 +1,5 @@ -module.exports = require('../property'); +var convert = require('./convert'), + func = convert('property', require('../property'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/propertyOf.js b/tools/eslint/node_modules/lodash/fp/propertyOf.js index d941cdbf55fc78..3cfdef790a9e46 100644 --- a/tools/eslint/node_modules/lodash/fp/propertyOf.js +++ b/tools/eslint/node_modules/lodash/fp/propertyOf.js @@ -1 +1,5 @@ -module.exports = require('../propertyOf'); +var convert = require('./convert'), + func = convert('propertyOf', require('../propertyOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/props.js b/tools/eslint/node_modules/lodash/fp/props.js new file mode 100644 index 00000000000000..1eb7950ac0a6fe --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/props.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/tools/eslint/node_modules/lodash/fp/pull.js b/tools/eslint/node_modules/lodash/fp/pull.js index 47f49aefcd03cd..8d7084f0795aca 100644 --- a/tools/eslint/node_modules/lodash/fp/pull.js +++ b/tools/eslint/node_modules/lodash/fp/pull.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pull', require('../pull')); +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAll.js b/tools/eslint/node_modules/lodash/fp/pullAll.js index ffb663bc6db55d..98d5c9a73a9c03 100644 --- a/tools/eslint/node_modules/lodash/fp/pullAll.js +++ b/tools/eslint/node_modules/lodash/fp/pullAll.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pullAll', require('../pullAll')); +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAllBy.js b/tools/eslint/node_modules/lodash/fp/pullAllBy.js index 23b11b7b3e3ed1..876bc3bf1cda84 100644 --- a/tools/eslint/node_modules/lodash/fp/pullAllBy.js +++ b/tools/eslint/node_modules/lodash/fp/pullAllBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pullAllBy', require('../pullAllBy')); +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAllWith.js b/tools/eslint/node_modules/lodash/fp/pullAllWith.js new file mode 100644 index 00000000000000..f71ba4d73db312 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAt.js b/tools/eslint/node_modules/lodash/fp/pullAt.js index 5836d2ddac431d..e8b3bb6125965d 100644 --- a/tools/eslint/node_modules/lodash/fp/pullAt.js +++ b/tools/eslint/node_modules/lodash/fp/pullAt.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('pullAt', require('../pullAt')); +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/random.js b/tools/eslint/node_modules/lodash/fp/random.js index 607d63a194d6af..99d852e4ab2436 100644 --- a/tools/eslint/node_modules/lodash/fp/random.js +++ b/tools/eslint/node_modules/lodash/fp/random.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('random', require('../random')); +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/range.js b/tools/eslint/node_modules/lodash/fp/range.js index 1142304e5f155c..a6bb59118b4490 100644 --- a/tools/eslint/node_modules/lodash/fp/range.js +++ b/tools/eslint/node_modules/lodash/fp/range.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('range', require('../range')); +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rangeRight.js b/tools/eslint/node_modules/lodash/fp/rangeRight.js index 22482877d0d618..fdb712f94e1e9a 100644 --- a/tools/eslint/node_modules/lodash/fp/rangeRight.js +++ b/tools/eslint/node_modules/lodash/fp/rangeRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('rangeRight', require('../rangeRight')); +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rearg.js b/tools/eslint/node_modules/lodash/fp/rearg.js index b2753e9e003456..678e02a32a8941 100644 --- a/tools/eslint/node_modules/lodash/fp/rearg.js +++ b/tools/eslint/node_modules/lodash/fp/rearg.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('rearg', require('../rearg')); +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reduce.js b/tools/eslint/node_modules/lodash/fp/reduce.js index 2f1b42510217e3..4cef0a0083ca58 100644 --- a/tools/eslint/node_modules/lodash/fp/reduce.js +++ b/tools/eslint/node_modules/lodash/fp/reduce.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('reduce', require('../reduce')); +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reduceRight.js b/tools/eslint/node_modules/lodash/fp/reduceRight.js index b110e9e9b96a44..caf5bb5155d9f7 100644 --- a/tools/eslint/node_modules/lodash/fp/reduceRight.js +++ b/tools/eslint/node_modules/lodash/fp/reduceRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('reduceRight', require('../reduceRight')); +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reject.js b/tools/eslint/node_modules/lodash/fp/reject.js index 30bd3bc7d2c3c7..c1632738619eae 100644 --- a/tools/eslint/node_modules/lodash/fp/reject.js +++ b/tools/eslint/node_modules/lodash/fp/reject.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('reject', require('../reject')); +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/remove.js b/tools/eslint/node_modules/lodash/fp/remove.js index 4b67a943159362..e9d13273680413 100644 --- a/tools/eslint/node_modules/lodash/fp/remove.js +++ b/tools/eslint/node_modules/lodash/fp/remove.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('remove', require('../remove')); +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/repeat.js b/tools/eslint/node_modules/lodash/fp/repeat.js index bc0704b3ab91b3..08470f247a36a3 100644 --- a/tools/eslint/node_modules/lodash/fp/repeat.js +++ b/tools/eslint/node_modules/lodash/fp/repeat.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('repeat', require('../repeat')); +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/replace.js b/tools/eslint/node_modules/lodash/fp/replace.js index a4462e7d858a39..2227db62571126 100644 --- a/tools/eslint/node_modules/lodash/fp/replace.js +++ b/tools/eslint/node_modules/lodash/fp/replace.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('replace', require('../replace')); +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rest.js b/tools/eslint/node_modules/lodash/fp/rest.js index 69dfc18a7d5cb5..c1f3d64bdceee0 100644 --- a/tools/eslint/node_modules/lodash/fp/rest.js +++ b/tools/eslint/node_modules/lodash/fp/rest.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('rest', require('../rest')); +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/restFrom.js b/tools/eslint/node_modules/lodash/fp/restFrom.js new file mode 100644 index 00000000000000..714e42b5d6632a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/result.js b/tools/eslint/node_modules/lodash/fp/result.js index 1d3fb58ffa0e93..f86ce071264248 100644 --- a/tools/eslint/node_modules/lodash/fp/result.js +++ b/tools/eslint/node_modules/lodash/fp/result.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('result', require('../result')); +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reverse.js b/tools/eslint/node_modules/lodash/fp/reverse.js index a6d960de0d7dab..07c9f5e4933056 100644 --- a/tools/eslint/node_modules/lodash/fp/reverse.js +++ b/tools/eslint/node_modules/lodash/fp/reverse.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('reverse', require('../reverse')); +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/round.js b/tools/eslint/node_modules/lodash/fp/round.js index 9eb69b18ed8ef8..4c0e5c829983d1 100644 --- a/tools/eslint/node_modules/lodash/fp/round.js +++ b/tools/eslint/node_modules/lodash/fp/round.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('round', require('../round')); +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sample.js b/tools/eslint/node_modules/lodash/fp/sample.js index 008cb0683151e6..6bea1254de6069 100644 --- a/tools/eslint/node_modules/lodash/fp/sample.js +++ b/tools/eslint/node_modules/lodash/fp/sample.js @@ -1 +1,5 @@ -module.exports = require('../sample'); +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sampleSize.js b/tools/eslint/node_modules/lodash/fp/sampleSize.js index 920c075ff999fd..359ed6fcda1501 100644 --- a/tools/eslint/node_modules/lodash/fp/sampleSize.js +++ b/tools/eslint/node_modules/lodash/fp/sampleSize.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sampleSize', require('../sampleSize')); +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/set.js b/tools/eslint/node_modules/lodash/fp/set.js index fc2a75b3665aff..0b56a56c8a8d3c 100644 --- a/tools/eslint/node_modules/lodash/fp/set.js +++ b/tools/eslint/node_modules/lodash/fp/set.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('set', require('../set')); +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/setWith.js b/tools/eslint/node_modules/lodash/fp/setWith.js index fd836ea40e7c87..0b584952b6c469 100644 --- a/tools/eslint/node_modules/lodash/fp/setWith.js +++ b/tools/eslint/node_modules/lodash/fp/setWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('setWith', require('../setWith')); +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/shuffle.js b/tools/eslint/node_modules/lodash/fp/shuffle.js index 85d569921a35dc..aa3a1ca5be95d8 100644 --- a/tools/eslint/node_modules/lodash/fp/shuffle.js +++ b/tools/eslint/node_modules/lodash/fp/shuffle.js @@ -1 +1,5 @@ -module.exports = require('../shuffle'); +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/size.js b/tools/eslint/node_modules/lodash/fp/size.js index efba2ca65d473b..7490136e1cb4d8 100644 --- a/tools/eslint/node_modules/lodash/fp/size.js +++ b/tools/eslint/node_modules/lodash/fp/size.js @@ -1 +1,5 @@ -module.exports = require('../size'); +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/slice.js b/tools/eslint/node_modules/lodash/fp/slice.js index 6fb1898f94a0f3..15945d321f78d2 100644 --- a/tools/eslint/node_modules/lodash/fp/slice.js +++ b/tools/eslint/node_modules/lodash/fp/slice.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('slice', require('../slice')); +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/snakeCase.js b/tools/eslint/node_modules/lodash/fp/snakeCase.js index 2893f7bdaa3c46..a0ff7808eb9223 100644 --- a/tools/eslint/node_modules/lodash/fp/snakeCase.js +++ b/tools/eslint/node_modules/lodash/fp/snakeCase.js @@ -1 +1,5 @@ -module.exports = require('../snakeCase'); +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/some.js b/tools/eslint/node_modules/lodash/fp/some.js index 64727fe3899614..a4fa2d00602861 100644 --- a/tools/eslint/node_modules/lodash/fp/some.js +++ b/tools/eslint/node_modules/lodash/fp/some.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('some', require('../some')); +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortBy.js b/tools/eslint/node_modules/lodash/fp/sortBy.js index 80fe4dd37ca72b..e0790ad5b70ff9 100644 --- a/tools/eslint/node_modules/lodash/fp/sortBy.js +++ b/tools/eslint/node_modules/lodash/fp/sortBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortBy', require('../sortBy')); +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndex.js b/tools/eslint/node_modules/lodash/fp/sortedIndex.js index 509dcb87917208..364a05435e7714 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedIndex.js +++ b/tools/eslint/node_modules/lodash/fp/sortedIndex.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndex', require('../sortedIndex')); +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js b/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js index aa2d219695c9c6..9593dbd13d6fd2 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js +++ b/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndexBy', require('../sortedIndexBy')); +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js b/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js index c1274201097cae..c9084cab6a0319 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js +++ b/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndexOf', require('../sortedIndexOf')); +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js index 7ec9e335940d48..47fe241af7d989 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndex', require('../sortedLastIndex')); +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js index e03f1853e0da88..0f9a3473267398 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js index 0130801e94b782..0d4d93278f906e 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedUniq.js b/tools/eslint/node_modules/lodash/fp/sortedUniq.js index c0df750eec6250..882d283702cd2f 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedUniq.js +++ b/tools/eslint/node_modules/lodash/fp/sortedUniq.js @@ -1 +1,5 @@ -module.exports = require('../sortedUniq'); +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js b/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js index f5c65ad6b086ac..033db91ca9de25 100644 --- a/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js +++ b/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sortedUniqBy', require('../sortedUniqBy')); +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/split.js b/tools/eslint/node_modules/lodash/fp/split.js index 79f26939318636..14de1a7efda4ed 100644 --- a/tools/eslint/node_modules/lodash/fp/split.js +++ b/tools/eslint/node_modules/lodash/fp/split.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('split', require('../split')); +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/spread.js b/tools/eslint/node_modules/lodash/fp/spread.js index 0348df25ce7720..2d11b70722dc83 100644 --- a/tools/eslint/node_modules/lodash/fp/spread.js +++ b/tools/eslint/node_modules/lodash/fp/spread.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('spread', require('../spread')); +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/spreadFrom.js b/tools/eslint/node_modules/lodash/fp/spreadFrom.js new file mode 100644 index 00000000000000..0b630df1b38bef --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/startCase.js b/tools/eslint/node_modules/lodash/fp/startCase.js index 2a6a66ef15c2ea..ada98c943dee83 100644 --- a/tools/eslint/node_modules/lodash/fp/startCase.js +++ b/tools/eslint/node_modules/lodash/fp/startCase.js @@ -1 +1,5 @@ -module.exports = require('../startCase'); +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/startsWith.js b/tools/eslint/node_modules/lodash/fp/startsWith.js index 730a141f6d7faa..985e2f2948ca34 100644 --- a/tools/eslint/node_modules/lodash/fp/startsWith.js +++ b/tools/eslint/node_modules/lodash/fp/startsWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('startsWith', require('../startsWith')); +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/subtract.js b/tools/eslint/node_modules/lodash/fp/subtract.js index 46b83db36316e1..d32b16d4797310 100644 --- a/tools/eslint/node_modules/lodash/fp/subtract.js +++ b/tools/eslint/node_modules/lodash/fp/subtract.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('subtract', require('../subtract')); +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sum.js b/tools/eslint/node_modules/lodash/fp/sum.js index e8a59c5d039501..5cce12b325c41c 100644 --- a/tools/eslint/node_modules/lodash/fp/sum.js +++ b/tools/eslint/node_modules/lodash/fp/sum.js @@ -1 +1,5 @@ -module.exports = require('../sum'); +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sumBy.js b/tools/eslint/node_modules/lodash/fp/sumBy.js index 2692dc1e4ad2ac..c8826565f988d6 100644 --- a/tools/eslint/node_modules/lodash/fp/sumBy.js +++ b/tools/eslint/node_modules/lodash/fp/sumBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('sumBy', require('../sumBy')); +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/tail.js b/tools/eslint/node_modules/lodash/fp/tail.js index 36c6494a61d693..f122f0ac3476e6 100644 --- a/tools/eslint/node_modules/lodash/fp/tail.js +++ b/tools/eslint/node_modules/lodash/fp/tail.js @@ -1 +1,5 @@ -module.exports = require('../tail'); +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/take.js b/tools/eslint/node_modules/lodash/fp/take.js index e0984a4d2da6b7..9af98a7bdb6dd9 100644 --- a/tools/eslint/node_modules/lodash/fp/take.js +++ b/tools/eslint/node_modules/lodash/fp/take.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('take', require('../take')); +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeRight.js b/tools/eslint/node_modules/lodash/fp/takeRight.js index 7b7c3ce70ed971..b82950a696ca12 100644 --- a/tools/eslint/node_modules/lodash/fp/takeRight.js +++ b/tools/eslint/node_modules/lodash/fp/takeRight.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('takeRight', require('../takeRight')); +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeRightWhile.js b/tools/eslint/node_modules/lodash/fp/takeRightWhile.js index 305b254a163552..8ffb0a285768e0 100644 --- a/tools/eslint/node_modules/lodash/fp/takeRightWhile.js +++ b/tools/eslint/node_modules/lodash/fp/takeRightWhile.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('takeRightWhile', require('../takeRightWhile')); +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeWhile.js b/tools/eslint/node_modules/lodash/fp/takeWhile.js index a90126db08edda..28136644fe6ac2 100644 --- a/tools/eslint/node_modules/lodash/fp/takeWhile.js +++ b/tools/eslint/node_modules/lodash/fp/takeWhile.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('takeWhile', require('../takeWhile')); +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/tap.js b/tools/eslint/node_modules/lodash/fp/tap.js index 3bec2bdb2cd5cc..d33ad6ec1e2a4e 100644 --- a/tools/eslint/node_modules/lodash/fp/tap.js +++ b/tools/eslint/node_modules/lodash/fp/tap.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('tap', require('../tap')); +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/template.js b/tools/eslint/node_modules/lodash/fp/template.js index 0130d14503b23b..74857e1c8411b5 100644 --- a/tools/eslint/node_modules/lodash/fp/template.js +++ b/tools/eslint/node_modules/lodash/fp/template.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('template', require('../template')); +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/templateSettings.js b/tools/eslint/node_modules/lodash/fp/templateSettings.js index ddbbb5861c584c..7bcc0a82b908fb 100644 --- a/tools/eslint/node_modules/lodash/fp/templateSettings.js +++ b/tools/eslint/node_modules/lodash/fp/templateSettings.js @@ -1 +1,5 @@ -module.exports = require('../templateSettings'); +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/throttle.js b/tools/eslint/node_modules/lodash/fp/throttle.js index 36f76d6df03b1e..77fff142840d74 100644 --- a/tools/eslint/node_modules/lodash/fp/throttle.js +++ b/tools/eslint/node_modules/lodash/fp/throttle.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('throttle', require('../throttle')); +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/thru.js b/tools/eslint/node_modules/lodash/fp/thru.js index 05ddaefd8243d5..d42b3b1d8404d9 100644 --- a/tools/eslint/node_modules/lodash/fp/thru.js +++ b/tools/eslint/node_modules/lodash/fp/thru.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('thru', require('../thru')); +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/times.js b/tools/eslint/node_modules/lodash/fp/times.js index 02fd3b70c6346c..0dab06dad16c86 100644 --- a/tools/eslint/node_modules/lodash/fp/times.js +++ b/tools/eslint/node_modules/lodash/fp/times.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('times', require('../times')); +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toArray.js b/tools/eslint/node_modules/lodash/fp/toArray.js index 1ea0b52103e57a..f0c360aca317da 100644 --- a/tools/eslint/node_modules/lodash/fp/toArray.js +++ b/tools/eslint/node_modules/lodash/fp/toArray.js @@ -1 +1,5 @@ -module.exports = require('../toArray'); +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toInteger.js b/tools/eslint/node_modules/lodash/fp/toInteger.js index 17e59a3d916fe4..e0af6a750e3963 100644 --- a/tools/eslint/node_modules/lodash/fp/toInteger.js +++ b/tools/eslint/node_modules/lodash/fp/toInteger.js @@ -1 +1,5 @@ -module.exports = require('../toInteger'); +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toIterator.js b/tools/eslint/node_modules/lodash/fp/toIterator.js index 13bf21c2ae5634..65e6baa9ddedf8 100644 --- a/tools/eslint/node_modules/lodash/fp/toIterator.js +++ b/tools/eslint/node_modules/lodash/fp/toIterator.js @@ -1 +1,5 @@ -module.exports = require('../toIterator'); +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toJSON.js b/tools/eslint/node_modules/lodash/fp/toJSON.js index 5f6cb9268f9688..2d718d0bc1beae 100644 --- a/tools/eslint/node_modules/lodash/fp/toJSON.js +++ b/tools/eslint/node_modules/lodash/fp/toJSON.js @@ -1 +1,5 @@ -module.exports = require('../toJSON'); +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toLength.js b/tools/eslint/node_modules/lodash/fp/toLength.js index 38529fb0a00244..b97cdd935144be 100644 --- a/tools/eslint/node_modules/lodash/fp/toLength.js +++ b/tools/eslint/node_modules/lodash/fp/toLength.js @@ -1 +1,5 @@ -module.exports = require('../toLength'); +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toLower.js b/tools/eslint/node_modules/lodash/fp/toLower.js index 01d343248a1ce1..616ef36ada145a 100644 --- a/tools/eslint/node_modules/lodash/fp/toLower.js +++ b/tools/eslint/node_modules/lodash/fp/toLower.js @@ -1 +1,5 @@ -module.exports = require('../toLower'); +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toNumber.js b/tools/eslint/node_modules/lodash/fp/toNumber.js index 071e320a170f70..d0c6f4d3d6449f 100644 --- a/tools/eslint/node_modules/lodash/fp/toNumber.js +++ b/tools/eslint/node_modules/lodash/fp/toNumber.js @@ -1 +1,5 @@ -module.exports = require('../toNumber'); +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPairs.js b/tools/eslint/node_modules/lodash/fp/toPairs.js index 4b4dcb767a3384..af783786ee1d6d 100644 --- a/tools/eslint/node_modules/lodash/fp/toPairs.js +++ b/tools/eslint/node_modules/lodash/fp/toPairs.js @@ -1 +1,5 @@ -module.exports = require('../toPairs'); +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPairsIn.js b/tools/eslint/node_modules/lodash/fp/toPairsIn.js index 53076cc6a96dfe..66504abf1f196c 100644 --- a/tools/eslint/node_modules/lodash/fp/toPairsIn.js +++ b/tools/eslint/node_modules/lodash/fp/toPairsIn.js @@ -1 +1,5 @@ -module.exports = require('../toPairsIn'); +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPath.js b/tools/eslint/node_modules/lodash/fp/toPath.js index 62762ecfab14bd..b4d5e50fb70249 100644 --- a/tools/eslint/node_modules/lodash/fp/toPath.js +++ b/tools/eslint/node_modules/lodash/fp/toPath.js @@ -1 +1,5 @@ -module.exports = require('../toPath'); +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPlainObject.js b/tools/eslint/node_modules/lodash/fp/toPlainObject.js index 6a6aebd042e36b..278bb86398d020 100644 --- a/tools/eslint/node_modules/lodash/fp/toPlainObject.js +++ b/tools/eslint/node_modules/lodash/fp/toPlainObject.js @@ -1 +1,5 @@ -module.exports = require('../toPlainObject'); +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toSafeInteger.js b/tools/eslint/node_modules/lodash/fp/toSafeInteger.js index 3f5b8174d3c3df..367a26fddc7411 100644 --- a/tools/eslint/node_modules/lodash/fp/toSafeInteger.js +++ b/tools/eslint/node_modules/lodash/fp/toSafeInteger.js @@ -1 +1,5 @@ -module.exports = require('../toSafeInteger'); +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toString.js b/tools/eslint/node_modules/lodash/fp/toString.js index c309058c0166e1..cec4f8e2233261 100644 --- a/tools/eslint/node_modules/lodash/fp/toString.js +++ b/tools/eslint/node_modules/lodash/fp/toString.js @@ -1 +1,5 @@ -module.exports = require('../[object Object]'); +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toUpper.js b/tools/eslint/node_modules/lodash/fp/toUpper.js index 428eb338500ed8..54f9a560585561 100644 --- a/tools/eslint/node_modules/lodash/fp/toUpper.js +++ b/tools/eslint/node_modules/lodash/fp/toUpper.js @@ -1 +1,5 @@ -module.exports = require('../toUpper'); +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/transform.js b/tools/eslint/node_modules/lodash/fp/transform.js index 30bed49a92953b..759d088f1a35f0 100644 --- a/tools/eslint/node_modules/lodash/fp/transform.js +++ b/tools/eslint/node_modules/lodash/fp/transform.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('transform', require('../transform')); +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trim.js b/tools/eslint/node_modules/lodash/fp/trim.js index b7cafe9679786e..e6319a741c7689 100644 --- a/tools/eslint/node_modules/lodash/fp/trim.js +++ b/tools/eslint/node_modules/lodash/fp/trim.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trim', require('../trim')); +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimChars.js b/tools/eslint/node_modules/lodash/fp/trimChars.js index 051ea1e6e65772..c9294de48c756f 100644 --- a/tools/eslint/node_modules/lodash/fp/trimChars.js +++ b/tools/eslint/node_modules/lodash/fp/trimChars.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trimChars', require('../trim')); +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js b/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js index 54c5cff72a1326..284bc2f813e897 100644 --- a/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js +++ b/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trimCharsEnd', require('../trimEnd')); +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimCharsStart.js b/tools/eslint/node_modules/lodash/fp/trimCharsStart.js index 44f986650ce928..ff0ee65dfbadc7 100644 --- a/tools/eslint/node_modules/lodash/fp/trimCharsStart.js +++ b/tools/eslint/node_modules/lodash/fp/trimCharsStart.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trimCharsStart', require('../trimStart')); +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimEnd.js b/tools/eslint/node_modules/lodash/fp/trimEnd.js index 166659666158ac..71908805fceeee 100644 --- a/tools/eslint/node_modules/lodash/fp/trimEnd.js +++ b/tools/eslint/node_modules/lodash/fp/trimEnd.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trimEnd', require('../trimEnd')); +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimStart.js b/tools/eslint/node_modules/lodash/fp/trimStart.js index 4921b0342965a0..fda902c3893a8b 100644 --- a/tools/eslint/node_modules/lodash/fp/trimStart.js +++ b/tools/eslint/node_modules/lodash/fp/trimStart.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('trimStart', require('../trimStart')); +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/truncate.js b/tools/eslint/node_modules/lodash/fp/truncate.js index 0c4d158f87bcaf..d265c1decb397d 100644 --- a/tools/eslint/node_modules/lodash/fp/truncate.js +++ b/tools/eslint/node_modules/lodash/fp/truncate.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('truncate', require('../truncate')); +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unary.js b/tools/eslint/node_modules/lodash/fp/unary.js index 3bc648376a003d..286c945fb638dd 100644 --- a/tools/eslint/node_modules/lodash/fp/unary.js +++ b/tools/eslint/node_modules/lodash/fp/unary.js @@ -1 +1,5 @@ -module.exports = require('../unary'); +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unescape.js b/tools/eslint/node_modules/lodash/fp/unescape.js index 4233b155fc20a4..fddcb46e2ddb93 100644 --- a/tools/eslint/node_modules/lodash/fp/unescape.js +++ b/tools/eslint/node_modules/lodash/fp/unescape.js @@ -1 +1,5 @@ -module.exports = require('../unescape'); +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/union.js b/tools/eslint/node_modules/lodash/fp/union.js index 9deef123523dea..ef8228d74c751c 100644 --- a/tools/eslint/node_modules/lodash/fp/union.js +++ b/tools/eslint/node_modules/lodash/fp/union.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('union', require('../union')); +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unionBy.js b/tools/eslint/node_modules/lodash/fp/unionBy.js index 029b359618a7e0..603687a188edb2 100644 --- a/tools/eslint/node_modules/lodash/fp/unionBy.js +++ b/tools/eslint/node_modules/lodash/fp/unionBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('unionBy', require('../unionBy')); +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unionWith.js b/tools/eslint/node_modules/lodash/fp/unionWith.js index 631eda089086b8..65bb3a79287031 100644 --- a/tools/eslint/node_modules/lodash/fp/unionWith.js +++ b/tools/eslint/node_modules/lodash/fp/unionWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('unionWith', require('../unionWith')); +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniq.js b/tools/eslint/node_modules/lodash/fp/uniq.js index c64510f0987d17..bc1852490ba9d1 100644 --- a/tools/eslint/node_modules/lodash/fp/uniq.js +++ b/tools/eslint/node_modules/lodash/fp/uniq.js @@ -1 +1,5 @@ -module.exports = require('../uniq'); +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqBy.js b/tools/eslint/node_modules/lodash/fp/uniqBy.js index 1b6c03ff9e734e..634c6a8bb3d7aa 100644 --- a/tools/eslint/node_modules/lodash/fp/uniqBy.js +++ b/tools/eslint/node_modules/lodash/fp/uniqBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('uniqBy', require('../uniqBy')); +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqWith.js b/tools/eslint/node_modules/lodash/fp/uniqWith.js index be4c48def48257..0ec601a910f5f0 100644 --- a/tools/eslint/node_modules/lodash/fp/uniqWith.js +++ b/tools/eslint/node_modules/lodash/fp/uniqWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('uniqWith', require('../uniqWith')); +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqueId.js b/tools/eslint/node_modules/lodash/fp/uniqueId.js index daa41cb0983a28..aa8fc2f73980d9 100644 --- a/tools/eslint/node_modules/lodash/fp/uniqueId.js +++ b/tools/eslint/node_modules/lodash/fp/uniqueId.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('uniqueId', require('../uniqueId')); +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unset.js b/tools/eslint/node_modules/lodash/fp/unset.js index 0c4c1a690fcf25..ea203a0f39fb59 100644 --- a/tools/eslint/node_modules/lodash/fp/unset.js +++ b/tools/eslint/node_modules/lodash/fp/unset.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('unset', require('../unset')); +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unzip.js b/tools/eslint/node_modules/lodash/fp/unzip.js index e0ac2dbf5a8d70..cc364b3c5a40ad 100644 --- a/tools/eslint/node_modules/lodash/fp/unzip.js +++ b/tools/eslint/node_modules/lodash/fp/unzip.js @@ -1 +1,5 @@ -module.exports = require('../unzip'); +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unzipWith.js b/tools/eslint/node_modules/lodash/fp/unzipWith.js index de25cf7a8c2fcb..182eaa10424f3e 100644 --- a/tools/eslint/node_modules/lodash/fp/unzipWith.js +++ b/tools/eslint/node_modules/lodash/fp/unzipWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('unzipWith', require('../unzipWith')); +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/update.js b/tools/eslint/node_modules/lodash/fp/update.js new file mode 100644 index 00000000000000..b8ce2cc9e1fcc4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/updateWith.js b/tools/eslint/node_modules/lodash/fp/updateWith.js new file mode 100644 index 00000000000000..d5e8282d94fdcd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/upperCase.js b/tools/eslint/node_modules/lodash/fp/upperCase.js index ddcb3695c4e38b..c886f202162a09 100644 --- a/tools/eslint/node_modules/lodash/fp/upperCase.js +++ b/tools/eslint/node_modules/lodash/fp/upperCase.js @@ -1 +1,5 @@ -module.exports = require('../upperCase'); +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/upperFirst.js b/tools/eslint/node_modules/lodash/fp/upperFirst.js index 34f1e20f9f6102..d8c04df54bb33b 100644 --- a/tools/eslint/node_modules/lodash/fp/upperFirst.js +++ b/tools/eslint/node_modules/lodash/fp/upperFirst.js @@ -1 +1,5 @@ -module.exports = require('../upperFirst'); +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/value.js b/tools/eslint/node_modules/lodash/fp/value.js index 4dc0e7e9639912..555eec7a38db21 100644 --- a/tools/eslint/node_modules/lodash/fp/value.js +++ b/tools/eslint/node_modules/lodash/fp/value.js @@ -1 +1,5 @@ -module.exports = require('../value'); +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/valueOf.js b/tools/eslint/node_modules/lodash/fp/valueOf.js index c309058c0166e1..f968807d701e97 100644 --- a/tools/eslint/node_modules/lodash/fp/valueOf.js +++ b/tools/eslint/node_modules/lodash/fp/valueOf.js @@ -1 +1,5 @@ -module.exports = require('../[object Object]'); +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/values.js b/tools/eslint/node_modules/lodash/fp/values.js index 38431709150748..2dfc56136b6ee1 100644 --- a/tools/eslint/node_modules/lodash/fp/values.js +++ b/tools/eslint/node_modules/lodash/fp/values.js @@ -1 +1,5 @@ -module.exports = require('../values'); +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/valuesIn.js b/tools/eslint/node_modules/lodash/fp/valuesIn.js index f81c171c4ee22d..a1b2bb8725e3e9 100644 --- a/tools/eslint/node_modules/lodash/fp/valuesIn.js +++ b/tools/eslint/node_modules/lodash/fp/valuesIn.js @@ -1 +1,5 @@ -module.exports = require('../valuesIn'); +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/without.js b/tools/eslint/node_modules/lodash/fp/without.js index 5238e940f7038a..bad9e125bc93a2 100644 --- a/tools/eslint/node_modules/lodash/fp/without.js +++ b/tools/eslint/node_modules/lodash/fp/without.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('without', require('../without')); +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/words.js b/tools/eslint/node_modules/lodash/fp/words.js index b58a485b9d1ee5..4a901414b8e0ad 100644 --- a/tools/eslint/node_modules/lodash/fp/words.js +++ b/tools/eslint/node_modules/lodash/fp/words.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('words', require('../words')); +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrap.js b/tools/eslint/node_modules/lodash/fp/wrap.js index 56465a22629120..e93bd8a1de6f41 100644 --- a/tools/eslint/node_modules/lodash/fp/wrap.js +++ b/tools/eslint/node_modules/lodash/fp/wrap.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('wrap', require('../wrap')); +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperAt.js b/tools/eslint/node_modules/lodash/fp/wrapperAt.js index f8d37a194e108d..8f0a310feacb1f 100644 --- a/tools/eslint/node_modules/lodash/fp/wrapperAt.js +++ b/tools/eslint/node_modules/lodash/fp/wrapperAt.js @@ -1 +1,5 @@ -module.exports = require('../wrapperAt'); +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperChain.js b/tools/eslint/node_modules/lodash/fp/wrapperChain.js index 964a846c84e58d..2a48ea2b5b7dfa 100644 --- a/tools/eslint/node_modules/lodash/fp/wrapperChain.js +++ b/tools/eslint/node_modules/lodash/fp/wrapperChain.js @@ -1 +1,5 @@ -module.exports = require('../wrapperChain'); +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperFlatMap.js b/tools/eslint/node_modules/lodash/fp/wrapperFlatMap.js deleted file mode 100644 index fa030c0dace84e..00000000000000 --- a/tools/eslint/node_modules/lodash/fp/wrapperFlatMap.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperFlatMap'); diff --git a/tools/eslint/node_modules/lodash/fp/wrapperLodash.js b/tools/eslint/node_modules/lodash/fp/wrapperLodash.js index d62a9969ffa62a..a7162d084c884f 100644 --- a/tools/eslint/node_modules/lodash/fp/wrapperLodash.js +++ b/tools/eslint/node_modules/lodash/fp/wrapperLodash.js @@ -1 +1,5 @@ -module.exports = require('../wrapperLodash'); +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperReverse.js b/tools/eslint/node_modules/lodash/fp/wrapperReverse.js index cf703886c25c36..e1481aab9171a5 100644 --- a/tools/eslint/node_modules/lodash/fp/wrapperReverse.js +++ b/tools/eslint/node_modules/lodash/fp/wrapperReverse.js @@ -1 +1,5 @@ -module.exports = require('../wrapperReverse'); +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperValue.js b/tools/eslint/node_modules/lodash/fp/wrapperValue.js index 494dfb107f641b..8eb9112f613785 100644 --- a/tools/eslint/node_modules/lodash/fp/wrapperValue.js +++ b/tools/eslint/node_modules/lodash/fp/wrapperValue.js @@ -1 +1,5 @@ -module.exports = require('../wrapperValue'); +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xor.js b/tools/eslint/node_modules/lodash/fp/xor.js index 0f3e025fed4ea1..29e2819489386c 100644 --- a/tools/eslint/node_modules/lodash/fp/xor.js +++ b/tools/eslint/node_modules/lodash/fp/xor.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('xor', require('../xor')); +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xorBy.js b/tools/eslint/node_modules/lodash/fp/xorBy.js index e48fc41c70dd52..b355686db652c1 100644 --- a/tools/eslint/node_modules/lodash/fp/xorBy.js +++ b/tools/eslint/node_modules/lodash/fp/xorBy.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('xorBy', require('../xorBy')); +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xorWith.js b/tools/eslint/node_modules/lodash/fp/xorWith.js index 5c2eebe67ef700..8e05739ad36d82 100644 --- a/tools/eslint/node_modules/lodash/fp/xorWith.js +++ b/tools/eslint/node_modules/lodash/fp/xorWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('xorWith', require('../xorWith')); +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zip.js b/tools/eslint/node_modules/lodash/fp/zip.js index 0cae73b0a0434a..69e147a441da74 100644 --- a/tools/eslint/node_modules/lodash/fp/zip.js +++ b/tools/eslint/node_modules/lodash/fp/zip.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('zip', require('../zip')); +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zipObject.js b/tools/eslint/node_modules/lodash/fp/zipObject.js index 8c2ff3bc200c87..462dbb68cb333b 100644 --- a/tools/eslint/node_modules/lodash/fp/zipObject.js +++ b/tools/eslint/node_modules/lodash/fp/zipObject.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('zipObject', require('../zipObject')); +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js b/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js index a0ee4e34ec25ec..53a5d3380735e6 100644 --- a/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js +++ b/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('zipObjectDeep', require('../zipObjectDeep')); +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zipWith.js b/tools/eslint/node_modules/lodash/fp/zipWith.js index da75f3de409f63..c5cf9e21282317 100644 --- a/tools/eslint/node_modules/lodash/fp/zipWith.js +++ b/tools/eslint/node_modules/lodash/fp/zipWith.js @@ -1,2 +1,5 @@ -var convert = require('./convert'); -module.exports = convert('zipWith', require('../zipWith')); +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fromPairs.js b/tools/eslint/node_modules/lodash/fromPairs.js index c18c1e38697b4c..a591488ef955a9 100644 --- a/tools/eslint/node_modules/lodash/fromPairs.js +++ b/tools/eslint/node_modules/lodash/fromPairs.js @@ -4,6 +4,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. diff --git a/tools/eslint/node_modules/lodash/functions.js b/tools/eslint/node_modules/lodash/functions.js index b50a197debb6f4..36a9cad2ea457a 100644 --- a/tools/eslint/node_modules/lodash/functions.js +++ b/tools/eslint/node_modules/lodash/functions.js @@ -6,6 +6,7 @@ var baseFunctions = require('./_baseFunctions'), * of `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. diff --git a/tools/eslint/node_modules/lodash/functionsIn.js b/tools/eslint/node_modules/lodash/functionsIn.js index b48e5a65b5f37b..6bd3b57df91a48 100644 --- a/tools/eslint/node_modules/lodash/functionsIn.js +++ b/tools/eslint/node_modules/lodash/functionsIn.js @@ -7,6 +7,7 @@ var baseFunctions = require('./_baseFunctions'), * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the new array of property names. diff --git a/tools/eslint/node_modules/lodash/get.js b/tools/eslint/node_modules/lodash/get.js index 755fa05ae2d96f..5a5837b2541884 100644 --- a/tools/eslint/node_modules/lodash/get.js +++ b/tools/eslint/node_modules/lodash/get.js @@ -2,14 +2,15 @@ var baseGet = require('./_baseGet'); /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is used in its place. * * @static * @memberOf _ + * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * diff --git a/tools/eslint/node_modules/lodash/groupBy.js b/tools/eslint/node_modules/lodash/groupBy.js index 728a6dabac3b9b..ae7db5faa354ae 100644 --- a/tools/eslint/node_modules/lodash/groupBy.js +++ b/tools/eslint/node_modules/lodash/groupBy.js @@ -8,15 +8,18 @@ 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 elements responsible for generating the key. - * The iteratee is invoked with one argument: (value). + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * diff --git a/tools/eslint/node_modules/lodash/gt.js b/tools/eslint/node_modules/lodash/gt.js index ddaf5ea06712ef..2fc9a206ccd4ca 100644 --- a/tools/eslint/node_modules/lodash/gt.js +++ b/tools/eslint/node_modules/lodash/gt.js @@ -3,10 +3,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. * @example * * _.gt(3, 1); diff --git a/tools/eslint/node_modules/lodash/gte.js b/tools/eslint/node_modules/lodash/gte.js index 4a5ffb5cdce2e6..521be993d23f2f 100644 --- a/tools/eslint/node_modules/lodash/gte.js +++ b/tools/eslint/node_modules/lodash/gte.js @@ -3,10 +3,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. * @example * * _.gte(3, 1); diff --git a/tools/eslint/node_modules/lodash/has.js b/tools/eslint/node_modules/lodash/has.js index d66d2de020ce24..34df55e8e2df61 100644 --- a/tools/eslint/node_modules/lodash/has.js +++ b/tools/eslint/node_modules/lodash/has.js @@ -5,6 +5,7 @@ var baseHas = require('./_baseHas'), * Checks if `path` is a direct property of `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -12,23 +13,23 @@ var baseHas = require('./_baseHas'), * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * - * _.has(object, 'a.b.c'); + * _.has(object, 'a.b'); * // => true * - * _.has(object, ['a', 'b', 'c']); + * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { - return hasPath(object, path, baseHas); + return object != null && hasPath(object, path, baseHas); } module.exports = has; diff --git a/tools/eslint/node_modules/lodash/hasIn.js b/tools/eslint/node_modules/lodash/hasIn.js index 7da6b7dcd1add2..06a3686542e672 100644 --- a/tools/eslint/node_modules/lodash/hasIn.js +++ b/tools/eslint/node_modules/lodash/hasIn.js @@ -6,28 +6,29 @@ var baseHasIn = require('./_baseHasIn'), * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * - * _.hasIn(object, 'a.b.c'); + * _.hasIn(object, 'a.b'); * // => true * - * _.hasIn(object, ['a', 'b', 'c']); + * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { - return hasPath(object, path, baseHasIn); + return object != null && hasPath(object, path, baseHasIn); } module.exports = hasIn; diff --git a/tools/eslint/node_modules/lodash/head.js b/tools/eslint/node_modules/lodash/head.js index 30b47b0b3f4fed..dee9d1f1e7f6c6 100644 --- a/tools/eslint/node_modules/lodash/head.js +++ b/tools/eslint/node_modules/lodash/head.js @@ -3,6 +3,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. @@ -16,7 +17,7 @@ * // => undefined */ function head(array) { - return array ? array[0] : undefined; + return (array && array.length) ? array[0] : undefined; } module.exports = head; diff --git a/tools/eslint/node_modules/lodash/identity.js b/tools/eslint/node_modules/lodash/identity.js index da7dea19c17904..3732edb131b69f 100644 --- a/tools/eslint/node_modules/lodash/identity.js +++ b/tools/eslint/node_modules/lodash/identity.js @@ -2,6 +2,7 @@ * This method returns the first argument given to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. diff --git a/tools/eslint/node_modules/lodash/inRange.js b/tools/eslint/node_modules/lodash/inRange.js index 69c61101cdbf5c..d864ca2cf3e22e 100644 --- a/tools/eslint/node_modules/lodash/inRange.js +++ b/tools/eslint/node_modules/lodash/inRange.js @@ -3,12 +3,13 @@ var baseInRange = require('./_baseInRange'), /** * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. + * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ + * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. diff --git a/tools/eslint/node_modules/lodash/includes.js b/tools/eslint/node_modules/lodash/includes.js index 01d68445416294..cefe3bf9487f68 100644 --- a/tools/eslint/node_modules/lodash/includes.js +++ b/tools/eslint/node_modules/lodash/includes.js @@ -8,18 +8,20 @@ var baseIndexOf = require('./_baseIndexOf'), var nativeMax = Math.max; /** - * Checks if `value` is in `collection`. If `collection` is a string it's checked - * for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to search. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * diff --git a/tools/eslint/node_modules/lodash/indexOf.js b/tools/eslint/node_modules/lodash/indexOf.js index 4474d0cafd6a07..65616d45490767 100644 --- a/tools/eslint/node_modules/lodash/indexOf.js +++ b/tools/eslint/node_modules/lodash/indexOf.js @@ -7,11 +7,12 @@ var nativeMax = Math.max; /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. diff --git a/tools/eslint/node_modules/lodash/initial.js b/tools/eslint/node_modules/lodash/initial.js index 59b7a7d96dfbda..f4441b547a6e9c 100644 --- a/tools/eslint/node_modules/lodash/initial.js +++ b/tools/eslint/node_modules/lodash/initial.js @@ -5,6 +5,7 @@ var dropRight = require('./dropRight'); * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. diff --git a/tools/eslint/node_modules/lodash/intersection.js b/tools/eslint/node_modules/lodash/intersection.js index e97efddb7c9c05..1a7c7706c39110 100644 --- a/tools/eslint/node_modules/lodash/intersection.js +++ b/tools/eslint/node_modules/lodash/intersection.js @@ -1,25 +1,27 @@ var arrayMap = require('./_arrayMap'), baseIntersection = require('./_baseIntersection'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); + castArrayLikeObject = require('./_castArrayLikeObject'), + rest = require('./rest'); /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. + * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [4, 2], [1, 2]); * // => [2] */ var intersection = rest(function(arrays) { - var mapped = arrayMap(arrays, toArrayLikeObject); + var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; diff --git a/tools/eslint/node_modules/lodash/intersectionBy.js b/tools/eslint/node_modules/lodash/intersectionBy.js index 2c9e0d33079367..6afb79db6c8fe0 100644 --- a/tools/eslint/node_modules/lodash/intersectionBy.js +++ b/tools/eslint/node_modules/lodash/intersectionBy.js @@ -1,21 +1,24 @@ var arrayMap = require('./_arrayMap'), baseIntersection = require('./_baseIntersection'), baseIteratee = require('./_baseIteratee'), + castArrayLikeObject = require('./_castArrayLikeObject'), last = require('./last'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); + rest = require('./rest'); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); @@ -27,7 +30,7 @@ var arrayMap = require('./_arrayMap'), */ var intersectionBy = rest(function(arrays) { var iteratee = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; diff --git a/tools/eslint/node_modules/lodash/intersectionWith.js b/tools/eslint/node_modules/lodash/intersectionWith.js index c39e38f533e91d..bc195dc99908ad 100644 --- a/tools/eslint/node_modules/lodash/intersectionWith.js +++ b/tools/eslint/node_modules/lodash/intersectionWith.js @@ -1,20 +1,22 @@ var arrayMap = require('./_arrayMap'), baseIntersection = require('./_baseIntersection'), + castArrayLikeObject = require('./_castArrayLikeObject'), last = require('./last'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); + rest = require('./rest'); /** * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). + * which is invoked to compare elements of `arrays`. Result values are chosen + * from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. + * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; @@ -25,7 +27,7 @@ var arrayMap = require('./_arrayMap'), */ var intersectionWith = rest(function(arrays) { var comparator = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); if (comparator === last(mapped)) { comparator = undefined; diff --git a/tools/eslint/node_modules/lodash/invert.js b/tools/eslint/node_modules/lodash/invert.js index 11628b14ea289b..21d10aba370dd7 100644 --- a/tools/eslint/node_modules/lodash/invert.js +++ b/tools/eslint/node_modules/lodash/invert.js @@ -4,11 +4,12 @@ var constant = require('./constant'), /** * 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. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. * * @static * @memberOf _ + * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. diff --git a/tools/eslint/node_modules/lodash/invertBy.js b/tools/eslint/node_modules/lodash/invertBy.js index 513f62b92fa7e2..4298199ccd1e0a 100644 --- a/tools/eslint/node_modules/lodash/invertBy.js +++ b/tools/eslint/node_modules/lodash/invertBy.js @@ -9,16 +9,18 @@ var hasOwnProperty = objectProto.hasOwnProperty; /** * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` through `iteratee`. - * The corresponding inverted value of each inverted key is an array of keys + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ + * @since 4.1.0 * @category Object * @param {Object} object The object to invert. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * diff --git a/tools/eslint/node_modules/lodash/invoke.js b/tools/eslint/node_modules/lodash/invoke.js index f090a723673976..7b6f56bb1fc354 100644 --- a/tools/eslint/node_modules/lodash/invoke.js +++ b/tools/eslint/node_modules/lodash/invoke.js @@ -6,6 +6,7 @@ var baseInvoke = require('./_baseInvoke'), * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. diff --git a/tools/eslint/node_modules/lodash/invokeMap.js b/tools/eslint/node_modules/lodash/invokeMap.js index 42c8fbe1415637..4a6063e0aadfe3 100644 --- a/tools/eslint/node_modules/lodash/invokeMap.js +++ b/tools/eslint/node_modules/lodash/invokeMap.js @@ -8,11 +8,12 @@ var apply = require('./_apply'), /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or diff --git a/tools/eslint/node_modules/lodash/isArguments.js b/tools/eslint/node_modules/lodash/isArguments.js index 73fbafe0d28320..3ca0d3ca120601 100644 --- a/tools/eslint/node_modules/lodash/isArguments.js +++ b/tools/eslint/node_modules/lodash/isArguments.js @@ -10,7 +10,8 @@ var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -23,9 +24,11 @@ var propertyIsEnumerable = objectProto.propertyIsEnumerable; * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArguments(function() { return arguments; }()); diff --git a/tools/eslint/node_modules/lodash/isArray.js b/tools/eslint/node_modules/lodash/isArray.js index 22a1a22eb43e2b..1901120e7e2382 100644 --- a/tools/eslint/node_modules/lodash/isArray.js +++ b/tools/eslint/node_modules/lodash/isArray.js @@ -3,10 +3,12 @@ * * @static * @memberOf _ - * @type Function + * @since 0.1.0 + * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArray([1, 2, 3]); diff --git a/tools/eslint/node_modules/lodash/isArrayBuffer.js b/tools/eslint/node_modules/lodash/isArrayBuffer.js index 80b85633f7deb7..0a6a8e67614d6f 100644 --- a/tools/eslint/node_modules/lodash/isArrayBuffer.js +++ b/tools/eslint/node_modules/lodash/isArrayBuffer.js @@ -6,7 +6,8 @@ var arrayBufferTag = '[object ArrayBuffer]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -16,10 +17,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ - * @type Function + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); diff --git a/tools/eslint/node_modules/lodash/isArrayLike.js b/tools/eslint/node_modules/lodash/isArrayLike.js index 9f4ddd51bb6767..189a611f005804 100644 --- a/tools/eslint/node_modules/lodash/isArrayLike.js +++ b/tools/eslint/node_modules/lodash/isArrayLike.js @@ -9,7 +9,7 @@ var getLength = require('./_getLength'), * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. @@ -28,8 +28,7 @@ var getLength = require('./_getLength'), * // => false */ function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); + return value != null && isLength(getLength(value)) && !isFunction(value); } module.exports = isArrayLike; diff --git a/tools/eslint/node_modules/lodash/isArrayLikeObject.js b/tools/eslint/node_modules/lodash/isArrayLikeObject.js index 22b3577376f95d..6c4812a8d862d3 100644 --- a/tools/eslint/node_modules/lodash/isArrayLikeObject.js +++ b/tools/eslint/node_modules/lodash/isArrayLikeObject.js @@ -7,10 +7,11 @@ var isArrayLike = require('./isArrayLike'), * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); diff --git a/tools/eslint/node_modules/lodash/isBoolean.js b/tools/eslint/node_modules/lodash/isBoolean.js index 53ec5d6e5ee25e..242fad1ffd0a34 100644 --- a/tools/eslint/node_modules/lodash/isBoolean.js +++ b/tools/eslint/node_modules/lodash/isBoolean.js @@ -7,7 +7,8 @@ var boolTag = '[object Boolean]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,9 +18,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isBoolean(false); diff --git a/tools/eslint/node_modules/lodash/isBuffer.js b/tools/eslint/node_modules/lodash/isBuffer.js index 1e6b8b6d385ab9..404c22200ca75f 100644 --- a/tools/eslint/node_modules/lodash/isBuffer.js +++ b/tools/eslint/node_modules/lodash/isBuffer.js @@ -8,13 +8,19 @@ var objectTypes = { }; /** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; /** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; /** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; +var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined; @@ -24,6 +30,7 @@ var Buffer = moduleExports ? root.Buffer : undefined; * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. diff --git a/tools/eslint/node_modules/lodash/isDate.js b/tools/eslint/node_modules/lodash/isDate.js index 6e3611a05bfbdb..f85a801747d47c 100644 --- a/tools/eslint/node_modules/lodash/isDate.js +++ b/tools/eslint/node_modules/lodash/isDate.js @@ -7,7 +7,8 @@ var dateTag = '[object Date]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,9 +18,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isDate(new Date); diff --git a/tools/eslint/node_modules/lodash/isElement.js b/tools/eslint/node_modules/lodash/isElement.js index 447d6bc2038fd2..67aca5dc7fa949 100644 --- a/tools/eslint/node_modules/lodash/isElement.js +++ b/tools/eslint/node_modules/lodash/isElement.js @@ -6,9 +6,11 @@ var isObjectLike = require('./isObjectLike'), * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @returns {boolean} Returns `true` if `value` is a DOM element, + * else `false`. * @example * * _.isElement(document.body); diff --git a/tools/eslint/node_modules/lodash/isEmpty.js b/tools/eslint/node_modules/lodash/isEmpty.js index 29062ed4bea91a..9d4649690bdb13 100644 --- a/tools/eslint/node_modules/lodash/isEmpty.js +++ b/tools/eslint/node_modules/lodash/isEmpty.js @@ -1,8 +1,16 @@ -var isArguments = require('./isArguments'), +var getTag = require('./_getTag'), + isArguments = require('./isArguments'), isArray = require('./isArray'), isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), isFunction = require('./isFunction'), - isString = require('./isString'); + isObjectLike = require('./isObjectLike'), + isString = require('./isString'), + keys = require('./keys'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -10,15 +18,27 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang - * @param {Array|Object|string} value The value to inspect. + * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * @@ -39,15 +59,22 @@ var hasOwnProperty = objectProto.hasOwnProperty; */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + (isArray(value) || isString(value) || isFunction(value.splice) || + isArguments(value) || isBuffer(value))) { return !value.length; } + if (isObjectLike(value)) { + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } - return true; + return !(nonEnumShadows && keys(value).length); } module.exports = isEmpty; diff --git a/tools/eslint/node_modules/lodash/isEqual.js b/tools/eslint/node_modules/lodash/isEqual.js index 43a3a2b567a0ce..dd5d0cc7ce0939 100644 --- a/tools/eslint/node_modules/lodash/isEqual.js +++ b/tools/eslint/node_modules/lodash/isEqual.js @@ -12,10 +12,12 @@ var baseIsEqual = require('./_baseIsEqual'); * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. * @example * * var object = { 'user': 'fred' }; diff --git a/tools/eslint/node_modules/lodash/isEqualWith.js b/tools/eslint/node_modules/lodash/isEqualWith.js index 60fe95d9eb0d16..a442b248f3a3c7 100644 --- a/tools/eslint/node_modules/lodash/isEqualWith.js +++ b/tools/eslint/node_modules/lodash/isEqualWith.js @@ -1,18 +1,20 @@ var baseIsEqual = require('./_baseIsEqual'); /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to six arguments: - * (objValue, othValue [, index|key, object, other, stack]). + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. * @example * * function isGreeting(value) { diff --git a/tools/eslint/node_modules/lodash/isError.js b/tools/eslint/node_modules/lodash/isError.js index e66b443d8e508e..b4a93aebe24764 100644 --- a/tools/eslint/node_modules/lodash/isError.js +++ b/tools/eslint/node_modules/lodash/isError.js @@ -7,7 +7,8 @@ var errorTag = '[object Error]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -18,9 +19,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @returns {boolean} Returns `true` if `value` is an error object, + * else `false`. * @example * * _.isError(new Error); @@ -30,8 +33,11 @@ var objectToString = objectProto.toString; * // => false */ function isError(value) { - return isObjectLike(value) && - typeof value.message == 'string' && objectToString.call(value) == errorTag; + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); } module.exports = isError; diff --git a/tools/eslint/node_modules/lodash/isFinite.js b/tools/eslint/node_modules/lodash/isFinite.js index 44be4bc9d0943b..744e7a65e1e4db 100644 --- a/tools/eslint/node_modules/lodash/isFinite.js +++ b/tools/eslint/node_modules/lodash/isFinite.js @@ -6,13 +6,16 @@ var nativeIsFinite = root.isFinite; /** * Checks if `value` is a finite primitive number. * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. * @example * * _.isFinite(3); diff --git a/tools/eslint/node_modules/lodash/isFunction.js b/tools/eslint/node_modules/lodash/isFunction.js index a1d9530c65e19e..da02be0e10be32 100644 --- a/tools/eslint/node_modules/lodash/isFunction.js +++ b/tools/eslint/node_modules/lodash/isFunction.js @@ -8,7 +8,8 @@ var funcTag = '[object Function]', var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -18,9 +19,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isFunction(_); @@ -31,8 +34,8 @@ var objectToString = objectProto.toString; */ 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. + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } diff --git a/tools/eslint/node_modules/lodash/isInteger.js b/tools/eslint/node_modules/lodash/isInteger.js index 1bfcc65fb8be8c..66aa87d573d717 100644 --- a/tools/eslint/node_modules/lodash/isInteger.js +++ b/tools/eslint/node_modules/lodash/isInteger.js @@ -3,10 +3,12 @@ var toInteger = require('./toInteger'); /** * Checks if `value` is an integer. * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. diff --git a/tools/eslint/node_modules/lodash/isLength.js b/tools/eslint/node_modules/lodash/isLength.js index 2f04aca810f31b..cd9b2572178cb9 100644 --- a/tools/eslint/node_modules/lodash/isLength.js +++ b/tools/eslint/node_modules/lodash/isLength.js @@ -4,13 +4,16 @@ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. * @example * * _.isLength(3); @@ -26,7 +29,8 @@ var MAX_SAFE_INTEGER = 9007199254740991; * // => false */ function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; diff --git a/tools/eslint/node_modules/lodash/isMap.js b/tools/eslint/node_modules/lodash/isMap.js index bc92defd87f91d..f83758e13bac1e 100644 --- a/tools/eslint/node_modules/lodash/isMap.js +++ b/tools/eslint/node_modules/lodash/isMap.js @@ -9,9 +9,11 @@ var mapTag = '[object Map]'; * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isMap(new Map); diff --git a/tools/eslint/node_modules/lodash/isMatch.js b/tools/eslint/node_modules/lodash/isMatch.js index a14131fef31724..371e4458b2a18a 100644 --- a/tools/eslint/node_modules/lodash/isMatch.js +++ b/tools/eslint/node_modules/lodash/isMatch.js @@ -2,13 +2,15 @@ var baseIsMatch = require('./_baseIsMatch'), getMatchData = require('./_getMatchData'); /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. This method is + * equivalent to a `_.matches` function when `source` is partially applied. * * **Note:** This method supports comparing the same values as `_.isEqual`. * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. diff --git a/tools/eslint/node_modules/lodash/isMatchWith.js b/tools/eslint/node_modules/lodash/isMatchWith.js index 2460eb35e0b66c..187b6a61de55d0 100644 --- a/tools/eslint/node_modules/lodash/isMatchWith.js +++ b/tools/eslint/node_modules/lodash/isMatchWith.js @@ -3,12 +3,13 @@ var baseIsMatch = require('./_baseIsMatch'), /** * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. diff --git a/tools/eslint/node_modules/lodash/isNaN.js b/tools/eslint/node_modules/lodash/isNaN.js index 5b757b1fc54376..7d0d783bada2ce 100644 --- a/tools/eslint/node_modules/lodash/isNaN.js +++ b/tools/eslint/node_modules/lodash/isNaN.js @@ -3,11 +3,14 @@ var isNumber = require('./isNumber'); /** * 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. + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. @@ -27,7 +30,8 @@ var isNumber = require('./isNumber'); */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. return isNumber(value) && value != +value; } diff --git a/tools/eslint/node_modules/lodash/isNative.js b/tools/eslint/node_modules/lodash/isNative.js index 616a832e6b8e29..2d5149ba457718 100644 --- a/tools/eslint/node_modules/lodash/isNative.js +++ b/tools/eslint/node_modules/lodash/isNative.js @@ -1,11 +1,15 @@ var isFunction = require('./isFunction'), isHostObject = require('./_isHostObject'), - isObjectLike = require('./isObjectLike'); + isObject = require('./isObject'), + toSource = require('./_toSource'); -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -/** Used to detect host constructors (Safari > 5). */ +/** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ @@ -28,9 +32,11 @@ var reIsNative = RegExp('^' + * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. * @example * * _.isNative(Array.prototype.push); @@ -40,14 +46,11 @@ var reIsNative = RegExp('^' + * // => false */ function isNative(value) { - if (value == null) { + if (!isObject(value)) { return false; } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } module.exports = isNative; diff --git a/tools/eslint/node_modules/lodash/isNil.js b/tools/eslint/node_modules/lodash/isNil.js index c4197fb3cf829f..79f05052c5ed9c 100644 --- a/tools/eslint/node_modules/lodash/isNil.js +++ b/tools/eslint/node_modules/lodash/isNil.js @@ -3,6 +3,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. diff --git a/tools/eslint/node_modules/lodash/isNull.js b/tools/eslint/node_modules/lodash/isNull.js index ec66c4d8d8f18e..c0a374d7dc178a 100644 --- a/tools/eslint/node_modules/lodash/isNull.js +++ b/tools/eslint/node_modules/lodash/isNull.js @@ -3,6 +3,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. diff --git a/tools/eslint/node_modules/lodash/isNumber.js b/tools/eslint/node_modules/lodash/isNumber.js index 0c8fb9ae93d23f..e427282ac85905 100644 --- a/tools/eslint/node_modules/lodash/isNumber.js +++ b/tools/eslint/node_modules/lodash/isNumber.js @@ -7,7 +7,8 @@ var numberTag = '[object Number]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -15,14 +16,16 @@ var objectToString = objectProto.toString; /** * Checks if `value` is classified as a `Number` primitive or object. * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isNumber(3); diff --git a/tools/eslint/node_modules/lodash/isObject.js b/tools/eslint/node_modules/lodash/isObject.js index 41993db213eb69..d16542f8bf3830 100644 --- a/tools/eslint/node_modules/lodash/isObject.js +++ b/tools/eslint/node_modules/lodash/isObject.js @@ -1,9 +1,11 @@ /** - * 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('')`) + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. diff --git a/tools/eslint/node_modules/lodash/isObjectLike.js b/tools/eslint/node_modules/lodash/isObjectLike.js index 240167ad811f34..e34114be54058c 100644 --- a/tools/eslint/node_modules/lodash/isObjectLike.js +++ b/tools/eslint/node_modules/lodash/isObjectLike.js @@ -4,6 +4,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. diff --git a/tools/eslint/node_modules/lodash/isPlainObject.js b/tools/eslint/node_modules/lodash/isPlainObject.js index 1d68332c04813e..13a90e7d03a842 100644 --- a/tools/eslint/node_modules/lodash/isPlainObject.js +++ b/tools/eslint/node_modules/lodash/isPlainObject.js @@ -1,4 +1,5 @@ -var isHostObject = require('./_isHostObject'), +var getPrototype = require('./_getPrototype'), + isHostObject = require('./_isHostObject'), isObjectLike = require('./isObjectLike'); /** `Object#toString` result references. */ @@ -10,27 +11,30 @@ var objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = Function.prototype.toString; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; -/** Built-in value references. */ -var getPrototypeOf = Object.getPrototypeOf; - /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ + * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, + * else `false`. * @example * * function Foo() { @@ -50,17 +54,15 @@ var getPrototypeOf = Object.getPrototypeOf; * // => true */ function isPlainObject(value) { - if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { return false; } - var proto = objectProto; - if (typeof value.constructor == 'function') { - proto = getPrototypeOf(value); - } + var proto = getPrototype(value); if (proto === null) { return true; } - var Ctor = proto.constructor; + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } diff --git a/tools/eslint/node_modules/lodash/isRegExp.js b/tools/eslint/node_modules/lodash/isRegExp.js index e127e5aae8c0d7..8eeb4103ec9fc8 100644 --- a/tools/eslint/node_modules/lodash/isRegExp.js +++ b/tools/eslint/node_modules/lodash/isRegExp.js @@ -7,7 +7,8 @@ var regexpTag = '[object RegExp]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,9 +18,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isRegExp(/abc/); diff --git a/tools/eslint/node_modules/lodash/isSafeInteger.js b/tools/eslint/node_modules/lodash/isSafeInteger.js index f601243fee2e25..a780afb6b64196 100644 --- a/tools/eslint/node_modules/lodash/isSafeInteger.js +++ b/tools/eslint/node_modules/lodash/isSafeInteger.js @@ -7,13 +7,16 @@ var MAX_SAFE_INTEGER = 9007199254740991; * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @returns {boolean} Returns `true` if `value` is a safe integer, + * else `false`. * @example * * _.isSafeInteger(3); diff --git a/tools/eslint/node_modules/lodash/isSet.js b/tools/eslint/node_modules/lodash/isSet.js index e1d50be9044c2a..9030dc44e031cd 100644 --- a/tools/eslint/node_modules/lodash/isSet.js +++ b/tools/eslint/node_modules/lodash/isSet.js @@ -9,9 +9,11 @@ var setTag = '[object Set]'; * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isSet(new Set); diff --git a/tools/eslint/node_modules/lodash/isString.js b/tools/eslint/node_modules/lodash/isString.js index 5ed392e4060e17..573de3b53cfa1b 100644 --- a/tools/eslint/node_modules/lodash/isString.js +++ b/tools/eslint/node_modules/lodash/isString.js @@ -8,7 +8,8 @@ var stringTag = '[object String]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,10 +18,12 @@ var objectToString = objectProto.toString; * Checks if `value` is classified as a `String` primitive or object. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isString('abc'); diff --git a/tools/eslint/node_modules/lodash/isSymbol.js b/tools/eslint/node_modules/lodash/isSymbol.js index 5e11a00d3c8522..21dd55927d3e54 100644 --- a/tools/eslint/node_modules/lodash/isSymbol.js +++ b/tools/eslint/node_modules/lodash/isSymbol.js @@ -7,7 +7,8 @@ var symbolTag = '[object Symbol]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,9 +18,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isSymbol(Symbol.iterator); diff --git a/tools/eslint/node_modules/lodash/isTypedArray.js b/tools/eslint/node_modules/lodash/isTypedArray.js index 9e9b0a274c8fde..0d86b90cb6e020 100644 --- a/tools/eslint/node_modules/lodash/isTypedArray.js +++ b/tools/eslint/node_modules/lodash/isTypedArray.js @@ -17,6 +17,7 @@ var argsTag = '[object Arguments]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', @@ -36,17 +37,19 @@ 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; +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; /** Used for built-in method references. */ var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -56,9 +59,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isTypedArray(new Uint8Array); @@ -68,7 +73,8 @@ var objectToString = objectProto.toString; * // => false */ function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; } module.exports = isTypedArray; diff --git a/tools/eslint/node_modules/lodash/isUndefined.js b/tools/eslint/node_modules/lodash/isUndefined.js index d64e560c66abd1..377d121ab8e93d 100644 --- a/tools/eslint/node_modules/lodash/isUndefined.js +++ b/tools/eslint/node_modules/lodash/isUndefined.js @@ -2,6 +2,7 @@ * Checks if `value` is `undefined`. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. diff --git a/tools/eslint/node_modules/lodash/isWeakMap.js b/tools/eslint/node_modules/lodash/isWeakMap.js index d934a9f5e64615..cd7b9ed81d9853 100644 --- a/tools/eslint/node_modules/lodash/isWeakMap.js +++ b/tools/eslint/node_modules/lodash/isWeakMap.js @@ -9,9 +9,11 @@ var weakMapTag = '[object WeakMap]'; * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isWeakMap(new WeakMap); diff --git a/tools/eslint/node_modules/lodash/isWeakSet.js b/tools/eslint/node_modules/lodash/isWeakSet.js index 40674f480c8ed8..5395797ae6c2e6 100644 --- a/tools/eslint/node_modules/lodash/isWeakSet.js +++ b/tools/eslint/node_modules/lodash/isWeakSet.js @@ -7,7 +7,8 @@ var weakSetTag = '[object WeakSet]'; var objectProto = Object.prototype; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -17,9 +18,11 @@ var objectToString = objectProto.toString; * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isWeakSet(new WeakSet); diff --git a/tools/eslint/node_modules/lodash/iteratee.js b/tools/eslint/node_modules/lodash/iteratee.js index c761adbbc5a21c..8ec05887671d0b 100644 --- a/tools/eslint/node_modules/lodash/iteratee.js +++ b/tools/eslint/node_modules/lodash/iteratee.js @@ -3,11 +3,13 @@ var baseClone = require('./_baseClone'), /** * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. * * @static + * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. @@ -15,20 +17,31 @@ var baseClone = require('./_baseClone'), * @example * * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); * }; * }); * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] */ function iteratee(func) { return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); diff --git a/tools/eslint/node_modules/lodash/join.js b/tools/eslint/node_modules/lodash/join.js index 79d308d2812f91..fe31067664ac8a 100644 --- a/tools/eslint/node_modules/lodash/join.js +++ b/tools/eslint/node_modules/lodash/join.js @@ -9,6 +9,7 @@ var nativeJoin = arrayProto.join; * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. diff --git a/tools/eslint/node_modules/lodash/kebabCase.js b/tools/eslint/node_modules/lodash/kebabCase.js index f29124fb2b7d21..8a52be64555638 100644 --- a/tools/eslint/node_modules/lodash/kebabCase.js +++ b/tools/eslint/node_modules/lodash/kebabCase.js @@ -1,10 +1,12 @@ var createCompounder = require('./_createCompounder'); /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. @@ -16,7 +18,7 @@ var createCompounder = require('./_createCompounder'); * _.kebabCase('fooBar'); * // => 'foo-bar' * - * _.kebabCase('__foo_bar__'); + * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { diff --git a/tools/eslint/node_modules/lodash/keyBy.js b/tools/eslint/node_modules/lodash/keyBy.js index febc86b4b45afe..97e6f4b38e2461 100644 --- a/tools/eslint/node_modules/lodash/keyBy.js +++ b/tools/eslint/node_modules/lodash/keyBy.js @@ -2,15 +2,17 @@ var createAggregator = require('./_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 + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * diff --git a/tools/eslint/node_modules/lodash/keys.js b/tools/eslint/node_modules/lodash/keys.js index eac239f5c88e4f..186a4fedd0a256 100644 --- a/tools/eslint/node_modules/lodash/keys.js +++ b/tools/eslint/node_modules/lodash/keys.js @@ -13,6 +13,7 @@ var baseHas = require('./_baseHas'), * for more details. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. diff --git a/tools/eslint/node_modules/lodash/keysIn.js b/tools/eslint/node_modules/lodash/keysIn.js index e327b874d9167d..d2fb91cb32b1e9 100644 --- a/tools/eslint/node_modules/lodash/keysIn.js +++ b/tools/eslint/node_modules/lodash/keysIn.js @@ -16,6 +16,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. diff --git a/tools/eslint/node_modules/lodash/lang.js b/tools/eslint/node_modules/lodash/lang.js index d3be68f06d2616..665f5c66ceade1 100644 --- a/tools/eslint/node_modules/lodash/lang.js +++ b/tools/eslint/node_modules/lodash/lang.js @@ -1,4 +1,5 @@ module.exports = { + 'castArray': require('./castArray'), 'clone': require('./clone'), 'cloneDeep': require('./cloneDeep'), 'cloneDeepWith': require('./cloneDeepWith'), diff --git a/tools/eslint/node_modules/lodash/last.js b/tools/eslint/node_modules/lodash/last.js index 299af3146ca232..6402a4c33a7b2e 100644 --- a/tools/eslint/node_modules/lodash/last.js +++ b/tools/eslint/node_modules/lodash/last.js @@ -3,6 +3,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. diff --git a/tools/eslint/node_modules/lodash/lastIndexOf.js b/tools/eslint/node_modules/lodash/lastIndexOf.js index 1eb2f2836faf08..7e9d988e5e93be 100644 --- a/tools/eslint/node_modules/lodash/lastIndexOf.js +++ b/tools/eslint/node_modules/lodash/lastIndexOf.js @@ -11,6 +11,7 @@ var nativeMax = Math.max, * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -33,7 +34,11 @@ function lastIndexOf(array, value, fromIndex) { var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); - index = (index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1)) + 1; + index = ( + index < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1) + ) + 1; } if (value !== value) { return indexOfNaN(array, index, true); diff --git a/tools/eslint/node_modules/lodash/lodash.js b/tools/eslint/node_modules/lodash/lodash.js index d314acd0976e00..2ad95ab4d13700 100644 --- a/tools/eslint/node_modules/lodash/lodash.js +++ b/tools/eslint/node_modules/lodash/lodash.js @@ -1,11 +1,11 @@ /** * @license - * lodash 4.3.0 (Custom Build) + * lodash 4.11.1 (Custom Build) * Build: `lodash -d -o ./foo/lodash.js` - * Copyright 2012-2016 The Dojo Foundation + * Copyright jQuery Foundation and other contributors + * Released under MIT license * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { @@ -13,7 +13,19 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.3.0'; + var VERSION = '4.11.1'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -39,20 +51,11 @@ var HOT_COUNT = 150, HOT_SPAN = 16; - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, @@ -64,9 +67,6 @@ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', @@ -78,6 +78,7 @@ mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', + promiseTag = '[object Promise]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', @@ -86,6 +87,7 @@ weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', @@ -117,7 +119,10 @@ reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); @@ -126,10 +131,16 @@ reTrimStart = /^\s+/, reTrimEnd = /\s+$/; + /** Used to match non-compound words composed of alphanumeric characters. */ + var reBasicWord = /[a-zA-Z0-9]+/g; + /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; - /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ @@ -144,7 +155,7 @@ /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; - /** Used to detect host constructors (Safari > 5). */ + /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ @@ -177,7 +188,8 @@ rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; /** Used to compose unicode capture groups. */ - var rsAstral = '[' + rsAstralRange + ']', + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', @@ -195,6 +207,8 @@ /** Used to compose unicode regexes. */ var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', @@ -202,6 +216,9 @@ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). @@ -211,32 +228,29 @@ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - - /** Used to match non-compound words composed of alphanumeric characters. */ - var reBasicWord = /[a-zA-Z0-9]+/g; - /** Used to match complex or compound words. */ var reComplexWord = RegExp([ - rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', - rsUpper + '?' + rsLowerMisc + '+', - rsUpper + '+', + rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, + rsUpper + '+' + rsOptUpperContr, rsDigits, rsEmoji ].join('|'), '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 detect strings that need a more robust regexp to match words. */ - var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ - 'Array', 'Buffer', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', - 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', + 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ @@ -251,25 +265,26 @@ 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; + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[mapTag] = cloneableTags[numberTag] = - cloneableTags[objectTag] = cloneableTags[regexpTag] = - cloneableTags[setTag] = cloneableTags[stringTag] = - cloneableTags[symbolTag] = cloneableTags[uint8Tag] = - cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = - cloneableTags[uint32Tag] = true; + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; @@ -335,10 +350,19 @@ freeParseInt = parseInt; /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; /** Detect free variable `global` from Node.js. */ var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); @@ -349,9 +373,6 @@ /** Detect free variable `window`. */ var freeWindow = checkGlobal(objectTypes[typeof window] && window); - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - /** Detect `this` as the global object. */ var thisGlobal = checkGlobal(objectTypes[typeof this] && this); @@ -361,7 +382,9 @@ * 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')(); + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); /*--------------------------------------------------------------------------*/ @@ -374,6 +397,7 @@ * @returns {Object} Returns `map`. */ function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. map.set(pair[0], pair[1]); return map; } @@ -398,7 +422,7 @@ * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. + * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { @@ -505,7 +529,8 @@ * @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`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. */ function arrayEvery(array, predicate) { var index = -1, @@ -531,13 +556,13 @@ function arrayFilter(array, predicate) { var index = -1, length = array.length, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { - result[++resIndex] = value; + result[resIndex++] = value; } } return result; @@ -557,8 +582,7 @@ } /** - * A specialized version of `_.includesWith` for arrays without support for - * specifying an index to search from. + * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} array The array to search. @@ -625,7 +649,8 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { @@ -649,7 +674,8 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { @@ -670,7 +696,8 @@ * @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`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ function arraySome(array, predicate) { var index = -1, @@ -722,7 +749,8 @@ * @param {Array|Object} collection The collection to search. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. + * @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) { @@ -782,6 +810,42 @@ return -1; } + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array ? array.length : 0; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. @@ -790,7 +854,8 @@ * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ @@ -804,9 +869,9 @@ } /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. + * 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. @@ -824,7 +889,8 @@ } /** - * The base implementation of `_.sum` without support for iteratee shorthands. + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. @@ -1021,10 +1087,53 @@ // 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. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + result++; + } + } + return result; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return 0; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + result = result === undefined ? other : operator(result, other); + } + return result; + }; + } + /** * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. * @@ -1159,13 +1268,14 @@ function replaceHolders(array, placeholder) { var index = -1, length = array.length, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { - if (array[index] === placeholder) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; - result[++resIndex] = index; + result[resIndex++] = index; } } return result; @@ -1235,6 +1345,7 @@ * * @static * @memberOf _ + * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. @@ -1277,7 +1388,8 @@ /** Used for built-in method references. */ var arrayProto = context.Array.prototype, - objectProto = context.Object.prototype; + objectProto = context.Object.prototype, + stringProto = context.String.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = context.Function.prototype.toString; @@ -1292,7 +1404,8 @@ var objectCtorString = funcToString.call(Object); /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -1313,9 +1426,9 @@ Uint8Array = context.Uint8Array, clearTimeout = context.clearTimeout, enumerate = Reflect ? Reflect.enumerate : undefined, - getPrototypeOf = Object.getPrototypeOf, getOwnPropertySymbols = Object.getOwnPropertySymbols, iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, setTimeout = context.setTimeout, splice = arrayProto.splice; @@ -1323,6 +1436,7 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, + nativeGetPrototype = Object.getPrototypeOf, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = Object.keys, @@ -1330,10 +1444,14 @@ nativeMin = Math.min, nativeParseInt = context.parseInt, nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; + nativeReplace = stringProto.replace, + nativeReverse = arrayProto.reverse, + nativeSplit = stringProto.split; /* Built-in method references that are verified to be native. */ - var Map = getNative(context, 'Map'), + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); @@ -1341,42 +1459,47 @@ /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /** Used to lookup unminified function names. */ + var realNames = {}; + /** Used to detect maps, sets, and weakmaps. */ - var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined, - symbolToString = Symbol ? symbolProto.toString : undefined; - - /** Used to lookup unminified function names. */ - var realNames = {}; + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. @@ -1395,51 +1518,55 @@ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, - * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, - * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, - * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, - * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, - * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, - * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, - * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, - * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, - * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, - * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, - * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, - * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, - * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`, * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, - * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, - * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, - * `upperCase`, `upperFirst`, `value`, and `words` + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ * @constructor @@ -1480,7 +1607,7 @@ } /** - * The function whose prototype all chaining wrappers inherit from. + * The function whose prototype chain sequence wrappers inherit from. * * @private */ @@ -1493,7 +1620,7 @@ * * @private * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; @@ -1510,7 +1637,7 @@ * * @static * @memberOf _ - * @type Object + * @type {Object} */ lodash.templateSettings = { @@ -1518,7 +1645,7 @@ * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'escape': reEscape, @@ -1526,7 +1653,7 @@ * Used to detect code to be evaluated. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'evaluate': reEvaluate, @@ -1534,7 +1661,7 @@ * Used to detect `data` property values to inject. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'interpolate': reInterpolate, @@ -1542,7 +1669,7 @@ * Used to reference the data object in the template text. * * @memberOf _.templateSettings - * @type string + * @type {string} */ 'variable': '', @@ -1550,7 +1677,7 @@ * Used to import variables into the compiled template. * * @memberOf _.templateSettings - * @type Object + * @type {Object} */ 'imports': { @@ -1558,18 +1685,26 @@ * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports - * @type Function + * @type {Function} */ '_': lodash } }; + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private + * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { @@ -1645,7 +1780,8 @@ resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); - if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { + if (!isArr || arrLength < LARGE_ARRAY_SIZE || + (arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; @@ -1678,12 +1814,17 @@ return result; } + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + /*------------------------------------------------------------------------*/ /** - * Creates an hash object. + * Creates a hash object. * * @private + * @constructor * @returns {Object} Returns the new hash object. */ function Hash() {} @@ -1740,12 +1881,16 @@ hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; } + // Avoid inheriting from `Object.prototype` when possible. + Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function MapCache(values) { @@ -1767,7 +1912,11 @@ * @memberOf MapCache */ function mapClear() { - this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash }; + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; } /** @@ -1829,7 +1978,7 @@ * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. + * @returns {Object} Returns the map cache instance. */ function mapSet(key, value) { var data = this.__data__; @@ -1843,6 +1992,13 @@ return this; } + // Add methods to `MapCache`. + MapCache.prototype.clear = mapClear; + MapCache.prototype['delete'] = mapDelete; + MapCache.prototype.get = mapGet; + MapCache.prototype.has = mapHas; + MapCache.prototype.set = mapSet; + /*------------------------------------------------------------------------*/ /** @@ -1850,6 +2006,7 @@ * Creates a set cache object to store unique values. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { @@ -1902,12 +2059,16 @@ } } + // Add methods to `SetCache`. + SetCache.prototype.push = cachePush; + /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private + * @constructor * @param {Array} [values] The values to cache. */ function Stack(values) { @@ -1988,7 +2149,7 @@ * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. + * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__, @@ -2009,13 +2170,20 @@ return this; } + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + /*------------------------------------------------------------------------*/ /** * Removes `key` and its value from the associative array. * * @private - * @param {Array} array The array to query. + * @param {Array} array The array to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ @@ -2059,8 +2227,7 @@ } /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. + * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to search. @@ -2115,7 +2282,8 @@ } /** - * This function is like `assignValue` except that it doesn't assign `undefined` values. + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. * * @private * @param {Object} object The object to modify. @@ -2141,8 +2309,7 @@ */ function assignValue(object, key, value) { var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } @@ -2227,13 +2394,14 @@ * @private * @param {*} value The value to clone. * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ - function baseClone(value, isDeep, customizer, key, object, stack) { + function baseClone(value, isDeep, isFull, customizer, key, object, stack) { var result; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); @@ -2266,9 +2434,10 @@ return copySymbols(value, baseAssign(result, value)); } } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); } } // Check for circular references and return its corresponding clone. @@ -2279,11 +2448,18 @@ } stack.set(value, result); + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); - return isArr ? result : copySymbols(value, result); + return result; } /** @@ -2307,7 +2483,8 @@ predicate = source[key], value = object[key]; - if ((value === undefined && !(key in Object(object))) || !predicate(value)) { + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { return false; } } @@ -2323,17 +2500,9 @@ * @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 = undefined; - } - return result || {}; - }; - }()); + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } /** * The base implementation of `_.delay` and `_.defer` which accepts an array @@ -2353,8 +2522,8 @@ } /** - * The base implementation of methods like `_.difference` without support for - * excluding multiple arrays or iteratee shorthands. + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. @@ -2433,7 +2602,8 @@ * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` */ function baseEvery(collection, predicate) { var result = true; @@ -2495,24 +2665,25 @@ * * @private * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ - function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - + function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index < length) { var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { + if (depth > 0 && predicate(value)) { + if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } @@ -2524,10 +2695,9 @@ } /** - * 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`. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. @@ -2549,18 +2719,6 @@ */ var baseForRight = createBaseFor(true); - /** - * The base implementation of `_.forIn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return object == null ? object : baseFor(object, iteratee, keysIn); - } - /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * @@ -2609,7 +2767,7 @@ * @returns {*} Returns the resolved value. */ function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); var index = 0, length = path.length; @@ -2620,6 +2778,24 @@ return (index && index == length) ? object : undefined; } + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) + ? result + : arrayPush(result, symbolsFunc(object)); + } + /** * The base implementation of `_.has` without support for deep paths. * @@ -2633,7 +2809,7 @@ // that are composed entirely of index properties, return `false` for // `hasOwnProperty` checks of them. return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); + (typeof object == 'object' && key in object && getPrototype(object) === null); } /** @@ -2673,9 +2849,11 @@ */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), + maxLength = Infinity, result = []; while (othIndex--) { @@ -2683,26 +2861,32 @@ if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } - caches[othIndex] = !comparator && (iteratee || array.length >= 120) + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, - length = array.length, seen = caches[0]; outer: - while (++index < length) { + while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; - if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { - var othIndex = othLength; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; - if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { continue outer; } } @@ -2745,7 +2929,7 @@ */ function baseInvoke(object, path, args) { if (!isKey(path, object)) { - path = baseToPath(path); + path = castPath(path); object = parent(object, path); path = last(path); } @@ -2788,7 +2972,8 @@ * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ @@ -2800,41 +2985,39 @@ if (!objIsArr) { objTag = getTag(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } + objTag = objTag == argsTag ? objectTag : objTag; } if (!othIsArr) { othTag = getTag(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } + othTag = othTag == argsTag ? objectTag : othTag; } var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { 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, bitmask, stack); + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); - return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); } /** @@ -2876,9 +3059,10 @@ return false; } } else { - var stack = new Stack, - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result @@ -2898,14 +3082,15 @@ * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { return value; } if (value == null) { return identity; } - if (type == 'object') { + if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); @@ -2918,7 +3103,6 @@ * property of prototypes or treat sparse arrays as dense. * * @private - * @type Function * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ @@ -2979,16 +3163,7 @@ 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 Object(object))); - }; + return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); @@ -3004,6 +3179,9 @@ * @returns {Function} Returns the new function. */ function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(path, srcValue); + } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) @@ -3020,13 +3198,16 @@ * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } - var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source); + if (!(isArray(source) || isTypedArray(source))) { + var props = keysIn(source); + } arrayEach(props || source, function(srcValue, key) { if (props) { key = srcValue; @@ -3037,7 +3218,10 @@ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { - var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + if (newValue === undefined) { newValue = srcValue; } @@ -3058,7 +3242,8 @@ * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], @@ -3069,21 +3254,24 @@ assignMergeValue(object, key, stacked); return; } - var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined, - isCommon = newValue === undefined; + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; if (isCommon) { newValue = srcValue; if (isArray(srcValue) || isTypedArray(srcValue)) { if (isArray(objValue)) { - newValue = srcIndex ? copyArray(objValue) : objValue; + newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else { isCommon = false; - newValue = baseClone(srcValue); + newValue = baseClone(srcValue, true); } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { @@ -3092,10 +3280,10 @@ } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { isCommon = false; - newValue = baseClone(srcValue); + newValue = baseClone(srcValue, true); } else { - newValue = srcIndex ? baseClone(objValue) : objValue; + newValue = objValue; } } else { @@ -3108,9 +3296,27 @@ // Recursively merge objects and arrays (susceptible to call stack limits). mergeFunc(newValue, srcValue, srcIndex, customizer, stack); } + stack['delete'](srcValue); assignMergeValue(object, key, newValue); } + /** + * The base implementation of `_.nth` which doesn't coerce `n` to an integer. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + /** * The base implementation of `_.orderBy` without param guards. * @@ -3121,12 +3327,8 @@ * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { - var index = -1, - toIteratee = getIteratee(); - - iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) { - return toIteratee(iteratee); - }); + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { @@ -3142,11 +3344,11 @@ /** * The base implementation of `_.pick` without support for individual - * property names. + * property identifiers. * * @private * @param {Object} object The source object. - * @param {string[]} props The property names to pick. + * @param {string[]} props The property identifiers to pick. * @returns {Object} Returns the new object. */ function basePick(object, props) { @@ -3168,12 +3370,19 @@ * @returns {Object} Returns the new object. */ function basePickBy(object, predicate) { - var result = {}; - baseForIn(object, function(value, key) { + var index = -1, + props = getAllKeysIn(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + if (predicate(value, key)) { result[key] = value; } - }); + } return result; } @@ -3203,18 +3412,6 @@ }; } - /** - * The base implementation of `_.pullAll`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values) { - return basePullAllBy(array, values); - } - /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. @@ -3223,22 +3420,24 @@ * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ - function basePullAllBy(array, values, iteratee) { - var index = -1, + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, length = values.length, seen = array; if (iteratee) { - seen = arrayMap(array, function(value) { return iteratee(value); }); + seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; - while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } @@ -3269,7 +3468,7 @@ splice.call(array, index, 1); } else if (!isKey(index, array)) { - var path = baseToPath(index), + var path = castPath(index), object = parent(array, path); if (object != null) { @@ -3320,6 +3519,34 @@ return result; } + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + /** * The base implementation of `_.set`. * @@ -3331,7 +3558,7 @@ * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); var index = -1, length = path.length, @@ -3346,7 +3573,9 @@ var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { - newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue; + newValue = objValue == null + ? (isIndex(path[index + 1]) ? [] : {}) + : objValue; } } assignValue(nested, key, newValue); @@ -3405,7 +3634,8 @@ * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ function baseSome(collection, predicate) { var result; @@ -3459,7 +3689,8 @@ * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); @@ -3522,7 +3753,7 @@ value = array[0], computed = iteratee ? iteratee(value) : value, seen = computed, - resIndex = 0, + resIndex = 1, result = [value]; while (++index < length) { @@ -3531,24 +3762,12 @@ if (!eq(computed, seen)) { seen = computed; - result[++resIndex] = value; + result[resIndex++] = value; } } return result; } - /** - * The base implementation of `_.toPath` which only converts `value` to a - * path if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ - function baseToPath(value) { - return isArray(value) ? value : stringToPath(value); - } - /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * @@ -3618,12 +3837,26 @@ * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); + path = isKey(path, object) ? [path] : castPath(path); object = parent(object, path); var key = last(path); return (object != null && has(object, key)) ? delete object[key] : true; } + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. @@ -3696,7 +3929,7 @@ * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private - * @param {Array} props The property names. + * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. @@ -3708,11 +3941,60 @@ result = {}; while (++index < length) { - assignFunc(result, props[index], index < valsLength ? values[index] : undefined); + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); } return result; } + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value) { + return isArray(value) ? value : stringToPath(value); + } + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + /** * Creates a clone of `buffer`. * @@ -3725,9 +4007,7 @@ if (isDeep) { return buffer.slice(); } - var Ctor = buffer.constructor, - result = new Ctor(buffer.length); - + var result = new buffer.constructor(buffer.length); buffer.copy(result); return result; } @@ -3740,24 +4020,36 @@ * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { - var Ctor = arrayBuffer.constructor, - result = new Ctor(arrayBuffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(arrayBuffer)); + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + /** * Creates a clone of `map`. * * @private * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned map. */ - function cloneMap(map) { - var Ctor = map.constructor; - return arrayReduce(mapToArray(map), addMapEntry, new Ctor); + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); } /** @@ -3768,9 +4060,7 @@ * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { - var Ctor = regexp.constructor, - result = new Ctor(regexp.source, reFlags.exec(regexp)); - + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } @@ -3780,11 +4070,13 @@ * * @private * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned set. */ - function cloneSet(set) { - var Ctor = set.constructor; - return arrayReduce(setToArray(set), addSetEntry, new Ctor); + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); } /** @@ -3795,7 +4087,7 @@ * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { - return Symbol ? Object(symbolValueOf.call(symbol)) : {}; + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** @@ -3807,10 +4099,8 @@ * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { - var buffer = typedArray.buffer, - Ctor = typedArray.constructor; - - return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** @@ -3821,23 +4111,28 @@ * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, - result = Array(leftLength + argsLength); + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } } - while (argsLength--) { + while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; @@ -3851,18 +4146,21 @@ * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, - result = Array(argsLength + rightLength); + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; - while (++argsIndex < argsLength) { + while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; @@ -3870,7 +4168,9 @@ result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } } return result; } @@ -3899,34 +4199,23 @@ * * @private * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. + * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ - function copyObjectWith(source, props, object, customizer) { + function copyObject(source, props, object, customizer) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; assignValue(object, key, newValue); } @@ -3976,7 +4265,10 @@ customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; @@ -4022,7 +4314,7 @@ } /** - * Creates a base function for methods like `_.forIn`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. @@ -4051,7 +4343,8 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ @@ -4077,9 +4370,17 @@ return function(string) { string = toString(string); - var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined, - chr = strSymbols ? strSymbols[0] : string.charAt(0), - trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); + var strSymbols = reHasComplexSymbol.test(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); return chr[methodName]() + trailing; }; @@ -4094,7 +4395,7 @@ */ function createCompounder(callback) { return function(string) { - return arrayReduce(words(deburr(string)), callback, ''); + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } @@ -4108,8 +4409,8 @@ */ function createCtorWrapper(Ctor) { return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { @@ -4136,7 +4437,8 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ @@ -4145,10 +4447,9 @@ function wrapper() { var length = arguments.length, - index = length, args = Array(length), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, - placeholder = lodash.placeholder || wrapper.placeholder; + index = length, + placeholder = getPlaceholder(wrapper); while (index--) { args[index] = arguments[index]; @@ -4158,9 +4459,13 @@ : replaceHolders(args, placeholder); length -= holders.length; - return length < arity - ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) - : apply(fn, this, args); + if (length < arity) { + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); } return wrapper; } @@ -4174,7 +4479,7 @@ */ function createFlow(fromRight) { return rest(function(funcs) { - funcs = baseFlatten(funcs); + funcs = baseFlatten(funcs, 1); var length = funcs.length, index = length, @@ -4199,17 +4504,23 @@ var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { + 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); + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; - if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + if (wrapper && args.length == 1 && + isArray(value) && value.length >= LARGE_ARRAY_SIZE) { return wrapper.plant(value).value(); } var index = 0, @@ -4229,11 +4540,14 @@ * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [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} [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`. @@ -4244,8 +4558,7 @@ var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, + isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), isFlip = bitmask & FLIP_FLAG, Ctor = isBindKey ? undefined : createCtorWrapper(func); @@ -4257,30 +4570,34 @@ while (index--) { args[index] = arguments[index]; } + if (isCurried) { + var placeholder = getPlaceholder(wrapper), + holdersCount = countHolders(args, placeholder); + } if (partials) { - args = composeArgs(args, partials, holders); + args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } - if (isCurry || isCurryRight) { - var placeholder = lodash.placeholder || wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); - } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; + length = args.length; if (argPos) { args = reorder(args, argPos); - } else if (isFlip && args.length > 1) { + } else if (isFlip && length > 1) { args.reverse(); } - if (isAry && ary < args.length) { + if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { @@ -4314,7 +4631,10 @@ */ function createOver(arrayFunc) { return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees), getIteratee()); + iteratees = (iteratees.length == 1 && isArray(iteratees[0])) + ? arrayMap(iteratees[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee())); + return rest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { @@ -4329,37 +4649,34 @@ * 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 {number} length 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; + function createPadding(length, chars) { chars = chars === undefined ? ' ' : (chars + ''); - var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return reHasComplexSymbol.test(chars) - ? stringToArray(result).slice(0, padLength).join('') - : result.slice(0, padLength); + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); } /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartialWrapper(func, bitmask, thisArg, partials) { @@ -4416,11 +4733,13 @@ * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder to replace. + * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. @@ -4429,8 +4748,7 @@ */ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & CURRY_FLAG, - newArgPos = argPos ? copyArray(argPos) : undefined, - newsHolders = isCurry ? holders : undefined, + newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; @@ -4441,9 +4759,12 @@ if (!(bitmask & CURRY_BOUND_FLAG)) { bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity], - result = wrapFunc.apply(undefined, newData); + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } @@ -4532,8 +4853,12 @@ partials = holders = undefined; } - var data = isBindKey ? undefined : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; if (data) { mergeData(newData, data); @@ -4571,9 +4896,10 @@ * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { @@ -4614,12 +4940,16 @@ // Recursively compare arrays (susceptible to call stack limits). if (isUnordered) { if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); })) { result = false; break; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { result = false; break; } @@ -4640,12 +4970,22 @@ * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { @@ -4655,8 +4995,9 @@ 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. + // 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: @@ -4668,8 +5009,9 @@ 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. + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. return object == (other + ''); case mapTag: @@ -4679,12 +5021,24 @@ var isPartial = bitmask & PARTIAL_COMPARE_FLAG; convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + // Recursively compare objects (susceptible to call stack limits). - return (isPartial || object.size == other.size) && - equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); case symbolTag: - return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } } return false; } @@ -4697,9 +5051,10 @@ * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { @@ -4764,6 +5119,29 @@ return result; } + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + /** * Gets metadata for `func`. * @@ -4798,10 +5176,10 @@ } /** - * Gets the appropriate "iteratee" function. If the `_.iteratee` method is - * customized this function returns the custom method, otherwise it returns - * `baseIteratee`. If arguments are provided the chosen function is invoked - * with them and its result is returned. + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. @@ -4817,8 +5195,9 @@ /** * 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. + * **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. @@ -4852,19 +5231,68 @@ * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { - var value = object == null ? undefined : object[key]; + var value = object[key]; return isNative(value) ? value : undefined; } /** - * Creates an array of the own symbol properties of `object`. + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getPlaceholder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the `[[Prototype]]` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {null|Object} Returns the `[[Prototype]]`. + */ + function getPrototype(value) { + return nativeGetPrototype(Object(value)); + } + + /** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + function getSymbols(object) { + // Coerce `object` to an object to avoid non-object errors in V8. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. + return getOwnPropertySymbols(Object(object)); + } + + // Fallback for IE < 11. + if (!getOwnPropertySymbols) { + getSymbols = function() { + return []; + }; + } + + /** + * Creates an array of the own and inherited enumerable symbol properties + * of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbols = getOwnPropertySymbols || function() { - return []; + var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; }; /** @@ -4878,18 +5306,23 @@ return objectToString.call(value); } - // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. - if ((Map && getTag(new Map) != mapTag) || + // Fallback for data views, maps, sets, and weak maps in IE 11, + // for data views in Edge, and promises in Node.js. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { + case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } @@ -4936,23 +5369,25 @@ * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseToPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = path[index]; + if (!(result = object != null && hasFunc(object, key))) { + break; } + object = object[key]; } - var length = object ? object.length : undefined; - return result || ( - !!length && isLength(length) && isIndex(path, length) && - (isArray(object) || isString(object) || isArguments(object)) - ); + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isString(object) || isArguments(object)); } /** @@ -4982,11 +5417,9 @@ * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { - if (isPrototype(object)) { - return {}; - } - var Ctor = object.constructor; - return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; } /** @@ -4998,10 +5431,11 @@ * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ - function initCloneByTag(object, tag, isDeep) { + function initCloneByTag(object, tag, cloneFunc, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: @@ -5011,13 +5445,16 @@ case dateTag: return new Ctor(+object); + case dataViewTag: + return cloneDataView(object, isDeep); + case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: - return cloneMap(object); + return cloneMap(object, isDeep, cloneFunc); case numberTag: case stringTag: @@ -5027,7 +5464,7 @@ return cloneRegExp(object); case setTag: - return cloneSet(object); + return cloneSet(object, isDeep, cloneFunc); case symbolTag: return cloneSymbol(object); @@ -5051,6 +5488,29 @@ return null; } + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + /** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + } + /** * Checks if the given arguments are from an iteratee call. * @@ -5058,7 +5518,8 @@ * @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`. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { @@ -5066,8 +5527,9 @@ } var type = typeof index; if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { return eq(object[index], value); } return false; @@ -5082,11 +5544,12 @@ * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { - if (typeof value == 'number') { + var type = typeof value; + if (type == 'number' || type == 'symbol') { return true; } return !isArray(value) && - (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object))); } @@ -5100,7 +5563,7 @@ function isKeyable(value) { var type = typeof value; return type == 'number' || type == 'boolean' || - (type == 'string' && value !== '__proto__') || value == null; + (type == 'string' && value != '__proto__') || value == null; } /** @@ -5108,7 +5571,8 @@ * * @private * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), @@ -5150,15 +5614,35 @@ return value === value && !isObject(value); } + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * modify function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * combined case where curried functions have `_.ary` and or `_.rearg` applied. + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. @@ -5172,9 +5656,9 @@ isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); var isCombo = - (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) || - (srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); + ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) || + ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { @@ -5184,26 +5668,26 @@ if (srcBitmask & BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; + newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { - data[7] = copyArray(value); + data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & ARY_FLAG) { @@ -5229,13 +5713,13 @@ * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. * @returns {*} Returns the value to assign. */ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); } return objValue; } @@ -5249,7 +5733,7 @@ * @returns {*} Returns the parent value. */ function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); + return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** @@ -5278,8 +5762,9 @@ * 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) + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private @@ -5314,34 +5799,42 @@ * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - function stringToPath(string) { + var stringToPath = memoize(function(string) { var result = []; toString(string).replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; - } + }); /** - * Converts `value` to an array-like object if it's not one. + * Converts `value` to a string key if it's not a string or symbol. * * @private - * @param {*} value The value to process. - * @returns {Array} Returns the array-like object. + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ - function toArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; + function toKey(key) { + return (typeof key == 'string' || isSymbol(key)) ? key : (key + ''); } /** - * Converts `value` to a function if it's not one. + * Converts `func` to its source code. * * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. + * @param {Function} func The function to process. + * @returns {string} Returns the source code. */ - function toFunction(value) { - return typeof value == 'function' ? value : identity; + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; } /** @@ -5371,9 +5864,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to process. - * @param {number} [size=0] The length of each chunk. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array containing chunks. * @example * @@ -5383,19 +5878,22 @@ * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ - function chunk(array, size) { - size = nativeMax(toInteger(size), 0); - + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } var length = array ? array.length : 0; if (!length || size < 1) { return []; } var index = 0, - resIndex = -1, + resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); + result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } @@ -5406,6 +5904,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. @@ -5417,13 +5916,13 @@ function compact(array) { var index = -1, length = array ? array.length : 0, - resIndex = -1, + resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { - result[++resIndex] = value; + result[resIndex++] = value; } } return result; @@ -5435,6 +5934,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. @@ -5450,21 +5950,29 @@ * console.log(array); * // => [1] */ - var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; + function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; } - values = baseFlatten(values); - return arrayConcat(array, values); - }); + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); + } /** - * Creates an array of unique `array` values not included in the other - * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. + * Creates an array of unique `array` values not included in the other given + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. @@ -5476,21 +5984,24 @@ */ var difference = rest(function(array, values) { return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * @@ -5507,17 +6018,19 @@ iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), getIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The comparator - * is invoked with two arguments: (arrVal, othVal). + * which is invoked to compare elements of `array` to `values`. Result values + * are chosen from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. @@ -5536,7 +6049,7 @@ comparator = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), undefined, comparator) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); @@ -5545,10 +6058,11 @@ * * @static * @memberOf _ + * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * @@ -5578,10 +6092,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * @@ -5614,9 +6129,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -5654,9 +6171,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -5695,6 +6214,7 @@ * * @static * @memberOf _ + * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. @@ -5733,9 +6253,11 @@ * * @static * @memberOf _ + * @since 1.1.0 * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {number} Returns the index of the found element, else `-1`. * @example * @@ -5772,9 +6294,11 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {number} Returns the index of the found element, else `-1`. * @example * @@ -5806,39 +6330,70 @@ } /** - * Flattens `array` a single level. + * Flattens `array` a single level deep. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; + return length ? baseFlatten(array, 1) : []; } /** - * This method is like `_.flatten` except that it recursively flattens `array`. + * Recursively flattens `array`. * * @static * @memberOf _ + * @since 3.0.0 * @category Array - * @param {Array} array The array to recursively flatten. + * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); } /** @@ -5847,6 +6402,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. @@ -5872,6 +6428,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. @@ -5885,17 +6442,18 @@ * // => undefined */ function head(array) { - return array ? array[0] : undefined; + return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -5927,6 +6485,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. @@ -5942,20 +6501,22 @@ /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. + * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [4, 2], [1, 2]); * // => [2] */ var intersection = rest(function(arrays) { - var mapped = arrayMap(arrays, toArrayLikeObject); + var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; @@ -5964,14 +6525,17 @@ /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); @@ -5983,7 +6547,7 @@ */ var intersectionBy = rest(function(arrays) { var iteratee = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; @@ -5997,15 +6561,17 @@ /** * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). + * which is invoked to compare elements of `arrays`. Result values are chosen + * from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. + * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; @@ -6016,7 +6582,7 @@ */ var intersectionWith = rest(function(arrays) { var comparator = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); if (comparator === last(mapped)) { comparator = undefined; @@ -6033,6 +6599,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. @@ -6051,6 +6618,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. @@ -6070,6 +6638,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -6092,7 +6661,11 @@ var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); - index = (index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1)) + 1; + index = ( + index < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1) + ) + 1; } if (value !== value) { return indexOfNaN(array, index, true); @@ -6105,15 +6678,42 @@ return -1; } + /** + * Gets the nth element of `array`. If `n` is negative, the nth element + * from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * - * **Note:** Unlike `_.without`, this method mutates `array`. + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. @@ -6135,6 +6735,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. @@ -6156,16 +6757,18 @@ /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * @@ -6177,7 +6780,36 @@ */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) - ? basePullAllBy(array, values, getIteratee(iteratee)) + ? basePullAll(array, values, getIteratee(iteratee)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) : array; } @@ -6189,10 +6821,10 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified individually or in arrays. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * @@ -6206,7 +6838,7 @@ * // => [10, 20] */ var pullAt = rest(function(array, indexes) { - indexes = arrayMap(baseFlatten(indexes), String); + indexes = arrayMap(baseFlatten(indexes, 1), String); var result = baseAt(array, indexes); basePullAt(array, indexes.sort(compareAscending)); @@ -6215,16 +6847,19 @@ /** * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked with - * three arguments: (value, index, array). + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). * - * **Note:** Unlike `_.filter`, this method mutates `array`. + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * @@ -6269,7 +6904,9 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array + * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * @@ -6288,11 +6925,13 @@ /** * Creates a slice of `array` from `start` up to, but not including, `end`. * - * **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) - * to ensure dense arrays are returned. + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. @@ -6316,15 +6955,17 @@ } /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * _.sortedIndex([30, 50], 40); @@ -6344,11 +6985,14 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; @@ -6370,6 +7014,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -6397,10 +7042,12 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * _.sortedLastIndex([4, 5], 4); @@ -6417,11 +7064,14 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * // The `_.property` iteratee shorthand. @@ -6438,6 +7088,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. @@ -6464,6 +7115,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. @@ -6484,6 +7136,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. @@ -6504,6 +7157,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. @@ -6521,10 +7175,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * @@ -6553,10 +7208,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * @@ -6584,14 +7240,16 @@ /** * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with three - * arguments: (value, index, array). + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -6629,9 +7287,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -6669,6 +7329,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. @@ -6678,19 +7339,22 @@ * // => [2, 1, 4] */ var union = rest(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * @@ -6706,7 +7370,7 @@ if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, false, true), getIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); }); /** @@ -6716,6 +7380,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. @@ -6733,17 +7398,18 @@ if (isArrayLikeObject(comparator)) { comparator = undefined; } - return baseUniq(baseFlatten(arrays, false, true), undefined, comparator); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. + * for equality comparisons, in which only the first occurrence of each + * element is kept. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. @@ -6765,9 +7431,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * @@ -6791,6 +7459,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. @@ -6815,6 +7484,7 @@ * * @static * @memberOf _ + * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. @@ -6849,9 +7519,11 @@ * * @static * @memberOf _ + * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine regrouped values. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * @@ -6881,6 +7553,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to filter. * @param {...*} [values] The values to exclude. @@ -6897,11 +7570,14 @@ }); /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. * * @static * @memberOf _ + * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of values. @@ -6916,14 +7592,17 @@ /** * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of values. * @example * @@ -6949,6 +7628,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. @@ -6970,12 +7650,13 @@ }); /** - * 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. + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. @@ -6988,12 +7669,13 @@ /** * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property names and one of corresponding values. + * one of property identifiers and one of corresponding values. * * @static * @memberOf _ + * @since 0.4.0 * @category Array - * @param {Array} [props=[]] The property names. + * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example @@ -7010,8 +7692,9 @@ * * @static * @memberOf _ + * @since 4.1.0 * @category Array - * @param {Array} [props=[]] The property names. + * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example @@ -7030,6 +7713,7 @@ * * @static * @memberOf _ + * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine grouped values. @@ -7052,11 +7736,13 @@ /*------------------------------------------------------------------------*/ /** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. * * @static * @memberOf _ + * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. @@ -7087,10 +7773,11 @@ /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain in order to modify intermediate results. + * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ + * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. @@ -7114,10 +7801,11 @@ /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain. + * results in a method chain sequence. * * @static * @memberOf _ + * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. @@ -7142,9 +7830,9 @@ * * @name at * @memberOf _ + * @since 1.0.0 * @category Seq - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. + * @param {...(string|string[])} [paths] The property paths of elements to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * @@ -7157,17 +7845,22 @@ * // => ['a', 'c'] */ var wrapperAt = rest(function(paths) { - paths = baseFlatten(paths); + paths = baseFlatten(paths, 1); var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; - if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); @@ -7177,10 +7870,11 @@ }); /** - * Enables explicit method chaining on the wrapper object. + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ + * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example @@ -7207,10 +7901,11 @@ } /** - * Executes the chained sequence and returns the wrapped result. + * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ + * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example @@ -7235,33 +7930,13 @@ return new LodashWrapper(this.value(), this.__chain__); } - /** - * This method is the wrapper version of `_.flatMap`. - * - * @name flatMap - * @memberOf _ - * @category Seq - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _([1, 2]).flatMap(duplicate).value(); - * // => [1, 1, 2, 2] - */ - function wrapperFlatMap(iteratee) { - return this.map(iteratee).flatten(); - } - /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ + * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example @@ -7292,6 +7967,7 @@ * * @name Symbol.iterator * @memberOf _ + * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example @@ -7309,10 +7985,11 @@ } /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. + * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ + * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. @@ -7358,6 +8035,7 @@ * * @name reverse * @memberOf _ + * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example @@ -7378,17 +8056,22 @@ wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); - wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** - * Executes the chained sequence to extract the unwrapped value. + * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ + * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. @@ -7405,15 +8088,17 @@ /** * 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 invoked with one argument: (value). + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7434,19 +8119,22 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. @@ -7471,14 +8159,16 @@ /** * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @example * @@ -7509,14 +8199,16 @@ /** * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -7556,9 +8248,11 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -7577,15 +8271,17 @@ } /** - * Creates an array of flattened values by running each element in `collection` - * through `iteratee` and concating its result to the other mapped values. - * The iteratee is invoked with three arguments: (value, index|key, collection). + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * @@ -7597,20 +8293,73 @@ * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee)); + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); } /** - * Iterates over elements of `collection` invoking `iteratee` for each element. + * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. * * @static * @memberOf _ + * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. @@ -7621,17 +8370,17 @@ * _([1, 2]).forEach(function(value) { * console.log(value); * }); - * // => logs `1` then `2` + * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { return (typeof iteratee == 'function' && isArray(collection)) ? arrayEach(collection, iteratee) - : baseEach(collection, toFunction(iteratee)); + : baseEach(collection, getIteratee(iteratee)); } /** @@ -7640,6 +8389,7 @@ * * @static * @memberOf _ + * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. @@ -7650,25 +8400,28 @@ * _.forEachRight([1, 2], function(value) { * console.log(value); * }); - * // => logs `2` then `1` + * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { return (typeof iteratee == 'function' && isArray(collection)) ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, toFunction(iteratee)); + : baseEachRight(collection, getIteratee(iteratee)); } /** * 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 elements responsible for generating the key. - * The iteratee is invoked with one argument: (value). + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7688,18 +8441,20 @@ }); /** - * Checks if `value` is in `collection`. If `collection` is a string it's checked - * for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to search. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * @@ -7731,11 +8486,12 @@ /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or @@ -7765,15 +8521,17 @@ /** * 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 + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7795,7 +8553,7 @@ }); /** - * Creates an array of values by running each element in `collection` through + * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * @@ -7803,16 +8561,18 @@ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -7848,24 +8608,26 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, + * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { @@ -7889,9 +8651,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * @@ -7922,9 +8686,9 @@ /** * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive + * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not given the first element of `collection` is used as the initial + * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -7937,6 +8701,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -7968,6 +8733,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -7995,9 +8761,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @example * @@ -8034,6 +8802,7 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. @@ -8055,9 +8824,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. - * @param {number} [n=0] The number of elements to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * @@ -8067,13 +8838,17 @@ * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ - function sampleSize(collection, n) { + function sampleSize(collection, n, guard) { var index = -1, result = toArray(collection), length = result.length, lastIndex = length - 1; - n = baseClamp(toInteger(n), 0, length); + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = baseClamp(toInteger(n), 0, length); + } while (++index < n) { var rand = baseRandom(index, lastIndex), value = result[rand]; @@ -8091,6 +8866,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. @@ -8105,10 +8881,11 @@ /** * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. + * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @returns {number} Returns the collection size. @@ -8131,6 +8908,12 @@ var result = collection.length; return (result && isString(collection)) ? stringSize(collection) : result; } + if (isObjectLike(collection)) { + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + } return keys(collection).length; } @@ -8141,11 +8924,14 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); @@ -8178,36 +8964,37 @@ /** * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method + * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, + * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] * * _.sortBy(users, 'user', function(o) { * return Math.floor(o.age / 10); * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ var sortBy = rest(function(collection, iteratees) { if (collection == null) { @@ -8217,9 +9004,13 @@ if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees.length = 1; + iteratees = [iteratees[0]]; } - return baseOrderBy(collection, baseFlatten(iteratees), []); + iteratees = (iteratees.length == 1 && isArray(iteratees[0])) + ? iteratees[0] + : baseFlatten(iteratees, 1, isFlattenableIteratee); + + return baseOrderBy(collection, iteratees, []); }); /*------------------------------------------------------------------------*/ @@ -8230,7 +9021,8 @@ * * @static * @memberOf _ - * @type Function + * @since 2.4.0 + * @type {Function} * @category Date * @returns {number} Returns the timestamp. * @example @@ -8238,7 +9030,7 @@ * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked + * // => Logs the number of milliseconds it took for the deferred function to be invoked. */ var now = Date.now; @@ -8250,6 +9042,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. @@ -8265,7 +9058,7 @@ * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); - * // => logs 'done saving!' after the two async saves have completed + * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { @@ -8280,15 +9073,16 @@ } /** - * Creates a function that accepts up to `n` arguments, ignoring any - * additional arguments. + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new function. * @example * @@ -8308,6 +9102,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. @@ -8336,8 +9131,7 @@ /** * 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. + * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. @@ -8347,6 +9141,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. @@ -8372,21 +9167,19 @@ var bind = rest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { - var placeholder = lodash.placeholder || bind.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(bind)); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); }); /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * 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 @@ -8394,6 +9187,7 @@ * * @static * @memberOf _ + * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. @@ -8427,9 +9221,7 @@ var bindKey = rest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { - var placeholder = lodash.placeholder || bindKey.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(bindKey)); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); @@ -8449,10 +9241,11 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * @@ -8478,7 +9271,7 @@ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = lodash.placeholder || curry.placeholder; + result.placeholder = curry.placeholder; return result; } @@ -8493,10 +9286,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * @@ -8522,7 +9316,7 @@ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = lodash.placeholder || curryRight.placeholder; + result.placeholder = curryRight.placeholder; return result; } @@ -8540,21 +9334,22 @@ * on the trailing edge of the timeout only if the debounced function is * invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it's invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * @@ -8576,16 +9371,15 @@ * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { - var args, - maxTimeoutId, + var lastArgs, + lastThis, + maxWait, result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, + timerId, + lastCallTime = 0, + lastInvokeTime = 0, leading = false, - maxWait = false, + maxing = false, trailing = true; if (typeof func != 'function') { @@ -8594,94 +9388,104 @@ wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; - maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - lastCalled = 0; - args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined; + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; } - function complete(isCalled, id) { - if (id) { - clearTimeout(id); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - } + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; } - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (!lastCallTime || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); } - function flush() { - if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) { - result = func.apply(thisArg, args); + function trailingEdge(time) { + clearTimeout(timerId); + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); } - cancel(); + lastArgs = lastThis = undefined; return result; } - function maxDelayed() { - complete(trailing, timeoutId); + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastCallTime = lastInvokeTime = 0; + lastArgs = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); } function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); + var time = now(), + isInvoking = shouldInvoke(time); - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!lastCalled && !maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; + lastArgs = arguments; + lastThis = this; + lastCallTime = time; - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); } } - 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 = undefined; + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); } return result; } @@ -8696,6 +9500,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. @@ -8705,7 +9510,7 @@ * _.defer(function(text) { * console.log(text); * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds + * // => Logs 'deferred' after one or more milliseconds. */ var defer = rest(function(func, args) { return baseDelay(func, 1, args); @@ -8717,6 +9522,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. @@ -8727,7 +9533,7 @@ * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); - * // => logs 'later' after one second + * // => Logs 'later' after one second. */ var delay = rest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); @@ -8738,6 +9544,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new function. @@ -8756,18 +9563,20 @@ /** * 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 + * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. @@ -8812,10 +9621,13 @@ memoized.cache = cache.set(key, result); return result; }; - memoized.cache = new memoize.Cache; + memoized.cache = new (memoize.Cache || MapCache); return memoized; } + // Assign cache to `_.memoize`. + memoize.Cache = MapCache; + /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the @@ -8823,6 +9635,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new function. @@ -8851,6 +9664,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. @@ -8870,11 +9684,12 @@ * corresponding `transforms`. * * @static + * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms] The functions to transform - * arguments, specified individually or in arrays. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [transforms[_.identity]] The functions to transform. * @returns {Function} Returns the new function. * @example * @@ -8897,7 +9712,9 @@ * // => [100, 10] */ var overArgs = rest(function(func, transforms) { - transforms = arrayMap(baseFlatten(transforms), getIteratee()); + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee())); var funcsLength = transforms.length; return rest(function(args) { @@ -8912,9 +9729,9 @@ }); /** - * 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. + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. @@ -8924,6 +9741,7 @@ * * @static * @memberOf _ + * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. @@ -8944,15 +9762,13 @@ * // => 'hi fred' */ var partial = rest(function(func, partials) { - var placeholder = lodash.placeholder || partial.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(partial)); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. + * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. @@ -8962,6 +9778,7 @@ * * @static * @memberOf _ + * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. @@ -8982,24 +9799,22 @@ * // => 'hello fred' */ var partialRight = rest(function(func, partials) { - var placeholder = lodash.placeholder || partialRight.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(partialRight)); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is + * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified individually or in arrays. + * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * @@ -9011,17 +9826,20 @@ * // => ['a', 'b', 'c'] */ var rearg = rest(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); + return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); }); /** * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. + * created function and arguments from `start` and beyond provided as + * an array. * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. @@ -9066,13 +9884,16 @@ } /** - * 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). + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). * - * **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator). + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ + * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. @@ -9103,7 +9924,7 @@ start = start === undefined ? 0 : nativeMax(toInteger(start), 0); return rest(function(args) { var array = args[start], - otherArgs = args.slice(0, start); + otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); @@ -9122,23 +9943,24 @@ * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the throttled function is - * invoked more than once during the `wait` timeout. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. + * @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 * @@ -9163,7 +9985,11 @@ leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } - return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); } /** @@ -9172,6 +9998,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new function. @@ -9192,9 +10019,10 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. + * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * @@ -9212,6 +10040,47 @@ /*------------------------------------------------------------------------*/ + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + /** * Creates a shallow clone of `value`. * @@ -9225,6 +10094,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. @@ -9237,17 +10107,18 @@ * // => true */ function clone(value) { - return baseClone(value); + return baseClone(value, false, true); } /** * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` + * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. @@ -9270,7 +10141,7 @@ * // => 0 */ function cloneWith(value, customizer) { - return baseClone(value, false, customizer); + return baseClone(value, false, true, customizer); } /** @@ -9278,6 +10149,7 @@ * * @static * @memberOf _ + * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. @@ -9290,7 +10162,7 @@ * // => false */ function cloneDeep(value) { - return baseClone(value, true); + return baseClone(value, true, true); } /** @@ -9298,6 +10170,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. @@ -9320,15 +10193,17 @@ * // => 20 */ function cloneDeepWith(value, customizer) { - return baseClone(value, true, customizer); + return baseClone(value, true, true, customizer); } /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. @@ -9362,10 +10237,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. * @example * * _.gt(3, 1); @@ -9386,10 +10263,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. * @example * * _.gte(3, 1); @@ -9410,9 +10289,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArguments(function() { return arguments; }()); @@ -9432,10 +10313,12 @@ * * @static * @memberOf _ - * @type Function + * @since 0.1.0 + * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArray([1, 2, 3]); @@ -9457,10 +10340,11 @@ * * @static * @memberOf _ - * @type Function + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); @@ -9480,7 +10364,7 @@ * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. @@ -9499,8 +10383,7 @@ * // => false */ function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); + return value != null && isLength(getLength(value)) && !isFunction(value); } /** @@ -9509,10 +10392,11 @@ * * @static * @memberOf _ - * @type Function + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); @@ -9536,9 +10420,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isBoolean(false); @@ -9557,6 +10443,7 @@ * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. @@ -9577,9 +10464,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isDate(new Date); @@ -9597,9 +10486,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @returns {boolean} Returns `true` if `value` is a DOM element, + * else `false`. * @example * * _.isElement(document.body); @@ -9613,14 +10504,20 @@ } /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang - * @param {Array|Object|string} value The value to inspect. + * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * @@ -9641,15 +10538,22 @@ */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { + (isArray(value) || isString(value) || isFunction(value.splice) || + isArguments(value) || isBuffer(value))) { return !value.length; } + if (isObjectLike(value)) { + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } - return true; + return !(nonEnumShadows && keys(value).length); } /** @@ -9664,10 +10568,12 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. * @example * * var object = { 'user': 'fred' }; @@ -9684,18 +10590,20 @@ } /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to six arguments: - * (objValue, othValue [, index|key, object, other, stack]). + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. * @example * * function isGreeting(value) { @@ -9726,9 +10634,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @returns {boolean} Returns `true` if `value` is an error object, + * else `false`. * @example * * _.isError(new Error); @@ -9738,20 +10648,26 @@ * // => false */ function isError(value) { - return isObjectLike(value) && - typeof value.message == 'string' && objectToString.call(value) == errorTag; + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); } /** * Checks if `value` is a finite primitive number. * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. * @example * * _.isFinite(3); @@ -9775,9 +10691,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isFunction(_); @@ -9788,8 +10706,8 @@ */ 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. + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -9797,10 +10715,12 @@ /** * Checks if `value` is an integer. * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. @@ -9825,13 +10745,16 @@ /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. * @example * * _.isLength(3); @@ -9847,15 +10770,18 @@ * // => false */ function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. @@ -9884,6 +10810,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. @@ -9910,9 +10837,11 @@ * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isMap(new Map); @@ -9926,13 +10855,15 @@ } /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. This method is + * equivalent to a `_.matches` function when `source` is partially applied. * * **Note:** This method supports comparing the same values as `_.isEqual`. * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. @@ -9953,12 +10884,13 @@ /** * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. @@ -9990,11 +10922,14 @@ /** * 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. + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. @@ -10014,7 +10949,8 @@ */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. return isNumber(value) && value != +value; } @@ -10023,9 +10959,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. * @example * * _.isNative(Array.prototype.push); @@ -10035,14 +10973,11 @@ * // => false */ function isNative(value) { - if (value == null) { + if (!isObject(value)) { return false; } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } /** @@ -10050,6 +10985,7 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. @@ -10070,6 +11006,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. @@ -10091,14 +11028,16 @@ /** * 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. + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isNumber(3); @@ -10124,9 +11063,11 @@ * * @static * @memberOf _ + * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, + * else `false`. * @example * * function Foo() { @@ -10146,17 +11087,15 @@ * // => true */ function isPlainObject(value) { - if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { return false; } - var proto = objectProto; - if (typeof value.constructor == 'function') { - proto = getPrototypeOf(value); - } + var proto = getPrototype(value); if (proto === null) { return true; } - var Ctor = proto.constructor; + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } @@ -10166,9 +11105,11 @@ * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isRegExp(/abc/); @@ -10185,13 +11126,16 @@ * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @returns {boolean} Returns `true` if `value` is a safe integer, + * else `false`. * @example * * _.isSafeInteger(3); @@ -10215,9 +11159,11 @@ * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isSet(new Set); @@ -10234,10 +11180,12 @@ * Checks if `value` is classified as a `String` primitive or object. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isString('abc'); @@ -10256,9 +11204,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isSymbol(Symbol.iterator); @@ -10277,9 +11227,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isTypedArray(new Uint8Array); @@ -10289,13 +11241,15 @@ * // => false */ function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; } /** * Checks if `value` is `undefined`. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. @@ -10317,9 +11271,11 @@ * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isWeakMap(new WeakMap); @@ -10337,9 +11293,11 @@ * * @static * @memberOf _ + * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. * @example * * _.isWeakSet(new WeakSet); @@ -10357,10 +11315,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. * @example * * _.lt(1, 3); @@ -10381,10 +11341,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. * @example * * _.lte(1, 3); @@ -10404,6 +11366,7 @@ * Converts `value` to an array. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. @@ -10441,10 +11404,12 @@ /** * Converts `value` to an integer. * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. @@ -10479,10 +11444,12 @@ * Converts `value` to an integer suitable for use as the length of an * array-like object. * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. @@ -10509,6 +11476,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. @@ -10527,6 +11495,12 @@ * // => 3 */ function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } if (isObject(value)) { var other = isFunction(value.valueOf) ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; @@ -10542,11 +11516,12 @@ } /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. @@ -10574,6 +11549,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. @@ -10596,11 +11572,12 @@ } /** - * 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. + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. @@ -10624,7 +11601,7 @@ return ''; } if (isSymbol(value)) { - return Symbol ? symbolToString.call(value) : ''; + return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; @@ -10633,15 +11610,16 @@ /*------------------------------------------------------------------------*/ /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ + * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. @@ -10663,7 +11641,15 @@ * // => { 'a': 1, 'c': 3, 'e': 5 } */ var assign = createAssigner(function(object, source) { - copyObject(source, keys(source), object); + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } }); /** @@ -10674,6 +11660,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. @@ -10696,19 +11683,26 @@ * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } */ var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keysIn(source), object); + return; + } + for (var key in source) { + assignValue(object, key, source[key]); + } }); /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. @@ -10727,19 +11721,20 @@ * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); + copyObject(source, keysIn(source), object, customizer); }); /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. @@ -10757,7 +11752,7 @@ * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keys(source), object, customizer); + copyObject(source, keys(source), object, customizer); }); /** @@ -10765,10 +11760,10 @@ * * @static * @memberOf _ + * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. + * @param {...(string|string[])} [paths] The property paths of elements to pick. * @returns {Array} Returns the new array of picked elements. * @example * @@ -10781,15 +11776,17 @@ * // => ['a', 'c'] */ var at = rest(function(object, paths) { - return baseAt(object, baseFlatten(paths)); + return baseAt(object, baseFlatten(paths, 1)); }); /** - * Creates an object that inherits from the `prototype` object. If a `properties` - * object is given its own enumerable properties are assigned to the created object. + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. * * @static * @memberOf _ + * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. @@ -10822,14 +11819,15 @@ } /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. @@ -10853,6 +11851,7 @@ * * @static * @memberOf _ + * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. @@ -10874,10 +11873,13 @@ * * @static * @memberOf _ + * @since 1.1.0 * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * * var users = { @@ -10911,10 +11913,13 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * * var users = { @@ -10943,13 +11948,14 @@ } /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by explicitly - * returning `false`. + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. * * @static * @memberOf _ + * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -10966,10 +11972,12 @@ * _.forIn(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed) + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { - return object == null ? object : baseFor(object, toFunction(iteratee), keysIn); + return object == null + ? object + : baseFor(object, getIteratee(iteratee), keysIn); } /** @@ -10978,6 +11986,7 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -10994,20 +12003,23 @@ * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c' + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { - return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn); + return object == null + ? object + : baseForRight(object, getIteratee(iteratee), keysIn); } /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by - * explicitly returning `false`. + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. * * @static * @memberOf _ + * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -11024,10 +12036,10 @@ * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { - return object && baseForOwn(object, toFunction(iteratee)); + return object && baseForOwn(object, getIteratee(iteratee)); } /** @@ -11036,6 +12048,7 @@ * * @static * @memberOf _ + * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -11052,10 +12065,10 @@ * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); - * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b' + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, toFunction(iteratee)); + return object && baseForOwnRight(object, getIteratee(iteratee)); } /** @@ -11063,6 +12076,7 @@ * of `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. @@ -11089,6 +12103,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the new array of property names. @@ -11110,14 +12125,15 @@ /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is used in its place. * * @static * @memberOf _ + * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * @@ -11141,6 +12157,7 @@ * Checks if `path` is a direct property of `object`. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -11148,23 +12165,23 @@ * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * - * _.has(object, 'a.b.c'); + * _.has(object, 'a.b'); * // => true * - * _.has(object, ['a', 'b', 'c']); + * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { - return hasPath(object, path, baseHas); + return object != null && hasPath(object, path, baseHas); } /** @@ -11172,37 +12189,39 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * - * _.hasIn(object, 'a.b.c'); + * _.hasIn(object, 'a.b'); * // => true * - * _.hasIn(object, ['a', 'b', 'c']); + * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { - return hasPath(object, path, baseHasIn); + return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. * * @static * @memberOf _ + * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. @@ -11219,16 +12238,18 @@ /** * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` through `iteratee`. - * The corresponding inverted value of each inverted key is an array of keys + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ + * @since 4.1.0 * @category Object * @param {Object} object The object to invert. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * @@ -11255,6 +12276,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. @@ -11277,6 +12299,7 @@ * for more details. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -11323,6 +12346,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. @@ -11361,13 +12385,16 @@ /** * 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`. + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). * * @static * @memberOf _ + * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @example * @@ -11387,15 +12414,18 @@ } /** - * 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 invoked with three arguments: (value, key, object). + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). * * @static * @memberOf _ + * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @example * @@ -11422,17 +12452,19 @@ } /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively.Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. @@ -11457,7 +12489,7 @@ /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the + * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with seven arguments: * (objValue, srcValue, key, object, source, stack). * @@ -11465,6 +12497,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. @@ -11497,14 +12530,15 @@ /** * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. + * own and inherited enumerable string keyed properties of `object` that are + * not omitted. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays.. + * @param {...(string|string[])} [props] The property identifiers to omit. * @returns {Object} Returns the new object. * @example * @@ -11517,20 +12551,23 @@ if (object == null) { return {}; } - props = arrayMap(baseFlatten(props), String); - return basePick(object, baseDifference(keysIn(object), props)); + props = arrayMap(baseFlatten(props, 1), toKey); + return basePick(object, baseDifference(getAllKeysIn(object), props)); }); /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -11540,7 +12577,7 @@ * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = getIteratee(predicate, 2); + predicate = getIteratee(predicate); return basePickBy(object, function(value, key) { return !predicate(value, key); }); @@ -11550,11 +12587,11 @@ * Creates an object composed of the picked `object` properties. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. + * @param {...(string|string[])} [props] The property identifiers to pick. * @returns {Object} Returns the new object. * @example * @@ -11564,7 +12601,7 @@ * // => { 'a': 1, 'c': 3 } */ var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, baseFlatten(props)); + return object == null ? {} : basePick(object, baseFlatten(props, 1)); }); /** @@ -11573,9 +12610,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -11585,20 +12624,21 @@ * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate, 2)); + return object == null ? {} : basePickBy(object, getIteratee(predicate)); } /** - * This method is like `_.get` except that if the resolved value is a function - * it's invoked with the `this` binding of its parent object and its result - * is returned. + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * @@ -11617,21 +12657,29 @@ * // => 'default' */ function result(object, path, defaultValue) { - if (!isKey(path, object)) { - path = baseToPath(path); - var result = get(object, path); - object = parent(object, path); - } else { - result = object == null ? undefined : object[path]; + path = isKey(path, object) ? [path] : castPath(path); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + object = undefined; + length = 1; } - if (result === undefined) { - result = defaultValue; + while (++index < length) { + var value = object == null ? undefined : object[path[index]]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; } - return isFunction(result) ? result.call(object) : result; + return object; } /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. @@ -11640,6 +12688,7 @@ * * @static * @memberOf _ + * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. @@ -11653,7 +12702,7 @@ * console.log(object.a[0].b.c); * // => 4 * - * _.set(object, 'x[0].y.z', 5); + * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ @@ -11671,6 +12720,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. @@ -11679,8 +12729,10 @@ * @returns {Object} Returns `object`. * @example * - * _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); - * // => { '0': { '1': { '2': 3 }, 'length': 2 } } + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; @@ -11688,10 +12740,13 @@ } /** - * Creates an array of own enumerable key-value pairs for `object`. + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. * * @static * @memberOf _ + * @since 4.0.0 + * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the new array of key-value pairs. @@ -11712,10 +12767,13 @@ } /** - * Creates an array of own and inherited enumerable key-value pairs for `object`. + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. * * @static * @memberOf _ + * @since 4.0.0 + * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the new array of key-value pairs. @@ -11737,14 +12795,15 @@ /** * 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 invoked with four arguments: - * (accumulator, value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. The iteratee is invoked + * with four arguments: (accumulator, value, key, object). Iteratee functions + * may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ + * @since 1.3.0 * @category Object * @param {Array|Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -11773,7 +12832,7 @@ if (isArr) { accumulator = isArray(object) ? new Ctor : []; } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } } else { accumulator = {}; @@ -11792,6 +12851,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. @@ -11805,7 +12865,7 @@ * console.log(object); * // => { 'a': [{ 'b': {} }] }; * - * _.unset(object, 'a[0].b.c'); + * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); @@ -11816,11 +12876,72 @@ } /** - * Creates an array of the own enumerable property values of `object`. + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. @@ -11845,12 +12966,14 @@ } /** - * Creates an array of the own and inherited enumerable property values of `object`. + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. @@ -11867,7 +12990,7 @@ * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { - return object == null ? baseValues(object, keysIn(object)) : []; + return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ @@ -11877,6 +13000,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. @@ -11908,12 +13032,13 @@ /** * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. + * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ + * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. @@ -11957,14 +13082,15 @@ /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are floats, - * a floating-point number is returned instead of an integer. + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ + * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. @@ -12030,6 +13156,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. @@ -12038,10 +13165,10 @@ * _.camelCase('Foo Bar'); * // => 'fooBar' * - * _.camelCase('--foo-bar'); + * _.camelCase('--foo-bar--'); * // => 'fooBar' * - * _.camelCase('__foo_bar__'); + * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { @@ -12055,6 +13182,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. @@ -12068,11 +13196,14 @@ } /** - * 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). + * Deburrs `string` by converting + * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. @@ -12091,11 +13222,13 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. * @example * * _.endsWith('abc', 'c'); @@ -12129,20 +13262,22 @@ * * 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) + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * Backticks are escaped because in IE < 9, they can break out of * attribute values or HTML comments. See [#59](https://html5sec.org/#59), * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. + * [#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. + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. * * @static + * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. @@ -12165,6 +13300,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. @@ -12181,10 +13317,12 @@ } /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. @@ -12196,7 +13334,7 @@ * _.kebabCase('fooBar'); * // => 'foo-bar' * - * _.kebabCase('__foo_bar__'); + * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { @@ -12208,12 +13346,13 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * - * _.lowerCase('--Foo-Bar'); + * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); @@ -12231,6 +13370,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. @@ -12244,30 +13384,13 @@ */ var lowerFirst = createCaseFirst('toLowerCase'); - /** - * Converts the first character of `string` to upper case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.upperFirst('fred'); - * // => 'Fred' - * - * _.upperFirst('FRED'); - * // => 'FRED' - */ - var upperFirst = createCaseFirst('toUpperCase'); - /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -12288,15 +13411,16 @@ string = toString(string); length = toInteger(length); - var strLength = stringSize(string); + var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } - var mid = (length - strLength) / 2, - leftLength = nativeFloor(mid), - rightLength = nativeCeil(mid); - - return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars); + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); } /** @@ -12305,6 +13429,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -12323,7 +13448,12 @@ */ function padEnd(string, length, chars) { string = toString(string); - return string + createPadding(string, length, chars); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; } /** @@ -12332,6 +13462,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -12350,23 +13481,29 @@ */ function padStart(string, length, chars) { string = toString(string); - return createPadding(string, length, chars) + string; + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) - * of `parseInt`. + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ + * @since 1.1.0 * @category String * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * @@ -12378,7 +13515,7 @@ */ function parseInt(string, radix, guard) { // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. if (guard || radix == null) { radix = 0; } else if (radix) { @@ -12393,9 +13530,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * @@ -12408,34 +13547,24 @@ * _.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; + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); } - // 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; + return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * - * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. @@ -12450,14 +13579,16 @@ var args = arguments, string = toString(args[0]); - return args.length < 3 ? string : string.replace(args[1], args[2]); + return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]); } /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. @@ -12469,7 +13600,7 @@ * _.snakeCase('fooBar'); * // => 'foo_bar' * - * _.snakeCase('--foo-bar'); + * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { @@ -12479,10 +13610,12 @@ /** * Splits `string` by `separator`. * - * **Note:** This method is based on [`String#split`](https://mdn.io/String/split). + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. @@ -12494,30 +13627,49 @@ * // => ['a', 'b'] */ function split(string, separator, limit) { - return toString(string).split(separator, limit); + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return nativeSplit.call(string, separator, limit); } /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ + * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * - * _.startCase('--foo-bar'); + * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + capitalize(word); + return result + (index ? ' ' : '') + upperFirst(word); }); /** @@ -12525,11 +13677,13 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. * @example * * _.startsWith('abc', 'a'); @@ -12552,7 +13706,7 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is given it takes precedence over `_.templateSettings` values. + * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) @@ -12565,17 +13719,24 @@ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static + * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] 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} [guard] Enables use as an iteratee for functions like `_.map`. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * @@ -12624,7 +13785,7 @@ * // Use the `sourceURL` option to specify a custom sourceURL for the template. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * compiled(data); - * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector + * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. * * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); @@ -12644,7 +13805,8 @@ * '); */ function template(string, options, guard) { - // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/) + // Based on John Resig's `tmpl` implementation + // (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = lodash.templateSettings; @@ -12737,7 +13899,8 @@ 'return __p\n}'; var result = attempt(function() { - return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); + return Function(importsKeys, sourceURL + 'return ' + source) + .apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or @@ -12750,17 +13913,19 @@ } /** - * Converts `string`, as a whole, to lower case. + * Converts `string`, as a whole, to lower case just like + * [String#toLowerCase](https://mdn.io/toLowerCase). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * - * _.toLower('--Foo-Bar'); - * // => '--foo-bar' + * _.toLower('--Foo-Bar--'); + * // => '--foo-bar--' * * _.toLower('fooBar'); * // => 'foobar' @@ -12773,17 +13938,19 @@ } /** - * Converts `string`, as a whole, to upper case. + * Converts `string`, as a whole, to upper case just like + * [String#toUpperCase](https://mdn.io/toUpperCase). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * - * _.toUpper('--foo-bar'); - * // => '--FOO-BAR' + * _.toUpper('--foo-bar--'); + * // => '--FOO-BAR--' * * _.toUpper('fooBar'); * // => 'FOOBAR' @@ -12800,10 +13967,11 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -12824,14 +13992,15 @@ if (guard || chars === undefined) { return string.replace(reTrim, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars); + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; - return strSymbols.slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1).join(''); + return castSlice(strSymbols, start, end).join(''); } /** @@ -12839,10 +14008,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -12860,12 +14030,13 @@ if (guard || chars === undefined) { return string.replace(reTrimEnd, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } - var strSymbols = stringToArray(string); - return strSymbols.slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1).join(''); + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); } /** @@ -12873,10 +14044,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -12894,12 +14066,13 @@ if (guard || chars === undefined) { return string.replace(reTrimStart, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } - var strSymbols = stringToArray(string); - return strSymbols.slice(charsStartIndex(strSymbols, stringToArray(chars))).join(''); + var strSymbols = stringToArray(string), + start = charsStartIndex(strSymbols, stringToArray(chars)); + + return castSlice(strSymbols, start).join(''); } /** @@ -12909,9 +14082,10 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to truncate. - * @param {Object} [options] The options object. + * @param {Object} [options={}] The options object. * @param {number} [options.length=30] The maximum string length. * @param {string} [options.omission='...'] The string to indicate text is omitted. * @param {RegExp|string} [options.separator] The separator pattern to truncate to. @@ -12962,7 +14136,7 @@ return omission; } var result = strSymbols - ? strSymbols.slice(0, end).join('') + ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); if (separator === undefined) { @@ -12996,14 +14170,15 @@ /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their - * corresponding characters. + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to + * their corresponding characters. * - * **Note:** No other HTML entities are unescaped. To unescape additional HTML - * entities use a third-party library like [_he_](https://mths.be/he). + * **Note:** No other HTML entities are unescaped. To unescape additional + * HTML entities use a third-party library like [_he_](https://mths.be/he). * * @static * @memberOf _ + * @since 0.6.0 * @category String * @param {string} [string=''] The string to unescape. * @returns {string} Returns the unescaped string. @@ -13024,6 +14199,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. @@ -13042,15 +14218,35 @@ return result + (index ? ' ' : '') + word.toUpperCase(); }); + /** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ + var upperFirst = createCaseFirst('toUpperCase'); + /** * Splits `string` into an array of its words. * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * @@ -13078,8 +14274,10 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * @@ -13096,7 +14294,7 @@ try { return apply(func, undefined, args); } catch (e) { - return isObject(e) ? e : new Error(e); + return isError(e) ? e : new Error(e); } }); @@ -13107,11 +14305,11 @@ * **Note:** This method doesn't set the "length" property of bound functions. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} methodNames The object method names to bind, - * specified individually or in arrays. + * @param {...(string|string[])} methodNames The object method names to bind. * @returns {Object} Returns `object`. * @example * @@ -13124,23 +14322,24 @@ * * _.bindAll(view, 'onClick'); * jQuery(element).on('click', view.onClick); - * // => logs 'clicked docs' when clicked + * // => Logs 'clicked docs' when clicked. */ var bindAll = rest(function(object, methodNames) { - arrayEach(baseFlatten(methodNames), function(key) { + arrayEach(baseFlatten(methodNames, 1), function(key) { object[key] = bind(object[key], object); }); return object; }); /** - * Creates a function that iterates over `pairs` invoking the corresponding + * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created * function. * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new function. @@ -13190,6 +14389,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new function. @@ -13212,6 +14412,7 @@ * * @static * @memberOf _ + * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new function. @@ -13236,6 +14437,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. * @returns {Function} Returns the new function. @@ -13256,6 +14458,7 @@ * invokes the given functions from right to left. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] Functions to invoke. @@ -13276,6 +14479,7 @@ * This method returns the first argument given to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. @@ -13293,11 +14497,13 @@ /** * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. * * @static + * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. @@ -13305,34 +14511,47 @@ * @example * * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); * }; * }); * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] */ function iteratee(func) { return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); } /** - * Creates a function that performs a deep partial comparison between a given + * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. + * property values, else `false`. The created function is equivalent to + * `_.isMatch` with a `source` partially applied. * * **Note:** This method supports comparing the same values as `_.isEqual`. * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new function. @@ -13351,7 +14570,7 @@ } /** - * Creates a function that performs a deep partial comparison between the + * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * @@ -13359,6 +14578,7 @@ * * @static * @memberOf _ + * @since 3.2.0 * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. @@ -13383,6 +14603,7 @@ * * @static * @memberOf _ + * @since 3.7.0 * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. @@ -13390,15 +14611,15 @@ * @example * * var objects = [ - * { 'a': { 'b': { 'c': _.constant(2) } } }, - * { 'a': { 'b': { 'c': _.constant(1) } } } + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } * ]; * - * _.map(objects, _.method('a.b.c')); + * _.map(objects, _.method('a.b')); * // => [2, 1] * - * _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); - * // => [1, 2] + * _.map(objects, _.method(['a', 'b'])); + * // => [2, 1] */ var method = rest(function(path, args) { return function(object) { @@ -13413,6 +14634,7 @@ * * @static * @memberOf _ + * @since 3.7.0 * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. @@ -13435,21 +14657,21 @@ }); /** - * Adds all own enumerable function properties of a source object to the - * destination object. If `object` is a function then methods are added to - * its prototype as well. + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. - * @param {Object} [options] The options object. - * @param {boolean} [options.chain=true] Specify whether the functions added - * are chainable. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * @@ -13481,7 +14703,7 @@ object = this; methodNames = baseFunctions(source, keys(source)); } - var chain = (isObject(options) && 'chain' in options) ? options.chain : true, + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { @@ -13511,6 +14733,7 @@ * the `lodash` function. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @returns {Function} Returns the `lodash` function. @@ -13531,6 +14754,7 @@ * * @static * @memberOf _ + * @since 2.3.0 * @category Util * @example * @@ -13544,35 +14768,42 @@ } /** - * Creates a function that returns its nth argument. + * Creates a function that returns its nth argument. If `n` is negative, + * the nth argument from the end is returned. * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. * @returns {Function} Returns the new function. * @example * * var func = _.nthArg(1); - * - * func('a', 'b', 'c'); + * func('a', 'b', 'c', 'd'); * // => 'b' + * + * var func = _.nthArg(-2); + * func('a', 'b', 'c', 'd'); + * // => 'c' */ function nthArg(n) { n = toInteger(n); - return function() { - return arguments[n]; - }; + return rest(function(args) { + return baseNth(args, n); + }); } /** - * Creates a function that invokes `iteratees` with the arguments provided - * to the created function and returns their results. + * Creates a function that invokes `iteratees` with the arguments it receives + * and returns their results. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} iteratees The iteratees to invoke. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to invoke. * @returns {Function} Returns the new function. * @example * @@ -13585,12 +14816,14 @@ /** * Creates a function that checks if **all** of the `predicates` return - * truthy when invoked with the arguments provided to the created function. + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} predicates The predicates to check. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [predicates=[_.identity]] The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -13609,12 +14842,14 @@ /** * Creates a function that checks if **any** of the `predicates` return - * truthy when invoked with the arguments provided to the created function. + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} predicates The predicates to check. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [predicates=[_.identity]] The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -13636,20 +14871,21 @@ * * @static * @memberOf _ + * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new function. * @example * * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } * ]; * - * _.map(objects, _.property('a.b.c')); + * _.map(objects, _.property('a.b')); * // => [2, 1] * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { @@ -13662,6 +14898,7 @@ * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Object} object The object to query. * @returns {Function} Returns the new function. @@ -13685,13 +14922,14 @@ /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified + * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. @@ -13729,6 +14967,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. @@ -13760,10 +14999,11 @@ var rangeRight = createRange(true); /** - * Invokes the iteratee function `n` times, returning an array of the results - * of each invocation. The iteratee is invoked with one argument; (index). + * Invokes the iteratee `n` times, returning an array of the results of + * each invocation. The iteratee is invoked with one argument; (index). * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {number} n The number of times to invoke `iteratee`. @@ -13785,7 +15025,7 @@ var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); - iteratee = toFunction(iteratee); + iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, iteratee); @@ -13800,6 +15040,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {*} value The value to convert. * @returns {Array} Returns the new property path array. @@ -13821,16 +15062,20 @@ * // => false */ function toPath(value) { - return isArray(value) ? arrayMap(value, String) : stringToPath(value); + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(value)); } /** - * Generates a unique ID. If `prefix` is given the ID is appended to it. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util - * @param {string} [prefix] The value to prefix the ID with. + * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * @@ -13852,6 +15097,7 @@ * * @static * @memberOf _ + * @since 3.4.0 * @category Math * @param {number} augend The first number in an addition. * @param {number} addend The second number in an addition. @@ -13861,25 +15107,16 @@ * _.add(6, 4); * // => 10 */ - function add(augend, addend) { - var result; - if (augend === undefined && addend === undefined) { - return 0; - } - if (augend !== undefined) { - result = augend; - } - if (addend !== undefined) { - result = result === undefined ? addend : (result + addend); - } - return result; - } + var add = createMathOperation(function(augend, addend) { + return augend + addend; + }); /** * Computes `number` rounded up to `precision`. * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round up. * @param {number} [precision=0] The precision to round up to. @@ -13897,11 +15134,31 @@ */ var ceil = createRound('ceil'); + /** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ + var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; + }); + /** * Computes `number` rounded down to `precision`. * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round down. * @param {number} [precision=0] The precision to round down to. @@ -13920,10 +15177,11 @@ var floor = createRound('floor'); /** - * Computes the maximum value of `array`. If `array` is empty or falsey + * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. @@ -13949,9 +15207,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * @@ -13975,6 +15235,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the mean. @@ -13984,14 +15245,43 @@ * // => 5 */ function mean(array) { - return sum(array) / (array ? array.length : 0); + return baseMean(array, identity); + } + + /** + * This method is like `_.mean` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be averaged. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the mean. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.meanBy(objects, function(o) { return o.n; }); + * // => 5 + * + * // The `_.property` iteratee shorthand. + * _.meanBy(objects, 'n'); + * // => 5 + */ + function meanBy(array, iteratee) { + return baseMean(array, getIteratee(iteratee)); } /** - * Computes the minimum value of `array`. If `array` is empty or falsey + * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. @@ -14017,9 +15307,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * @@ -14038,11 +15330,31 @@ : undefined; } + /** + * Multiply two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} multiplier The first number in a multiplication. + * @param {number} multiplicand The second number in a multiplication. + * @returns {number} Returns the product. + * @example + * + * _.multiply(6, 4); + * // => 24 + */ + var multiply = createMathOperation(function(multiplier, multiplicand) { + return multiplier * multiplicand; + }); + /** * Computes `number` rounded to `precision`. * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round. * @param {number} [precision=0] The precision to round to. @@ -14065,6 +15377,7 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {number} minuend The first number in a subtraction. * @param {number} subtrahend The second number in a subtraction. @@ -14074,25 +15387,16 @@ * _.subtract(6, 4); * // => 2 */ - function subtract(minuend, subtrahend) { - var result; - if (minuend === undefined && subtrahend === undefined) { - return 0; - } - if (minuend !== undefined) { - result = minuend; - } - if (subtrahend !== undefined) { - result = result === undefined ? subtrahend : (result - subtrahend); - } - return result; - } + var subtract = createMathOperation(function(minuend, subtrahend) { + return minuend - subtrahend; + }); /** * Computes the sum of the values in `array`. * * @static * @memberOf _ + * @since 3.4.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. @@ -14114,9 +15418,11 @@ * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {number} Returns the sum. * @example * @@ -14137,39 +15443,7 @@ /*------------------------------------------------------------------------*/ - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - - // Add functions to the `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; - - // Add functions to the `SetCache`. - SetCache.prototype.push = cachePush; - - // Add functions to the `Stack` cache. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - // Assign cache to `_.memoize`. - memoize.Cache = MapCache; - - // Add functions that return wrapped values when chaining. + // Add methods that return wrapped values in chain sequences. lodash.after = after; lodash.ary = ary; lodash.assign = assign; @@ -14181,6 +15455,7 @@ lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; + lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; @@ -14207,8 +15482,11 @@ lodash.fill = fill; lodash.filter = filter; lodash.flatMap = flatMap; + lodash.flatMapDeep = flatMapDeep; + lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; + lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; @@ -14258,6 +15536,7 @@ lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; + lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range; lodash.rangeRight = rangeRight; @@ -14300,6 +15579,8 @@ lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; + lodash.update = update; + lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; @@ -14314,15 +15595,17 @@ lodash.zipWith = zipWith; // Add aliases. + lodash.entries = toPairs; + lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; - // Add functions to `lodash.prototype`. + // Add methods to `lodash.prototype`. mixin(lodash, lodash); /*------------------------------------------------------------------------*/ - // Add functions that return unwrapped values when chaining. + // Add methods that return unwrapped values in chain sequences. lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; @@ -14334,6 +15617,7 @@ lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.deburr = deburr; + lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; @@ -14411,8 +15695,11 @@ lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; + lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; + lodash.multiply = multiply; + lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; @@ -14483,7 +15770,7 @@ * * @static * @memberOf _ - * @type string + * @type {string} */ lodash.VERSION = VERSION; @@ -14505,7 +15792,10 @@ if (filtered) { result.__takeCount__ = nativeMin(n, result.__takeCount__); } else { - result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') }); + result.__views__.push({ + 'size': nativeMin(n, MAX_ARRAY_LENGTH), + 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') + }); } return result; }; @@ -14522,7 +15812,10 @@ LazyWrapper.prototype[methodName] = function(iteratee) { var result = this.clone(); - result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type }); + result.__iteratees__.push({ + 'iteratee': getIteratee(iteratee, 3), + 'type': type + }); result.__filtered__ = result.__filtered__ || isFilter; return result; }; @@ -14646,7 +15939,7 @@ }; }); - // Add `Array` and `String` methods to `lodash.prototype`. + // Add `Array` methods to `lodash.prototype`. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', @@ -14655,15 +15948,16 @@ lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { - return func.apply(this.value(), args); + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value) { - return func.apply(value, args); + return func.apply(isArray(value) ? value : [], args); }); }; }); - // Map minified function names to their real names. + // Map minified method names to their real names. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { @@ -14674,18 +15968,20 @@ } }); - realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; + realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ + 'name': 'wrapper', + 'func': undefined + }]; - // Add functions to the lazy wrapper. + // Add methods to `LazyWrapper`. LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; - // Add chaining functions to the `lodash` wrapper. + // Add chain sequence methods to the `lodash` wrapper. lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; - lodash.prototype.flatMap = wrapperFlatMap; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; diff --git a/tools/eslint/node_modules/lodash/lodash.min.js b/tools/eslint/node_modules/lodash/lodash.min.js new file mode 100644 index 00000000000000..8b4cdf1e2c7e83 --- /dev/null +++ b/tools/eslint/node_modules/lodash/lodash.min.js @@ -0,0 +1,125 @@ +/** + * @license + * lodash 4.11.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash -o ./dist/lodash.js` + */ +;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t.length;++un&&!o||!u||r&&!i&&f||e&&f)return 1;if(n>t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function W(t){return function(n,r){var e; +return n===q&&r===q?0:(n!==q&&(e=n),r!==q&&(e=e===q?r:t(e,r)),e)}}function B(t){return Ut[t]}function L(t){return Dt[t]}function C(t){return"\\"+Nt[t]}function M(t,n,r){var e=t.length;for(n+=r?0:-1;r?n--:++n-1&&0==t%1&&(null==n?9007199254740991:n)>t}function D(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value); +return r}function $(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function F(t,n){for(var r=-1,e=t.length,u=0,o=[];++rr?false:(r==t.length-1?t.pop():Uu.call(t,r,1),true)}function qt(t,n){var r=Kt(t,n);return 0>r?q:t[r][1]}function Kt(t,n){for(var r=t.length;r--;)if(we(t[r][0],n))return r;return-1}function Gt(t,n,r){ +var e=Kt(t,n);0>e?t.push([n,r]):t[e][1]=r}function Jt(t,n,r,e){return t===q||we(t,du[r])&&!xu.call(e,r)?n:t}function Qt(t,n,r){(r===q||we(t[n],r))&&(typeof n!="number"||r!==q||n in t)||(t[n]=r)}function Xt(t,n,r){var e=t[n];xu.call(t,n)&&we(e,r)&&(r!==q||n in t)||(t[n]=r)}function tn(t,n,r,e){return _o(t,function(t,u,o){n(e,t,r(t),o)}),e}function nn(t,n){return t&&ir(n,He(n),t)}function rn(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++rr?r:t), +n!==q&&(t=n>t?n:t)),t}function un(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==q)return c;if(!Be(t))return t;if(o=oi(t)){if(c=Ur(t),!n)return or(t,c)}else{var a=Mr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(ii(t))return nr(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(z(t))return i?t:{};if(c=Dr(l?{}:t),!n)return fr(t,nn(c,t))}else{if(!zt[a])return i?t:{};c=$r(t,a,un,n)}}if(f||(f=new Nt),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?dn(t,He,Cr):He(t);return u(s||t,function(u,o){ +s&&(o=u,u=t[o]),Xt(c,o,un(u,n,r,e,o,t,f))}),c}function on(t){var n=He(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===q&&!(o in Object(e))||!i(f))return false}return true}}function fn(t){return Be(t)?Cu(t):{}}function cn(t,n,r){if(typeof t!="function")throw new vu("Expected a function");return zu(function(){t.apply(q,r)},n)}function an(t,n,r,e){var u=-1,o=f,i=true,l=t.length,s=[],h=n.length;if(!l)return s;r&&(n=a(n,O(r))),e?(o=c,i=false):n.length>=200&&(o=Ft, +i=false,n=new $t(n));t:for(;++u0&&r(f)?n>1?hn(f,n-1,r,e,u):l(u,f):e||(u[u.length]=f)}return u}function pn(t,n){return t&&go(t,n,He)}function _n(t,n){ +return t&&yo(t,n,He)}function vn(t,n){return i(n,function(n){return Se(t[n])})}function gn(t,n){n=Tr(n,t)?[n]:Xn(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[n[r++]];return r&&r==e?t:q}function dn(t,n,r){return n=n(t),oi(t)?n:l(n,r(t))}function yn(t,n){return xu.call(t,n)||typeof t=="object"&&n in t&&null===Fu(Object(t))}function bn(t,n){return n in Object(t)}function xn(t,n,r){for(var e=r?c:f,u=t[0].length,o=t.length,i=o,l=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=a(p,O(n))),s=qu(p.length,s), +l[i]=r||!n&&(120>u||120>p.length)?q:new $t(i&&p)}var p=t[0],_=-1,v=l[0];t:for(;++_h.length;){var g=p[_],d=n?n(g):g;if(v?!Ft(v,d):!e(h,d,r)){for(i=o;--i;){var y=l[i];if(y?!Ft(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function jn(t,n,r){var e={};return pn(t,function(t,u,o){n(e,r(t),u,o)}),e}function mn(t,n,e){return Tr(n,t)||(n=Xn(n),t=Yr(t,n),n=ee(n)),n=null==t?t:t[n],null==n?q:r(n,t,e)}function wn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!Be(t)&&!Le(n))n=t!==t&&n!==n;else t:{ +var o=oi(t),i=oi(n),f="[object Array]",c="[object Array]";o||(f=Mr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Mr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!z(t),i="[object Object]"==c&&!z(n);if((c=f==c)&&!a)u||(u=new Nt),n=o||Fe(t)?Er(t,n,wn,r,e,u):Ir(t,n,f,wn,r,e,u);else{if(!(2&e)&&(o=a&&xu.call(t,"__wrapped__"),f=i&&xu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new Nt),n=wn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Nt),o=2&e, +f=He(t),i=f.length,c=He(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:yn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{c=true,u.set(t,n);for(var s=o;++an?r:0,U(n,r)?t[n]:q):void 0}function Bn(t,n,r){var e=-1;return n=a(n.length?n:[iu],O(Rr())),t=En(t,function(t){return{a:a(n,function(n){return n(t)}),b:++e, +c:t}}),j(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++ee?c*("desc"==r[e]?-1:1):c;break t}}e=t.b-n.b}return e})}function Ln(t,n){return t=Object(t),s(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Cn(t,n){for(var r=-1,e=dn(t,Qe,wo),u=e.length,o={};++rn||n>9007199254740991)return r;do n%2&&(r+=t),(n=$u(n/2))&&(t+=t);while(n);return r; +}function Nn(t,n,r,e){n=Tr(n,t)?[n]:Xn(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++un&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e=u){ +for(;u>e;){var o=e+u>>>1,i=t[o];(r?n>=i:n>i)&&null!==i?e=o+1:u=o}return u}return qn(t,n,iu,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=n===q;o>u;){var a=$u((u+o)/2),l=r(t[a]),s=l!==q,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?n>=l:n>l)?u=a+1:o=a}return qu(o,4294967294)}function Vn(t,n){for(var r=0,e=t.length,u=t[0],o=n?n(u):u,i=o,f=1,c=[u];++re?n[e]:q);return i}function Qn(t){return Ee(t)?t:[]}function Xn(t){return oi(t)?t:Oo(t)}function tr(t,n,r){var e=t.length;return r=r===q?e:r,n||e>r?Pn(t,n,r):t}function nr(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function rr(t){var n=new t.constructor(t.byteLength); +return new Su(n).set(new Su(t)),n}function er(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Tu(o-i,0),l=Array(c+a);for(e=!e;++fu)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function ur(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Tu(o-f,0),s=Array(l+a);for(e=!e;++uu)&&(s[l+r[i]]=t[u++]);return s}function or(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r1?r[u-1]:q,i=u>2?r[2]:q,o=typeof o=="function"?(u--,o):q;for(i&&Zr(r[0],r[1],i)&&(o=3>u?q:o,u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:F(f,a),i-=c.length,e>i?Ar(t,n,yr,u.placeholder,q,f,c,q,q,e-i):r(this&&this!==Yt&&this instanceof u?o:t,this,f)}var o=vr(t);return u}function dr(t){return je(function(n){n=hn(n,1);var r=n.length,e=r,u=kt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new vu("Expected a function");if(u&&!i&&"wrapper"==Sr(o))var i=new kt([],true); +}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++ud)return j=F(b,j),Ar(t,n,yr,l.placeholder,r,b,j,f,c,a-d);if(j=h?r:this,y=p?j[t]:t,d=b.length,f){x=b.length;for(var m=qu(f.length,x),w=or(b);m--;){var A=f[m];b[m]=U(A,x)?w[A]:q}}else v&&d>1&&b.reverse();return s&&d>c&&(b.length=c),this&&this!==Yt&&this instanceof l&&(y=g||vr(y)),y.apply(j,b)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?q:vr(t);return l}function br(t,n){return function(r,e){return jn(r,t,n(e))}}function xr(t){return je(function(n){return n=1==n.length&&oi(n[0])?a(n[0],O(Rr())):a(hn(n,1,Pr),O(Rr())), +je(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function jr(t,n){n=n===q?" ":n+"";var r=n.length;return 2>r?r?Fn(n,t):n:(r=Fn(n,Du(t/P(n))),Bt.test(n)?tr(r.match(Rt),0,t).join(""):r.slice(0,t))}function mr(t,n,e,u){function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Yt&&this instanceof o?f:t;++an?1:-1:qe(e)||0;var u=-1;r=Tu(Du((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Ar(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:q;i=l?q:i;var h=l?o:q;return o=l?q:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(q,n),Vr(t)&&Ao(r,n),r.placeholder=e,r}function Or(t){var n=pu[t];return function(t,r){if(t=qe(t),r=Ze(r)){var e=(Ke(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(Ke(e)+"e").split("e"); +return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function kr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new vu("Expected a function");var a=e?e.length:0;if(a||(n&=-97,e=u=q),i=i===q?i:Tu(Ze(i),0),f=f===q?f:Ze(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=q}var h=c?q:jo(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?er(e,r,h[4]):r,o[4]=e?F(o[3],"__lodash_placeholder__"):h[4]), +(r=h[5])&&(e=o[5],o[5]=e?ur(e,r,h[6]):r,o[6]=e?F(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),128&t&&(o[8]=null==o[8]?h[8]:qu(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Tu(o[9]-a,0),!f&&24&n&&(n&=-25),(h?bo:Ao)(n&&1!=n?8==n||16==n?gr(t,n,f):32!=n&&33!=n||u.length?yr.apply(q,o):mr(t,n,r,e):hr(t,n,r),o)}function Er(t,n,r,e,u,o){var i=-1,f=2&u,c=1&u,a=t.length,l=n.length;if(!(a==l||f&&l>a))return false;if(l=o.get(t))return l==n; +for(l=true,o.set(t,n);++in?0:n,e)):[]}function ne(t,n,r){var e=t?t.length:0;return e?(n=r||n===q?1:Ze(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function re(t){return t&&t.length?t[0]:q}function ee(t){var n=t?t.length:0;return n?t[n-1]:q}function ue(t,n){return t&&t.length&&n&&n.length?Un(t,n):t}function oe(t){return t?Ju.call(t):t}function ie(t){if(!t||!t.length)return[];var n=0;return t=i(t,function(t){return Ee(t)?(n=Tu(t.length,n),true):void 0}),w(n,function(n){return a(t,Mn(n))})}function fe(t,n){if(!t||!t.length)return[];var e=ie(t); +return null==n?e:a(e,function(t){return r(n,q,t)})}function ce(t){return t=jt(t),t.__chain__=true,t}function ae(t,n){return n(t)}function le(){return this}function se(t,n){return typeof n=="function"&&oi(t)?u(t,n):_o(t,Rr(n))}function he(t,n){var r;if(typeof n=="function"&&oi(t)){for(r=t.length;r--&&false!==n(t[r],r,t););r=t}else r=vo(t,Rr(n));return r}function pe(t,n){return(oi(t)?a:En)(t,Rr(n,3))}function _e(t,n,r){var e=-1,u=Pe(t),o=u.length,i=o-1;for(n=(r?Zr(t,n,r):n===q)?1:en(Ze(n),0,o);++e=t&&(n=q),r}}function de(t,n,r){return n=r?q:n,t=kr(t,8,q,q,q,q,q,n),t.placeholder=de.placeholder,t}function ye(t,n,r){return n=r?q:n,t=kr(t,16,q,q,q,q,q,n),t.placeholder=ye.placeholder,t}function be(t,n,r){function e(n){var r=c,e=a; +return c=a=q,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,!p||r>=n||0>r||g&&t>=l}function o(){var t=Yo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?qu(t,l-r):t,h=zu(o,r)}function i(t){return Ru(h),h=q,d&&c?e(t):(c=a=q,s)}function f(){var t=Yo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===q)return _=t=p,h=zu(o,n),v?e(t):s;if(g)return Ru(h),h=zu(o,n),e(p)}return h===q&&(h=zu(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new vu("Expected a function");return n=qe(n)||0, +Be(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Tu(qe(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==q&&Ru(h),p=_=0,c=a=h=q},f.flush=function(){return h===q?s:i(Yo())},f}function xe(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new vu("Expected a function");return r.cache=new(xe.Cache||Dt),r}function je(t,n){if(typeof t!="function")throw new vu("Expected a function"); +return n=Tu(n===q?t.length-1:Ze(n),0),function(){for(var e=arguments,u=-1,o=Tu(e.length-n,0),i=Array(o);++un}function Oe(t){return Ee(t)&&xu.call(t,"callee")&&(!Mu.call(t,"callee")||"[object Arguments]"==wu.call(t)); +}function ke(t){return null!=t&&We(mo(t))&&!Se(t)}function Ee(t){return Le(t)&&ke(t)}function Ie(t){return Le(t)?"[object Error]"==wu.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Se(t){return t=Be(t)?wu.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function Re(t){return typeof t=="number"&&t==Ze(t)}function We(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t}function Be(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Le(t){ +return!!t&&typeof t=="object"}function Ce(t){return Be(t)?(Se(t)||z(t)?Ou:bt).test(Qr(t)):false}function Me(t){return typeof t=="number"||Le(t)&&"[object Number]"==wu.call(t)}function ze(t){return!Le(t)||"[object Object]"!=wu.call(t)||z(t)?false:(t=Fu(Object(t)),null===t?true:(t=xu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&bu.call(t)==mu))}function Ue(t){return Be(t)&&"[object RegExp]"==wu.call(t)}function De(t){return typeof t=="string"||!oi(t)&&Le(t)&&"[object String]"==wu.call(t); +}function $e(t){return typeof t=="symbol"||Le(t)&&"[object Symbol]"==wu.call(t)}function Fe(t){return Le(t)&&We(t.length)&&!!Mt[wu.call(t)]}function Ne(t,n){return n>t}function Pe(t){if(!t)return[];if(ke(t))return De(t)?t.match(Rt):or(t);if(Lu&&t[Lu])return D(t[Lu]());var n=Mr(t);return("[object Map]"==n?$:"[object Set]"==n?N:nu)(t)}function Ze(t){if(!t)return 0===t?t:0;if(t=qe(t),t===V||t===-V)return 1.7976931348623157e308*(0>t?-1:1);var n=t%1;return t===t?n?t-n:t:0}function Te(t){return t?en(Ze(t),0,4294967295):0; +}function qe(t){if(typeof t=="number")return t;if($e(t))return K;if(Be(t)&&(t=Se(t.valueOf)?t.valueOf():t,t=Be(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(at,"");var n=yt.test(t);return n||xt.test(t)?Zt(t.slice(2),n?2:8):dt.test(t)?K:+t}function Ve(t){return ir(t,Qe(t))}function Ke(t){if(typeof t=="string")return t;if(null==t)return"";if($e(t))return po?po.call(t):"";var n=t+"";return"0"==n&&1/t==-V?"-0":n}function Ge(t,n,r){return t=null==t?q:gn(t,n),t===q?r:t}function Je(t,n){return null!=t&&zr(t,n,yn); +}function Ye(t,n){return null!=t&&zr(t,n,bn)}function He(t){var n=Kr(t);if(!n&&!ke(t))return Zu(Object(t));var r,e=Fr(t),u=!!e,e=e||[],o=e.length;for(r in t)!yn(t,r)||u&&("length"==r||U(r,o))||n&&"constructor"==r||e.push(r);return e}function Qe(t){for(var n=-1,r=Kr(t),e=kn(t),u=e.length,o=Fr(t),i=!!o,o=o||[],f=o.length;++ne.length?Gt(e,t,n):(r.array=null,r.map=new Dt(e))),(r=r.map)&&r.set(t,n),this};var _o=lr(pn),vo=lr(_n,true),go=sr(),yo=sr(true);Wu&&!Mu.call({valueOf:1},"valueOf")&&(kn=function(t){return D(Wu(t))});var bo=eo?function(t,n){return eo.set(t,n),t}:iu,xo=to&&2===new to([1,2]).size?function(t){ +return new to(t)}:au,jo=eo?function(t){return eo.get(t)}:au,mo=Mn("length");Bu||(Cr=function(){return[]});var wo=Bu?function(t){for(var n=[];t;)l(n,Cr(t)),t=Fu(Object(t));return n}:Cr;(Hu&&"[object DataView]"!=Mr(new Hu(new ArrayBuffer(1)))||Qu&&"[object Map]"!=Mr(new Qu)||Xu&&"[object Promise]"!=Mr(Xu.resolve())||to&&"[object Set]"!=Mr(new to)||no&&"[object WeakMap]"!=Mr(new no))&&(Mr=function(t){var n=wu.call(t);if(t=(t="[object Object]"==n?t.constructor:q)?Qr(t):q)switch(t){case io:return"[object DataView]"; +case fo:return"[object Map]";case co:return"[object Promise]";case ao:return"[object Set]";case lo:return"[object WeakMap]"}return n});var Ao=function(){var t=0,n=0;return function(r,e){var u=Yo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return bo(r,e)}}(),Oo=xe(function(t){var n=[];return Ke(t).replace(it,function(t,r,e,u){n.push(e?u.replace(pt,"$1"):r||t)}),n}),ko=je(function(t,n){return Ee(t)?an(t,hn(n,1,Ee,true)):[]}),Eo=je(function(t,n){var r=ee(n);return Ee(r)&&(r=q),Ee(t)?an(t,hn(n,1,Ee,true),Rr(r)):[]; +}),Io=je(function(t,n){var r=ee(n);return Ee(r)&&(r=q),Ee(t)?an(t,hn(n,1,Ee,true),q,r):[]}),So=je(function(t){var n=a(t,Qn);return n.length&&n[0]===t[0]?xn(n):[]}),Ro=je(function(t){var n=ee(t),r=a(t,Qn);return n===ee(r)?n=q:r.pop(),r.length&&r[0]===t[0]?xn(r,Rr(n)):[]}),Wo=je(function(t){var n=ee(t),r=a(t,Qn);return n===ee(r)?n=q:r.pop(),r.length&&r[0]===t[0]?xn(r,q,n):[]}),Bo=je(ue),Lo=je(function(t,n){n=a(hn(n,1),String);var r=rn(t,n);return Dn(t,n.sort(R)),r}),Co=je(function(t){return Kn(hn(t,1,Ee,true)); +}),Mo=je(function(t){var n=ee(t);return Ee(n)&&(n=q),Kn(hn(t,1,Ee,true),Rr(n))}),zo=je(function(t){var n=ee(t);return Ee(n)&&(n=q),Kn(hn(t,1,Ee,true),q,n)}),Uo=je(function(t,n){return Ee(t)?an(t,n):[]}),Do=je(function(t){return Yn(i(t,Ee))}),$o=je(function(t){var n=ee(t);return Ee(n)&&(n=q),Yn(i(t,Ee),Rr(n))}),Fo=je(function(t){var n=ee(t);return Ee(n)&&(n=q),Yn(i(t,Ee),q,n)}),No=je(ie),Po=je(function(t){var n=t.length,n=n>1?t[n-1]:q,n=typeof n=="function"?(t.pop(),n):q;return fe(t,n)}),Zo=je(function(t){ +function n(n){return rn(n,t)}t=hn(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof Et&&U(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ae,args:[n],thisArg:q}),new kt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(q),t})):this.thru(n)}),To=cr(function(t,n,r){xu.call(t,r)?++t[r]:t[r]=1}),qo=cr(function(t,n,r){xu.call(t,r)?t[r].push(n):t[r]=[n]}),Vo=je(function(t,n,e){var u=-1,o=typeof n=="function",i=Tr(n),f=ke(t)?Array(t.length):[]; +return _o(t,function(t){var c=o?n:i&&null!=t?t[n]:q;f[++u]=c?r(c,t,e):mn(t,n,e)}),f}),Ko=cr(function(t,n,r){t[r]=n}),Go=cr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Jo=je(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Zr(t,n[0],n[1])?n=[]:r>2&&Zr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&oi(n[0])?n[0]:hn(n,1,Pr),Bn(t,n,[])}),Yo=su.now,Ho=je(function(t,n,r){var e=1;if(r.length)var u=F(r,Lr(Ho)),e=32|e;return kr(t,e,n,r,u)}),Qo=je(function(t,n,r){var e=3;if(r.length)var u=F(r,Lr(Qo)),e=32|e; +return kr(n,e,t,r,u)}),Xo=je(function(t,n){return cn(t,1,n)}),ti=je(function(t,n,r){return cn(t,qe(n)||0,r)});xe.Cache=Dt;var ni=je(function(t,n){n=1==n.length&&oi(n[0])?a(n[0],O(Rr())):a(hn(n,1,Pr),O(Rr()));var e=n.length;return je(function(u){for(var o=-1,i=qu(u.length,e);++o--t?n.apply(this,arguments):void 0}},jt.ary=ve,jt.assign=fi,jt.assignIn=ci,jt.assignInWith=ai,jt.assignWith=li,jt.at=si,jt.before=ge,jt.bind=Ho,jt.bindAll=Ri,jt.bindKey=Qo,jt.castArray=me,jt.chain=ce,jt.chunk=function(t,n,r){ +if(n=(r?Zr(t,n,r):n===q)?1:Tu(Ze(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Du(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},jt.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++nt)return t?or(n):[];for(var r=Array(t-1);t--;)r[t-1]=arguments[t];for(var t=hn(r,1),r=-1,e=n.length,u=-1,o=t.length,i=Array(e+o);++rr&&(r=-r>u?0:u+r),e=e===q||e>u?u:Ze(e),0>e&&(e+=u),e=r>e?0:Te(e);e>r;)t[r++]=n;return t},jt.filter=function(t,n){return(oi(t)?i:sn)(t,Rr(n,3))},jt.flatMap=function(t,n){return hn(pe(t,n),1); +},jt.flatMapDeep=function(t,n){return hn(pe(t,n),V)},jt.flatMapDepth=function(t,n,r){return r=r===q?1:Ze(r),hn(pe(t,n),r)},jt.flatten=function(t){return t&&t.length?hn(t,1):[]},jt.flattenDeep=function(t){return t&&t.length?hn(t,V):[]},jt.flattenDepth=function(t,n){return t&&t.length?(n=n===q?1:Ze(n),hn(t,n)):[]},jt.flip=function(t){return kr(t,512)},jt.flow=Wi,jt.flowRight=Bi,jt.fromPairs=function(t){for(var n=-1,r=t?t.length:0,e={};++n>>0,r?(t=Ke(t))&&(typeof n=="string"||null!=n&&!Ue(n))&&(n+="",""==n&&Bt.test(t))?tr(t.match(Rt),0,r):Yu.call(t,n,r):[]; +},jt.spread=function(t,n){if(typeof t!="function")throw new vu("Expected a function");return n=n===q?0:Tu(Ze(n),0),je(function(e){var u=e[n];return e=tr(e,0,n),u&&l(e,u),r(t,this,e)})},jt.tail=function(t){return te(t,1)},jt.take=function(t,n,r){return t&&t.length?(n=r||n===q?1:Ze(n),Pn(t,0,0>n?0:n)):[]},jt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===q?1:Ze(n),n=e-n,Pn(t,0>n?0:n,e)):[]},jt.takeRightWhile=function(t,n){return t&&t.length?Gn(t,Rr(n,3),false,true):[]},jt.takeWhile=function(t,n){ +return t&&t.length?Gn(t,Rr(n,3)):[]},jt.tap=function(t,n){return n(t),t},jt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new vu("Expected a function");return Be(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),be(t,n,{leading:e,maxWait:n,trailing:u})},jt.thru=ae,jt.toArray=Pe,jt.toPairs=Xe,jt.toPairsIn=tu,jt.toPath=function(t){return oi(t)?a(t,Hr):$e(t)?[t]:or(Oo(t))},jt.toPlainObject=Ve,jt.transform=function(t,n,r){var e=oi(t)||Fe(t);if(n=Rr(n,4),null==r)if(e||Be(t)){ +var o=t.constructor;r=e?oi(t)?new o:[]:Se(o)?fn(Fu(Object(t))):{}}else r={};return(e?u:pn)(t,function(t,e,u){return n(r,t,e,u)}),r},jt.unary=function(t){return ve(t,1)},jt.union=Co,jt.unionBy=Mo,jt.unionWith=zo,jt.uniq=function(t){return t&&t.length?Kn(t):[]},jt.uniqBy=function(t,n){return t&&t.length?Kn(t,Rr(n)):[]},jt.uniqWith=function(t,n){return t&&t.length?Kn(t,q,n):[]},jt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Tr(e,r)?[e]:Xn(e);r=Yr(r,e),e=ee(e),r=null!=r&&Je(r,e)?delete r[e]:true; +}return r},jt.unzip=ie,jt.unzipWith=fe,jt.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:iu)(gn(t,n)),void 0)},jt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:q,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:iu)(gn(t,n)),e)),t},jt.values=nu,jt.valuesIn=function(t){return null==t?[]:k(t,Qe(t))},jt.without=Uo,jt.words=uu,jt.wrap=function(t,n){return n=null==n?iu:n,ri(n,t)},jt.xor=Do,jt.xorBy=$o,jt.xorWith=Fo,jt.zip=No,jt.zipObject=function(t,n){return Hn(t||[],n||[],Xt); +},jt.zipObjectDeep=function(t,n){return Hn(t||[],n||[],Nn)},jt.zipWith=Po,jt.entries=Xe,jt.entriesIn=tu,jt.extend=ci,jt.extendWith=ai,cu(jt,jt),jt.add=Fi,jt.attempt=Si,jt.camelCase=ji,jt.capitalize=ru,jt.ceil=Ni,jt.clamp=function(t,n,r){return r===q&&(r=n,n=q),r!==q&&(r=qe(r),r=r===r?r:0),n!==q&&(n=qe(n),n=n===n?n:0),en(qe(t),n,r)},jt.clone=function(t){return un(t,false,true)},jt.cloneDeep=function(t){return un(t,true,true)},jt.cloneDeepWith=function(t,n){return un(t,true,true,n)},jt.cloneWith=function(t,n){return un(t,false,true,n); +},jt.deburr=eu,jt.divide=Pi,jt.endsWith=function(t,n,r){t=Ke(t),n=typeof n=="string"?n:n+"";var e=t.length;return r=r===q?e:en(Ze(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},jt.eq=we,jt.escape=function(t){return(t=Ke(t))&&tt.test(t)?t.replace(Q,L):t},jt.escapeRegExp=function(t){return(t=Ke(t))&&ct.test(t)?t.replace(ft,"\\$&"):t},jt.every=function(t,n,r){var e=oi(t)?o:ln;return r&&Zr(t,n,r)&&(n=q),e(t,Rr(n,3))},jt.find=function(t,n){if(n=Rr(n,3),oi(t)){var r=g(t,n);return r>-1?t[r]:q}return v(t,n,_o); +},jt.findIndex=function(t,n){return t&&t.length?g(t,Rr(n,3)):-1},jt.findKey=function(t,n){return v(t,Rr(n,3),pn,true)},jt.findLast=function(t,n){if(n=Rr(n,3),oi(t)){var r=g(t,n,true);return r>-1?t[r]:q}return v(t,n,vo)},jt.findLastIndex=function(t,n){return t&&t.length?g(t,Rr(n,3),true):-1},jt.findLastKey=function(t,n){return v(t,Rr(n,3),_n,true)},jt.floor=Zi,jt.forEach=se,jt.forEachRight=he,jt.forIn=function(t,n){return null==t?t:go(t,Rr(n),Qe)},jt.forInRight=function(t,n){return null==t?t:yo(t,Rr(n),Qe); +},jt.forOwn=function(t,n){return t&&pn(t,Rr(n))},jt.forOwnRight=function(t,n){return t&&_n(t,Rr(n))},jt.get=Ge,jt.gt=Ae,jt.gte=function(t,n){return t>=n},jt.has=Je,jt.hasIn=Ye,jt.head=re,jt.identity=iu,jt.includes=function(t,n,r,e){return t=ke(t)?t:nu(t),r=r&&!e?Ze(r):0,e=t.length,0>r&&(r=Tu(e+r,0)),De(t)?e>=r&&-1r&&(r=Tu(e+r,0)),d(t,n,r)):-1},jt.inRange=function(t,n,r){return n=qe(n)||0,r===q?(r=n, +n=0):r=qe(r)||0,t=qe(t),t>=qu(n,r)&&t=-9007199254740991&&9007199254740991>=t},jt.isSet=function(t){return Le(t)&&"[object Set]"==Mr(t)},jt.isString=De,jt.isSymbol=$e,jt.isTypedArray=Fe,jt.isUndefined=function(t){ +return t===q},jt.isWeakMap=function(t){return Le(t)&&"[object WeakMap]"==Mr(t)},jt.isWeakSet=function(t){return Le(t)&&"[object WeakSet]"==wu.call(t)},jt.join=function(t,n){return t?Pu.call(t,n):""},jt.kebabCase=mi,jt.last=ee,jt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==q&&(u=Ze(r),u=(0>u?Tu(e+u,0):qu(u,e-1))+1),n!==n)return M(t,u,true);for(;u--;)if(t[u]===n)return u;return-1},jt.lowerCase=wi,jt.lowerFirst=Ai,jt.lt=Ne,jt.lte=function(t,n){return n>=t},jt.max=function(t){ +return t&&t.length?_(t,iu,Ae):q},jt.maxBy=function(t,n){return t&&t.length?_(t,Rr(n),Ae):q},jt.mean=function(t){return b(t,iu)},jt.meanBy=function(t,n){return b(t,Rr(n))},jt.min=function(t){return t&&t.length?_(t,iu,Ne):q},jt.minBy=function(t,n){return t&&t.length?_(t,Rr(n),Ne):q},jt.multiply=Ti,jt.nth=function(t,n){return t&&t.length?Wn(t,Ze(n)):q},jt.noConflict=function(){return Yt._===this&&(Yt._=Au),this},jt.noop=au,jt.now=Yo,jt.pad=function(t,n,r){t=Ke(t);var e=(n=Ze(n))?P(t):0;return n&&n>e?(n=(n-e)/2, +jr($u(n),r)+t+jr(Du(n),r)):t},jt.padEnd=function(t,n,r){t=Ke(t);var e=(n=Ze(n))?P(t):0;return n&&n>e?t+jr(n-e,r):t},jt.padStart=function(t,n,r){t=Ke(t);var e=(n=Ze(n))?P(t):0;return n&&n>e?jr(n-e,r)+t:t},jt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=Ke(t).replace(at,""),Vu(t,n||(gt.test(t)?16:10))},jt.random=function(t,n,r){if(r&&typeof r!="boolean"&&Zr(t,n,r)&&(n=r=q),r===q&&(typeof n=="boolean"?(r=n,n=q):typeof t=="boolean"&&(r=t,t=q)),t===q&&n===q?(t=0,n=1):(t=qe(t)||0,n===q?(n=t, +t=0):n=qe(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Ku(),qu(t+r*(n-t+Pt("1e-"+((r+"").length-1))),n)):$n(t,n)},jt.reduce=function(t,n,r){var e=oi(t)?s:x,u=3>arguments.length;return e(t,Rr(n,4),r,u,_o)},jt.reduceRight=function(t,n,r){var e=oi(t)?h:x,u=3>arguments.length;return e(t,Rr(n,4),r,u,vo)},jt.repeat=function(t,n,r){return n=(r?Zr(t,n,r):n===q)?1:Ze(n),Fn(Ke(t),n)},jt.replace=function(){var t=arguments,n=Ke(t[0]);return 3>t.length?n:Gu.call(n,t[1],t[2])},jt.result=function(t,n,r){n=Tr(n,t)?[n]:Xn(n); +var e=-1,u=n.length;for(u||(t=q,u=1);++e0?t[$n(0,n-1)]:q},jt.size=function(t){if(null==t)return 0;if(ke(t)){var n=t.length;return n&&De(t)?P(t):n}return Le(t)&&(n=Mr(t),"[object Map]"==n||"[object Set]"==n)?t.size:He(t).length},jt.snakeCase=Oi,jt.some=function(t,n,r){var e=oi(t)?p:Zn;return r&&Zr(t,n,r)&&(n=q),e(t,Rr(n,3))},jt.sortedIndex=function(t,n){ +return Tn(t,n)},jt.sortedIndexBy=function(t,n,r){return qn(t,n,Rr(r))},jt.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&we(t[e],n))return e}return-1},jt.sortedLastIndex=function(t,n){return Tn(t,n,true)},jt.sortedLastIndexBy=function(t,n,r){return qn(t,n,Rr(r),true)},jt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(we(t[r],n))return r}return-1},jt.startCase=ki,jt.startsWith=function(t,n,r){return t=Ke(t),r=en(Ze(r),0,t.length),t.lastIndexOf(n,r)==r; +},jt.subtract=Vi,jt.sum=function(t){return t&&t.length?m(t,iu):0},jt.sumBy=function(t,n){return t&&t.length?m(t,Rr(n)):0},jt.template=function(t,n,r){var e=jt.templateSettings;r&&Zr(t,n,r)&&(n=q),t=Ke(t),n=ai({},n,e,Jt),r=ai({},n.imports,e.imports,Jt);var u,o,i=He(r),f=k(r,i),c=0;r=n.interpolate||wt;var a="__p+='";r=_u((n.escape||wt).source+"|"+r.source+"|"+(r===et?_t:wt).source+"|"+(n.evaluate||wt).source+"|$","g");var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){ +return e||(e=i),a+=t.slice(c,l).replace(At,C),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(G,""):a).replace(J,"$1").replace(Y,"$1;"),a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",n=Si(function(){return Function(i,l+"return "+a).apply(q,f); +}),n.source=a,Ie(n))throw n;return n},jt.times=function(t,n){if(t=Ze(t),1>t||t>9007199254740991)return[];var r=4294967295,e=qu(t,4294967295);for(n=Rr(n),t-=4294967295,e=w(e,n);++r=o)return t;if(o=r-P(e),1>o)return e;if(r=i?tr(i,0,o).join(""):t.slice(0,o),u===q)return r+e;if(i&&(o+=r.length-o),Ue(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=_u(u.source,Ke(vt.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===q?o:c)}}else t.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},jt.unescape=function(t){return(t=Ke(t))&&X.test(t)?t.replace(H,Z):t},jt.uniqueId=function(t){var n=++ju;return Ke(t)+n},jt.upperCase=Ei,jt.upperFirst=Ii, +jt.each=se,jt.eachRight=he,jt.first=re,cu(jt,function(){var t={};return pn(jt,function(n,r){xu.call(jt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),jt.VERSION="4.11.1",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){jt[t].placeholder=jt}),u(["drop","take"],function(t,n){Et.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Et(this);r=r===q?1:Tu(Ze(r),0);var u=this.clone();return e?u.__takeCount__=qu(r,u.__takeCount__):u.__views__.push({size:qu(r,4294967295), +type:t+(0>u.__dir__?"Right":"")}),u},Et.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Et.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Rr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Et.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); +Et.prototype[t]=function(){return this.__filtered__?new Et(this):this[r](1)}}),Et.prototype.compact=function(){return this.filter(iu)},Et.prototype.find=function(t){return this.filter(t).head()},Et.prototype.findLast=function(t){return this.reverse().find(t)},Et.prototype.invokeMap=je(function(t,n){return typeof t=="function"?new Et(this):this.map(function(r){return mn(r,t,n)})}),Et.prototype.reject=function(t){return t=Rr(t,3),this.filter(function(n){return!t(n)})},Et.prototype.slice=function(t,n){ +t=Ze(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Et(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==q&&(n=Ze(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Et.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Et.prototype.toArray=function(){return this.take(4294967295)},pn(Et.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=jt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(jt.prototype[n]=function(){ +function n(t){return t=u.apply(jt,l([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Et,a=f[0],s=c||oi(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new Et(this),i=t.apply(i,f),i.__actions__.push({func:ae,args:[n],thisArg:q}),new kt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=gu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t); +jt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(oi(u)?u:[],t)}return this[r](function(r){return n.apply(oi(r)?r:[],t)})}}),pn(Et.prototype,function(t,n){var r=jt[n];if(r){var e=r.name+"";(oo[e]||(oo[e]=[])).push({name:n,func:r})}}),oo[yr(q,2).name]=[{name:"wrapper",func:q}],Et.prototype.clone=function(){var t=new Et(this.__wrapped__);return t.__actions__=or(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=or(this.__iteratees__), +t.__takeCount__=this.__takeCount__,t.__views__=or(this.__views__),t},Et.prototype.reverse=function(){if(this.__filtered__){var t=new Et(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Et.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=oi(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==t&&a==t)return Jn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o=this.__values__.length,n=t?q:this.__values__[this.__index__++];return{done:t,value:n}},jt.prototype.plant=function(t){for(var n,r=this;r instanceof Ot;){var e=Xr(r);e.__index__=0,e.__values__=q,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},jt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Et?(this.__actions__.length&&(t=new Et(this)),t=t.reverse(),t.__actions__.push({func:ae, +args:[oe],thisArg:q}),new kt(t,this.__chain__)):this.thru(oe)},jt.prototype.toJSON=jt.prototype.valueOf=jt.prototype.value=function(){return Jn(this.__wrapped__,this.__actions__)},Lu&&(jt.prototype[Lu]=le),jt}var q,V=1/0,K=NaN,G=/\b__p\+='';/g,J=/\b(__p\+=)''\+/g,Y=/(__e\(.*?\)|\b__t\))\+'';/g,H=/&(?:amp|lt|gt|quot|#39|#96);/g,Q=/[&<>"'`]/g,X=RegExp(H.source),tt=RegExp(Q.source),nt=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ot=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,ft=/[\\^$.*+?()[\]{}|]/g,ct=RegExp(ft.source),at=/^\s+|\s+$/g,lt=/^\s+/,st=/\s+$/,ht=/[a-zA-Z0-9]+/g,pt=/\\(\\)?/g,_t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,gt=/^0x/i,dt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,xt=/^0o[0-7]+$/i,jt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,wt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,Ot="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",kt="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+Ot,Et="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",It=RegExp("['\u2019]","g"),St=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),Rt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+Et+Ot,"g"),Wt=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",kt].join("|"),"g"),Bt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ct="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Mt={}; +Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=true,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=false; +var zt={};zt["[object Arguments]"]=zt["[object Array]"]=zt["[object ArrayBuffer]"]=zt["[object DataView]"]=zt["[object Boolean]"]=zt["[object Date]"]=zt["[object Float32Array]"]=zt["[object Float64Array]"]=zt["[object Int8Array]"]=zt["[object Int16Array]"]=zt["[object Int32Array]"]=zt["[object Map]"]=zt["[object Number]"]=zt["[object Object]"]=zt["[object RegExp]"]=zt["[object Set]"]=zt["[object String]"]=zt["[object Symbol]"]=zt["[object Uint8Array]"]=zt["[object Uint8ClampedArray]"]=zt["[object Uint16Array]"]=zt["[object Uint32Array]"]=true, +zt["[object Error]"]=zt["[object Function]"]=zt["[object WeakMap]"]=false;var Ut={"\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"},Dt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ft={"function":true,object:true},Nt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" +},Pt=parseFloat,Zt=parseInt,Tt=Ft[typeof exports]&&exports&&!exports.nodeType?exports:q,qt=Ft[typeof module]&&module&&!module.nodeType?module:q,Vt=qt&&qt.exports===Tt?Tt:q,Kt=S(Ft[typeof self]&&self),Gt=S(Ft[typeof window]&&window),Jt=S(Ft[typeof this]&&this),Yt=S(Tt&&qt&&typeof global=="object"&&global)||Gt!==(Jt&&Jt.window)&&Gt||Kt||Jt||Function("return this")(),Ht=T();(Gt||Kt||{})._=Ht,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Ht}):Tt&&qt?(Vt&&((qt.exports=Ht)._=Ht), +Tt._=Ht):Yt._=Ht}).call(this); \ No newline at end of file diff --git a/tools/eslint/node_modules/lodash/lowerCase.js b/tools/eslint/node_modules/lodash/lowerCase.js index 4222dcbad1d61d..66c1f499f4151a 100644 --- a/tools/eslint/node_modules/lodash/lowerCase.js +++ b/tools/eslint/node_modules/lodash/lowerCase.js @@ -5,12 +5,13 @@ var createCompounder = require('./_createCompounder'); * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * - * _.lowerCase('--Foo-Bar'); + * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); diff --git a/tools/eslint/node_modules/lodash/lowerFirst.js b/tools/eslint/node_modules/lodash/lowerFirst.js index 884ec2dec1f039..c08f082b139af2 100644 --- a/tools/eslint/node_modules/lodash/lowerFirst.js +++ b/tools/eslint/node_modules/lodash/lowerFirst.js @@ -5,6 +5,7 @@ var createCaseFirst = require('./_createCaseFirst'); * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. diff --git a/tools/eslint/node_modules/lodash/lt.js b/tools/eslint/node_modules/lodash/lt.js index 4439870a318ee4..4e06fdd028e88e 100644 --- a/tools/eslint/node_modules/lodash/lt.js +++ b/tools/eslint/node_modules/lodash/lt.js @@ -3,10 +3,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. * @example * * _.lt(1, 3); diff --git a/tools/eslint/node_modules/lodash/lte.js b/tools/eslint/node_modules/lodash/lte.js index e2b8ab15a063ee..76e8607fdb8cc2 100644 --- a/tools/eslint/node_modules/lodash/lte.js +++ b/tools/eslint/node_modules/lodash/lte.js @@ -3,10 +3,12 @@ * * @static * @memberOf _ + * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. * @example * * _.lte(1, 3); diff --git a/tools/eslint/node_modules/lodash/map.js b/tools/eslint/node_modules/lodash/map.js index d19a9a6c06cedb..e9f9f22ebef446 100644 --- a/tools/eslint/node_modules/lodash/map.js +++ b/tools/eslint/node_modules/lodash/map.js @@ -4,7 +4,7 @@ var arrayMap = require('./_arrayMap'), isArray = require('./isArray'); /** - * Creates an array of values by running each element in `collection` through + * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * @@ -12,16 +12,18 @@ var arrayMap = require('./_arrayMap'), * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * diff --git a/tools/eslint/node_modules/lodash/mapKeys.js b/tools/eslint/node_modules/lodash/mapKeys.js index aa3899fa5820ec..0850afd396316f 100644 --- a/tools/eslint/node_modules/lodash/mapKeys.js +++ b/tools/eslint/node_modules/lodash/mapKeys.js @@ -4,13 +4,16 @@ var baseForOwn = require('./_baseForOwn'), /** * 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`. + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). * * @static * @memberOf _ + * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @example * diff --git a/tools/eslint/node_modules/lodash/mapValues.js b/tools/eslint/node_modules/lodash/mapValues.js index c160702f828305..c3af35e823ff5d 100644 --- a/tools/eslint/node_modules/lodash/mapValues.js +++ b/tools/eslint/node_modules/lodash/mapValues.js @@ -2,15 +2,18 @@ var baseForOwn = require('./_baseForOwn'), baseIteratee = require('./_baseIteratee'); /** - * 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 invoked with three arguments: (value, key, object). + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). * * @static * @memberOf _ + * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @example * diff --git a/tools/eslint/node_modules/lodash/matches.js b/tools/eslint/node_modules/lodash/matches.js index 5a2926ae524e8a..16fe16d47ec913 100644 --- a/tools/eslint/node_modules/lodash/matches.js +++ b/tools/eslint/node_modules/lodash/matches.js @@ -2,14 +2,16 @@ var baseClone = require('./_baseClone'), baseMatches = require('./_baseMatches'); /** - * Creates a function that performs a deep partial comparison between a given + * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. + * property values, else `false`. The created function is equivalent to + * `_.isMatch` with a `source` partially applied. * * **Note:** This method supports comparing the same values as `_.isEqual`. * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/matchesProperty.js b/tools/eslint/node_modules/lodash/matchesProperty.js index d4356fb956a015..3dd59d5a141049 100644 --- a/tools/eslint/node_modules/lodash/matchesProperty.js +++ b/tools/eslint/node_modules/lodash/matchesProperty.js @@ -2,7 +2,7 @@ var baseClone = require('./_baseClone'), baseMatchesProperty = require('./_baseMatchesProperty'); /** - * Creates a function that performs a deep partial comparison between the + * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * @@ -10,6 +10,7 @@ var baseClone = require('./_baseClone'), * * @static * @memberOf _ + * @since 3.2.0 * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. diff --git a/tools/eslint/node_modules/lodash/math.js b/tools/eslint/node_modules/lodash/math.js index edfba7f7fe7347..596688748e02f9 100644 --- a/tools/eslint/node_modules/lodash/math.js +++ b/tools/eslint/node_modules/lodash/math.js @@ -1,12 +1,15 @@ module.exports = { 'add': require('./add'), 'ceil': require('./ceil'), + 'divide': require('./divide'), 'floor': require('./floor'), 'max': require('./max'), 'maxBy': require('./maxBy'), 'mean': require('./mean'), + 'meanBy': require('./meanBy'), 'min': require('./min'), 'minBy': require('./minBy'), + 'multiply': require('./multiply'), 'round': require('./round'), 'subtract': require('./subtract'), 'sum': require('./sum'), diff --git a/tools/eslint/node_modules/lodash/max.js b/tools/eslint/node_modules/lodash/max.js index 124b33127dd159..f563459b8aeef5 100644 --- a/tools/eslint/node_modules/lodash/max.js +++ b/tools/eslint/node_modules/lodash/max.js @@ -3,10 +3,11 @@ var baseExtremum = require('./_baseExtremum'), identity = require('./identity'); /** - * Computes the maximum value of `array`. If `array` is empty or falsey + * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. diff --git a/tools/eslint/node_modules/lodash/maxBy.js b/tools/eslint/node_modules/lodash/maxBy.js index c70395fbfcc7f3..a58dd016371900 100644 --- a/tools/eslint/node_modules/lodash/maxBy.js +++ b/tools/eslint/node_modules/lodash/maxBy.js @@ -9,9 +9,11 @@ var baseExtremum = require('./_baseExtremum'), * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * diff --git a/tools/eslint/node_modules/lodash/mean.js b/tools/eslint/node_modules/lodash/mean.js index 739dc4147f136e..e3ffff67c79b05 100644 --- a/tools/eslint/node_modules/lodash/mean.js +++ b/tools/eslint/node_modules/lodash/mean.js @@ -1,10 +1,12 @@ -var sum = require('./sum'); +var baseMean = require('./_baseMean'), + identity = require('./identity'); /** * Computes the mean of the values in `array`. * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the mean. @@ -14,7 +16,7 @@ var sum = require('./sum'); * // => 5 */ function mean(array) { - return sum(array) / (array ? array.length : 0); + return baseMean(array, identity); } module.exports = mean; diff --git a/tools/eslint/node_modules/lodash/meanBy.js b/tools/eslint/node_modules/lodash/meanBy.js new file mode 100644 index 00000000000000..970d79836766ab --- /dev/null +++ b/tools/eslint/node_modules/lodash/meanBy.js @@ -0,0 +1,32 @@ +var baseIteratee = require('./_baseIteratee'), + baseMean = require('./_baseMean'); + +/** + * This method is like `_.mean` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be averaged. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the mean. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.meanBy(objects, function(o) { return o.n; }); + * // => 5 + * + * // The `_.property` iteratee shorthand. + * _.meanBy(objects, 'n'); + * // => 5 + */ +function meanBy(array, iteratee) { + return baseMean(array, baseIteratee(iteratee)); +} + +module.exports = meanBy; diff --git a/tools/eslint/node_modules/lodash/memoize.js b/tools/eslint/node_modules/lodash/memoize.js index 4fe714973475be..b657bbe41e9814 100644 --- a/tools/eslint/node_modules/lodash/memoize.js +++ b/tools/eslint/node_modules/lodash/memoize.js @@ -5,18 +5,20 @@ 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 + * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. @@ -61,7 +63,7 @@ function memoize(func, resolver) { memoized.cache = cache.set(key, result); return result; }; - memoized.cache = new memoize.Cache; + memoized.cache = new (memoize.Cache || MapCache); return memoized; } diff --git a/tools/eslint/node_modules/lodash/merge.js b/tools/eslint/node_modules/lodash/merge.js index 07625956a68e70..61c6e015613ed6 100644 --- a/tools/eslint/node_modules/lodash/merge.js +++ b/tools/eslint/node_modules/lodash/merge.js @@ -2,17 +2,19 @@ var baseMerge = require('./_baseMerge'), createAssigner = require('./_createAssigner'); /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively.Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ + * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. diff --git a/tools/eslint/node_modules/lodash/mergeWith.js b/tools/eslint/node_modules/lodash/mergeWith.js index c41390c72805da..8fada62dda3947 100644 --- a/tools/eslint/node_modules/lodash/mergeWith.js +++ b/tools/eslint/node_modules/lodash/mergeWith.js @@ -4,7 +4,7 @@ var baseMerge = require('./_baseMerge'), /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the + * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with seven arguments: * (objValue, srcValue, key, object, source, stack). * @@ -12,6 +12,7 @@ var baseMerge = require('./_baseMerge'), * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. diff --git a/tools/eslint/node_modules/lodash/method.js b/tools/eslint/node_modules/lodash/method.js index 0095361b65b445..12bc4bf59ea0de 100644 --- a/tools/eslint/node_modules/lodash/method.js +++ b/tools/eslint/node_modules/lodash/method.js @@ -7,6 +7,7 @@ var baseInvoke = require('./_baseInvoke'), * * @static * @memberOf _ + * @since 3.7.0 * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. @@ -14,15 +15,15 @@ var baseInvoke = require('./_baseInvoke'), * @example * * var objects = [ - * { 'a': { 'b': { 'c': _.constant(2) } } }, - * { 'a': { 'b': { 'c': _.constant(1) } } } + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } * ]; * - * _.map(objects, _.method('a.b.c')); + * _.map(objects, _.method('a.b')); * // => [2, 1] * - * _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); - * // => [1, 2] + * _.map(objects, _.method(['a', 'b'])); + * // => [2, 1] */ var method = rest(function(path, args) { return function(object) { diff --git a/tools/eslint/node_modules/lodash/methodOf.js b/tools/eslint/node_modules/lodash/methodOf.js index 8601ebaac371a9..edac32f4cd56b5 100644 --- a/tools/eslint/node_modules/lodash/methodOf.js +++ b/tools/eslint/node_modules/lodash/methodOf.js @@ -8,6 +8,7 @@ var baseInvoke = require('./_baseInvoke'), * * @static * @memberOf _ + * @since 3.7.0 * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. diff --git a/tools/eslint/node_modules/lodash/min.js b/tools/eslint/node_modules/lodash/min.js index 77dde9803d5b91..0852b5dbb00067 100644 --- a/tools/eslint/node_modules/lodash/min.js +++ b/tools/eslint/node_modules/lodash/min.js @@ -3,10 +3,11 @@ var baseExtremum = require('./_baseExtremum'), lt = require('./lt'); /** - * Computes the minimum value of `array`. If `array` is empty or falsey + * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. diff --git a/tools/eslint/node_modules/lodash/minBy.js b/tools/eslint/node_modules/lodash/minBy.js index 9c40ea64b7e70c..3a4e21205ad6d0 100644 --- a/tools/eslint/node_modules/lodash/minBy.js +++ b/tools/eslint/node_modules/lodash/minBy.js @@ -9,9 +9,11 @@ var baseExtremum = require('./_baseExtremum'), * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * diff --git a/tools/eslint/node_modules/lodash/mixin.js b/tools/eslint/node_modules/lodash/mixin.js index 02e2b6c2719e5a..6dc96746718517 100644 --- a/tools/eslint/node_modules/lodash/mixin.js +++ b/tools/eslint/node_modules/lodash/mixin.js @@ -7,21 +7,21 @@ var arrayEach = require('./_arrayEach'), keys = require('./keys'); /** - * Adds all own enumerable function properties of a source object to the - * destination object. If `object` is a function then methods are added to - * its prototype as well. + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. - * @param {Object} [options] The options object. - * @param {boolean} [options.chain=true] Specify whether the functions added - * are chainable. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * @@ -46,7 +46,7 @@ function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); - var chain = (isObject(options) && 'chain' in options) ? options.chain : true, + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { diff --git a/tools/eslint/node_modules/lodash/multiply.js b/tools/eslint/node_modules/lodash/multiply.js new file mode 100644 index 00000000000000..57ba9398554569 --- /dev/null +++ b/tools/eslint/node_modules/lodash/multiply.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Multiply two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} multiplier The first number in a multiplication. + * @param {number} multiplicand The second number in a multiplication. + * @returns {number} Returns the product. + * @example + * + * _.multiply(6, 4); + * // => 24 + */ +var multiply = createMathOperation(function(multiplier, multiplicand) { + return multiplier * multiplicand; +}); + +module.exports = multiply; diff --git a/tools/eslint/node_modules/lodash/negate.js b/tools/eslint/node_modules/lodash/negate.js index 82479390ad7802..2ad58d6a2d38c8 100644 --- a/tools/eslint/node_modules/lodash/negate.js +++ b/tools/eslint/node_modules/lodash/negate.js @@ -8,6 +8,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/next.js b/tools/eslint/node_modules/lodash/next.js index 24ce3b24c32843..55f949c8cd5bfb 100644 --- a/tools/eslint/node_modules/lodash/next.js +++ b/tools/eslint/node_modules/lodash/next.js @@ -6,6 +6,7 @@ var toArray = require('./toArray'); * * @name next * @memberOf _ + * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example diff --git a/tools/eslint/node_modules/lodash/noop.js b/tools/eslint/node_modules/lodash/noop.js index 9f63a6633b7371..26e19c31728af4 100644 --- a/tools/eslint/node_modules/lodash/noop.js +++ b/tools/eslint/node_modules/lodash/noop.js @@ -4,6 +4,7 @@ * * @static * @memberOf _ + * @since 2.3.0 * @category Util * @example * diff --git a/tools/eslint/node_modules/lodash/now.js b/tools/eslint/node_modules/lodash/now.js index eca3b9eddea21d..c0656728c9906d 100644 --- a/tools/eslint/node_modules/lodash/now.js +++ b/tools/eslint/node_modules/lodash/now.js @@ -4,7 +4,8 @@ * * @static * @memberOf _ - * @type Function + * @since 2.4.0 + * @type {Function} * @category Date * @returns {number} Returns the timestamp. * @example @@ -12,7 +13,7 @@ * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked + * // => Logs the number of milliseconds it took for the deferred function to be invoked. */ var now = Date.now; diff --git a/tools/eslint/node_modules/lodash/nth.js b/tools/eslint/node_modules/lodash/nth.js new file mode 100644 index 00000000000000..eed69e2c5d6778 --- /dev/null +++ b/tools/eslint/node_modules/lodash/nth.js @@ -0,0 +1,29 @@ +var baseNth = require('./_baseNth'), + toInteger = require('./toInteger'); + +/** + * Gets the nth element of `array`. If `n` is negative, the nth element + * from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ +function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; +} + +module.exports = nth; diff --git a/tools/eslint/node_modules/lodash/nthArg.js b/tools/eslint/node_modules/lodash/nthArg.js index bf95dd011f8207..533747af3f80ac 100644 --- a/tools/eslint/node_modules/lodash/nthArg.js +++ b/tools/eslint/node_modules/lodash/nthArg.js @@ -1,25 +1,32 @@ -var toInteger = require('./toInteger'); +var baseNth = require('./_baseNth'), + rest = require('./rest'), + toInteger = require('./toInteger'); /** - * Creates a function that returns its nth argument. + * Creates a function that returns its nth argument. If `n` is negative, + * the nth argument from the end is returned. * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. * @returns {Function} Returns the new function. * @example * * var func = _.nthArg(1); - * - * func('a', 'b', 'c'); + * func('a', 'b', 'c', 'd'); * // => 'b' + * + * var func = _.nthArg(-2); + * func('a', 'b', 'c', 'd'); + * // => 'c' */ function nthArg(n) { n = toInteger(n); - return function() { - return arguments[n]; - }; + return rest(function(args) { + return baseNth(args, n); + }); } module.exports = nthArg; diff --git a/tools/eslint/node_modules/lodash/object.js b/tools/eslint/node_modules/lodash/object.js index aab1e8286c6eeb..d6f51c8e1c6d2a 100644 --- a/tools/eslint/node_modules/lodash/object.js +++ b/tools/eslint/node_modules/lodash/object.js @@ -6,6 +6,8 @@ module.exports = { 'create': require('./create'), 'defaults': require('./defaults'), 'defaultsDeep': require('./defaultsDeep'), + 'entries': require('./entries'), + 'entriesIn': require('./entriesIn'), 'extend': require('./extend'), 'extendWith': require('./extendWith'), 'findKey': require('./findKey'), @@ -39,6 +41,8 @@ module.exports = { 'toPairsIn': require('./toPairsIn'), 'transform': require('./transform'), 'unset': require('./unset'), + 'update': require('./update'), + 'updateWith': require('./updateWith'), 'values': require('./values'), 'valuesIn': require('./valuesIn') }; diff --git a/tools/eslint/node_modules/lodash/omit.js b/tools/eslint/node_modules/lodash/omit.js index dd3c70dc6d6ac5..a19974da774ef9 100644 --- a/tools/eslint/node_modules/lodash/omit.js +++ b/tools/eslint/node_modules/lodash/omit.js @@ -2,19 +2,21 @@ var arrayMap = require('./_arrayMap'), baseDifference = require('./_baseDifference'), baseFlatten = require('./_baseFlatten'), basePick = require('./_basePick'), - keysIn = require('./keysIn'), - rest = require('./rest'); + getAllKeysIn = require('./_getAllKeysIn'), + rest = require('./rest'), + toKey = require('./_toKey'); /** * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. + * own and inherited enumerable string keyed properties of `object` that are + * not omitted. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays.. + * @param {...(string|string[])} [props] The property identifiers to omit. * @returns {Object} Returns the new object. * @example * @@ -27,8 +29,8 @@ var omit = rest(function(object, props) { if (object == null) { return {}; } - props = arrayMap(baseFlatten(props), String); - return basePick(object, baseDifference(keysIn(object), props)); + props = arrayMap(baseFlatten(props, 1), toKey); + return basePick(object, baseDifference(getAllKeysIn(object), props)); }); module.exports = omit; diff --git a/tools/eslint/node_modules/lodash/omitBy.js b/tools/eslint/node_modules/lodash/omitBy.js index d7d045354b4108..79505deafc2c4b 100644 --- a/tools/eslint/node_modules/lodash/omitBy.js +++ b/tools/eslint/node_modules/lodash/omitBy.js @@ -2,15 +2,18 @@ var baseIteratee = require('./_baseIteratee'), basePickBy = require('./_basePickBy'); /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -20,7 +23,7 @@ var baseIteratee = require('./_baseIteratee'), * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = baseIteratee(predicate, 2); + predicate = baseIteratee(predicate); return basePickBy(object, function(value, key) { return !predicate(value, key); }); diff --git a/tools/eslint/node_modules/lodash/once.js b/tools/eslint/node_modules/lodash/once.js index 75f7d99b7797f6..4f66808a164511 100644 --- a/tools/eslint/node_modules/lodash/once.js +++ b/tools/eslint/node_modules/lodash/once.js @@ -7,6 +7,7 @@ var before = require('./before'); * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. diff --git a/tools/eslint/node_modules/lodash/orderBy.js b/tools/eslint/node_modules/lodash/orderBy.js index f1b64f7a29847d..7195c8c737f2fb 100644 --- a/tools/eslint/node_modules/lodash/orderBy.js +++ b/tools/eslint/node_modules/lodash/orderBy.js @@ -9,24 +9,26 @@ var baseOrderBy = require('./_baseOrderBy'), * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, + * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { diff --git a/tools/eslint/node_modules/lodash/over.js b/tools/eslint/node_modules/lodash/over.js index e2a8f45f5cd030..2275bf70d087b7 100644 --- a/tools/eslint/node_modules/lodash/over.js +++ b/tools/eslint/node_modules/lodash/over.js @@ -2,13 +2,15 @@ var arrayMap = require('./_arrayMap'), createOver = require('./_createOver'); /** - * Creates a function that invokes `iteratees` with the arguments provided - * to the created function and returns their results. + * Creates a function that invokes `iteratees` with the arguments it receives + * and returns their results. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} iteratees The iteratees to invoke. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to invoke. * @returns {Function} Returns the new function. * @example * diff --git a/tools/eslint/node_modules/lodash/overArgs.js b/tools/eslint/node_modules/lodash/overArgs.js index 0bb760fde8a1fa..d6a74671792be9 100644 --- a/tools/eslint/node_modules/lodash/overArgs.js +++ b/tools/eslint/node_modules/lodash/overArgs.js @@ -2,6 +2,9 @@ var apply = require('./_apply'), arrayMap = require('./_arrayMap'), baseFlatten = require('./_baseFlatten'), baseIteratee = require('./_baseIteratee'), + baseUnary = require('./_baseUnary'), + isArray = require('./isArray'), + isFlattenableIteratee = require('./_isFlattenableIteratee'), rest = require('./rest'); /* Built-in method references for those with the same name as other `lodash` methods. */ @@ -12,11 +15,12 @@ var nativeMin = Math.min; * corresponding `transforms`. * * @static + * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms] The functions to transform - * arguments, specified individually or in arrays. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [transforms[_.identity]] The functions to transform. * @returns {Function} Returns the new function. * @example * @@ -39,7 +43,9 @@ var nativeMin = Math.min; * // => [100, 10] */ var overArgs = rest(function(func, transforms) { - transforms = arrayMap(baseFlatten(transforms), baseIteratee); + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(baseIteratee)) + : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(baseIteratee)); var funcsLength = transforms.length; return rest(function(args) { diff --git a/tools/eslint/node_modules/lodash/overEvery.js b/tools/eslint/node_modules/lodash/overEvery.js index bad7a5a72699bd..4ea596a7bf9424 100644 --- a/tools/eslint/node_modules/lodash/overEvery.js +++ b/tools/eslint/node_modules/lodash/overEvery.js @@ -3,12 +3,14 @@ var arrayEvery = require('./_arrayEvery'), /** * Creates a function that checks if **all** of the `predicates` return - * truthy when invoked with the arguments provided to the created function. + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} predicates The predicates to check. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [predicates=[_.identity]] The predicates to check. * @returns {Function} Returns the new function. * @example * diff --git a/tools/eslint/node_modules/lodash/overSome.js b/tools/eslint/node_modules/lodash/overSome.js index fb0001b76fad91..55ff733f7e5ddb 100644 --- a/tools/eslint/node_modules/lodash/overSome.js +++ b/tools/eslint/node_modules/lodash/overSome.js @@ -3,12 +3,14 @@ var arraySome = require('./_arraySome'), /** * Creates a function that checks if **any** of the `predicates` return - * truthy when invoked with the arguments provided to the created function. + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ + * @since 4.0.0 * @category Util - * @param {...(Function|Function[])} predicates The predicates to check. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [predicates=[_.identity]] The predicates to check. * @returns {Function} Returns the new function. * @example * diff --git a/tools/eslint/node_modules/lodash/package.json b/tools/eslint/node_modules/lodash/package.json index 5cdb591be5ec06..55a4de95ccd5ce 100644 --- a/tools/eslint/node_modules/lodash/package.json +++ b/tools/eslint/node_modules/lodash/package.json @@ -2,24 +2,24 @@ "_args": [ [ "lodash@^4.0.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "lodash@>=4.0.0 <5.0.0", - "_id": "lodash@4.3.0", + "_id": "lodash@4.11.1", "_inCache": true, "_installable": true, - "_location": "/eslint/lodash", + "_location": "/lodash", "_nodeVersion": "5.5.0", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/lodash-4.3.0.tgz_1454921838929_0.49659619107842445" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/lodash-4.11.1.tgz_1460618480099_0.40750555554404855" }, "_npmUser": { "email": "john.david.dalton@gmail.com", "name": "jdalton" }, - "_npmVersion": "2.14.18", + "_npmVersion": "2.15.3", "_phantomChildren": {}, "_requested": { "name": "lodash", @@ -31,14 +31,14 @@ }, "_requiredBy": [ "/eslint", - "/eslint/inquirer", - "/eslint/table" + "/inquirer", + "/table" ], - "_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", - "_shasum": "efd9c4a6ec53f3b05412429915c3e4824e4d25a4", + "_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz", + "_shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc", "_shrinkwrap": null, "_spec": "lodash@^4.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", @@ -69,8 +69,8 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "efd9c4a6ec53f3b05412429915c3e4824e4d25a4", - "tarball": "http://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz" + "shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc", + "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -86,12 +86,16 @@ "email": "john.david.dalton@gmail.com", "name": "jdalton" }, + { + "email": "justin+npm@ridgewell.name", + "name": "jridgewell" + }, { "email": "mathias@qiwi.be", "name": "mathias" }, { - "email": "blaine@iceddev.com", + "email": "blaine.bublitz@gmail.com", "name": "phated" } ], @@ -105,5 +109,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.3.0" + "version": "4.11.1" } diff --git a/tools/eslint/node_modules/lodash/pad.js b/tools/eslint/node_modules/lodash/pad.js index aaebdb6d11a948..77e1f1c1ab6c7a 100644 --- a/tools/eslint/node_modules/lodash/pad.js +++ b/tools/eslint/node_modules/lodash/pad.js @@ -13,6 +13,7 @@ var nativeCeil = Math.ceil, * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -33,15 +34,16 @@ function pad(string, length, chars) { string = toString(string); length = toInteger(length); - var strLength = stringSize(string); + var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } - var mid = (length - strLength) / 2, - leftLength = nativeFloor(mid), - rightLength = nativeCeil(mid); - - return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars); + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); } module.exports = pad; diff --git a/tools/eslint/node_modules/lodash/padEnd.js b/tools/eslint/node_modules/lodash/padEnd.js index a7240fd5375df1..224eb80e99e168 100644 --- a/tools/eslint/node_modules/lodash/padEnd.js +++ b/tools/eslint/node_modules/lodash/padEnd.js @@ -1,4 +1,6 @@ var createPadding = require('./_createPadding'), + stringSize = require('./_stringSize'), + toInteger = require('./toInteger'), toString = require('./toString'); /** @@ -7,6 +9,7 @@ var createPadding = require('./_createPadding'), * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -25,7 +28,12 @@ var createPadding = require('./_createPadding'), */ function padEnd(string, length, chars) { string = toString(string); - return string + createPadding(string, length, chars); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; } module.exports = padEnd; diff --git a/tools/eslint/node_modules/lodash/padStart.js b/tools/eslint/node_modules/lodash/padStart.js index 52188b17e8b62a..f991866bf36afc 100644 --- a/tools/eslint/node_modules/lodash/padStart.js +++ b/tools/eslint/node_modules/lodash/padStart.js @@ -1,4 +1,6 @@ var createPadding = require('./_createPadding'), + stringSize = require('./_stringSize'), + toInteger = require('./toInteger'), toString = require('./toString'); /** @@ -7,6 +9,7 @@ var createPadding = require('./_createPadding'), * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. @@ -25,7 +28,12 @@ var createPadding = require('./_createPadding'), */ function padStart(string, length, chars) { string = toString(string); - return createPadding(string, length, chars) + string; + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; } module.exports = padStart; diff --git a/tools/eslint/node_modules/lodash/parseInt.js b/tools/eslint/node_modules/lodash/parseInt.js index ae608ce59f949d..fe140f61b13d5b 100644 --- a/tools/eslint/node_modules/lodash/parseInt.js +++ b/tools/eslint/node_modules/lodash/parseInt.js @@ -12,18 +12,19 @@ var nativeParseInt = root.parseInt; /** * 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. + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) - * of `parseInt`. + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ + * @since 1.1.0 * @category String * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * @@ -35,7 +36,7 @@ var nativeParseInt = root.parseInt; */ function parseInt(string, radix, guard) { // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. if (guard || radix == null) { radix = 0; } else if (radix) { diff --git a/tools/eslint/node_modules/lodash/partial.js b/tools/eslint/node_modules/lodash/partial.js index e857ab7d2adbd6..149060e5a72803 100644 --- a/tools/eslint/node_modules/lodash/partial.js +++ b/tools/eslint/node_modules/lodash/partial.js @@ -1,4 +1,5 @@ var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), replaceHolders = require('./_replaceHolders'), rest = require('./rest'); @@ -6,9 +7,9 @@ var createWrapper = require('./_createWrapper'), 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. + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. @@ -18,6 +19,7 @@ var PARTIAL_FLAG = 32; * * @static * @memberOf _ + * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. @@ -38,9 +40,7 @@ var PARTIAL_FLAG = 32; * // => 'hi fred' */ var partial = rest(function(func, partials) { - var placeholder = partial.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(partial)); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); }); diff --git a/tools/eslint/node_modules/lodash/partialRight.js b/tools/eslint/node_modules/lodash/partialRight.js index 4fdb470bc133d2..02d14b9a0572e3 100644 --- a/tools/eslint/node_modules/lodash/partialRight.js +++ b/tools/eslint/node_modules/lodash/partialRight.js @@ -1,4 +1,5 @@ var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), replaceHolders = require('./_replaceHolders'), rest = require('./rest'); @@ -7,7 +8,7 @@ var PARTIAL_RIGHT_FLAG = 64; /** * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. + * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. @@ -17,6 +18,7 @@ var PARTIAL_RIGHT_FLAG = 64; * * @static * @memberOf _ + * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. @@ -37,9 +39,7 @@ var PARTIAL_RIGHT_FLAG = 64; * // => 'hello fred' */ var partialRight = rest(function(func, partials) { - var placeholder = partialRight.placeholder, - holders = replaceHolders(partials, placeholder); - + var holders = replaceHolders(partials, getPlaceholder(partialRight)); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); diff --git a/tools/eslint/node_modules/lodash/partition.js b/tools/eslint/node_modules/lodash/partition.js index b5e0e55d7b70d6..2e30e8b97b5e8a 100644 --- a/tools/eslint/node_modules/lodash/partition.js +++ b/tools/eslint/node_modules/lodash/partition.js @@ -8,9 +8,11 @@ var createAggregator = require('./_createAggregator'); * * @static * @memberOf _ + * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * diff --git a/tools/eslint/node_modules/lodash/pick.js b/tools/eslint/node_modules/lodash/pick.js index 44745755f74619..f85ac4d9fd2391 100644 --- a/tools/eslint/node_modules/lodash/pick.js +++ b/tools/eslint/node_modules/lodash/pick.js @@ -6,11 +6,11 @@ var baseFlatten = require('./_baseFlatten'), * Creates an object composed of the picked `object` properties. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. + * @param {...(string|string[])} [props] The property identifiers to pick. * @returns {Object} Returns the new object. * @example * @@ -20,7 +20,7 @@ var baseFlatten = require('./_baseFlatten'), * // => { 'a': 1, 'c': 3 } */ var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, baseFlatten(props)); + return object == null ? {} : basePick(object, baseFlatten(props, 1)); }); module.exports = pick; diff --git a/tools/eslint/node_modules/lodash/pickBy.js b/tools/eslint/node_modules/lodash/pickBy.js index 611859eff18f27..d355442c9e4d41 100644 --- a/tools/eslint/node_modules/lodash/pickBy.js +++ b/tools/eslint/node_modules/lodash/pickBy.js @@ -7,9 +7,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -19,7 +21,7 @@ var baseIteratee = require('./_baseIteratee'), * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, baseIteratee(predicate, 2)); + return object == null ? {} : basePickBy(object, baseIteratee(predicate)); } module.exports = pickBy; diff --git a/tools/eslint/node_modules/lodash/plant.js b/tools/eslint/node_modules/lodash/plant.js index d01b191cecfa9f..23776f3238bd37 100644 --- a/tools/eslint/node_modules/lodash/plant.js +++ b/tools/eslint/node_modules/lodash/plant.js @@ -2,10 +2,11 @@ var baseLodash = require('./_baseLodash'), wrapperClone = require('./_wrapperClone'); /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. + * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ + * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. diff --git a/tools/eslint/node_modules/lodash/property.js b/tools/eslint/node_modules/lodash/property.js index 54e95eb6a81540..0abbe380dc10c6 100644 --- a/tools/eslint/node_modules/lodash/property.js +++ b/tools/eslint/node_modules/lodash/property.js @@ -7,20 +7,21 @@ var baseProperty = require('./_baseProperty'), * * @static * @memberOf _ + * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new function. * @example * * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } * ]; * - * _.map(objects, _.property('a.b.c')); + * _.map(objects, _.property('a.b')); * // => [2, 1] * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { diff --git a/tools/eslint/node_modules/lodash/propertyOf.js b/tools/eslint/node_modules/lodash/propertyOf.js index 667430e72a8fa2..13bdbbb7bbd65a 100644 --- a/tools/eslint/node_modules/lodash/propertyOf.js +++ b/tools/eslint/node_modules/lodash/propertyOf.js @@ -6,6 +6,7 @@ var baseGet = require('./_baseGet'); * * @static * @memberOf _ + * @since 3.0.0 * @category Util * @param {Object} object The object to query. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/pull.js b/tools/eslint/node_modules/lodash/pull.js index c2f6c1e316be84..f5846fbc196059 100644 --- a/tools/eslint/node_modules/lodash/pull.js +++ b/tools/eslint/node_modules/lodash/pull.js @@ -6,10 +6,12 @@ var pullAll = require('./pullAll'), * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * - * **Note:** Unlike `_.without`, this method mutates `array`. + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. diff --git a/tools/eslint/node_modules/lodash/pullAll.js b/tools/eslint/node_modules/lodash/pullAll.js index 4eecae61381000..d6ce1bf80ef3bc 100644 --- a/tools/eslint/node_modules/lodash/pullAll.js +++ b/tools/eslint/node_modules/lodash/pullAll.js @@ -7,6 +7,7 @@ var basePullAll = require('./_basePullAll'); * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. diff --git a/tools/eslint/node_modules/lodash/pullAllBy.js b/tools/eslint/node_modules/lodash/pullAllBy.js index 7d732e70ce7260..7192650c371054 100644 --- a/tools/eslint/node_modules/lodash/pullAllBy.js +++ b/tools/eslint/node_modules/lodash/pullAllBy.js @@ -1,19 +1,21 @@ var baseIteratee = require('./_baseIteratee'), - basePullAllBy = require('./_basePullAllBy'); + basePullAll = require('./_basePullAll'); /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * @@ -25,7 +27,7 @@ var baseIteratee = require('./_baseIteratee'), */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) - ? basePullAllBy(array, values, baseIteratee(iteratee)) + ? basePullAll(array, values, baseIteratee(iteratee)) : array; } diff --git a/tools/eslint/node_modules/lodash/pullAllWith.js b/tools/eslint/node_modules/lodash/pullAllWith.js new file mode 100644 index 00000000000000..1d2fd9f941cb0e --- /dev/null +++ b/tools/eslint/node_modules/lodash/pullAllWith.js @@ -0,0 +1,32 @@ +var basePullAll = require('./_basePullAll'); + +/** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ +function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; +} + +module.exports = pullAllWith; diff --git a/tools/eslint/node_modules/lodash/pullAt.js b/tools/eslint/node_modules/lodash/pullAt.js index 5938c056663298..c312aa1bb930d2 100644 --- a/tools/eslint/node_modules/lodash/pullAt.js +++ b/tools/eslint/node_modules/lodash/pullAt.js @@ -13,10 +13,10 @@ var arrayMap = require('./_arrayMap'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified individually or in arrays. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * @@ -30,7 +30,7 @@ var arrayMap = require('./_arrayMap'), * // => [10, 20] */ var pullAt = rest(function(array, indexes) { - indexes = arrayMap(baseFlatten(indexes), String); + indexes = arrayMap(baseFlatten(indexes, 1), String); var result = baseAt(array, indexes); basePullAt(array, indexes.sort(compareAscending)); diff --git a/tools/eslint/node_modules/lodash/random.js b/tools/eslint/node_modules/lodash/random.js index 2c5895b33f50dc..22e92594c0efb7 100644 --- a/tools/eslint/node_modules/lodash/random.js +++ b/tools/eslint/node_modules/lodash/random.js @@ -12,14 +12,15 @@ var nativeMin = Math.min, /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are floats, - * a floating-point number is returned instead of an integer. + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ + * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. diff --git a/tools/eslint/node_modules/lodash/range.js b/tools/eslint/node_modules/lodash/range.js index 231c2bc1d20459..0b1907964ceae9 100644 --- a/tools/eslint/node_modules/lodash/range.js +++ b/tools/eslint/node_modules/lodash/range.js @@ -3,13 +3,14 @@ var createRange = require('./_createRange'); /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified + * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. diff --git a/tools/eslint/node_modules/lodash/rangeRight.js b/tools/eslint/node_modules/lodash/rangeRight.js index 67c2fffa0d62f0..fc580da4f63f9a 100644 --- a/tools/eslint/node_modules/lodash/rangeRight.js +++ b/tools/eslint/node_modules/lodash/rangeRight.js @@ -6,6 +6,7 @@ var createRange = require('./_createRange'); * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. diff --git a/tools/eslint/node_modules/lodash/rearg.js b/tools/eslint/node_modules/lodash/rearg.js index 1fc204afd064eb..6648ec834eb60c 100644 --- a/tools/eslint/node_modules/lodash/rearg.js +++ b/tools/eslint/node_modules/lodash/rearg.js @@ -7,16 +7,16 @@ 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 + * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ + * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified individually or in arrays. + * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * @@ -28,7 +28,7 @@ var REARG_FLAG = 256; * // => ['a', 'b', 'c'] */ var rearg = rest(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); + return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); }); module.exports = rearg; diff --git a/tools/eslint/node_modules/lodash/reduce.js b/tools/eslint/node_modules/lodash/reduce.js index 98da3ff0a2219d..3fdfd04ecb4a46 100644 --- a/tools/eslint/node_modules/lodash/reduce.js +++ b/tools/eslint/node_modules/lodash/reduce.js @@ -6,9 +6,9 @@ var arrayReduce = require('./_arrayReduce'), /** * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive + * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not given the first element of `collection` is used as the initial + * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -21,6 +21,7 @@ var arrayReduce = require('./_arrayReduce'), * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. diff --git a/tools/eslint/node_modules/lodash/reduceRight.js b/tools/eslint/node_modules/lodash/reduceRight.js index af62c6c191d242..992b661eb38fd3 100644 --- a/tools/eslint/node_modules/lodash/reduceRight.js +++ b/tools/eslint/node_modules/lodash/reduceRight.js @@ -10,6 +10,7 @@ var arrayReduceRight = require('./_arrayReduceRight'), * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. diff --git a/tools/eslint/node_modules/lodash/reject.js b/tools/eslint/node_modules/lodash/reject.js index 81ea0dd552dbe2..92165abb9bbdd1 100644 --- a/tools/eslint/node_modules/lodash/reject.js +++ b/tools/eslint/node_modules/lodash/reject.js @@ -9,9 +9,11 @@ var arrayFilter = require('./_arrayFilter'), * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @example * diff --git a/tools/eslint/node_modules/lodash/remove.js b/tools/eslint/node_modules/lodash/remove.js index bf513906735c16..ef3d68187d52cd 100644 --- a/tools/eslint/node_modules/lodash/remove.js +++ b/tools/eslint/node_modules/lodash/remove.js @@ -3,16 +3,19 @@ var baseIteratee = require('./_baseIteratee'), /** * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked with - * three arguments: (value, index, array). + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). * - * **Note:** Unlike `_.filter`, this method mutates `array`. + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. * * @static * @memberOf _ + * @since 2.0.0 * @category Array * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * diff --git a/tools/eslint/node_modules/lodash/repeat.js b/tools/eslint/node_modules/lodash/repeat.js index d2a9cd29ff8d73..f4d8c69a0553db 100644 --- a/tools/eslint/node_modules/lodash/repeat.js +++ b/tools/eslint/node_modules/lodash/repeat.js @@ -1,20 +1,18 @@ -var toInteger = require('./toInteger'), +var baseRepeat = require('./_baseRepeat'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'), toString = require('./toString'); -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor; - /** * Repeats the given string `n` times. * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * @@ -27,25 +25,13 @@ var nativeFloor = Math.floor; * _.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; +function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); } - // 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; + return baseRepeat(toString(string), n); } module.exports = repeat; diff --git a/tools/eslint/node_modules/lodash/replace.js b/tools/eslint/node_modules/lodash/replace.js index 908d6a62370c97..1d113e70a95122 100644 --- a/tools/eslint/node_modules/lodash/replace.js +++ b/tools/eslint/node_modules/lodash/replace.js @@ -1,12 +1,20 @@ var toString = require('./toString'); +/** Used for built-in method references. */ +var stringProto = String.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeReplace = stringProto.replace; + /** * Replaces matches for `pattern` in `string` with `replacement`. * - * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. @@ -21,7 +29,7 @@ function replace() { var args = arguments, string = toString(args[0]); - return args.length < 3 ? string : string.replace(args[1], args[2]); + return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]); } module.exports = replace; diff --git a/tools/eslint/node_modules/lodash/rest.js b/tools/eslint/node_modules/lodash/rest.js index 40856aeee9c5f0..ddb732694734c6 100644 --- a/tools/eslint/node_modules/lodash/rest.js +++ b/tools/eslint/node_modules/lodash/rest.js @@ -9,12 +9,15 @@ 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. + * created function and arguments from `start` and beyond provided as + * an array. * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. diff --git a/tools/eslint/node_modules/lodash/result.js b/tools/eslint/node_modules/lodash/result.js index 99b7f1bacd8965..6a4c9d941cabfe 100644 --- a/tools/eslint/node_modules/lodash/result.js +++ b/tools/eslint/node_modules/lodash/result.js @@ -1,20 +1,19 @@ -var baseToPath = require('./_baseToPath'), - get = require('./get'), +var castPath = require('./_castPath'), isFunction = require('./isFunction'), - isKey = require('./_isKey'), - parent = require('./_parent'); + isKey = require('./_isKey'); /** - * This method is like `_.get` except that if the resolved value is a function - * it's invoked with the `this` binding of its parent object and its result - * is returned. + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * @@ -33,17 +32,25 @@ var baseToPath = require('./_baseToPath'), * // => 'default' */ function result(object, path, defaultValue) { - if (!isKey(path, object)) { - path = baseToPath(path); - var result = get(object, path); - object = parent(object, path); - } else { - result = object == null ? undefined : object[path]; + path = isKey(path, object) ? [path] : castPath(path); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + object = undefined; + length = 1; } - if (result === undefined) { - result = defaultValue; + while (++index < length) { + var value = object == null ? undefined : object[path[index]]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; } - return isFunction(result) ? result.call(object) : result; + return object; } module.exports = result; diff --git a/tools/eslint/node_modules/lodash/reverse.js b/tools/eslint/node_modules/lodash/reverse.js index 049284911db289..d56699706ce582 100644 --- a/tools/eslint/node_modules/lodash/reverse.js +++ b/tools/eslint/node_modules/lodash/reverse.js @@ -13,7 +13,9 @@ var nativeReverse = arrayProto.reverse; * * @static * @memberOf _ + * @since 4.0.0 * @category Array + * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/round.js b/tools/eslint/node_modules/lodash/round.js index c5f1f85e6c869a..fccc83101e79b1 100644 --- a/tools/eslint/node_modules/lodash/round.js +++ b/tools/eslint/node_modules/lodash/round.js @@ -5,6 +5,7 @@ var createRound = require('./_createRound'); * * @static * @memberOf _ + * @since 3.10.0 * @category Math * @param {number} number The number to round. * @param {number} [precision=0] The precision to round to. diff --git a/tools/eslint/node_modules/lodash/sample.js b/tools/eslint/node_modules/lodash/sample.js index 1a4d813695f6df..aff8e77d06b51e 100644 --- a/tools/eslint/node_modules/lodash/sample.js +++ b/tools/eslint/node_modules/lodash/sample.js @@ -7,6 +7,7 @@ var baseRandom = require('./_baseRandom'), * * @static * @memberOf _ + * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. diff --git a/tools/eslint/node_modules/lodash/sampleSize.js b/tools/eslint/node_modules/lodash/sampleSize.js index 47e7b116e394ef..29df2e6f222a0e 100644 --- a/tools/eslint/node_modules/lodash/sampleSize.js +++ b/tools/eslint/node_modules/lodash/sampleSize.js @@ -1,5 +1,6 @@ var baseClamp = require('./_baseClamp'), baseRandom = require('./_baseRandom'), + isIterateeCall = require('./_isIterateeCall'), toArray = require('./toArray'), toInteger = require('./toInteger'); @@ -9,9 +10,11 @@ var baseClamp = require('./_baseClamp'), * * @static * @memberOf _ + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. - * @param {number} [n=0] The number of elements to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * @@ -21,13 +24,17 @@ var baseClamp = require('./_baseClamp'), * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ -function sampleSize(collection, n) { +function sampleSize(collection, n, guard) { var index = -1, result = toArray(collection), length = result.length, lastIndex = length - 1; - n = baseClamp(toInteger(n), 0, length); + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = baseClamp(toInteger(n), 0, length); + } while (++index < n) { var rand = baseRandom(index, lastIndex), value = result[rand]; diff --git a/tools/eslint/node_modules/lodash/seq.js b/tools/eslint/node_modules/lodash/seq.js index 15aac5a1696e6b..1570c2db7b3843 100644 --- a/tools/eslint/node_modules/lodash/seq.js +++ b/tools/eslint/node_modules/lodash/seq.js @@ -2,7 +2,6 @@ module.exports = { 'at': require('./wrapperAt'), 'chain': require('./chain'), 'commit': require('./commit'), - 'flatMap': require('./wrapperFlatMap'), 'lodash': require('./wrapperLodash'), 'next': require('./next'), 'plant': require('./plant'), diff --git a/tools/eslint/node_modules/lodash/set.js b/tools/eslint/node_modules/lodash/set.js index 9777731d4fb5fa..d6630027f12964 100644 --- a/tools/eslint/node_modules/lodash/set.js +++ b/tools/eslint/node_modules/lodash/set.js @@ -1,7 +1,7 @@ var baseSet = require('./_baseSet'); /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. @@ -10,6 +10,7 @@ var baseSet = require('./_baseSet'); * * @static * @memberOf _ + * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. @@ -23,7 +24,7 @@ var baseSet = require('./_baseSet'); * console.log(object.a[0].b.c); * // => 4 * - * _.set(object, 'x[0].y.z', 5); + * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ diff --git a/tools/eslint/node_modules/lodash/setWith.js b/tools/eslint/node_modules/lodash/setWith.js index a1a03ccc034949..fb3e0f65a7e1be 100644 --- a/tools/eslint/node_modules/lodash/setWith.js +++ b/tools/eslint/node_modules/lodash/setWith.js @@ -10,6 +10,7 @@ var baseSet = require('./_baseSet'); * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. @@ -18,8 +19,10 @@ var baseSet = require('./_baseSet'); * @returns {Object} Returns `object`. * @example * - * _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); - * // => { '0': { '1': { '2': 3 }, 'length': 2 } } + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; diff --git a/tools/eslint/node_modules/lodash/shuffle.js b/tools/eslint/node_modules/lodash/shuffle.js index c7abdf25071f5a..88d00cefe38ccd 100644 --- a/tools/eslint/node_modules/lodash/shuffle.js +++ b/tools/eslint/node_modules/lodash/shuffle.js @@ -9,6 +9,7 @@ var MAX_ARRAY_LENGTH = 4294967295; * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. diff --git a/tools/eslint/node_modules/lodash/size.js b/tools/eslint/node_modules/lodash/size.js index fbe2b3b66e349a..2e414ab47ee179 100644 --- a/tools/eslint/node_modules/lodash/size.js +++ b/tools/eslint/node_modules/lodash/size.js @@ -1,14 +1,21 @@ -var isArrayLike = require('./isArrayLike'), +var getTag = require('./_getTag'), + isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'), isString = require('./isString'), keys = require('./keys'), stringSize = require('./_stringSize'); +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + /** * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. + * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @returns {number} Returns the collection size. @@ -31,6 +38,12 @@ function size(collection) { var result = collection.length; return (result && isString(collection)) ? stringSize(collection) : result; } + if (isObjectLike(collection)) { + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + } return keys(collection).length; } diff --git a/tools/eslint/node_modules/lodash/slice.js b/tools/eslint/node_modules/lodash/slice.js index 324b8391a1f478..ac8cb7546e6091 100644 --- a/tools/eslint/node_modules/lodash/slice.js +++ b/tools/eslint/node_modules/lodash/slice.js @@ -5,11 +5,13 @@ var baseSlice = require('./_baseSlice'), /** * Creates a slice of `array` from `start` up to, but not including, `end`. * - * **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) - * to ensure dense arrays are returned. + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. diff --git a/tools/eslint/node_modules/lodash/snakeCase.js b/tools/eslint/node_modules/lodash/snakeCase.js index 5bfafdf04fec1c..27f2a76764767b 100644 --- a/tools/eslint/node_modules/lodash/snakeCase.js +++ b/tools/eslint/node_modules/lodash/snakeCase.js @@ -1,10 +1,12 @@ var createCompounder = require('./_createCompounder'); /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. @@ -16,7 +18,7 @@ var createCompounder = require('./_createCompounder'); * _.snakeCase('fooBar'); * // => 'foo_bar' * - * _.snakeCase('--foo-bar'); + * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { diff --git a/tools/eslint/node_modules/lodash/some.js b/tools/eslint/node_modules/lodash/some.js index 7b17e0f3e6c871..eeb7c18ad218d4 100644 --- a/tools/eslint/node_modules/lodash/some.js +++ b/tools/eslint/node_modules/lodash/some.js @@ -11,11 +11,14 @@ var arraySome = require('./_arraySome'), * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); diff --git a/tools/eslint/node_modules/lodash/sortBy.js b/tools/eslint/node_modules/lodash/sortBy.js index 96cbdb2c6bf24d..c6d40bbb702644 100644 --- a/tools/eslint/node_modules/lodash/sortBy.js +++ b/tools/eslint/node_modules/lodash/sortBy.js @@ -1,40 +1,43 @@ var baseFlatten = require('./_baseFlatten'), baseOrderBy = require('./_baseOrderBy'), + isArray = require('./isArray'), + isFlattenableIteratee = require('./_isFlattenableIteratee'), isIterateeCall = require('./_isIterateeCall'), rest = require('./rest'); /** * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method + * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, + * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] * * _.sortBy(users, 'user', function(o) { * return Math.floor(o.age / 10); * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ var sortBy = rest(function(collection, iteratees) { if (collection == null) { @@ -44,9 +47,13 @@ var sortBy = rest(function(collection, iteratees) { if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees.length = 1; + iteratees = [iteratees[0]]; } - return baseOrderBy(collection, baseFlatten(iteratees), []); + iteratees = (iteratees.length == 1 && isArray(iteratees[0])) + ? iteratees[0] + : baseFlatten(iteratees, 1, isFlattenableIteratee); + + return baseOrderBy(collection, iteratees, []); }); module.exports = sortBy; diff --git a/tools/eslint/node_modules/lodash/sortedIndex.js b/tools/eslint/node_modules/lodash/sortedIndex.js index bdb217d81a5a7d..044a57e563a245 100644 --- a/tools/eslint/node_modules/lodash/sortedIndex.js +++ b/tools/eslint/node_modules/lodash/sortedIndex.js @@ -1,15 +1,17 @@ var baseSortedIndex = require('./_baseSortedIndex'); /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * _.sortedIndex([30, 50], 40); diff --git a/tools/eslint/node_modules/lodash/sortedIndexBy.js b/tools/eslint/node_modules/lodash/sortedIndexBy.js index f3230e10f83116..df05972a3fe2af 100644 --- a/tools/eslint/node_modules/lodash/sortedIndexBy.js +++ b/tools/eslint/node_modules/lodash/sortedIndexBy.js @@ -8,11 +8,14 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; diff --git a/tools/eslint/node_modules/lodash/sortedIndexOf.js b/tools/eslint/node_modules/lodash/sortedIndexOf.js index 7a6caa1200e6d3..2c534d324ed510 100644 --- a/tools/eslint/node_modules/lodash/sortedIndexOf.js +++ b/tools/eslint/node_modules/lodash/sortedIndexOf.js @@ -7,6 +7,7 @@ var baseSortedIndex = require('./_baseSortedIndex'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. diff --git a/tools/eslint/node_modules/lodash/sortedLastIndex.js b/tools/eslint/node_modules/lodash/sortedLastIndex.js index ee679af5769092..919089f4a5a1f4 100644 --- a/tools/eslint/node_modules/lodash/sortedLastIndex.js +++ b/tools/eslint/node_modules/lodash/sortedLastIndex.js @@ -7,10 +7,12 @@ var baseSortedIndex = require('./_baseSortedIndex'); * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * _.sortedLastIndex([4, 5], 4); diff --git a/tools/eslint/node_modules/lodash/sortedLastIndexBy.js b/tools/eslint/node_modules/lodash/sortedLastIndexBy.js index 6517498773dc2b..74e8d7acbfee43 100644 --- a/tools/eslint/node_modules/lodash/sortedLastIndexBy.js +++ b/tools/eslint/node_modules/lodash/sortedLastIndexBy.js @@ -8,11 +8,14 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * * // The `_.property` iteratee shorthand. diff --git a/tools/eslint/node_modules/lodash/sortedLastIndexOf.js b/tools/eslint/node_modules/lodash/sortedLastIndexOf.js index 5604448837690b..80234de2d04cca 100644 --- a/tools/eslint/node_modules/lodash/sortedLastIndexOf.js +++ b/tools/eslint/node_modules/lodash/sortedLastIndexOf.js @@ -7,6 +7,7 @@ var baseSortedIndex = require('./_baseSortedIndex'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to search. * @param {*} value The value to search for. diff --git a/tools/eslint/node_modules/lodash/sortedUniq.js b/tools/eslint/node_modules/lodash/sortedUniq.js index 6d9b5ba17582d7..866db311e4e968 100644 --- a/tools/eslint/node_modules/lodash/sortedUniq.js +++ b/tools/eslint/node_modules/lodash/sortedUniq.js @@ -6,6 +6,7 @@ var baseSortedUniq = require('./_baseSortedUniq'); * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. diff --git a/tools/eslint/node_modules/lodash/sortedUniqBy.js b/tools/eslint/node_modules/lodash/sortedUniqBy.js index c3aa5c9c6ddf65..b7105922704b44 100644 --- a/tools/eslint/node_modules/lodash/sortedUniqBy.js +++ b/tools/eslint/node_modules/lodash/sortedUniqBy.js @@ -7,6 +7,7 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. diff --git a/tools/eslint/node_modules/lodash/split.js b/tools/eslint/node_modules/lodash/split.js index 6fe9ed102106b3..0718e3fb62d5fd 100644 --- a/tools/eslint/node_modules/lodash/split.js +++ b/tools/eslint/node_modules/lodash/split.js @@ -1,12 +1,28 @@ -var toString = require('./toString'); +var castSlice = require('./_castSlice'), + isIterateeCall = require('./_isIterateeCall'), + isRegExp = require('./isRegExp'), + reHasComplexSymbol = require('./_reHasComplexSymbol'), + stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** Used for built-in method references. */ +var stringProto = String.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeSplit = stringProto.split; /** * Splits `string` by `separator`. * - * **Note:** This method is based on [`String#split`](https://mdn.io/String/split). + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. @@ -18,7 +34,24 @@ var toString = require('./toString'); * // => ['a', 'b'] */ function split(string, separator, limit) { - return toString(string).split(separator, limit); + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return nativeSplit.call(string, separator, limit); } module.exports = split; diff --git a/tools/eslint/node_modules/lodash/spread.js b/tools/eslint/node_modules/lodash/spread.js index ea25908367bf4f..9d32bb96edf1dc 100644 --- a/tools/eslint/node_modules/lodash/spread.js +++ b/tools/eslint/node_modules/lodash/spread.js @@ -1,5 +1,6 @@ var apply = require('./_apply'), arrayPush = require('./_arrayPush'), + castSlice = require('./_castSlice'), rest = require('./rest'), toInteger = require('./toInteger'); @@ -10,13 +11,16 @@ var FUNC_ERROR_TEXT = 'Expected a function'; var nativeMax = Math.max; /** - * 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). + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). * - * **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator). + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ + * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. @@ -47,7 +51,7 @@ function spread(func, start) { start = start === undefined ? 0 : nativeMax(toInteger(start), 0); return rest(function(args) { var array = args[start], - otherArgs = args.slice(0, start); + otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); diff --git a/tools/eslint/node_modules/lodash/startCase.js b/tools/eslint/node_modules/lodash/startCase.js index 33013357db46f1..a48f21ce9b3ddf 100644 --- a/tools/eslint/node_modules/lodash/startCase.js +++ b/tools/eslint/node_modules/lodash/startCase.js @@ -1,27 +1,29 @@ -var capitalize = require('./capitalize'), - createCompounder = require('./_createCompounder'); +var createCompounder = require('./_createCompounder'), + upperFirst = require('./upperFirst'); /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ + * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * - * _.startCase('--foo-bar'); + * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + capitalize(word); + return result + (index ? ' ' : '') + upperFirst(word); }); module.exports = startCase; diff --git a/tools/eslint/node_modules/lodash/startsWith.js b/tools/eslint/node_modules/lodash/startsWith.js index a7c170e55c76d8..367fbecae225f4 100644 --- a/tools/eslint/node_modules/lodash/startsWith.js +++ b/tools/eslint/node_modules/lodash/startsWith.js @@ -7,11 +7,13 @@ var baseClamp = require('./_baseClamp'), * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. * @example * * _.startsWith('abc', 'a'); diff --git a/tools/eslint/node_modules/lodash/subtract.js b/tools/eslint/node_modules/lodash/subtract.js index 9ce53f2a36e2c8..bd4086a0085bab 100644 --- a/tools/eslint/node_modules/lodash/subtract.js +++ b/tools/eslint/node_modules/lodash/subtract.js @@ -1,8 +1,11 @@ +var createMathOperation = require('./_createMathOperation'); + /** * Subtract two numbers. * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {number} minuend The first number in a subtraction. * @param {number} subtrahend The second number in a subtraction. @@ -12,18 +15,8 @@ * _.subtract(6, 4); * // => 2 */ -function subtract(minuend, subtrahend) { - var result; - if (minuend === undefined && subtrahend === undefined) { - return 0; - } - if (minuend !== undefined) { - result = minuend; - } - if (subtrahend !== undefined) { - result = result === undefined ? subtrahend : (result - subtrahend); - } - return result; -} +var subtract = createMathOperation(function(minuend, subtrahend) { + return minuend - subtrahend; +}); module.exports = subtract; diff --git a/tools/eslint/node_modules/lodash/sum.js b/tools/eslint/node_modules/lodash/sum.js index 339dd72cd7efd5..3b07ee40e77d0b 100644 --- a/tools/eslint/node_modules/lodash/sum.js +++ b/tools/eslint/node_modules/lodash/sum.js @@ -6,6 +6,7 @@ var baseSum = require('./_baseSum'), * * @static * @memberOf _ + * @since 3.4.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. diff --git a/tools/eslint/node_modules/lodash/sumBy.js b/tools/eslint/node_modules/lodash/sumBy.js index 9078f6aea236ae..ce73c844908beb 100644 --- a/tools/eslint/node_modules/lodash/sumBy.js +++ b/tools/eslint/node_modules/lodash/sumBy.js @@ -8,9 +8,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {number} Returns the sum. * @example * diff --git a/tools/eslint/node_modules/lodash/tail.js b/tools/eslint/node_modules/lodash/tail.js index a8bd9c671543dd..459a8a379365ab 100644 --- a/tools/eslint/node_modules/lodash/tail.js +++ b/tools/eslint/node_modules/lodash/tail.js @@ -5,6 +5,7 @@ var drop = require('./drop'); * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. diff --git a/tools/eslint/node_modules/lodash/take.js b/tools/eslint/node_modules/lodash/take.js index 21b22a4e019262..b7da712ffe5549 100644 --- a/tools/eslint/node_modules/lodash/take.js +++ b/tools/eslint/node_modules/lodash/take.js @@ -6,10 +6,11 @@ var baseSlice = require('./_baseSlice'), * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/takeRight.js b/tools/eslint/node_modules/lodash/takeRight.js index c8deb057c50c41..b11fb34add5e7a 100644 --- a/tools/eslint/node_modules/lodash/takeRight.js +++ b/tools/eslint/node_modules/lodash/takeRight.js @@ -6,10 +6,11 @@ var baseSlice = require('./_baseSlice'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/takeRightWhile.js b/tools/eslint/node_modules/lodash/takeRightWhile.js index 1662edcb6ad06d..1d497506187cfe 100644 --- a/tools/eslint/node_modules/lodash/takeRightWhile.js +++ b/tools/eslint/node_modules/lodash/takeRightWhile.js @@ -3,14 +3,16 @@ var baseIteratee = require('./_baseIteratee'), /** * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with three - * arguments: (value, index, array). + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/takeWhile.js b/tools/eslint/node_modules/lodash/takeWhile.js index b1fa18b048f0c3..1283755923637c 100644 --- a/tools/eslint/node_modules/lodash/takeWhile.js +++ b/tools/eslint/node_modules/lodash/takeWhile.js @@ -8,9 +8,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * diff --git a/tools/eslint/node_modules/lodash/tap.js b/tools/eslint/node_modules/lodash/tap.js index a3e43a0d33b91c..d00728525ee69c 100644 --- a/tools/eslint/node_modules/lodash/tap.js +++ b/tools/eslint/node_modules/lodash/tap.js @@ -1,10 +1,11 @@ /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain in order to modify intermediate results. + * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ + * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. diff --git a/tools/eslint/node_modules/lodash/template.js b/tools/eslint/node_modules/lodash/template.js index c09fcde87de9b3..304d287259a8e6 100644 --- a/tools/eslint/node_modules/lodash/template.js +++ b/tools/eslint/node_modules/lodash/template.js @@ -15,7 +15,10 @@ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; -/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ +/** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to ensure capturing order of template delimiters. */ @@ -29,7 +32,7 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is given it takes precedence over `_.templateSettings` values. + * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) @@ -42,17 +45,24 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static + * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] 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} [guard] Enables use as an iteratee for functions like `_.map`. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * @@ -101,7 +111,7 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; * // Use the `sourceURL` option to specify a custom sourceURL for the template. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * compiled(data); - * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector + * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. * * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); @@ -121,7 +131,8 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; * '); */ function template(string, options, guard) { - // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/) + // Based on John Resig's `tmpl` implementation + // (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = templateSettings.imports._.templateSettings || templateSettings; @@ -210,7 +221,8 @@ function template(string, options, guard) { 'return __p\n}'; var result = attempt(function() { - return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); + return Function(importsKeys, sourceURL + 'return ' + source) + .apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or diff --git a/tools/eslint/node_modules/lodash/templateSettings.js b/tools/eslint/node_modules/lodash/templateSettings.js index 67dc19b4cdbd5d..bce2f749c10a72 100644 --- a/tools/eslint/node_modules/lodash/templateSettings.js +++ b/tools/eslint/node_modules/lodash/templateSettings.js @@ -10,7 +10,7 @@ var escape = require('./escape'), * * @static * @memberOf _ - * @type Object + * @type {Object} */ var templateSettings = { @@ -18,7 +18,7 @@ var templateSettings = { * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'escape': reEscape, @@ -26,7 +26,7 @@ var templateSettings = { * Used to detect code to be evaluated. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'evaluate': reEvaluate, @@ -34,7 +34,7 @@ var templateSettings = { * Used to detect `data` property values to inject. * * @memberOf _.templateSettings - * @type RegExp + * @type {RegExp} */ 'interpolate': reInterpolate, @@ -42,7 +42,7 @@ var templateSettings = { * Used to reference the data object in the template text. * * @memberOf _.templateSettings - * @type string + * @type {string} */ 'variable': '', @@ -50,7 +50,7 @@ var templateSettings = { * Used to import variables into the compiled template. * * @memberOf _.templateSettings - * @type Object + * @type {Object} */ 'imports': { @@ -58,7 +58,7 @@ var templateSettings = { * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports - * @type Function + * @type {Function} */ '_': { 'escape': escape } } diff --git a/tools/eslint/node_modules/lodash/throttle.js b/tools/eslint/node_modules/lodash/throttle.js index ff7dc7579e3beb..d2018859676213 100644 --- a/tools/eslint/node_modules/lodash/throttle.js +++ b/tools/eslint/node_modules/lodash/throttle.js @@ -14,23 +14,24 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the throttled function is - * invoked more than once during the `wait` timeout. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. + * @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 * @@ -55,7 +56,11 @@ function throttle(func, wait, options) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } - return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); } module.exports = throttle; diff --git a/tools/eslint/node_modules/lodash/thru.js b/tools/eslint/node_modules/lodash/thru.js index 190d7552bb375a..91e132e52cff00 100644 --- a/tools/eslint/node_modules/lodash/thru.js +++ b/tools/eslint/node_modules/lodash/thru.js @@ -1,10 +1,11 @@ /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain. + * results in a method chain sequence. * * @static * @memberOf _ + * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. diff --git a/tools/eslint/node_modules/lodash/times.js b/tools/eslint/node_modules/lodash/times.js index b7ede33bd42d18..d0bff577ab240f 100644 --- a/tools/eslint/node_modules/lodash/times.js +++ b/tools/eslint/node_modules/lodash/times.js @@ -1,5 +1,5 @@ -var baseTimes = require('./_baseTimes'), - toFunction = require('./_toFunction'), +var baseIteratee = require('./_baseIteratee'), + baseTimes = require('./_baseTimes'), toInteger = require('./toInteger'); /** Used as references for various `Number` constants. */ @@ -12,10 +12,11 @@ var MAX_ARRAY_LENGTH = 4294967295; var nativeMin = Math.min; /** - * Invokes the iteratee function `n` times, returning an array of the results - * of each invocation. The iteratee is invoked with one argument; (index). + * Invokes the iteratee `n` times, returning an array of the results of + * each invocation. The iteratee is invoked with one argument; (index). * * @static + * @since 0.1.0 * @memberOf _ * @category Util * @param {number} n The number of times to invoke `iteratee`. @@ -37,7 +38,7 @@ function times(n, iteratee) { var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); - iteratee = toFunction(iteratee); + iteratee = baseIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, iteratee); diff --git a/tools/eslint/node_modules/lodash/toArray.js b/tools/eslint/node_modules/lodash/toArray.js index c342289194395a..6675806bb4dba3 100644 --- a/tools/eslint/node_modules/lodash/toArray.js +++ b/tools/eslint/node_modules/lodash/toArray.js @@ -20,6 +20,7 @@ var iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'sym * Converts `value` to an array. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. diff --git a/tools/eslint/node_modules/lodash/toInteger.js b/tools/eslint/node_modules/lodash/toInteger.js index 2b5060875da25d..459f0c3710bcdc 100644 --- a/tools/eslint/node_modules/lodash/toInteger.js +++ b/tools/eslint/node_modules/lodash/toInteger.js @@ -7,10 +7,12 @@ var INFINITY = 1 / 0, /** * Converts `value` to an integer. * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. diff --git a/tools/eslint/node_modules/lodash/toIterator.js b/tools/eslint/node_modules/lodash/toIterator.js index c50c4d17b4ce77..beeed5d55c668c 100644 --- a/tools/eslint/node_modules/lodash/toIterator.js +++ b/tools/eslint/node_modules/lodash/toIterator.js @@ -3,6 +3,7 @@ * * @name Symbol.iterator * @memberOf _ + * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example diff --git a/tools/eslint/node_modules/lodash/toLength.js b/tools/eslint/node_modules/lodash/toLength.js index c1d64ca2d0de3d..9d415145016687 100644 --- a/tools/eslint/node_modules/lodash/toLength.js +++ b/tools/eslint/node_modules/lodash/toLength.js @@ -8,10 +8,12 @@ var MAX_ARRAY_LENGTH = 4294967295; * Converts `value` to an integer suitable for use as the length of an * array-like object. * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. diff --git a/tools/eslint/node_modules/lodash/toLower.js b/tools/eslint/node_modules/lodash/toLower.js index 02111c709a0db2..b4b7858eb03992 100644 --- a/tools/eslint/node_modules/lodash/toLower.js +++ b/tools/eslint/node_modules/lodash/toLower.js @@ -1,17 +1,19 @@ var toString = require('./toString'); /** - * Converts `string`, as a whole, to lower case. + * Converts `string`, as a whole, to lower case just like + * [String#toLowerCase](https://mdn.io/toLowerCase). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * - * _.toLower('--Foo-Bar'); - * // => '--foo-bar' + * _.toLower('--Foo-Bar--'); + * // => '--foo-bar--' * * _.toLower('fooBar'); * // => 'foobar' diff --git a/tools/eslint/node_modules/lodash/toNumber.js b/tools/eslint/node_modules/lodash/toNumber.js index 8fc0a78d7aed53..9baba7059229c8 100644 --- a/tools/eslint/node_modules/lodash/toNumber.js +++ b/tools/eslint/node_modules/lodash/toNumber.js @@ -1,5 +1,6 @@ var isFunction = require('./isFunction'), - isObject = require('./isObject'); + isObject = require('./isObject'), + isSymbol = require('./isSymbol'); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; @@ -24,6 +25,7 @@ var freeParseInt = parseInt; * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. @@ -42,6 +44,12 @@ var freeParseInt = parseInt; * // => 3 */ function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } if (isObject(value)) { var other = isFunction(value.valueOf) ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; diff --git a/tools/eslint/node_modules/lodash/toPairs.js b/tools/eslint/node_modules/lodash/toPairs.js index 8c6e4d0b0dec35..417ac8ce9cb9a1 100644 --- a/tools/eslint/node_modules/lodash/toPairs.js +++ b/tools/eslint/node_modules/lodash/toPairs.js @@ -2,10 +2,13 @@ var baseToPairs = require('./_baseToPairs'), keys = require('./keys'); /** - * Creates an array of own enumerable key-value pairs for `object`. + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. * * @static * @memberOf _ + * @since 4.0.0 + * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the new array of key-value pairs. diff --git a/tools/eslint/node_modules/lodash/toPairsIn.js b/tools/eslint/node_modules/lodash/toPairsIn.js index a6f882bc45a5ea..b84ef7e94645e8 100644 --- a/tools/eslint/node_modules/lodash/toPairsIn.js +++ b/tools/eslint/node_modules/lodash/toPairsIn.js @@ -2,10 +2,13 @@ var baseToPairs = require('./_baseToPairs'), keysIn = require('./keysIn'); /** - * Creates an array of own and inherited enumerable key-value pairs for `object`. + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. * * @static * @memberOf _ + * @since 4.0.0 + * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the new array of key-value pairs. diff --git a/tools/eslint/node_modules/lodash/toPath.js b/tools/eslint/node_modules/lodash/toPath.js index 270698deff6c44..e2dc7ae7ef5a58 100644 --- a/tools/eslint/node_modules/lodash/toPath.js +++ b/tools/eslint/node_modules/lodash/toPath.js @@ -1,12 +1,16 @@ var arrayMap = require('./_arrayMap'), + copyArray = require('./_copyArray'), isArray = require('./isArray'), - stringToPath = require('./_stringToPath'); + isSymbol = require('./isSymbol'), + stringToPath = require('./_stringToPath'), + toKey = require('./_toKey'); /** * Converts `value` to a property path array. * * @static * @memberOf _ + * @since 4.0.0 * @category Util * @param {*} value The value to convert. * @returns {Array} Returns the new property path array. @@ -28,7 +32,10 @@ var arrayMap = require('./_arrayMap'), * // => false */ function toPath(value) { - return isArray(value) ? arrayMap(value, String) : stringToPath(value); + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(value)); } module.exports = toPath; diff --git a/tools/eslint/node_modules/lodash/toPlainObject.js b/tools/eslint/node_modules/lodash/toPlainObject.js index ec6eb699fdd14b..5de79b8b3cd9a7 100644 --- a/tools/eslint/node_modules/lodash/toPlainObject.js +++ b/tools/eslint/node_modules/lodash/toPlainObject.js @@ -2,11 +2,12 @@ var copyObject = require('./_copyObject'), keysIn = require('./keysIn'); /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ + * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. diff --git a/tools/eslint/node_modules/lodash/toSafeInteger.js b/tools/eslint/node_modules/lodash/toSafeInteger.js index 6350b76e936e3e..475874fbffda11 100644 --- a/tools/eslint/node_modules/lodash/toSafeInteger.js +++ b/tools/eslint/node_modules/lodash/toSafeInteger.js @@ -10,6 +10,7 @@ var MAX_SAFE_INTEGER = 9007199254740991; * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. diff --git a/tools/eslint/node_modules/lodash/toString.js b/tools/eslint/node_modules/lodash/toString.js index 1e1d2d8f421532..2b29ab18f416c8 100644 --- a/tools/eslint/node_modules/lodash/toString.js +++ b/tools/eslint/node_modules/lodash/toString.js @@ -6,14 +6,15 @@ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = Symbol ? symbolProto.toString : undefined; + symbolToString = symbolProto ? symbolProto.toString : undefined; /** - * 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. + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. @@ -37,7 +38,7 @@ function toString(value) { return ''; } if (isSymbol(value)) { - return Symbol ? symbolToString.call(value) : ''; + return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; diff --git a/tools/eslint/node_modules/lodash/toUpper.js b/tools/eslint/node_modules/lodash/toUpper.js index 3746142cd1bd4d..b3648e8bf9cd44 100644 --- a/tools/eslint/node_modules/lodash/toUpper.js +++ b/tools/eslint/node_modules/lodash/toUpper.js @@ -1,17 +1,19 @@ var toString = require('./toString'); /** - * Converts `string`, as a whole, to upper case. + * Converts `string`, as a whole, to upper case just like + * [String#toUpperCase](https://mdn.io/toUpperCase). * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * - * _.toUpper('--foo-bar'); - * // => '--FOO-BAR' + * _.toUpper('--foo-bar--'); + * // => '--FOO-BAR--' * * _.toUpper('fooBar'); * // => 'FOOBAR' diff --git a/tools/eslint/node_modules/lodash/transform.js b/tools/eslint/node_modules/lodash/transform.js index 3aa48edb464690..3013a83cb2d161 100644 --- a/tools/eslint/node_modules/lodash/transform.js +++ b/tools/eslint/node_modules/lodash/transform.js @@ -2,6 +2,7 @@ var arrayEach = require('./_arrayEach'), baseCreate = require('./_baseCreate'), baseForOwn = require('./_baseForOwn'), baseIteratee = require('./_baseIteratee'), + getPrototype = require('./_getPrototype'), isArray = require('./isArray'), isFunction = require('./isFunction'), isObject = require('./isObject'), @@ -9,14 +10,15 @@ var arrayEach = require('./_arrayEach'), /** * 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 invoked with four arguments: - * (accumulator, value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. The iteratee is invoked + * with four arguments: (accumulator, value, key, object). Iteratee functions + * may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ + * @since 1.3.0 * @category Object * @param {Array|Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. @@ -45,7 +47,7 @@ function transform(object, iteratee, accumulator) { if (isArr) { accumulator = isArray(object) ? new Ctor : []; } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } } else { accumulator = {}; diff --git a/tools/eslint/node_modules/lodash/trim.js b/tools/eslint/node_modules/lodash/trim.js index 47f73b686c7d87..ed086523d7ef40 100644 --- a/tools/eslint/node_modules/lodash/trim.js +++ b/tools/eslint/node_modules/lodash/trim.js @@ -1,4 +1,5 @@ -var charsEndIndex = require('./_charsEndIndex'), +var castSlice = require('./_castSlice'), + charsEndIndex = require('./_charsEndIndex'), charsStartIndex = require('./_charsStartIndex'), stringToArray = require('./_stringToArray'), toString = require('./toString'); @@ -11,10 +12,11 @@ var reTrim = /^\s+|\s+$/g; * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -35,14 +37,15 @@ function trim(string, chars, guard) { if (guard || chars === undefined) { return string.replace(reTrim, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars); + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; - return strSymbols.slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1).join(''); + return castSlice(strSymbols, start, end).join(''); } module.exports = trim; diff --git a/tools/eslint/node_modules/lodash/trimEnd.js b/tools/eslint/node_modules/lodash/trimEnd.js index 743dc41c9dc9aa..c86302c49d0941 100644 --- a/tools/eslint/node_modules/lodash/trimEnd.js +++ b/tools/eslint/node_modules/lodash/trimEnd.js @@ -1,4 +1,5 @@ -var charsEndIndex = require('./_charsEndIndex'), +var castSlice = require('./_castSlice'), + charsEndIndex = require('./_charsEndIndex'), stringToArray = require('./_stringToArray'), toString = require('./toString'); @@ -10,10 +11,11 @@ var reTrimEnd = /\s+$/; * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -31,12 +33,13 @@ function trimEnd(string, chars, guard) { if (guard || chars === undefined) { return string.replace(reTrimEnd, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } - var strSymbols = stringToArray(string); - return strSymbols.slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1).join(''); + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); } module.exports = trimEnd; diff --git a/tools/eslint/node_modules/lodash/trimStart.js b/tools/eslint/node_modules/lodash/trimStart.js index cdd3b6a99bde7a..bf7111a587a79d 100644 --- a/tools/eslint/node_modules/lodash/trimStart.js +++ b/tools/eslint/node_modules/lodash/trimStart.js @@ -1,4 +1,5 @@ -var charsStartIndex = require('./_charsStartIndex'), +var castSlice = require('./_castSlice'), + charsStartIndex = require('./_charsStartIndex'), stringToArray = require('./_stringToArray'), toString = require('./toString'); @@ -10,10 +11,11 @@ var reTrimStart = /^\s+/; * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -31,12 +33,13 @@ function trimStart(string, chars, guard) { if (guard || chars === undefined) { return string.replace(reTrimStart, ''); } - chars = (chars + ''); - if (!chars) { + if (!(chars += '')) { return string; } - var strSymbols = stringToArray(string); - return strSymbols.slice(charsStartIndex(strSymbols, stringToArray(chars))).join(''); + var strSymbols = stringToArray(string), + start = charsStartIndex(strSymbols, stringToArray(chars)); + + return castSlice(strSymbols, start).join(''); } module.exports = trimStart; diff --git a/tools/eslint/node_modules/lodash/truncate.js b/tools/eslint/node_modules/lodash/truncate.js index 18b1c39c8152d6..473cacbeb35542 100644 --- a/tools/eslint/node_modules/lodash/truncate.js +++ b/tools/eslint/node_modules/lodash/truncate.js @@ -1,5 +1,7 @@ -var isObject = require('./isObject'), +var castSlice = require('./_castSlice'), + isObject = require('./isObject'), isRegExp = require('./isRegExp'), + reHasComplexSymbol = require('./_reHasComplexSymbol'), stringSize = require('./_stringSize'), stringToArray = require('./_stringToArray'), toInteger = require('./toInteger'), @@ -12,18 +14,6 @@ var DEFAULT_TRUNC_LENGTH = 30, /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - /** * Truncates `string` if it's longer than the given maximum string length. * The last characters of the truncated string are replaced with the omission @@ -31,9 +21,10 @@ var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to truncate. - * @param {Object} [options] The options object. + * @param {Object} [options={}] The options object. * @param {number} [options.length=30] The maximum string length. * @param {string} [options.omission='...'] The string to indicate text is omitted. * @param {RegExp|string} [options.separator] The separator pattern to truncate to. @@ -84,7 +75,7 @@ function truncate(string, options) { return omission; } var result = strSymbols - ? strSymbols.slice(0, end).join('') + ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); if (separator === undefined) { diff --git a/tools/eslint/node_modules/lodash/unary.js b/tools/eslint/node_modules/lodash/unary.js index c18ebd8cdef0a2..34c144c5dad247 100644 --- a/tools/eslint/node_modules/lodash/unary.js +++ b/tools/eslint/node_modules/lodash/unary.js @@ -6,6 +6,7 @@ var ary = require('./ary'); * * @static * @memberOf _ + * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new function. diff --git a/tools/eslint/node_modules/lodash/unescape.js b/tools/eslint/node_modules/lodash/unescape.js index 046893366d4c26..929bb1675d7c0c 100644 --- a/tools/eslint/node_modules/lodash/unescape.js +++ b/tools/eslint/node_modules/lodash/unescape.js @@ -7,14 +7,15 @@ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their - * corresponding characters. + * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to + * their corresponding characters. * - * **Note:** No other HTML entities are unescaped. To unescape additional HTML - * entities use a third-party library like [_he_](https://mths.be/he). + * **Note:** No other HTML entities are unescaped. To unescape additional + * HTML entities use a third-party library like [_he_](https://mths.be/he). * * @static * @memberOf _ + * @since 0.6.0 * @category String * @param {string} [string=''] The string to unescape. * @returns {string} Returns the unescaped string. diff --git a/tools/eslint/node_modules/lodash/union.js b/tools/eslint/node_modules/lodash/union.js index fafe1885e2cad0..1276c886a2de75 100644 --- a/tools/eslint/node_modules/lodash/union.js +++ b/tools/eslint/node_modules/lodash/union.js @@ -1,5 +1,6 @@ var baseFlatten = require('./_baseFlatten'), baseUniq = require('./_baseUniq'), + isArrayLikeObject = require('./isArrayLikeObject'), rest = require('./rest'); /** @@ -9,6 +10,7 @@ var baseFlatten = require('./_baseFlatten'), * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. @@ -18,7 +20,7 @@ var baseFlatten = require('./_baseFlatten'), * // => [2, 1, 4] */ var union = rest(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); module.exports = union; diff --git a/tools/eslint/node_modules/lodash/unionBy.js b/tools/eslint/node_modules/lodash/unionBy.js index 26050bcd4f785f..f44340cb0748c9 100644 --- a/tools/eslint/node_modules/lodash/unionBy.js +++ b/tools/eslint/node_modules/lodash/unionBy.js @@ -7,14 +7,17 @@ var baseFlatten = require('./_baseFlatten'), /** * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * @@ -30,7 +33,7 @@ var unionBy = rest(function(arrays) { if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, false, true), baseIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee)); }); module.exports = unionBy; diff --git a/tools/eslint/node_modules/lodash/unionWith.js b/tools/eslint/node_modules/lodash/unionWith.js index 1eca729069e44a..dad71f9f3756a1 100644 --- a/tools/eslint/node_modules/lodash/unionWith.js +++ b/tools/eslint/node_modules/lodash/unionWith.js @@ -11,6 +11,7 @@ var baseFlatten = require('./_baseFlatten'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. @@ -28,7 +29,7 @@ var unionWith = rest(function(arrays) { if (isArrayLikeObject(comparator)) { comparator = undefined; } - return baseUniq(baseFlatten(arrays, false, true), undefined, comparator); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); module.exports = unionWith; diff --git a/tools/eslint/node_modules/lodash/uniq.js b/tools/eslint/node_modules/lodash/uniq.js index fcaec4e4fc2770..0e99ee932b9995 100644 --- a/tools/eslint/node_modules/lodash/uniq.js +++ b/tools/eslint/node_modules/lodash/uniq.js @@ -3,11 +3,12 @@ var baseUniq = require('./_baseUniq'); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. + * for equality comparisons, in which only the first occurrence of each + * element is kept. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. diff --git a/tools/eslint/node_modules/lodash/uniqBy.js b/tools/eslint/node_modules/lodash/uniqBy.js index 4fc843b8a41c2c..91cf9e06328d62 100644 --- a/tools/eslint/node_modules/lodash/uniqBy.js +++ b/tools/eslint/node_modules/lodash/uniqBy.js @@ -8,9 +8,11 @@ var baseIteratee = require('./_baseIteratee'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * diff --git a/tools/eslint/node_modules/lodash/uniqWith.js b/tools/eslint/node_modules/lodash/uniqWith.js index 5bef1515048635..957c17d6a9684c 100644 --- a/tools/eslint/node_modules/lodash/uniqWith.js +++ b/tools/eslint/node_modules/lodash/uniqWith.js @@ -7,6 +7,7 @@ var baseUniq = require('./_baseUniq'); * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. diff --git a/tools/eslint/node_modules/lodash/uniqueId.js b/tools/eslint/node_modules/lodash/uniqueId.js index a39b2bcbe2b5a1..ffa8c034722f51 100644 --- a/tools/eslint/node_modules/lodash/uniqueId.js +++ b/tools/eslint/node_modules/lodash/uniqueId.js @@ -4,12 +4,13 @@ var toString = require('./toString'); var idCounter = 0; /** - * Generates a unique ID. If `prefix` is given the ID is appended to it. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static + * @since 0.1.0 * @memberOf _ * @category Util - * @param {string} [prefix] The value to prefix the ID with. + * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * diff --git a/tools/eslint/node_modules/lodash/unset.js b/tools/eslint/node_modules/lodash/unset.js index 91daee09d539b5..723c3d44b2c9ad 100644 --- a/tools/eslint/node_modules/lodash/unset.js +++ b/tools/eslint/node_modules/lodash/unset.js @@ -7,6 +7,7 @@ var baseUnset = require('./_baseUnset'); * * @static * @memberOf _ + * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. @@ -20,7 +21,7 @@ var baseUnset = require('./_baseUnset'); * console.log(object); * // => { 'a': [{ 'b': {} }] }; * - * _.unset(object, 'a[0].b.c'); + * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); diff --git a/tools/eslint/node_modules/lodash/unzip.js b/tools/eslint/node_modules/lodash/unzip.js index 0dddd4447bbd3e..7990d26e85091d 100644 --- a/tools/eslint/node_modules/lodash/unzip.js +++ b/tools/eslint/node_modules/lodash/unzip.js @@ -14,6 +14,7 @@ var nativeMax = Math.max; * * @static * @memberOf _ + * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. diff --git a/tools/eslint/node_modules/lodash/unzipWith.js b/tools/eslint/node_modules/lodash/unzipWith.js index b8f5d5e7ec74c1..926c8993d904bf 100644 --- a/tools/eslint/node_modules/lodash/unzipWith.js +++ b/tools/eslint/node_modules/lodash/unzipWith.js @@ -9,9 +9,11 @@ var apply = require('./_apply'), * * @static * @memberOf _ + * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine regrouped values. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * diff --git a/tools/eslint/node_modules/lodash/update.js b/tools/eslint/node_modules/lodash/update.js new file mode 100644 index 00000000000000..b90098e6da98ca --- /dev/null +++ b/tools/eslint/node_modules/lodash/update.js @@ -0,0 +1,35 @@ +var baseUpdate = require('./_baseUpdate'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ +function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); +} + +module.exports = update; diff --git a/tools/eslint/node_modules/lodash/updateWith.js b/tools/eslint/node_modules/lodash/updateWith.js new file mode 100644 index 00000000000000..a2f4a2cfbf1142 --- /dev/null +++ b/tools/eslint/node_modules/lodash/updateWith.js @@ -0,0 +1,33 @@ +var baseUpdate = require('./_baseUpdate'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ +function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); +} + +module.exports = updateWith; diff --git a/tools/eslint/node_modules/lodash/upperCase.js b/tools/eslint/node_modules/lodash/upperCase.js index e09737ffcf89dc..efbb8b06cf4c9e 100644 --- a/tools/eslint/node_modules/lodash/upperCase.js +++ b/tools/eslint/node_modules/lodash/upperCase.js @@ -5,6 +5,7 @@ var createCompounder = require('./_createCompounder'); * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. diff --git a/tools/eslint/node_modules/lodash/upperFirst.js b/tools/eslint/node_modules/lodash/upperFirst.js index 14d74d5c379ecb..1dd64e13561334 100644 --- a/tools/eslint/node_modules/lodash/upperFirst.js +++ b/tools/eslint/node_modules/lodash/upperFirst.js @@ -5,6 +5,7 @@ var createCaseFirst = require('./_createCaseFirst'); * * @static * @memberOf _ + * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. diff --git a/tools/eslint/node_modules/lodash/values.js b/tools/eslint/node_modules/lodash/values.js index 70915b59561fb6..738260bcb74a90 100644 --- a/tools/eslint/node_modules/lodash/values.js +++ b/tools/eslint/node_modules/lodash/values.js @@ -2,11 +2,12 @@ var baseValues = require('./_baseValues'), keys = require('./keys'); /** - * Creates an array of the own enumerable property values of `object`. + * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static + * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. diff --git a/tools/eslint/node_modules/lodash/valuesIn.js b/tools/eslint/node_modules/lodash/valuesIn.js index 2e8b8ba8e49e7b..6296094207986f 100644 --- a/tools/eslint/node_modules/lodash/valuesIn.js +++ b/tools/eslint/node_modules/lodash/valuesIn.js @@ -2,12 +2,14 @@ var baseValues = require('./_baseValues'), keysIn = require('./keysIn'); /** - * Creates an array of the own and inherited enumerable property values of `object`. + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. @@ -24,7 +26,7 @@ var baseValues = require('./_baseValues'), * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { - return object == null ? baseValues(object, keysIn(object)) : []; + return object == null ? [] : baseValues(object, keysIn(object)); } module.exports = valuesIn; diff --git a/tools/eslint/node_modules/lodash/without.js b/tools/eslint/node_modules/lodash/without.js index b7dea5d5cc003f..0900f232ff7c79 100644 --- a/tools/eslint/node_modules/lodash/without.js +++ b/tools/eslint/node_modules/lodash/without.js @@ -9,6 +9,7 @@ var baseDifference = require('./_baseDifference'), * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {Array} array The array to filter. * @param {...*} [values] The values to exclude. diff --git a/tools/eslint/node_modules/lodash/words.js b/tools/eslint/node_modules/lodash/words.js index 20ea44987cf78d..9f4b55b39276c6 100644 --- a/tools/eslint/node_modules/lodash/words.js +++ b/tools/eslint/node_modules/lodash/words.js @@ -1,5 +1,8 @@ var toString = require('./toString'); +/** Used to match non-compound words composed of alphanumeric characters. */ +var reBasicWord = /[a-zA-Z0-9]+/g; + /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', @@ -15,7 +18,8 @@ var rsAstralRange = '\\ud800-\\udfff', rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; /** Used to compose unicode capture groups. */ -var rsBreak = '[' + rsBreakRange + ']', +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', @@ -32,37 +36,37 @@ var rsBreak = '[' + rsBreakRange + ']', /** Used to compose unicode regexes. */ var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; -/** Used to match non-compound words composed of alphanumeric characters. */ -var reBasicWord = /[a-zA-Z0-9]+/g; - /** Used to match complex or compound words. */ var reComplexWord = RegExp([ - rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', - rsUpper + '?' + rsLowerMisc + '+', - rsUpper + '+', + rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, + rsUpper + '+' + rsOptUpperContr, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings that need a more robust regexp to match words. */ -var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; +var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** * Splits `string` into an array of its words. * * @static * @memberOf _ + * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * diff --git a/tools/eslint/node_modules/lodash/wrap.js b/tools/eslint/node_modules/lodash/wrap.js index 51dcf2fee6b0fb..9a4542de31c5dd 100644 --- a/tools/eslint/node_modules/lodash/wrap.js +++ b/tools/eslint/node_modules/lodash/wrap.js @@ -9,9 +9,10 @@ var identity = require('./identity'), * * @static * @memberOf _ + * @since 0.1.0 * @category Function * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. + * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * diff --git a/tools/eslint/node_modules/lodash/wrapperAt.js b/tools/eslint/node_modules/lodash/wrapperAt.js index ce06e72b983c83..119089453c0087 100644 --- a/tools/eslint/node_modules/lodash/wrapperAt.js +++ b/tools/eslint/node_modules/lodash/wrapperAt.js @@ -11,9 +11,9 @@ var LazyWrapper = require('./_LazyWrapper'), * * @name at * @memberOf _ + * @since 1.0.0 * @category Seq - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. + * @param {...(string|string[])} [paths] The property paths of elements to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * @@ -26,17 +26,22 @@ var LazyWrapper = require('./_LazyWrapper'), * // => ['a', 'c'] */ var wrapperAt = rest(function(paths) { - paths = baseFlatten(paths); + paths = baseFlatten(paths, 1); var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; - if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); diff --git a/tools/eslint/node_modules/lodash/wrapperChain.js b/tools/eslint/node_modules/lodash/wrapperChain.js index 52f85319c861ba..bda2ce69c97c1f 100644 --- a/tools/eslint/node_modules/lodash/wrapperChain.js +++ b/tools/eslint/node_modules/lodash/wrapperChain.js @@ -1,10 +1,11 @@ var chain = require('./chain'); /** - * Enables explicit method chaining on the wrapper object. + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ + * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example diff --git a/tools/eslint/node_modules/lodash/wrapperFlatMap.js b/tools/eslint/node_modules/lodash/wrapperFlatMap.js deleted file mode 100644 index 4c2f85b08710ae..00000000000000 --- a/tools/eslint/node_modules/lodash/wrapperFlatMap.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This method is the wrapper version of `_.flatMap`. - * - * @name flatMap - * @memberOf _ - * @category Seq - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _([1, 2]).flatMap(duplicate).value(); - * // => [1, 1, 2, 2] - */ -function wrapperFlatMap(iteratee) { - return this.map(iteratee).flatten(); -} - -module.exports = wrapperFlatMap; diff --git a/tools/eslint/node_modules/lodash/wrapperLodash.js b/tools/eslint/node_modules/lodash/wrapperLodash.js index 3c38eb9cba4b97..717ff8e3ef835e 100644 --- a/tools/eslint/node_modules/lodash/wrapperLodash.js +++ b/tools/eslint/node_modules/lodash/wrapperLodash.js @@ -13,25 +13,25 @@ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. @@ -50,51 +50,55 @@ var hasOwnProperty = objectProto.hasOwnProperty; * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, - * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, - * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, - * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, - * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, - * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, - * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, - * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, - * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, - * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, - * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, - * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, - * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, - * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`, * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, - * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, - * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, - * `upperCase`, `upperFirst`, `value`, and `words` + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` * * @name _ * @constructor @@ -136,5 +140,6 @@ function lodash(value) { // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; +lodash.prototype.constructor = lodash; module.exports = lodash; diff --git a/tools/eslint/node_modules/lodash/wrapperReverse.js b/tools/eslint/node_modules/lodash/wrapperReverse.js index 51d44b9ba8824d..e93112a21acea3 100644 --- a/tools/eslint/node_modules/lodash/wrapperReverse.js +++ b/tools/eslint/node_modules/lodash/wrapperReverse.js @@ -10,6 +10,7 @@ var LazyWrapper = require('./_LazyWrapper'), * * @name reverse * @memberOf _ + * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example @@ -30,7 +31,11 @@ function wrapperReverse() { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); - wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); diff --git a/tools/eslint/node_modules/lodash/wrapperValue.js b/tools/eslint/node_modules/lodash/wrapperValue.js index e04329a0395414..f56c2dadedbf29 100644 --- a/tools/eslint/node_modules/lodash/wrapperValue.js +++ b/tools/eslint/node_modules/lodash/wrapperValue.js @@ -1,10 +1,11 @@ var baseWrapperValue = require('./_baseWrapperValue'); /** - * Executes the chained sequence to extract the unwrapped value. + * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ + * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. diff --git a/tools/eslint/node_modules/lodash/xor.js b/tools/eslint/node_modules/lodash/xor.js index e92eee2e07ad46..7ec0c295afec21 100644 --- a/tools/eslint/node_modules/lodash/xor.js +++ b/tools/eslint/node_modules/lodash/xor.js @@ -4,11 +4,14 @@ var arrayFilter = require('./_arrayFilter'), rest = require('./rest'); /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. * * @static * @memberOf _ + * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of values. diff --git a/tools/eslint/node_modules/lodash/xorBy.js b/tools/eslint/node_modules/lodash/xorBy.js index ec905845bcba65..efb977d2127efd 100644 --- a/tools/eslint/node_modules/lodash/xorBy.js +++ b/tools/eslint/node_modules/lodash/xorBy.js @@ -7,14 +7,17 @@ var arrayFilter = require('./_arrayFilter'), /** * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. * @returns {Array} Returns the new array of values. * @example * diff --git a/tools/eslint/node_modules/lodash/xorWith.js b/tools/eslint/node_modules/lodash/xorWith.js index f35bc7abde5fea..d1335b837a2356 100644 --- a/tools/eslint/node_modules/lodash/xorWith.js +++ b/tools/eslint/node_modules/lodash/xorWith.js @@ -11,6 +11,7 @@ var arrayFilter = require('./_arrayFilter'), * * @static * @memberOf _ + * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. diff --git a/tools/eslint/node_modules/lodash/zip.js b/tools/eslint/node_modules/lodash/zip.js index 2300a2bfd03fb0..e1cbbbbc518b27 100644 --- a/tools/eslint/node_modules/lodash/zip.js +++ b/tools/eslint/node_modules/lodash/zip.js @@ -2,12 +2,13 @@ var rest = require('./rest'), 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. + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. * * @static * @memberOf _ + * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. diff --git a/tools/eslint/node_modules/lodash/zipObject.js b/tools/eslint/node_modules/lodash/zipObject.js index 11c160ff69fc7d..23fdf1417d1d52 100644 --- a/tools/eslint/node_modules/lodash/zipObject.js +++ b/tools/eslint/node_modules/lodash/zipObject.js @@ -3,12 +3,13 @@ var assignValue = require('./_assignValue'), /** * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property names and one of corresponding values. + * one of property identifiers and one of corresponding values. * * @static * @memberOf _ + * @since 0.4.0 * @category Array - * @param {Array} [props=[]] The property names. + * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example diff --git a/tools/eslint/node_modules/lodash/zipObjectDeep.js b/tools/eslint/node_modules/lodash/zipObjectDeep.js index 09eb541c53021c..7c858f844f4910 100644 --- a/tools/eslint/node_modules/lodash/zipObjectDeep.js +++ b/tools/eslint/node_modules/lodash/zipObjectDeep.js @@ -6,8 +6,9 @@ var baseSet = require('./_baseSet'), * * @static * @memberOf _ + * @since 4.1.0 * @category Array - * @param {Array} [props=[]] The property names. + * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example diff --git a/tools/eslint/node_modules/lodash/zipWith.js b/tools/eslint/node_modules/lodash/zipWith.js index d1d4bf3e55b40d..d01b6388c5b906 100644 --- a/tools/eslint/node_modules/lodash/zipWith.js +++ b/tools/eslint/node_modules/lodash/zipWith.js @@ -8,6 +8,7 @@ var rest = require('./rest'), * * @static * @memberOf _ + * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine grouped values. diff --git a/tools/eslint/node_modules/minimatch/package.json b/tools/eslint/node_modules/minimatch/package.json index ce3be5e2602daa..a1ba807325590d 100644 --- a/tools/eslint/node_modules/minimatch/package.json +++ b/tools/eslint/node_modules/minimatch/package.json @@ -2,14 +2,14 @@ "_args": [ [ "minimatch@2 || 3", - "/Users/trott/test/node_modules/eslint/node_modules/glob" + "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob" ] ], "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "_id": "minimatch@3.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/minimatch", + "_location": "/minimatch", "_nodeVersion": "4.0.0", "_npmUser": { "email": "isaacs@npmjs.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/glob", - "/eslint/rimraf/glob" + "/glob", + "/globby/glob" ], "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", "_shrinkwrap": null, "_spec": "minimatch@2 || 3", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/glob", + "_where": "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", @@ -53,7 +53,7 @@ "directories": {}, "dist": { "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" }, "engines": { "node": "*" diff --git a/tools/eslint/node_modules/minimist/example/parse.js b/tools/eslint/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8ee8f5ef..00000000000000 --- a/tools/eslint/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/tools/eslint/node_modules/minimist/index.js b/tools/eslint/node_modules/minimist/index.js index a5793ceccec488..584f551a6da734 100644 --- a/tools/eslint/node_modules/minimist/index.js +++ b/tools/eslint/node_modules/minimist/index.js @@ -1,16 +1,16 @@ module.exports = function (args, opts) { if (!opts) opts = {}; - + var flags = { bools : {}, strings : {} }; - + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); - + [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; }); - + var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); @@ -20,14 +20,14 @@ module.exports = function (args, opts) { })); }); }); - + var defaults = opts['default'] || {}; - + var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); - + var notFlags = []; if (args.indexOf('--') !== -1) { @@ -40,15 +40,15 @@ module.exports = function (args, opts) { ? Number(val) : val ; setKey(argv, key.split('.'), value); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } - + for (var i = 0; i < args.length; i++) { var arg = args[i]; - + if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: @@ -79,23 +79,23 @@ module.exports = function (args, opts) { } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); - + var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); - + if (next === '-') { setArg(letters[j], next) continue; } - + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next); broken = true; break; } - + if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2)); broken = true; @@ -105,7 +105,7 @@ module.exports = function (args, opts) { setArg(letters[j], flags.strings[letters[j]] ? '' : true); } } - + var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) @@ -129,17 +129,17 @@ module.exports = function (args, opts) { ); } } - + Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); - + notFlags.forEach(function(key) { argv._.push(key); }); @@ -163,7 +163,7 @@ function setKey (obj, keys, value) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); - + var key = keys[keys.length - 1]; if (o[key] === undefined || typeof o[key] === 'boolean') { o[key] = value; diff --git a/tools/eslint/node_modules/minimist/package.json b/tools/eslint/node_modules/minimist/package.json index ff82eed7c13b9a..e5c12e88ac92cc 100644 --- a/tools/eslint/node_modules/minimist/package.json +++ b/tools/eslint/node_modules/minimist/package.json @@ -2,14 +2,14 @@ "_args": [ [ "minimist@0.0.8", - "/Users/trott/test/node_modules/eslint/node_modules/mkdirp" + "/Users/trott/io.js/tools/node_modules/mkdirp" ] ], "_from": "minimist@0.0.8", "_id": "minimist@0.0.8", "_inCache": true, "_installable": true, - "_location": "/eslint/minimist", + "_location": "/minimist", "_npmUser": { "email": "mail@substack.net", "name": "substack" @@ -25,13 +25,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/mkdirp" + "/mkdirp" ], "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", "_shrinkwrap": null, "_spec": "minimist@0.0.8", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/mkdirp", + "_where": "/Users/trott/io.js/tools/node_modules/mkdirp", "author": { "email": "mail@substack.net", "name": "James Halliday", @@ -49,7 +49,7 @@ "directories": {}, "dist": { "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "tarball": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" }, "homepage": "https://github.com/substack/minimist", "keywords": [ diff --git a/tools/eslint/node_modules/minimist/test/dash.js b/tools/eslint/node_modules/minimist/test/dash.js deleted file mode 100644 index 8b034b99a9eace..00000000000000 --- a/tools/eslint/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,24 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); diff --git a/tools/eslint/node_modules/minimist/test/default_bool.js b/tools/eslint/node_modules/minimist/test/default_bool.js deleted file mode 100644 index f0041ee40cd05f..00000000000000 --- a/tools/eslint/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); diff --git a/tools/eslint/node_modules/minimist/test/dotted.js b/tools/eslint/node_modules/minimist/test/dotted.js deleted file mode 100644 index ef0ae349bf3bf5..00000000000000 --- a/tools/eslint/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); diff --git a/tools/eslint/node_modules/minimist/test/long.js b/tools/eslint/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09d3b64c..00000000000000 --- a/tools/eslint/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/tools/eslint/node_modules/minimist/test/parse.js b/tools/eslint/node_modules/minimist/test/parse.js deleted file mode 100644 index 47e92237fb0bbc..00000000000000 --- a/tools/eslint/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,318 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/tools/eslint/node_modules/minimist/test/parse_modified.js b/tools/eslint/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index 7c4c2abe397797..00000000000000 --- a/tools/eslint/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: ['123'] }); -}); diff --git a/tools/eslint/node_modules/minimist/test/short.js b/tools/eslint/node_modules/minimist/test/short.js deleted file mode 100644 index ac18880f1eb50c..00000000000000 --- a/tools/eslint/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/tools/eslint/node_modules/minimist/test/whitespace.js b/tools/eslint/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58cecfd7a..00000000000000 --- a/tools/eslint/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/tools/eslint/node_modules/mkdirp/.travis.yml b/tools/eslint/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 74c57bf15e2391..00000000000000 --- a/tools/eslint/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/tools/eslint/node_modules/mkdirp/examples/pow.js b/tools/eslint/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e6924212e6a244..00000000000000 --- a/tools/eslint/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/tools/eslint/node_modules/mkdirp/package.json b/tools/eslint/node_modules/mkdirp/package.json index 4adbeb98dd6054..b30b978d477ed1 100644 --- a/tools/eslint/node_modules/mkdirp/package.json +++ b/tools/eslint/node_modules/mkdirp/package.json @@ -2,14 +2,14 @@ "_args": [ [ "mkdirp@^0.5.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "mkdirp@>=0.5.0 <0.6.0", "_id": "mkdirp@0.5.1", "_inCache": true, "_installable": true, - "_location": "/eslint/mkdirp", + "_location": "/mkdirp", "_nodeVersion": "2.0.0", "_npmUser": { "email": "substack@gmail.com", @@ -27,13 +27,13 @@ }, "_requiredBy": [ "/eslint", - "/eslint/write" + "/write" ], "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", "_shrinkwrap": null, "_spec": "mkdirp@^0.5.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "mail@substack.net", "name": "James Halliday", @@ -56,7 +56,7 @@ "directories": {}, "dist": { "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + "tarball": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" }, "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", "homepage": "https://github.com/substack/node-mkdirp#readme", diff --git a/tools/eslint/node_modules/mkdirp/test/chmod.js b/tools/eslint/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 6a404b932f941f..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); -var _0744 = parseInt('0744', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = _0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = _0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/clobber.js b/tools/eslint/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 2433b9ad548557..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, _0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/mkdirp.js b/tools/eslint/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index 1983e70941fb0e..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('woo', function (t) { - t.plan(5); - 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 file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/opts_fs.js b/tools/eslint/node_modules/mkdirp/test/opts_fs.js deleted file mode 100644 index 7da51ec25a3f32..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/opts_fs.js +++ /dev/null @@ -1,29 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs', function (t) { - t.plan(5); - - 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 file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { - t.ifError(err); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js b/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js deleted file mode 100644 index e80e9be84b5d80..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs sync', function (t) { - t.plan(4); - - 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 file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp.sync(file, { fs: xfs, mode: _0755 }); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/perm.js b/tools/eslint/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 652586ed1d9fb9..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('async perm', function (t) { - t.plan(5); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', _0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/perm_sync.js b/tools/eslint/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f82842bfc1c3d5..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,36 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync perm', function (t) { - t.plan(4); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); - -test('sync root perm', function (t) { - t.plan(3); - - var file = '/tmp'; - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/race.js b/tools/eslint/node_modules/mkdirp/test/race.js deleted file mode 100644 index cba90799d9ceff..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('race', function (t) { - t.plan(10); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file); - - mk(file); - - function mk (file, cb) { - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); - } -}); diff --git a/tools/eslint/node_modules/mkdirp/test/rel.js b/tools/eslint/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 90b13566824bb7..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('rel', function (t) { - t.plan(5); - 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 cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - process.chdir(cwd); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/return.js b/tools/eslint/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5613e3f9..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - 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 file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/return_sync.js b/tools/eslint/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3558d6f0..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - 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 file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/root.js b/tools/eslint/node_modules/mkdirp/test/root.js deleted file mode 100644 index 9e7d079d9fc757..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,19 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, _0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/sync.js b/tools/eslint/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 8c8dc938c8b4a8..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync', function (t) { - t.plan(4); - 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 file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, _0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/umask.js b/tools/eslint/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 09bcd2d8864572..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('implicit mode from umask', function (t) { - t.plan(5); - 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 file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); -}); diff --git a/tools/eslint/node_modules/mkdirp/test/umask_sync.js b/tools/eslint/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 11a76147496a52..00000000000000 --- a/tools/eslint/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('umask sync modes', function (t) { - t.plan(4); - 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 file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/tools/eslint/node_modules/ms/.npmignore b/tools/eslint/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce42e1360..00000000000000 --- a/tools/eslint/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/tools/eslint/node_modules/ms/History.md b/tools/eslint/node_modules/ms/History.md deleted file mode 100644 index 32fdfc17623565..00000000000000 --- a/tools/eslint/node_modules/ms/History.md +++ /dev/null @@ -1,66 +0,0 @@ - -0.7.1 / 2015-04-20 -================== - - * prevent extraordinary long inputs (@evilpacket) - * Fixed broken readme link - -0.7.0 / 2014-11-24 -================== - - * add time abbreviations, updated tests and readme for the new units - * fix example in the readme. - * add LICENSE file - -0.6.2 / 2013-12-05 -================== - - * Adding repository section to package.json to suppress warning from NPM. - -0.6.1 / 2013-05-10 -================== - - * fix singularization [visionmedia] - -0.6.0 / 2013-03-15 -================== - - * fix minutes - -0.5.1 / 2013-02-24 -================== - - * add component namespace - -0.5.0 / 2012-11-09 -================== - - * add short formatting as default and .long option - * add .license property to component.json - * add version to component.json - -0.4.0 / 2012-10-22 -================== - - * add rounding to fix crazy decimals - -0.3.0 / 2012-09-07 -================== - - * fix `ms()` [visionmedia] - -0.2.0 / 2012-09-03 -================== - - * add component.json [visionmedia] - * add days support [visionmedia] - * add hours support [visionmedia] - * add minutes support [visionmedia] - * add seconds support [visionmedia] - * add ms string support [visionmedia] - * refactor tests to facilitate ms(number) [visionmedia] - -0.1.0 / 2012-03-07 -================== - - * Initial release diff --git a/tools/eslint/node_modules/ms/package.json b/tools/eslint/node_modules/ms/package.json index d6d6925988ef40..275f0b0ea8ba7c 100644 --- a/tools/eslint/node_modules/ms/package.json +++ b/tools/eslint/node_modules/ms/package.json @@ -2,14 +2,14 @@ "_args": [ [ "ms@0.7.1", - "/Users/trott/test/node_modules/eslint/node_modules/debug" + "/Users/trott/io.js/tools/node_modules/debug" ] ], "_from": "ms@0.7.1", "_id": "ms@0.7.1", "_inCache": true, "_installable": true, - "_location": "/eslint/ms", + "_location": "/ms", "_nodeVersion": "0.12.2", "_npmUser": { "email": "rauchg@gmail.com", @@ -26,13 +26,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/debug" + "/debug" ], "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", "_shrinkwrap": null, "_spec": "ms@0.7.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/debug", + "_where": "/Users/trott/io.js/tools/node_modules/debug", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, @@ -51,7 +51,7 @@ "directories": {}, "dist": { "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" }, "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", "homepage": "https://github.com/guille/ms.js", diff --git a/tools/eslint/node_modules/mute-stream/package.json b/tools/eslint/node_modules/mute-stream/package.json index fcacbc893863e7..734ae4af44d750 100644 --- a/tools/eslint/node_modules/mute-stream/package.json +++ b/tools/eslint/node_modules/mute-stream/package.json @@ -2,14 +2,14 @@ "_args": [ [ "mute-stream@0.0.5", - "/Users/trott/test/node_modules/eslint/node_modules/readline2" + "/Users/trott/io.js/tools/node_modules/readline2" ] ], "_from": "mute-stream@0.0.5", "_id": "mute-stream@0.0.5", "_inCache": true, "_installable": true, - "_location": "/eslint/mute-stream", + "_location": "/mute-stream", "_nodeVersion": "2.0.1", "_npmUser": { "email": "isaacs@npmjs.com", @@ -26,13 +26,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/readline2" + "/readline2" ], "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", "_shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0", "_shrinkwrap": null, "_spec": "mute-stream@0.0.5", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/readline2", + "_where": "/Users/trott/io.js/tools/node_modules/readline2", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", diff --git a/tools/eslint/node_modules/mute-stream/test/basic.js b/tools/eslint/node_modules/mute-stream/test/basic.js deleted file mode 100644 index 41f9e10c385a2f..00000000000000 --- a/tools/eslint/node_modules/mute-stream/test/basic.js +++ /dev/null @@ -1,207 +0,0 @@ -var Stream = require('stream') -var tap = require('tap') -var MS = require('../mute.js') - -// some marker objects -var END = {} -var PAUSE = {} -var RESUME = {} - -function PassThrough () { - Stream.call(this) - this.readable = this.writable = true -} - -PassThrough.prototype = Object.create(Stream.prototype, { - constructor: { - value: PassThrough - }, - write: { - value: function (c) { - this.emit('data', c) - return true - } - }, - end: { - value: function (c) { - if (c) this.write(c) - this.emit('end') - } - }, - pause: { - value: function () { - this.emit('pause') - } - }, - resume: { - value: function () { - this.emit('resume') - } - } -}) - -tap.test('incoming', function (t) { - var ms = new MS - var str = new PassThrough - str.pipe(ms) - - var expect = ['foo', 'boo', END] - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - ms.on('end', function () { - t.equal(END, expect.shift()) - t.end() - }) - str.write('foo') - ms.mute() - str.write('bar') - ms.unmute() - str.write('boo') - ms.mute() - str.write('blaz') - str.end('grelb') -}) - -tap.test('outgoing', function (t) { - var ms = new MS - var str = new PassThrough - ms.pipe(str) - - var expect = ['foo', 'boo', END] - str.on('data', function (c) { - t.equal(c, expect.shift()) - }) - str.on('end', function () { - t.equal(END, expect.shift()) - t.end() - }) - - ms.write('foo') - ms.mute() - ms.write('bar') - ms.unmute() - ms.write('boo') - ms.mute() - ms.write('blaz') - ms.end('grelb') -}) - -tap.test('isTTY', function (t) { - var str = new PassThrough - str.isTTY = true - str.columns=80 - str.rows=24 - - var ms = new MS - t.equal(ms.isTTY, false) - t.equal(ms.columns, undefined) - t.equal(ms.rows, undefined) - ms.pipe(str) - t.equal(ms.isTTY, true) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - str.isTTY = false - t.equal(ms.isTTY, false) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - str.isTTY = true - t.equal(ms.isTTY, true) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - ms.isTTY = false - t.equal(ms.isTTY, false) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - - ms = new MS - t.equal(ms.isTTY, false) - str.pipe(ms) - t.equal(ms.isTTY, true) - str.isTTY = false - t.equal(ms.isTTY, false) - str.isTTY = true - t.equal(ms.isTTY, true) - ms.isTTY = false - t.equal(ms.isTTY, false) - - t.end() -}) - -tap.test('pause/resume incoming', function (t) { - var str = new PassThrough - var ms = new MS - str.on('pause', function () { - t.equal(PAUSE, expect.shift()) - }) - str.on('resume', function () { - t.equal(RESUME, expect.shift()) - }) - var expect = [PAUSE, RESUME, PAUSE, RESUME] - str.pipe(ms) - ms.pause() - ms.resume() - ms.pause() - ms.resume() - t.equal(expect.length, 0, 'saw all events') - t.end() -}) - -tap.test('replace with *', function (t) { - var str = new PassThrough - var ms = new MS({replace: '*'}) - str.pipe(ms) - var expect = ['foo', '*****', 'bar', '***', 'baz', 'boo', '**', '****'] - - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - - str.write('foo') - ms.mute() - str.write('12345') - ms.unmute() - str.write('bar') - ms.mute() - str.write('baz') - ms.unmute() - str.write('baz') - str.write('boo') - ms.mute() - str.write('xy') - str.write('xyzΩ') - - t.equal(expect.length, 0) - t.end() -}) - -tap.test('replace with ~YARG~', function (t) { - var str = new PassThrough - var ms = new MS({replace: '~YARG~'}) - str.pipe(ms) - var expect = ['foo', '~YARG~~YARG~~YARG~~YARG~~YARG~', 'bar', - '~YARG~~YARG~~YARG~', 'baz', 'boo', '~YARG~~YARG~', - '~YARG~~YARG~~YARG~~YARG~'] - - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - - // also throw some unicode in there, just for good measure. - str.write('foo') - ms.mute() - str.write('ΩΩ') - ms.unmute() - str.write('bar') - ms.mute() - str.write('Ω') - ms.unmute() - str.write('baz') - str.write('boo') - ms.mute() - str.write('Ω') - str.write('ΩΩ') - - t.equal(expect.length, 0) - t.end() -}) diff --git a/tools/eslint/node_modules/number-is-nan/package.json b/tools/eslint/node_modules/number-is-nan/package.json index 3859d88f652473..bcbbc5b194bd3c 100644 --- a/tools/eslint/node_modules/number-is-nan/package.json +++ b/tools/eslint/node_modules/number-is-nan/package.json @@ -2,14 +2,14 @@ "_args": [ [ "number-is-nan@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/code-point-at" + "/Users/trott/io.js/tools/node_modules/code-point-at" ] ], "_from": "number-is-nan@>=1.0.0 <2.0.0", "_id": "number-is-nan@1.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/number-is-nan", + "_location": "/number-is-nan", "_nodeVersion": "0.12.3", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/code-point-at", - "/eslint/is-fullwidth-code-point" + "/code-point-at", + "/is-fullwidth-code-point" ], "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", "_shrinkwrap": null, "_spec": "number-is-nan@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/code-point-at", + "_where": "/Users/trott/io.js/tools/node_modules/code-point-at", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/object-assign/package.json b/tools/eslint/node_modules/object-assign/package.json index a1db7ffb298df6..5fbfdaa6387d34 100644 --- a/tools/eslint/node_modules/object-assign/package.json +++ b/tools/eslint/node_modules/object-assign/package.json @@ -2,14 +2,14 @@ "_args": [ [ "object-assign@^4.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/file-entry-cache" + "/Users/trott/io.js/tools/node_modules/esrecurse" ] ], "_from": "object-assign@>=4.0.1 <5.0.0", "_id": "object-assign@4.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/object-assign", + "_location": "/object-assign", "_nodeVersion": "3.0.0", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,15 +26,16 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del", - "/eslint/file-entry-cache", - "/eslint/globby" + "/del", + "/esrecurse", + "/file-entry-cache", + "/globby" ], "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", "_shasum": "99504456c3598b5cad4fc59c26e8a9bb107fe0bd", "_shrinkwrap": null, "_spec": "object-assign@^4.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/file-entry-cache", + "_where": "/Users/trott/io.js/tools/node_modules/esrecurse", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -54,7 +55,7 @@ "directories": {}, "dist": { "shasum": "99504456c3598b5cad4fc59c26e8a9bb107fe0bd", - "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz" + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/once/package.json b/tools/eslint/node_modules/once/package.json index fa7c3b64082ee4..f63e5f74573125 100644 --- a/tools/eslint/node_modules/once/package.json +++ b/tools/eslint/node_modules/once/package.json @@ -2,14 +2,14 @@ "_args": [ [ "once@^1.3.0", - "/Users/trott/test/node_modules/eslint/node_modules/glob" + "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob" ] ], "_from": "once@>=1.3.0 <2.0.0", "_id": "once@1.3.3", "_inCache": true, "_installable": true, - "_location": "/eslint/once", + "_location": "/once", "_nodeVersion": "4.0.0", "_npmUser": { "email": "i@izs.me", @@ -26,16 +26,16 @@ "type": "range" }, "_requiredBy": [ - "/eslint/glob", - "/eslint/inflight", - "/eslint/rimraf/glob", - "/eslint/run-async" + "/glob", + "/globby/glob", + "/inflight", + "/run-async" ], "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", "_shrinkwrap": null, "_spec": "once@^1.3.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/glob", + "_where": "/Users/trott/io.js/tools/node_modules/globby/node_modules/glob", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", diff --git a/tools/eslint/node_modules/onetime/package.json b/tools/eslint/node_modules/onetime/package.json index c2a8f953d97442..00cc12016692e4 100644 --- a/tools/eslint/node_modules/onetime/package.json +++ b/tools/eslint/node_modules/onetime/package.json @@ -2,14 +2,14 @@ "_args": [ [ "onetime@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/restore-cursor" + "/Users/trott/io.js/tools/node_modules/restore-cursor" ] ], "_from": "onetime@>=1.0.0 <2.0.0", "_id": "onetime@1.1.0", "_inCache": true, "_installable": true, - "_location": "/eslint/onetime", + "_location": "/onetime", "_nodeVersion": "4.2.1", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/restore-cursor" + "/restore-cursor" ], "_resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "_shasum": "a1f7838f8314c516f05ecefcbc4ccfe04b4ed789", "_shrinkwrap": null, "_spec": "onetime@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/restore-cursor", + "_where": "/Users/trott/io.js/tools/node_modules/restore-cursor", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/onetime/readme.md b/tools/eslint/node_modules/onetime/readme.md index a51cada0b205b5..e27d2bcb47ae34 100644 --- a/tools/eslint/node_modules/onetime/readme.md +++ b/tools/eslint/node_modules/onetime/readme.md @@ -39,7 +39,7 @@ Function that should only be called once. #### shouldThrow -Type: `boolean` +Type: `boolean` Default: `false` ![](screenshot-shouldthrow.png) diff --git a/tools/eslint/node_modules/optionator/CHANGELOG.md b/tools/eslint/node_modules/optionator/CHANGELOG.md deleted file mode 100644 index 050df2a8f69705..00000000000000 --- a/tools/eslint/node_modules/optionator/CHANGELOG.md +++ /dev/null @@ -1,48 +0,0 @@ -# 0.8.1 -- update `fast-levenshtein` dependency - -# 0.8.0 -- update `levn` dependency - supplying a float value to an option with type `Int` now throws an error, instead of silently converting to an `Int` - -# 0.7.1 -- fix bug with use of `defaults` and `concatRepeatedArrays` or `mergeRepeatedObjects` - -# 0.7.0 -- added `concatrepeatedarrays` option: `oneValuePerFlag`, only allows one array value per flag -- added `typeAliases` option -- added `parseArgv` which takes an array and parses with the first two items sliced off -- changed enum help style -- bug fixes (#12) -- use of `concatRepeatedArrays` and `mergeRepeatedObjects` at the top level is deprecated, use it as either a per-option option, or set them in the `defaults` object to set them for all objects - -# 0.6.0 -- added `defaults` lib-option flag, allowing one to set default properties for all options -- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only - -# 0.5.0 -- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help - -# 0.4.0 -- add `mergeRepeatedObjects` setting - -# 0.3.0 -- add `concatRepeatedArrays` setting -- add `overrideRequired` option setting -- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue - -# 0.2.2 -- bug fixes - -# 0.2.1 -- improved interpolation -- added changelog - -# 0.2.0 -- add dependency checks to options - added `dependsOn` as an option property -- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate` - -# 0.1.1 -- update dependencies - -# 0.1.0 -- initial release diff --git a/tools/eslint/node_modules/optionator/package.json b/tools/eslint/node_modules/optionator/package.json index 702bae7628bc16..0a23d2ec59e44f 100644 --- a/tools/eslint/node_modules/optionator/package.json +++ b/tools/eslint/node_modules/optionator/package.json @@ -2,14 +2,14 @@ "_args": [ [ "optionator@^0.8.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "optionator@>=0.8.1 <0.9.0", "_id": "optionator@0.8.1", "_inCache": true, "_installable": true, - "_location": "/eslint/optionator", + "_location": "/optionator", "_nodeVersion": "5.3.0", "_npmUser": { "email": "z@georgezahariev.com", @@ -32,7 +32,7 @@ "_shasum": "e31b4932cdd5fb862a8b0d10bc63d3ee1ec7d78b", "_shrinkwrap": null, "_spec": "optionator@^0.8.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "z@georgezahariev.com", "name": "George Zahariev" diff --git a/tools/eslint/node_modules/os-homedir/package.json b/tools/eslint/node_modules/os-homedir/package.json index f23c542f87ca65..c52db9372e388b 100644 --- a/tools/eslint/node_modules/os-homedir/package.json +++ b/tools/eslint/node_modules/os-homedir/package.json @@ -2,14 +2,14 @@ "_args": [ [ "os-homedir@^1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/user-home" + "/Users/trott/io.js/tools/node_modules/user-home" ] ], "_from": "os-homedir@>=1.0.0 <2.0.0", "_id": "os-homedir@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/os-homedir", + "_location": "/os-homedir", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/user-home" + "/user-home" ], "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", "_shrinkwrap": null, "_spec": "os-homedir@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/user-home", + "_where": "/Users/trott/io.js/tools/node_modules/user-home", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -50,7 +50,7 @@ "directories": {}, "dist": { "shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", - "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz" + "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/path-is-absolute/package.json b/tools/eslint/node_modules/path-is-absolute/package.json index 64a8cad46a977a..b272f1e065a6b6 100644 --- a/tools/eslint/node_modules/path-is-absolute/package.json +++ b/tools/eslint/node_modules/path-is-absolute/package.json @@ -2,14 +2,14 @@ "_args": [ [ "path-is-absolute@^1.0.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "path-is-absolute@>=1.0.0 <2.0.0", "_id": "path-is-absolute@1.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/path-is-absolute", + "_location": "/path-is-absolute", "_nodeVersion": "0.12.0", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -27,14 +27,14 @@ }, "_requiredBy": [ "/eslint", - "/eslint/glob", - "/eslint/rimraf/glob" + "/glob", + "/globby/glob" ], "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", "_shrinkwrap": null, "_spec": "path-is-absolute@^1.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/path-is-inside/package.json b/tools/eslint/node_modules/path-is-inside/package.json index a573737bbc56d5..fdfb35ab1b347a 100644 --- a/tools/eslint/node_modules/path-is-inside/package.json +++ b/tools/eslint/node_modules/path-is-inside/package.json @@ -2,14 +2,14 @@ "_args": [ [ "path-is-inside@^1.0.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "path-is-inside@>=1.0.1 <2.0.0", "_id": "path-is-inside@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/path-is-inside", + "_location": "/path-is-inside", "_npmUser": { "email": "domenic@domenicdenicola.com", "name": "domenic" @@ -26,13 +26,13 @@ }, "_requiredBy": [ "/eslint", - "/eslint/is-path-inside" + "/is-path-inside" ], "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz", "_shasum": "98d8f1d030bf04bd7aeee4a1ba5485d40318fd89", "_shrinkwrap": null, "_spec": "path-is-inside@^1.0.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "domenic@domenicdenicola.com", "name": "Domenic Denicola", diff --git a/tools/eslint/node_modules/pify/package.json b/tools/eslint/node_modules/pify/package.json index f6466e417525aa..bf8e9afa9b2777 100644 --- a/tools/eslint/node_modules/pify/package.json +++ b/tools/eslint/node_modules/pify/package.json @@ -2,14 +2,14 @@ "_args": [ [ "pify@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/node_modules/del" ] ], "_from": "pify@>=2.0.0 <3.0.0", "_id": "pify@2.3.0", "_inCache": true, "_installable": true, - "_location": "/eslint/pify", + "_location": "/pify", "_nodeVersion": "4.2.1", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del", - "/eslint/globby" + "/del", + "/globby" ], "_resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c", "_shrinkwrap": null, "_spec": "pify@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/del", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -53,7 +53,7 @@ "directories": {}, "dist": { "shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c", - "tarball": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + "tarball": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/pify/readme.md b/tools/eslint/node_modules/pify/readme.md index 97aeeb628b0897..c79ca8bf643927 100644 --- a/tools/eslint/node_modules/pify/readme.md +++ b/tools/eslint/node_modules/pify/readme.md @@ -56,7 +56,7 @@ Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you ##### multiArgs -Type: `boolean` +Type: `boolean` Default: `false` By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. @@ -78,14 +78,14 @@ Methods in a module to promisify. Remaining methods will be left untouched. ##### exclude -Type: `array` of (`string`|`regex`) +Type: `array` of (`string`|`regex`) Default: `[/.+Sync$/]` Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. ##### excludeMain -Type: `boolean` +Type: `boolean` Default: `false` By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. diff --git a/tools/eslint/node_modules/pinkie-promise/index.js b/tools/eslint/node_modules/pinkie-promise/index.js index cc64b902c80b4b..777377a1f777b1 100644 --- a/tools/eslint/node_modules/pinkie-promise/index.js +++ b/tools/eslint/node_modules/pinkie-promise/index.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = global.Promise || require('pinkie'); +module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/tools/eslint/node_modules/pinkie-promise/package.json b/tools/eslint/node_modules/pinkie-promise/package.json index bacc5fa1fd65e2..91770fb785ee0b 100644 --- a/tools/eslint/node_modules/pinkie-promise/package.json +++ b/tools/eslint/node_modules/pinkie-promise/package.json @@ -2,20 +2,24 @@ "_args": [ [ "pinkie-promise@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/node_modules/del" ] ], "_from": "pinkie-promise@>=2.0.0 <3.0.0", - "_id": "pinkie-promise@2.0.0", + "_id": "pinkie-promise@2.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/pinkie-promise", - "_nodeVersion": "4.2.0", + "_location": "/pinkie-promise", + "_nodeVersion": "4.4.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279" + }, "_npmUser": { "email": "floatdrop@gmail.com", "name": "floatdrop" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.14.20", "_phantomChildren": {}, "_requested": { "name": "pinkie-promise", @@ -26,14 +30,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del", - "/eslint/globby" + "/del", + "/globby" ], - "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz", - "_shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259", + "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "_shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", "_shrinkwrap": null, "_spec": "pinkie-promise@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/del", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", @@ -51,8 +55,8 @@ }, "directories": {}, "dist": { - "shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259", - "tarball": "http://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz" + "shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", + "tarball": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -60,7 +64,7 @@ "files": [ "index.js" ], - "gitHead": "f90fcae9838bcae7ae1ae4ebc9b29f11e5db4980", + "gitHead": "4a936c09c34ad591a25db93f1216d242de0d6184", "homepage": "https://github.com/floatdrop/pinkie-promise", "keywords": [ "promise", @@ -87,5 +91,5 @@ "scripts": { "test": "mocha" }, - "version": "2.0.0" + "version": "2.0.1" } diff --git a/tools/eslint/node_modules/pinkie/package.json b/tools/eslint/node_modules/pinkie/package.json index d0c71a25f94d51..a7a2a00b09b528 100644 --- a/tools/eslint/node_modules/pinkie/package.json +++ b/tools/eslint/node_modules/pinkie/package.json @@ -2,14 +2,14 @@ "_args": [ [ "pinkie@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/pinkie-promise" + "/Users/trott/io.js/tools/node_modules/pinkie-promise" ] ], "_from": "pinkie@>=2.0.0 <3.0.0", "_id": "pinkie@2.0.4", "_inCache": true, "_installable": true, - "_location": "/eslint/pinkie", + "_location": "/pinkie", "_nodeVersion": "4.2.4", "_npmUser": { "email": "floatdrop@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/pinkie-promise" + "/pinkie-promise" ], "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", "_shrinkwrap": null, "_spec": "pinkie@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/pinkie-promise", + "_where": "/Users/trott/io.js/tools/node_modules/pinkie-promise", "author": { "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", @@ -54,7 +54,7 @@ "directories": {}, "dist": { "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", - "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "tarball": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/pinkie/readme.md b/tools/eslint/node_modules/pinkie/readme.md index 54747f60cc538b..1565f95889661b 100644 --- a/tools/eslint/node_modules/pinkie/readme.md +++ b/tools/eslint/node_modules/pinkie/readme.md @@ -51,7 +51,7 @@ Returns new instance of `Promise`. ##### executor -*Required* +*Required* Type: `function` Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. diff --git a/tools/eslint/node_modules/pluralize/package.json b/tools/eslint/node_modules/pluralize/package.json index 7f7650f3712ae0..f4b7011095e49b 100644 --- a/tools/eslint/node_modules/pluralize/package.json +++ b/tools/eslint/node_modules/pluralize/package.json @@ -2,14 +2,14 @@ "_args": [ [ "pluralize@^1.2.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "pluralize@>=1.2.1 <2.0.0", "_id": "pluralize@1.2.1", "_inCache": true, "_installable": true, - "_location": "/eslint/pluralize", + "_location": "/pluralize", "_nodeVersion": "4.0.0", "_npmUser": { "email": "hello@blakeembrey.com", @@ -32,7 +32,7 @@ "_shasum": "d1a21483fd22bb41e58a12fa3421823140897c45", "_shrinkwrap": null, "_spec": "pluralize@^1.2.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "hello@blakeembrey.com", "name": "Blake Embrey", @@ -53,7 +53,7 @@ "directories": {}, "dist": { "shasum": "d1a21483fd22bb41e58a12fa3421823140897c45", - "tarball": "http://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz" + "tarball": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz" }, "files": [ "pluralize.js", diff --git a/tools/eslint/node_modules/prelude-ls/CHANGELOG.md b/tools/eslint/node_modules/prelude-ls/CHANGELOG.md deleted file mode 100644 index c2de12d5672c5c..00000000000000 --- a/tools/eslint/node_modules/prelude-ls/CHANGELOG.md +++ /dev/null @@ -1,99 +0,0 @@ -# 1.1.2 -- add `Func.memoize` -- fix `zip-all` and `zip-with-all` corner case (no input) -- build with LiveScript 1.4.0 - -# 1.1.1 -- curry `unique-by`, `minimum-by` - -# 1.1.0 -- added `List` functions: `maximum-by`, `minimum-by`, `unique-by` -- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices` -- added `Str` functions: `capitalize`, `camelize`, `dasherize` -- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)`` -- exported `Str.repeat` through main `prelude` object -- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one -- fixed issue with `fix` -- improved code coverage - -# 1.0.3 -- build browser versions - -# 1.0.2 -- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects - -# 1.0.1 -- bug fixes for `drop-while` and `take-while` - -# 1.0.0 -* massive update - separated functions into separate modules -* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list -* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that -* browser version now using browserify - use `prelude = require('prelude-ls')` -* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply` -* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists` -* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs` -* removed `cons`, `append` - use the concat operator -* removed `compose` - use the compose operator -* removed `obj-to-func` - use partially applied access (eg. `(obj.)`) -* removed `length` - use `(.length)` -* `sort-by` renamed to `sort-with` -* added new `sort-by` -* removed `compare` - just use the new `sort-by` -* `break-it` renamed `break-list`, (`Str.break-str` for the string version) -* added `Str.repeat` which creates a new string by repeating the input n times -* `unfold` as alias to `unfoldr` is no longer used -* fixed up style and compiled with LiveScript 1.1.1 -* use Make instead of Slake -* greatly improved tests - -# 0.6.0 -* fixed various bugs -* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions -* added `unfoldr` (alias `unfold`) -* calling `replicate` with a string now returns a list of strings -* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying -* added `sort`, `sortBy`, and `compare` - -# 0.5.0 -* removed `lookup` - use (.prop) -* removed `call` - use (.func arg1, arg2) -* removed `pluck` - use map (.prop), xs -* fixed buys wtih `head` and `last` -* added non-minifed browser version, as `prelude-browser.js` -* renamed `prelude-min.js` to `prelude-browser-min.js` -* renamed `zip` to `zipAll` -* renamed `zipWith` to `zipAllWith` -* added `zip`, a curried zip that takes only two arguments -* added `zipWith`, a curried zipWith that takes only two arguments - -# 0.4.0 -* added `parition` function -* added `curry` function -* removed `elem` function (use `in`) -* removed `notElem` function (use `not in`) - -# 0.3.0 -* added `listToObject` -* added `unique` -* added `objToFunc` -* added support for using strings in map and the like -* added support for using objects in map and the like -* added ability to use objects instead of functions in certain cases -* removed `error` (just use throw) -* added `tau` constant -* added `join` -* added `values` -* added `keys` -* added `partial` -* renamed `log` to `ln` -* added alias to `head`: `first` -* added `installPrelude` helper - -# 0.2.0 -* removed functions that simply warp operators as you can now use operators as functions in LiveScript -* `min/max` are now curried and take only 2 arguments -* added `call` - -# 0.1.0 -* initial public release diff --git a/tools/eslint/node_modules/prelude-ls/package.json b/tools/eslint/node_modules/prelude-ls/package.json index a740fa38cc51f5..8ecbb9a30180b9 100644 --- a/tools/eslint/node_modules/prelude-ls/package.json +++ b/tools/eslint/node_modules/prelude-ls/package.json @@ -2,14 +2,14 @@ "_args": [ [ "prelude-ls@~1.1.2", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/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", + "_location": "/prelude-ls", "_nodeVersion": "0.11.15", "_npmUser": { "email": "z@georgezahariev.com", @@ -26,15 +26,15 @@ "type": "range" }, "_requiredBy": [ - "/eslint/levn", - "/eslint/optionator", - "/eslint/type-check" + "/levn", + "/optionator", + "/type-check" ], "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "_shasum": "21932a549f5e52ffd9a827f570e04be62a97da54", "_shrinkwrap": null, "_spec": "prelude-ls@~1.1.2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/optionator", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "z@georgezahariev.com", "name": "George Zahariev" diff --git a/tools/eslint/node_modules/process-nextick-args/package.json b/tools/eslint/node_modules/process-nextick-args/package.json index 64f80345e8d5a4..b29ea9dd4dd205 100644 --- a/tools/eslint/node_modules/process-nextick-args/package.json +++ b/tools/eslint/node_modules/process-nextick-args/package.json @@ -2,14 +2,14 @@ "_args": [ [ "process-nextick-args@~1.0.6", - "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + "/Users/trott/io.js/tools/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", + "_location": "/process-nextick-args", "_nodeVersion": "4.1.1", "_npmUser": { "email": "calvin.metcalf@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readable-stream" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/readable-stream", "author": "", "bugs": { "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" diff --git a/tools/eslint/node_modules/progress/.npmignore b/tools/eslint/node_modules/progress/.npmignore deleted file mode 100644 index f1250e584c94b8..00000000000000 --- a/tools/eslint/node_modules/progress/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/tools/eslint/node_modules/progress/History.md b/tools/eslint/node_modules/progress/History.md deleted file mode 100644 index 6a02e974ed8e89..00000000000000 --- a/tools/eslint/node_modules/progress/History.md +++ /dev/null @@ -1,77 +0,0 @@ -### 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/package.json b/tools/eslint/node_modules/progress/package.json index c93112fbfa8ae4..c8036599be4834 100644 --- a/tools/eslint/node_modules/progress/package.json +++ b/tools/eslint/node_modules/progress/package.json @@ -2,14 +2,14 @@ "_args": [ [ "progress@^1.1.8", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "progress@>=1.1.8 <2.0.0", "_id": "progress@1.1.8", "_inCache": true, "_installable": true, - "_location": "/eslint/progress", + "_location": "/progress", "_npmUser": { "email": "scalesjordan@gmail.com", "name": "prezjordan" @@ -31,7 +31,7 @@ "_shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", "_shrinkwrap": null, "_spec": "progress@^1.1.8", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "tj@vision-media.ca", "name": "TJ Holowaychuk" @@ -55,7 +55,7 @@ "directories": {}, "dist": { "shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", - "tarball": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz" + "tarball": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz" }, "engines": { "node": ">=0.4.0" diff --git a/tools/eslint/node_modules/read-json-sync/README.md b/tools/eslint/node_modules/read-json-sync/README.md index d395cf37745a3f..822c694d796b91 100755 --- a/tools/eslint/node_modules/read-json-sync/README.md +++ b/tools/eslint/node_modules/read-json-sync/README.md @@ -33,8 +33,8 @@ 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) +*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 diff --git a/tools/eslint/node_modules/read-json-sync/package.json b/tools/eslint/node_modules/read-json-sync/package.json index 30fe718951a567..fccbcc6a21ae06 100644 --- a/tools/eslint/node_modules/read-json-sync/package.json +++ b/tools/eslint/node_modules/read-json-sync/package.json @@ -2,14 +2,14 @@ "_args": [ [ "read-json-sync@^1.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + "/Users/trott/io.js/tools/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", + "_location": "/read-json-sync", "_nodeVersion": "5.1.0", "_npmUser": { "email": "snnskwtnb@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/flat-cache" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/flat-cache", "author": { "name": "Shinnosuke Watanabe", "url": "https://github.com/shinnn" diff --git a/tools/eslint/node_modules/readable-stream/.travis.yml b/tools/eslint/node_modules/readable-stream/.travis.yml deleted file mode 100644 index cfe1c9439388b6..00000000000000 --- a/tools/eslint/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -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/README.md b/tools/eslint/node_modules/readable-stream/README.md index 77fafa3da15f9f..86b95a3bf6df4e 100644 --- a/tools/eslint/node_modules/readable-stream/README.md +++ b/tools/eslint/node_modules/readable-stream/README.md @@ -1,6 +1,6 @@ # 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) +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) @@ -21,7 +21,7 @@ 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. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/tools/eslint/node_modules/readable-stream/doc/stream.markdown b/tools/eslint/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index 3988c0cbd0d9c9..00000000000000 --- a/tools/eslint/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1730 +0,0 @@ -# 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/lib/_stream_duplex.js b/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js index 69558af037cd66..736693b8400fed 100644 --- a/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js @@ -6,22 +6,21 @@ 'use strict'; /**/ + var objectKeys = Object.keys || function (obj) { var keys = []; - for (var key in obj) keys.push(key); - return keys; -} + for (var key in obj) { + keys.push(key); + }return keys; +}; /**/ - module.exports = Duplex; /**/ var processNextTick = require('process-nextick-args'); /**/ - - /**/ var util = require('core-util-is'); util.inherits = require('inherits'); @@ -35,26 +34,21 @@ 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]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); + if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); - if (options && options.readable === false) - this.readable = false; + if (options && options.readable === false) this.readable = false; - if (options && options.writable === false) - this.writable = false; + if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } @@ -63,8 +57,7 @@ function Duplex(options) { function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; + if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. @@ -75,8 +68,8 @@ function onEndNT(self) { self.end(); } -function forEach (xs, f) { +function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } -} +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js index bddfdd01537a40..d06f71f1868d77 100644 --- a/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js @@ -16,12 +16,11 @@ util.inherits = require('inherits'); util.inherits(PassThrough, Transform); function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); + if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } -PassThrough.prototype._transform = function(chunk, encoding, cb) { +PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); -}; +}; \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js index 50852aee7e6e02..54a9d5c553d69e 100644 --- a/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js @@ -6,12 +6,10 @@ module.exports = Readable; var processNextTick = require('process-nextick-args'); /**/ - /**/ var isArray = require('isarray'); /**/ - /**/ var Buffer = require('buffer').Buffer; /**/ @@ -21,21 +19,20 @@ Readable.ReadableState = ReadableState; var EE = require('events'); /**/ -var EElistenerCount = function(emitter, type) { +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; -}}()) +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); /**/ var Buffer = require('buffer').Buffer; @@ -45,11 +42,9 @@ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ - - /**/ var debugUtil = require('util'); -var debug; +var debug = undefined; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { @@ -71,17 +66,16 @@ function ReadableState(options, stream) { // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; + 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; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~~this.highWaterMark; + this.highWaterMark = ~ ~this.highWaterMark; this.buffer = []; this.length = 0; @@ -103,6 +97,7 @@ function ReadableState(options, stream) { this.needReadable = false; this.emittedReadable = false; this.readableListening = false; + this.resumeScheduled = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. @@ -122,8 +117,7 @@ function ReadableState(options, stream) { this.decoder = null; this.encoding = null; if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } @@ -133,16 +127,14 @@ var Duplex; function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) - return new Readable(options); + if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; - if (options && typeof options.read === 'function') - this._read = options.read; + if (options && typeof options.read === 'function') this._read = options.read; Stream.call(this); } @@ -151,7 +143,7 @@ function Readable(options) { // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. -Readable.prototype.push = function(chunk, encoding) { +Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; if (!state.objectMode && typeof chunk === 'string') { @@ -166,12 +158,12 @@ Readable.prototype.push = function(chunk, encoding) { }; // Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { +Readable.prototype.unshift = function (chunk) { var state = this._readableState; return readableAddChunk(this, state, chunk, '', true); }; -Readable.prototype.isPaused = function() { +Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; @@ -190,26 +182,28 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { var e = new Error('stream.unshift() after end event'); stream.emit('error', e); } else { - if (state.decoder && !addToFront && !encoding) + var skipAdd; + if (state.decoder && !addToFront && !encoding) { chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } } maybeReadMore(stream, state); @@ -221,7 +215,6 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { return needMoreData(state); } - // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, @@ -230,16 +223,12 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } // backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; @@ -264,29 +253,22 @@ function computeNewHighWaterMark(n) { } function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; + if (state.length === 0 && state.ended) return 0; - if (state.objectMode) - return n === 0 ? 0 : 1; + if (state.objectMode) return n === 0 ? 0 : 1; if (n === null || isNaN(n)) { // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; } - if (n <= 0) - return 0; + if (n <= 0) return 0; // If we're asking for more than the target buffer level, // then raise the water mark. Bump up to the next highest // power of 2, to prevent increasing it excessively in tiny // amounts. - if (n > state.highWaterMark) - state.highWaterMark = computeNewHighWaterMark(n); + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); // don't have that much. return null, unless we've ended. if (n > state.length) { @@ -302,25 +284,19 @@ function howMuchToRead(n, state) { } // you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { +Readable.prototype.read = function (n) { debug('read', n); var state = this._readableState; var nOrig = n; - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } @@ -328,8 +304,7 @@ Readable.prototype.read = function(n) { // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); + if (state.length === 0) endReadable(this); return null; } @@ -377,8 +352,7 @@ Readable.prototype.read = function(n) { state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; + if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; @@ -386,14 +360,10 @@ Readable.prototype.read = function(n) { // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; + if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; @@ -404,32 +374,24 @@ Readable.prototype.read = function(n) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; + if (state.length === 0 && !state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (ret !== null) - this.emit('data', ret); + 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) { + 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) { @@ -454,10 +416,7 @@ function emitReadable(stream) { if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; - if (state.sync) - processNextTick(emitReadable_, stream); - else - emitReadable_(stream); + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); } } @@ -467,7 +426,6 @@ function emitReadable_(stream) { flow(stream); } - // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if @@ -483,15 +441,12 @@ function maybeReadMore(stream, state) { function maybeReadMore_(stream, state) { var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. - break; - else - len = state.length; + break;else len = state.length; } state.readingMore = false; } @@ -500,11 +455,11 @@ function maybeReadMore_(stream, state) { // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { +Readable.prototype._read = function (n) { this.emit('error', new Error('not implemented')); }; -Readable.prototype.pipe = function(dest, pipeOpts) { +Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; @@ -522,15 +477,10 @@ Readable.prototype.pipe = function(dest, pipeOpts) { state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - processNextTick(endFn); - else - src.once('end', endFn); + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable) { @@ -572,9 +522,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); @@ -585,10 +533,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. - if (state.pipesCount === 1 && - state.pipes[0] === dest && - src.listenerCount('data') === 1 && - !cleanedUp) { + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; } @@ -602,18 +547,11 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) - dest.emit('error', er); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; // Both close and finish should trigger unpipe, but only once. function onclose() { @@ -646,11 +584,10 @@ Readable.prototype.pipe = function(dest, pipeOpts) { }; function pipeOnDrain(src) { - return function() { + return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; + if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); @@ -658,29 +595,24 @@ function pipeOnDrain(src) { }; } - -Readable.prototype.unpipe = function(dest) { +Readable.prototype.unpipe = function (dest) { var state = this._readableState; // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; + if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; + if (dest && dest !== state.pipes) return this; - if (!dest) - dest = state.pipes; + if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; - if (dest) - dest.emit('unpipe', this); + if (dest) dest.emit('unpipe', this); return this; } @@ -694,20 +626,18 @@ Readable.prototype.unpipe = function(dest) { state.pipesCount = 0; state.flowing = false; - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } // try to find the right one. var i = indexOf(state.pipes, dest); - if (i === -1) - return this; + if (i === -1) return this; state.pipes.splice(i, 1); state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this); @@ -716,7 +646,7 @@ Readable.prototype.unpipe = function(dest) { // set up data events if they are asked for // Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { +Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); // If listening to data, and it has not explicitly been paused, @@ -725,7 +655,7 @@ Readable.prototype.on = function(ev, fn) { this.resume(); } - if (ev === 'readable' && this.readable) { + if (ev === 'readable' && !this._readableState.endEmitted) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; @@ -750,7 +680,7 @@ function nReadingNextTick(self) { // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { +Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); @@ -776,11 +706,10 @@ function resume_(stream, state) { state.resumeScheduled = false; stream.emit('resume'); flow(stream); - if (state.flowing && !state.reading) - stream.read(0); + if (state.flowing && !state.reading) stream.read(0); } -Readable.prototype.pause = function() { +Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); @@ -803,32 +732,27 @@ function flow(stream) { // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { +Readable.prototype.wrap = function (stream) { var state = this._readableState; var paused = false; var self = this; - stream.on('end', function() { + stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); + if (chunk && chunk.length) self.push(chunk); } self.push(null); }); - stream.on('data', function(chunk) { + stream.on('data', function (chunk) { debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); + if (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; + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = self.push(chunk); if (!ret) { @@ -841,21 +765,23 @@ Readable.prototype.wrap = function(stream) { // 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); + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); } } // proxy certain important events. var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { + forEach(events, function (ev) { stream.on(ev, self.emit.bind(self, ev)); }); // when we try to consume some more bytes, simply unpause the // underlying stream. - self._read = function(n) { + self._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; @@ -866,7 +792,6 @@ Readable.prototype.wrap = function(stream) { return self; }; - // exposed for testing purposes only. Readable._fromList = fromList; @@ -880,21 +805,11 @@ function fromList(n, state) { var ret; // nothing in the list, definitely empty. - if (list.length === 0) - return null; + if (list.length === 0) return null; - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else if (list.length === 1) - ret = list[0]; - else - ret = Buffer.concat(list, length); + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); list.length = 0; } else { // read just some of it. @@ -910,25 +825,16 @@ function fromList(n, state) { } else { // complex case. // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); + if (stringMode) ret = '';else ret = new Buffer(n); var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { var buf = list[0]; var cpy = Math.min(n - c, buf.length); - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); c += cpy; } @@ -943,8 +849,7 @@ function endReadable(stream) { // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); if (!state.endEmitted) { state.ended = true; @@ -961,15 +866,15 @@ function endReadableNT(state, stream) { } } -function forEach (xs, f) { +function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } -function indexOf (xs, x) { +function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; -} +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js b/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js index 3675d18d915610..625cdc17698059 100644 --- a/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js @@ -53,9 +53,8 @@ util.inherits = require('inherits'); util.inherits(Transform, Duplex); - function TransformState(stream) { - this.afterTransform = function(er, data) { + this.afterTransform = function (er, data) { return afterTransform(stream, er, data); }; @@ -63,6 +62,7 @@ function TransformState(stream) { this.transforming = false; this.writecb = null; this.writechunk = null; + this.writeencoding = null; } function afterTransform(stream, er, data) { @@ -71,17 +71,14 @@ function afterTransform(stream, er, data) { var cb = ts.writecb; - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); ts.writechunk = null; ts.writecb = null; - if (data !== null && data !== undefined) - stream.push(data); + if (data !== null && data !== undefined) stream.push(data); - if (cb) - cb(er); + cb(er); var rs = stream._readableState; rs.reading = false; @@ -90,10 +87,8 @@ function afterTransform(stream, er, data) { } } - function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); + if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); @@ -111,24 +106,19 @@ function Transform(options) { this._readableState.sync = false; if (options) { - if (typeof options.transform === 'function') - this._transform = options.transform; + if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') - this._flush = options.flush; + 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); + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); }); } -Transform.prototype.push = function(chunk, encoding) { +Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; @@ -143,28 +133,25 @@ Transform.prototype.push = function(chunk, encoding) { // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { +Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('not implemented'); }; -Transform.prototype._write = function(chunk, encoding, cb) { +Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { +Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { @@ -177,21 +164,17 @@ Transform.prototype._read = function(n) { } }; - function done(stream, er) { - if (er) - return stream.emit('error', er); + if (er) return stream.emit('error', er); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided var ws = stream._writableState; var ts = stream._transformState; - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); + if (ws.length) throw new Error('calling transform done when ws.length != 0'); - if (ts.transforming) - throw new Error('calling transform done when still transforming'); + if (ts.transforming) throw new Error('calling transform done when still transforming'); return stream.push(null); -} +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js index 1fa5eb695adde6..95916c992a9507 100644 --- a/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js @@ -10,6 +10,9 @@ module.exports = Writable; var processNextTick = require('process-nextick-args'); /**/ +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ /**/ var Buffer = require('buffer').Buffer; @@ -17,29 +20,26 @@ 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; -}}()) +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); /**/ var Buffer = require('buffer').Buffer; @@ -65,18 +65,17 @@ function WritableState(options, stream) { // contains buffers or objects. this.objectMode = !!options.objectMode; - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm = options.highWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~~this.highWaterMark; + this.highWaterMark = ~ ~this.highWaterMark; this.needDrain = false; // at the start of calling end() @@ -120,7 +119,7 @@ function WritableState(options, stream) { this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { + this.onwrite = function (er) { onwrite(stream, er); }; @@ -143,6 +142,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() { @@ -155,15 +162,15 @@ WritableState.prototype.getBuffer = function writableStateGetBuffer() { 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(_){}}()); - +(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) { @@ -171,8 +178,7 @@ function Writable(options) { // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); @@ -180,22 +186,19 @@ function Writable(options) { this.writable = true; if (options) { - if (typeof options.write === 'function') - this._write = options.write; + if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') - this._writev = options.writev; + if (typeof options.writev === 'function') this._writev = options.writev; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { +Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe. Not readable.')); }; - function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb @@ -211,11 +214,7 @@ function writeAfterEnd(stream, cb) { function validChunk(stream, state, chunk, cb) { var valid = true; - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); processNextTick(cb, er); @@ -224,7 +223,7 @@ function validChunk(stream, state, chunk, cb) { return valid; } -Writable.prototype.write = function(chunk, encoding, cb) { +Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; @@ -233,17 +232,11 @@ Writable.prototype.write = function(chunk, encoding, cb) { encoding = null; } - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') - cb = nop; + if (typeof cb !== 'function') cb = nop; - if (state.ended) - writeAfterEnd(this, cb); - else if (validChunk(this, state, chunk, cb)) { + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } @@ -251,42 +244,31 @@ Writable.prototype.write = function(chunk, encoding, cb) { return ret; }; -Writable.prototype.cork = function() { +Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; -Writable.prototype.uncork = function() { +Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.bufferedRequest) - clearBuffer(this, state); + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') - encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', -'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] -.indexOf((encoding + '').toLowerCase()) > -1)) - throw new TypeError('Unknown encoding: ' + encoding); + 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') { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = new Buffer(chunk, encoding); } return chunk; @@ -298,16 +280,14 @@ function decodeChunk(state, chunk, encoding) { function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; + if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; @@ -317,6 +297,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); } @@ -329,19 +310,13 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writecb = cb; state.writing = true; state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; - if (sync) - processNextTick(cb, er); - else - cb(er); + if (sync) processNextTick(cb, er);else cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); @@ -361,30 +336,26 @@ function onwrite(stream, er) { onwriteStateUpdate(state); - if (er) - onwriteError(stream, state, sync, er, cb); - else { + if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state); - if (!finished && - !state.corked && - !state.bufferProcessing && - state.bufferedRequest) { + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { - processNextTick(afterWrite, stream, state, finished, cb); + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ } else { - afterWrite(stream, state, finished, cb); - } + afterWrite(stream, state, finished, cb); + } } } function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); + if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); @@ -400,7 +371,6 @@ function onwriteDrain(stream, state) { } } - // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; @@ -408,26 +378,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) { @@ -447,20 +417,21 @@ function clearBuffer(stream, state) { } } - if (entry === null) - state.lastBufferedRequest = null; + if (entry === null) state.lastBufferedRequest = null; } + + state.bufferedRequestCount = 0; state.bufferedRequest = entry; state.bufferProcessing = false; } -Writable.prototype._write = function(chunk, encoding, cb) { +Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('not implemented')); }; Writable.prototype._writev = null; -Writable.prototype.end = function(chunk, encoding, cb) { +Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { @@ -472,8 +443,7 @@ Writable.prototype.end = function(chunk, encoding, cb) { encoding = null; } - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { @@ -482,17 +452,11 @@ Writable.prototype.end = function(chunk, encoding, cb) { } // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); + if (!state.ending && !state.finished) endWritable(this, state, cb); }; - function needFinish(state) { - return (state.ending && - state.length === 0 && - state.bufferedRequest === null && - !state.finished && - !state.writing); + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function prefinish(stream, state) { @@ -520,10 +484,33 @@ function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { - if (state.finished) - processNextTick(cb); - else - stream.once('finish', cb); + if (state.finished) processNextTick(cb);else stream.once('finish', cb); } state.ended = true; + stream.writable = false; } + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/package.json b/tools/eslint/node_modules/readable-stream/package.json index 3e0a2b06d407d3..1bf4d021ae0412 100644 --- a/tools/eslint/node_modules/readable-stream/package.json +++ b/tools/eslint/node_modules/readable-stream/package.json @@ -2,20 +2,24 @@ "_args": [ [ "readable-stream@~2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + "/Users/trott/io.js/tools/node_modules/concat-stream" ] ], "_from": "readable-stream@>=2.0.0 <2.1.0", - "_id": "readable-stream@2.0.5", + "_id": "readable-stream@2.0.6", "_inCache": true, "_installable": true, - "_location": "/eslint/readable-stream", - "_nodeVersion": "5.1.1", + "_location": "/readable-stream", + "_nodeVersion": "5.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, "_npmUser": { "email": "calvin.metcalf@gmail.com", "name": "cwmma" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.6.0", "_phantomChildren": {}, "_requested": { "name": "readable-stream", @@ -26,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/concat-stream" + "/concat-stream" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", - "_shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", "_shrinkwrap": null, "_spec": "readable-stream@~2.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/concat-stream", + "_where": "/Users/trott/io.js/tools/node_modules/concat-stream", "browser": { "util": false }, @@ -42,23 +46,23 @@ "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", - "isarray": "0.0.1", + "isarray": "~1.0.0", "process-nextick-args": "~1.0.6", "string_decoder": "~0.10.x", "util-deprecate": "~1.0.1" }, - "description": "Streams3, a user-land copy of the stream library from iojs v2.x", + "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { "tap": "~0.2.6", - "tape": "~4.0.0", - "zuul": "~3.0.0" + "tape": "~4.5.1", + "zuul": "~3.9.0" }, "directories": {}, "dist": { - "shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" }, - "gitHead": "a4f23d8e451267684a8160679ce16e16149fe72b", + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", @@ -94,8 +98,8 @@ }, "scripts": { "browser": "npm run write-zuul && zuul -- test/browser.js", - "test": "tap test/parallel/*.js", + "test": "tap test/parallel/*.js test/ours/*.js", "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, - "version": "2.0.5" + "version": "2.0.6" } diff --git a/tools/eslint/node_modules/readline2/package.json b/tools/eslint/node_modules/readline2/package.json index 6c0e6ea166fe1c..646942df2d29ed 100644 --- a/tools/eslint/node_modules/readline2/package.json +++ b/tools/eslint/node_modules/readline2/package.json @@ -2,14 +2,14 @@ "_args": [ [ "readline2@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "readline2@>=1.0.1 <2.0.0", "_id": "readline2@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/readline2", + "_location": "/readline2", "_nodeVersion": "0.12.5", "_npmUser": { "email": "admin@simonboudrias.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "admin@simonboudrias.com", "name": "Simon Boudrias" diff --git a/tools/eslint/node_modules/require-uncached/index.js b/tools/eslint/node_modules/require-uncached/index.js new file mode 100644 index 00000000000000..eaabd49c3fdc03 --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/index.js @@ -0,0 +1,18 @@ +'use strict'; +var path = require('path'); +var resolveFrom = require('resolve-from'); +var callerPath = require('caller-path'); + +module.exports = function (moduleId) { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + var filePath = resolveFrom(path.dirname(callerPath()), moduleId); + var tmp = require.cache[filePath]; + delete require.cache[filePath]; + var ret = require(filePath); + require.cache[filePath] = tmp; + + return ret; +}; diff --git a/tools/eslint/node_modules/require-uncached/package.json b/tools/eslint/node_modules/require-uncached/package.json new file mode 100644 index 00000000000000..560f8c18751d82 --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "require-uncached@^1.0.2", + "/Users/trott/io.js/tools/node_modules/eslint" + ] + ], + "_from": "require-uncached@>=1.0.2 <2.0.0", + "_id": "require-uncached@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/require-uncached", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "name": "require-uncached", + "raw": "require-uncached@^1.0.2", + "rawSpec": "^1.0.2", + "scope": null, + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.2.tgz", + "_shasum": "67dad3b733089e77030124678a459589faf6a7ec", + "_shrinkwrap": null, + "_spec": "require-uncached@^1.0.2", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/require-uncached/issues" + }, + "dependencies": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + }, + "description": "Require a module bypassing the cache", + "devDependencies": { + "ava": "0.0.3" + }, + "directories": {}, + "dist": { + "shasum": "67dad3b733089e77030124678a459589faf6a7ec", + "tarball": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/require-uncached", + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "require-uncached", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/require-uncached.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/require-uncached/readme.md b/tools/eslint/node_modules/require-uncached/readme.md new file mode 100644 index 00000000000000..13104be14acea5 --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/readme.md @@ -0,0 +1,44 @@ +# require-uncached [![Build Status](https://travis-ci.org/sindresorhus/require-uncached.svg?branch=master)](https://travis-ci.org/sindresorhus/require-uncached) + +> Require a module bypassing the [cache](http://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly require a module. + + +## Install + +```sh +$ npm install --save require-uncached +``` + + +## Usage + +```js +// foo.js +var i = 0; +module.exports = function () { + return ++i; +}; +``` + +```js +var requireUncached = require('require-uncached'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +requireUncached('./foo')(); +//=> 1 + +requireUncached('./foo')(); +//=> 1 +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/resolve-from/index.js b/tools/eslint/node_modules/resolve-from/index.js new file mode 100644 index 00000000000000..9162f4acf31bef --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/index.js @@ -0,0 +1,19 @@ +'use strict'; +var path = require('path'); +var Module = require('module'); + +module.exports = function (fromDir, moduleId) { + if (typeof fromDir !== 'string' || typeof moduleId !== 'string') { + throw new TypeError('Expected `fromDir` and `moduleId` to be a string'); + } + + fromDir = path.resolve(fromDir); + + var fromFile = path.join(fromDir, 'noop.js'); + + return Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDir) + }); +}; diff --git a/tools/eslint/node_modules/resolve-from/license b/tools/eslint/node_modules/resolve-from/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/resolve-from/package.json b/tools/eslint/node_modules/resolve-from/package.json new file mode 100644 index 00000000000000..6e3afa5c99ebcc --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "resolve-from@^1.0.0", + "/Users/trott/io.js/tools/node_modules/require-uncached" + ] + ], + "_from": "resolve-from@>=1.0.0 <2.0.0", + "_id": "resolve-from@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/resolve-from", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "resolve-from", + "raw": "resolve-from@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/require-uncached" + ], + "_resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "_shasum": "26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226", + "_shrinkwrap": null, + "_spec": "resolve-from@^1.0.0", + "_where": "/Users/trott/io.js/tools/node_modules/require-uncached", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/resolve-from/issues" + }, + "dependencies": {}, + "description": "Resolve the path of a module like require.resolve() but from a given path", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226", + "tarball": "http://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "bae2cf1d66c616ad2eb27e0fe85a10ff0f2dfc92", + "homepage": "https://github.com/sindresorhus/resolve-from", + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "path" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "resolve-from", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/resolve-from.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/resolve-from/readme.md b/tools/eslint/node_modules/resolve-from/readme.md new file mode 100644 index 00000000000000..80a240c48762e3 --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/readme.md @@ -0,0 +1,56 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install --save resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// there's a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDir, moduleId) + +#### fromDir + +Type: `string` + +The directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to require from the same `fromDir` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/resolve/.travis.yml b/tools/eslint/node_modules/resolve/.travis.yml deleted file mode 100644 index 895dbd36234210..00000000000000 --- a/tools/eslint/node_modules/resolve/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index ee27ba4b4412b0..00000000000000 --- a/tools/eslint/node_modules/resolve/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index 6624ff7268f409..00000000000000 --- a/tools/eslint/node_modules/resolve/example/async.js +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 54b2cc1004223d..00000000000000 --- a/tools/eslint/node_modules/resolve/example/sync.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 51f194b4ca7adb..00000000000000 --- a/tools/eslint/node_modules/resolve/index.js +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index fd7f4e5e5c2d02..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/async.js +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100644 index 5536549b046d3c..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/caller.js +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index ea4a6c87effc0b..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/core.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 28560f7ef74126..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/core.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - "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 deleted file mode 100644 index ce0a0d9f2fb104..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/node-modules-paths.js +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index bc4a2a8543dfd0..00000000000000 --- a/tools/eslint/node_modules/resolve/lib/sync.js +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100644 index 73fb88ffb755da..00000000000000 --- a/tools/eslint/node_modules/resolve/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_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 deleted file mode 100644 index 4fab9b04362700..00000000000000 --- a/tools/eslint/node_modules/resolve/readme.markdown +++ /dev/null @@ -1,148 +0,0 @@ -# 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 deleted file mode 100644 index aede52af69933a..00000000000000 --- a/tools/eslint/node_modules/resolve/test/core.js +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index dc836d397c9aa6..00000000000000 --- a/tools/eslint/node_modules/resolve/test/dotdot.js +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 67f2534ebf90dc..00000000000000 --- a/tools/eslint/node_modules/resolve/test/dotdot/abc/index.js +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index afec73603cc717..00000000000000 --- a/tools/eslint/node_modules/resolve/test/dotdot/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 244081882bd617..00000000000000 --- a/tools/eslint/node_modules/resolve/test/faulty_basedir.js +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 07c38f3493924f..00000000000000 --- a/tools/eslint/node_modules/resolve/test/filter.js +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index 3f89b794209653..00000000000000 --- a/tools/eslint/node_modules/resolve/test/filter_sync.js +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 9701478980e278..00000000000000 --- a/tools/eslint/node_modules/resolve/test/mock.js +++ /dev/null @@ -1,142 +0,0 @@ -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 deleted file mode 100644 index 5a0e68cc7a19f3..00000000000000 --- a/tools/eslint/node_modules/resolve/test/mock_sync.js +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100644 index f462610cdc02c6..00000000000000 --- a/tools/eslint/node_modules/resolve/test/module_dir.js +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100644 index 55cd18ca7e60a9..00000000000000 --- a/tools/eslint/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 651aca860d44f0..00000000000000 --- a/tools/eslint/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 4325a0bd5c2bd0..00000000000000 --- a/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c13b8cf6acfd33..00000000000000 --- a/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 684ac8cb9bd342..00000000000000 --- a/tools/eslint/node_modules/resolve/test/node_path.js +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100644 index 1ea591380dfb09..00000000000000 --- a/tools/eslint/node_modules/resolve/test/node_path/x/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f186fa7574fe9b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/node_path/x/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e22dd83c0ca44e..00000000000000 --- a/tools/eslint/node_modules/resolve/test/node_path/y/bbb/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d0043d1ec4a0ea..00000000000000 --- a/tools/eslint/node_modules/resolve/test/node_path/y/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'CY' diff --git a/tools/eslint/node_modules/resolve/test/nonstring.js b/tools/eslint/node_modules/resolve/test/nonstring.js deleted file mode 100644 index ef63c40f9393dc..00000000000000 --- a/tools/eslint/node_modules/resolve/test/nonstring.js +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 3dbc2a8007b65a..00000000000000 --- a/tools/eslint/node_modules/resolve/test/pathfilter.js +++ /dev/null @@ -1,35 +0,0 @@ -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/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/main.js b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/main.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 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 deleted file mode 100644 index fe4b408a06d41a..00000000000000 --- a/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "deep", - "version": "1.2.3" -} diff --git a/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/precedence.js b/tools/eslint/node_modules/resolve/test/precedence.js deleted file mode 100644 index 6593de9606f6ab..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence.js +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index a182397c5133e2..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence/aaa.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 993b03c2cea1a1..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index db38959d72f2cf..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence/aaa/main.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c8a9996b39ba5f..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence/bbb.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 716b81d4bd463f..00000000000000 --- a/tools/eslint/node_modules/resolve/test/precedence/bbb/main.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f0d6ccf1e0402c..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver.js +++ /dev/null @@ -1,281 +0,0 @@ -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 deleted file mode 100644 index bd816eaba4ca3b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/tools/eslint/node_modules/resolve/test/resolver/baz/doom.js b/tools/eslint/node_modules/resolve/test/resolver/baz/doom.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/resolver/baz/package.json b/tools/eslint/node_modules/resolve/test/resolver/baz/package.json deleted file mode 100644 index 6b81dcddfc4a22..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/baz/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index bd816eaba4ca3b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/baz/quux.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 0379e29f701f92..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index babaac58fddb1b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 49960555ab4cf8..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 690aad34a46dc9..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/resolver/foo.js b/tools/eslint/node_modules/resolve/test/resolver/foo.js deleted file mode 100644 index bd816eaba4ca3b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/foo.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bc1fb0a6f4ede1..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// 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 deleted file mode 100644 index 1592ed393718f8..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/tools/eslint/node_modules/resolve/test/resolver/mug.js b/tools/eslint/node_modules/resolve/test/resolver/mug.js deleted file mode 100644 index e69de29bb2d1d6..00000000000000 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 deleted file mode 100644 index e69de29bb2d1d6..00000000000000 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 deleted file mode 100644 index e69de29bb2d1d6..00000000000000 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 deleted file mode 100644 index e69de29bb2d1d6..00000000000000 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 deleted file mode 100644 index bd816eaba4ca3b..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/quux/foo/index.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b62aa0e0ae08fa..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/without_basedir/main.js +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 2b58aa4087d758..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 04cc855c75c5b0..00000000000000 --- a/tools/eslint/node_modules/resolve/test/resolver_sync.js +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100644 index b7b8450a9ef231..00000000000000 --- a/tools/eslint/node_modules/resolve/test/subdirs.js +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 3cc0ecbedfe42f..00000000000000 --- a/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json +++ /dev/null @@ -1 +0,0 @@ -[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 deleted file mode 100644 index 0967ef424bce67..00000000000000 --- a/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tools/eslint/node_modules/restore-cursor/package.json b/tools/eslint/node_modules/restore-cursor/package.json index e7ff8d75f6334b..033867aac0e829 100644 --- a/tools/eslint/node_modules/restore-cursor/package.json +++ b/tools/eslint/node_modules/restore-cursor/package.json @@ -2,14 +2,14 @@ "_args": [ [ "restore-cursor@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/cli-cursor" + "/Users/trott/io.js/tools/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", + "_location": "/restore-cursor", "_nodeVersion": "4.1.0", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/cli-cursor" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/cli-cursor", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/common.js b/tools/eslint/node_modules/rimraf/node_modules/glob/common.js deleted file mode 100644 index b280e76cee9be6..00000000000000 --- a/tools/eslint/node_modules/rimraf/node_modules/glob/common.js +++ /dev/null @@ -1,226 +0,0 @@ -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/package.json b/tools/eslint/node_modules/rimraf/node_modules/glob/package.json deleted file mode 100644 index 6405125e7f396e..00000000000000 --- a/tools/eslint/node_modules/rimraf/node_modules/glob/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_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 deleted file mode 100644 index aa28c87a3e5daf..00000000000000 --- a/tools/eslint/node_modules/rimraf/node_modules/glob/sync.js +++ /dev/null @@ -1,466 +0,0 @@ -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 index 81e560b3210b33..5c5532fe7c0cd6 100644 --- a/tools/eslint/node_modules/rimraf/package.json +++ b/tools/eslint/node_modules/rimraf/package.json @@ -2,14 +2,14 @@ "_args": [ [ "rimraf@^2.2.8", - "/Users/trott/test/node_modules/eslint/node_modules/del" + "/Users/trott/io.js/tools/node_modules/del" ] ], "_from": "rimraf@>=2.2.8 <3.0.0", "_id": "rimraf@2.5.2", "_inCache": true, "_installable": true, - "_location": "/eslint/rimraf", + "_location": "/rimraf", "_nodeVersion": "5.6.0", "_npmOperationalInternal": { "host": "packages-6-west.internal.npmjs.com", @@ -20,13 +20,7 @@ "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" - }, + "_phantomChildren": {}, "_requested": { "name": "rimraf", "raw": "rimraf@^2.2.8", @@ -36,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/del" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/del", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", @@ -65,7 +59,7 @@ "directories": {}, "dist": { "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", - "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" + "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" }, "files": [ "LICENSE", diff --git a/tools/eslint/node_modules/run-async/.editorconfig b/tools/eslint/node_modules/run-async/.editorconfig deleted file mode 100644 index 6d740d54dbe4f1..00000000000000 --- a/tools/eslint/node_modules/run-async/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# 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 deleted file mode 100644 index 176a458f94e0ea..00000000000000 --- a/tools/eslint/node_modules/run-async/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/tools/eslint/node_modules/run-async/.jshintrc b/tools/eslint/node_modules/run-async/.jshintrc deleted file mode 100644 index 3e4ba5a6357b53..00000000000000 --- a/tools/eslint/node_modules/run-async/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "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/tools/eslint/node_modules/run-async/.npmignore b/tools/eslint/node_modules/run-async/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/tools/eslint/node_modules/run-async/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/tools/eslint/node_modules/run-async/.travis.yml b/tools/eslint/node_modules/run-async/.travis.yml deleted file mode 100644 index 244b7e88e3273c..00000000000000 --- a/tools/eslint/node_modules/run-async/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - '0.10' diff --git a/tools/eslint/node_modules/run-async/README.md b/tools/eslint/node_modules/run-async/README.md index c86374b23f5658..d89123ca19eaf5 100644 --- a/tools/eslint/node_modules/run-async/README.md +++ b/tools/eslint/node_modules/run-async/README.md @@ -46,5 +46,5 @@ runAsync(asyncFn, function (answer) { Licence ======== -Copyright (c) 2014 Simon Boudrias (twitter: @vaxilart) +Copyright (c) 2014 Simon Boudrias (twitter: @vaxilart) Licensed under the MIT license. diff --git a/tools/eslint/node_modules/run-async/package.json b/tools/eslint/node_modules/run-async/package.json index 337564dce1707e..a90fe41c7a0f1b 100644 --- a/tools/eslint/node_modules/run-async/package.json +++ b/tools/eslint/node_modules/run-async/package.json @@ -2,14 +2,14 @@ "_args": [ [ "run-async@^0.1.0", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/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", + "_location": "/run-async", "_npmUser": { "email": "admin@simonboudrias.com", "name": "sboudrias" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "admin@simonboudrias.com", "name": "Simon Boudrias" diff --git a/tools/eslint/node_modules/run-async/test.js b/tools/eslint/node_modules/run-async/test.js deleted file mode 100644 index 0a82fedf198661..00000000000000 --- a/tools/eslint/node_modules/run-async/test.js +++ /dev/null @@ -1,51 +0,0 @@ -'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 index decda62b654083..46937107f80a2f 100644 --- a/tools/eslint/node_modules/rx-lite/package.json +++ b/tools/eslint/node_modules/rx-lite/package.json @@ -2,14 +2,14 @@ "_args": [ [ "rx-lite@^3.1.2", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/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", + "_location": "/rx-lite", "_nodeVersion": "0.12.7", "_npmUser": { "email": "matthew.podwysocki@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "name": "Cloud Programmability Team", "url": "https://github.com/Reactive-Extensions/RxJS/blob/master/authors.txt" diff --git a/tools/eslint/node_modules/rx-lite/readme.md b/tools/eslint/node_modules/rx-lite/readme.md index e4eb3dbba78518..8143ccc2b234e9 100644 --- a/tools/eslint/node_modules/rx-lite/readme.md +++ b/tools/eslint/node_modules/rx-lite/readme.md @@ -4,7 +4,7 @@ The Reactive Extensions for JavaScript Lite version is a lightweight version of ## Getting Started -There are a number of ways to get started with RxJS. +There are a number of ways to get started with RxJS. ### Installing with [NPM](https://npmjs.org/) @@ -63,7 +63,7 @@ var Rx = require('rx-lite'); - [`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) +- [`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) diff --git a/tools/eslint/node_modules/rx-lite/rx.lite.js b/tools/eslint/node_modules/rx-lite/rx.lite.js index e38d7a5defb2ac..21e9aa5b97a7fa 100644 --- a/tools/eslint/node_modules/rx-lite/rx.lite.js +++ b/tools/eslint/node_modules/rx-lite/rx.lite.js @@ -1811,7 +1811,7 @@ var FlatMapObservable = (function(__super__){ 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) { @@ -1836,7 +1836,7 @@ var FlatMapObservable = (function(__super__){ isDisposed = true; })); }; - + function InnerObserver(o, s, e) { this.o = o; this.s = s; @@ -1865,21 +1865,21 @@ var FlatMapObservable = (function(__super__){ } 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$](); @@ -1908,7 +1908,7 @@ var FlatMapObservable = (function(__super__){ isDisposed = true; })); }; - + return CatchErrorObservable; }(ObservableBase)); @@ -1969,18 +1969,18 @@ var FlatMapObservable = (function(__super__){ })); }); }; - + 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; @@ -1988,16 +1988,16 @@ var FlatMapObservable = (function(__super__){ 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) { @@ -2007,7 +2007,7 @@ var FlatMapObservable = (function(__super__){ OfEnumerable.prototype[$iterator$] = function () { return new OfEnumerator(this); }; - + function OfEnumerator(p) { this.i = -1; this.s = p.s; @@ -2017,9 +2017,9 @@ var FlatMapObservable = (function(__super__){ 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)); @@ -2064,7 +2064,7 @@ var FlatMapObservable = (function(__super__){ this.o.onError(e); return true; } - + return false; }; @@ -3862,7 +3862,7 @@ observableProto.zipIterable = function () { }; /** - * 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 @@ -4138,11 +4138,11 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA 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; @@ -4151,7 +4151,7 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA } InnerObserver.prototype.onNext = function (x) { if (this.isStopped) { return; } - if (this.r <= 0) { + if (this.r <= 0) { this.o.onNext(x); } else { this.r--; @@ -4172,10 +4172,10 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA } 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. @@ -4280,7 +4280,7 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA 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); } } @@ -4288,7 +4288,7 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA 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; @@ -4296,7 +4296,7 @@ Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisA 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); @@ -4376,7 +4376,7 @@ function createCbHandler(o, ctx, selector) { */ Observable.fromCallback = function (fn, ctx, selector) { return function () { - typeof ctx === 'undefined' && (ctx = this); + typeof ctx === 'undefined' && (ctx = this); var len = arguments.length, args = new Array(len) for(var i = 0; i < len; i++) { args[i] = arguments[i]; } @@ -4426,7 +4426,7 @@ function createNodeHandler(o, ctx, selector) { */ Observable.fromNodeCallback = function (fn, ctx, selector) { return function () { - typeof ctx === 'undefined' && (ctx = this); + 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); @@ -5150,7 +5150,7 @@ Observable.fromNodeCallback = function (fn, ctx, selector) { function (e) { o.onError(e); }, function () { atEnd = true; - sourceSubscription.dispose(); + sourceSubscription.dispose(); } )); diff --git a/tools/eslint/node_modules/shelljs/.documentup.json b/tools/eslint/node_modules/shelljs/.documentup.json deleted file mode 100644 index 57fe30116b7659..00000000000000 --- a/tools/eslint/node_modules/shelljs/.documentup.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ShellJS", - "twitter": [ - "r2r" - ] -} diff --git a/tools/eslint/node_modules/shelljs/.jshintrc b/tools/eslint/node_modules/shelljs/.jshintrc deleted file mode 100644 index a80c559aa14d6d..00000000000000 --- a/tools/eslint/node_modules/shelljs/.jshintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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 deleted file mode 100644 index 6b20c38ae7d468..00000000000000 --- a/tools/eslint/node_modules/shelljs/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 335f4f45d63834..00000000000000 --- a/tools/eslint/node_modules/shelljs/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -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 index fb35c092f1a8a7..0f0f119be840a3 100644 --- a/tools/eslint/node_modules/shelljs/LICENSE +++ b/tools/eslint/node_modules/shelljs/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012, Artur Adib +Copyright (c) 2012, Artur Adib All rights reserved. You may use this project under the terms of the New BSD license as follows: @@ -14,13 +14,13 @@ modification, are permitted provided that the following conditions are met: 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 +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 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/shelljs/MAINTAINERS b/tools/eslint/node_modules/shelljs/MAINTAINERS new file mode 100644 index 00000000000000..3f94761505a94b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/MAINTAINERS @@ -0,0 +1,3 @@ +Ari Porad (@ariporad) +Nate Fischer (@nfischer) +Artur Adib (@arturadib) diff --git a/tools/eslint/node_modules/shelljs/README.md b/tools/eslint/node_modules/shelljs/README.md index d08d13e8b06eb5..d6dcb63408653a 100644 --- a/tools/eslint/node_modules/shelljs/README.md +++ b/tools/eslint/node_modules/shelljs/README.md @@ -1,8 +1,12 @@ -# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs) +# ShellJS - Unix shell commands for Node.js + +[![Join the chat at https://gitter.im/shelljs/shelljs](https://badges.gitter.im/shelljs/shelljs.svg)](https://gitter.im/shelljs/shelljs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/shelljs/shelljs.svg?branch=master)](http://travis-ci.org/shelljs/shelljs) +[![Build status](https://ci.appveyor.com/api/projects/status/42txr0s3ux5wbumv/branch/master?svg=true)](https://ci.appveyor.com/project/shelljs/shelljs) ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! -The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like: +The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battled-tested in projects like: + [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader + [Firebug](http://getfirebug.com/) - Firefox's infamous debugger @@ -13,7 +17,7 @@ The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled and [many more](https://npmjs.org/browse/depended/shelljs). -Connect with [@r2r](http://twitter.com/r2r) on Twitter for questions, suggestions, etc. +If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). ## Installing @@ -30,9 +34,6 @@ run ShellJS scripts much like any shell script from the command line, i.e. witho $ shjs my_script ``` -You can also just copy `shell.js` into your project's directory, and `require()` accordingly. - - ## Examples ### JavaScript @@ -67,6 +68,8 @@ if (exec('git commit -am "Auto-commit"').code !== 0) { ### CoffeeScript +CoffeeScript is also supported automatically: + ```coffeescript require 'shelljs/global' @@ -83,7 +86,7 @@ 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 + sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file cd '..' # Run external tool synchronously @@ -105,31 +108,38 @@ 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): +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. -```coffeescript -require 'shelljs/make' - -target.all = -> - target.bundle() - target.docs() +Example: -target.bundle = -> - cd __dirname - mkdir 'build' - cd 'lib' - (cat '*.js').to '../build/output.js' +```javascript +require('shelljs/make'); -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' +target.all = function() { + target.bundle(); + target.docs(); +}; + +target.bundle = function() { + cd(__dirname); + mkdir('-p', 'build'); + cd('src'); + cat('*.js').to('../build/output.js'); +}; + +target.docs = function() { + cd(__dirname); + mkdir('-p', 'docs'); + var files = ls('src/*.js'); + for(var i = 0; i < files.length; i++) { + var text = grep('//@', files[i]); // extract special comments + text = text.replace(/\/\/@/g, ''); // remove comment tags + text.toEnd('docs/my_docs.md'); + } +}; ``` To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`. @@ -155,20 +165,26 @@ target.bundle = function(argsArray) { All commands run synchronously, unless otherwise stated. -### cd('dir') -Changes to directory `dir` for the duration of the script +### cd([dir]) +Changes to directory `dir` for the duration of the script. Changes to home +directory if no argument is supplied. ### pwd() Returns the current directory. -### ls([options ,] path [,path ...]) -### ls([options ,] path_array) +### ls([options,] [path, ...]) +### ls([options,] path_array) Available options: + `-R`: recursive + `-A`: all files (include files beginning with `.`, except for `.` and `..`) ++ `-d`: list directories themselves, not their contents ++ `-l`: list objects representing each file, each with fields containing `ls + -l` output fields. See + [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) + for more info Examples: @@ -176,12 +192,13 @@ Examples: ls('projs/*.js'); ls('-R', '/users/me', '/tmp'); ls('-R', ['/users/me', '/tmp']); // same as above +ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} ``` Returns array of files in the given path, or in current directory if no path provided. -### find(path [,path ...]) +### find(path [, path ...]) ### find(path_array) Examples: @@ -197,11 +214,12 @@ 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) +### cp([options,] source [, source ...], dest) +### cp([options,] source_array, dest) Available options: -+ `-f`: force ++ `-f`: force (default behavior) ++ `-n`: no-clobber + `-r, -R`: recursive Examples: @@ -215,8 +233,8 @@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above Copies files. The wildcard `*` is accepted. -### rm([options ,] file [, file ...]) -### rm([options ,] file_array) +### rm([options,] file [, file ...]) +### rm([options,] file_array) Available options: + `-f`: force @@ -233,16 +251,17 @@ rm(['some_file.txt', 'another_file.txt']); // same as above Removes files. The wildcard `*` is accepted. -### mv(source [, source ...], dest') -### mv(source_array, dest') +### mv([options ,] source [, source ...], dest') +### mv([options ,] source_array, dest') Available options: -+ `f`: force ++ `-f`: force (default behavior) ++ `-n`: no-clobber Examples: ```javascript -mv('-f', 'file', 'dir/'); +mv('-n', 'file', 'dir/'); mv('file1', 'file2', 'dir/'); mv(['file1', 'file2'], 'dir/'); // same as above ``` @@ -250,11 +269,11 @@ mv(['file1', 'file2'], 'dir/'); // same as above Moves files. The wildcard `*` is accepted. -### mkdir([options ,] dir [, dir ...]) -### mkdir([options ,] dir_array) +### mkdir([options,] dir [, dir ...]) +### mkdir([options,] dir_array) Available options: -+ `p`: full path (will create intermediate dirs if necessary) ++ `-p`: full path (will create intermediate dirs if necessary) Examples: @@ -328,7 +347,8 @@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaS those returned by `cat`, `grep`, etc). -### sed([options ,] search_regex, replacement, file) +### sed([options,] search_regex, replacement, file [, file ...]) +### sed([options,] search_regex, replacement, file_array) Available options: + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ @@ -340,12 +360,12 @@ 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 +Reads an input string from `files` and performs a JavaScript `replace()` on the input using the given search regex and replacement string or function. Returns the new string after replacement. -### grep([options ,] regex_filter, file [, file ...]) -### grep([options ,] regex_filter, file_array) +### 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. @@ -369,11 +389,12 @@ Examples: var nodeExec = which('node'); ``` -Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +Searches for `command` in the system's PATH. On Windows, this uses the +`PATHEXT` variable to append the extension if it's not already executable. Returns string containing the absolute path to the command. -### echo(string [,string ...]) +### echo(string [, string ...]) Examples: @@ -447,12 +468,11 @@ Display the list of currently remembered directories. Returns an array of paths See also: pushd, popd -### ln(options, source, dest) -### ln(source, dest) +### ln([options,] source, dest) Available options: -+ `s`: symlink -+ `f`: force ++ `-s`: symlink ++ `-f`: force Examples: @@ -473,29 +493,33 @@ Object containing environment variables (both getter and setter). Shortcut to pr ### exec(command [, options] [, callback]) Available options (all `false` by default): -+ `async`: Asynchronous execution. Defaults to true if a callback is provided. ++ `async`: Asynchronous execution. If a callback is provided, it will be set to + `true`, regardless of the passed value. + `silent`: Do not echo program output to console. ++ and any option available to NodeJS's + [child_process.exec()](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) Examples: ```javascript -var version = exec('node --version', {silent:true}).output; +var version = exec('node --version', {silent:true}).stdout; var child = exec('some_long_running_process', {async:true}); child.stdout.on('data', function(data) { /* ... do something with data ... */ }); -exec('some_long_running_process', function(code, output) { +exec('some_long_running_process', function(code, stdout, stderr) { console.log('Exit code:', code); - console.log('Program output:', output); + console.log('Program output:', stdout); + console.log('Program stderr:', stderr); }); ``` -Executes the given `command` _synchronously_, unless otherwise specified. -When in synchronous mode returns the object `{ code:..., 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)`. +Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +`stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +and the `callback` gets the arguments `(code, stdout, stderr)`. **Note:** For long-lived processes, it's best to run `exec()` asynchronously as the current synchronous implementation uses a lot of CPU. This should be getting @@ -529,6 +553,44 @@ Notable exceptions: + There is no "quiet" option since default behavior is to run silent. +### touch([options,] file) +Available options: + ++ `-a`: Change only the access time ++ `-c`: Do not create any files ++ `-m`: Change only the modification time ++ `-d DATE`: Parse DATE and use it instead of current time ++ `-r FILE`: Use FILE's times instead of current time + +Examples: + +```javascript +touch('source.js'); +touch('-c', '/path/to/some/dir/source.js'); +touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +``` + +Update the access and modification times of each FILE to the current time. +A FILE argument that does not exist is created empty, unless -c is supplied. +This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. + + +### set(options) +Available options: + ++ `+/-e`: exit upon error (`config.fatal`) ++ `+/-v`: verbose: show all commands (`config.verbose`) + +Examples: + +```javascript +set('-e'); // exit upon first error +set('+e'); // this undoes a "set('-e')" +``` + +Sets global configuration variables + + ## Non-Unix commands @@ -571,9 +633,26 @@ Example: ```javascript require('shelljs/global'); -config.fatal = true; +config.fatal = true; // or set('-e'); cp('this_file_does_not_exist', '/dev/null'); // dies here /* more commands... */ ``` -If `true` the script will die on errors. Default is `false`. +If `true` the script will die on errors. Default is `false`. This is +analogous to Bash's `set -e` + +### config.verbose +Example: + +```javascript +config.verbose = true; // or set('-v'); +cd('dir/'); +ls('subdir/'); +``` + +Will print each command as follows: + +``` +cd dir/ +ls subdir/ +``` diff --git a/tools/eslint/node_modules/shelljs/RELEASE.md b/tools/eslint/node_modules/shelljs/RELEASE.md deleted file mode 100644 index 69ef3fbb0a7832..00000000000000 --- a/tools/eslint/node_modules/shelljs/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 index d239a7ad4b987a..aae3bc64ce2b68 100755 --- a/tools/eslint/node_modules/shelljs/bin/shjs +++ b/tools/eslint/node_modules/shelljs/bin/shjs @@ -37,7 +37,9 @@ if (scriptName.match(/\.coffee$/)) { // CoffeeScript // if (which('coffee')) { - exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); + exec('coffee "' + scriptName + '" ' + args.join(' '), function(code) { + process.exit(code); + }); } else { console.log('ShellJS: CoffeeScript interpreter not found'); console.log(); @@ -47,5 +49,7 @@ if (scriptName.match(/\.coffee$/)) { // // JavaScript // - exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); + exec('node "' + scriptName + '" ' + args.join(' '), function(code) { + process.exit(code); + }); } diff --git a/tools/eslint/node_modules/shelljs/build/output.js b/tools/eslint/node_modules/shelljs/build/output.js new file mode 100644 index 00000000000000..1b778b93183ee1 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/build/output.js @@ -0,0 +1,2411 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### cat(file [, file ...]) +//@ ### cat(file_array) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = cat('file*.txt'); +//@ var str = cat('file1', 'file2'); +//@ var str = cat(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Returns a string containing the given file, or a concatenated string +//@ containing the files if more than one file is given (a new line character is +//@ introduced between each file). Wildcard `*` accepted. +function _cat(options, files) { + var cat = ''; + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + cat += fs.readFileSync(file, 'utf8'); + }); + + return common.ShellString(cat); +} +module.exports = _cat; + +var fs = require('fs'); +var common = require('./common'); + +//@ +//@ ### cd([dir]) +//@ Changes to directory `dir` for the duration of the script. Changes to home +//@ directory if no argument is supplied. +function _cd(options, dir) { + if (!dir) + dir = common.getUserHome(); + + if (dir === '-') { + if (!common.state.previousDir) + common.error('could not find previous directory'); + else + dir = common.state.previousDir; + } + + if (!fs.existsSync(dir)) + common.error('no such file or directory: ' + dir); + + if (!fs.statSync(dir).isDirectory()) + common.error('not a directory: ' + dir); + + common.state.previousDir = process.cwd(); + process.chdir(dir); +} +module.exports = _cd; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +var PERMS = (function (base) { + return { + OTHER_EXEC : base.EXEC, + OTHER_WRITE : base.WRITE, + OTHER_READ : base.READ, + + GROUP_EXEC : base.EXEC << 3, + GROUP_WRITE : base.WRITE << 3, + GROUP_READ : base.READ << 3, + + OWNER_EXEC : base.EXEC << 6, + OWNER_WRITE : base.WRITE << 6, + OWNER_READ : base.READ << 6, + + // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is + // the preferred way, else a jshint warning is thrown. + STICKY : parseInt('01000', 8), + SETGID : parseInt('02000', 8), + SETUID : parseInt('04000', 8), + + TYPE_MASK : parseInt('0770000', 8) + }; +})({ + EXEC : 1, + WRITE : 2, + READ : 4 +}); + +//@ +//@ ### chmod(octal_mode || octal_string, file) +//@ ### chmod(symbolic_mode, file) +//@ +//@ Available options: +//@ +//@ + `-v`: output a diagnostic for every file processed//@ +//@ + `-c`: like verbose but report only when a change is made//@ +//@ + `-R`: change files and directories recursively//@ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ chmod(755, '/Users/brandon'); +//@ chmod('755', '/Users/brandon'); // same as above +//@ chmod('u+x', '/Users/brandon'); +//@ ``` +//@ +//@ Alters the permissions of a file or directory by either specifying the +//@ absolute permissions in octal form or expressing the changes in symbols. +//@ This command tries to mimic the POSIX behavior as much as possible. +//@ Notable exceptions: +//@ +//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is +//@ given to the umask. +//@ + There is no "quiet" option since default behavior is to run silent. +function _chmod(options, mode, filePattern) { + if (!filePattern) { + if (options.length > 0 && options.charAt(0) === '-') { + // Special case where the specified file permissions started with - to subtract perms, which + // get picked up by the option parser as command flags. + // If we are down by one argument and options starts with -, shift everything over. + filePattern = mode; + mode = options; + options = ''; + } + else { + common.error('You must specify a file.'); + } + } + + options = common.parseOptions(options, { + 'R': 'recursive', + 'c': 'changes', + 'v': 'verbose' + }); + + if (typeof filePattern === 'string') { + filePattern = [ filePattern ]; + } + + var files; + + if (options.recursive) { + files = []; + common.expand(filePattern).forEach(function addFile(expandedFile) { + var stat = fs.lstatSync(expandedFile); + + if (!stat.isSymbolicLink()) { + files.push(expandedFile); + + if (stat.isDirectory()) { // intentionally does not follow symlinks. + fs.readdirSync(expandedFile).forEach(function (child) { + addFile(expandedFile + '/' + child); + }); + } + } + }); + } + else { + files = common.expand(filePattern); + } + + files.forEach(function innerChmod(file) { + file = path.resolve(file); + if (!fs.existsSync(file)) { + common.error('File not found: ' + file); + } + + // When recursing, don't follow symlinks. + if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { + return; + } + + var stat = fs.statSync(file); + var isDir = stat.isDirectory(); + var perms = stat.mode; + var type = perms & PERMS.TYPE_MASK; + + var newPerms = perms; + + if (isNaN(parseInt(mode, 8))) { + // parse options + mode.split(',').forEach(function (symbolicMode) { + /*jshint regexdash:true */ + var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; + var matches = pattern.exec(symbolicMode); + + if (matches) { + var applyTo = matches[1]; + var operator = matches[2]; + var change = matches[3]; + + var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; + var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; + var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; + + var changeRead = change.indexOf('r') != -1; + var changeWrite = change.indexOf('w') != -1; + var changeExec = change.indexOf('x') != -1; + var changeExecDir = change.indexOf('X') != -1; + var changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + if (changeExecDir && isDir) + changeExec = true; + + var mask = 0; + if (changeOwner) { + mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); + } + if (changeGroup) { + mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); + } + if (changeOther) { + mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); + } + + // Sticky bit is special - it's not tied to user, group or other. + if (changeSticky) { + mask |= PERMS.STICKY; + } + + switch (operator) { + case '+': + newPerms |= mask; + break; + + case '-': + newPerms &= ~mask; + break; + + case '=': + newPerms = type + mask; + + // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + break; + } + + if (options.verbose) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms != newPerms) { + if (!options.verbose && options.changes) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + perms = newPerms; // for the next round of changes! + } + } + else { + common.error('Invalid symbolic mode change: ' + symbolicMode); + } + }); + } + else { + // they gave us a full number + newPerms = type + parseInt(mode, 8); + + // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + + fs.chmodSync(file, newPerms); + } + }); +} +module.exports = _chmod; + +var os = require('os'); +var fs = require('fs'); +var _ls = require('./ls'); + +// Module globals +var config = { + silent: false, + fatal: false, + verbose: false, +}; +exports.config = config; + +var state = { + error: null, + currentCmd: 'shell.js', + previousDir: null, + tempDir: null +}; +exports.state = state; + +var platform = os.type().match(/^Win/) ? 'win' : 'unix'; +exports.platform = platform; + +function log() { + if (!config.silent) + console.error.apply(console, arguments); +} +exports.log = log; + +// Shows error message. Throws unless _continue or config.fatal are true +function error(msg, _continue) { + if (state.error === null) + state.error = ''; + var log_entry = state.currentCmd + ': ' + msg; + if (state.error === '') + state.error = log_entry; + else + state.error += '\n' + log_entry; + + if (msg.length > 0) + log(log_entry); + + if (config.fatal) + process.exit(1); + + if (!_continue) + throw ''; +} +exports.error = error; + +// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. +// For now, this is a dummy function to bookmark places we need such strings +function ShellString(str) { + return str; +} +exports.ShellString = ShellString; + +// Return the home directory in a platform-agnostic way, with consideration for +// older versions of node +function getUserHome() { + var result; + if (os.homedir) + result = os.homedir(); // node 3+ + else + result = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']; + return result; +} +exports.getUserHome = getUserHome; + +// Returns {'alice': true, 'bob': false} when passed a dictionary, e.g.: +// parseOptions('-a', {'a':'alice', 'b':'bob'}); +function parseOptions(str, map) { + if (!map) + error('parseOptions() internal error: no map given'); + + // All options are false by default + var options = {}; + for (var letter in map) { + if (!map[letter].match('^!')) + options[map[letter]] = false; + } + + if (!str) + return options; // defaults + + if (typeof str !== 'string') + error('parseOptions() internal error: wrong str'); + + // e.g. match[1] = 'Rf' for str = '-Rf' + var match = str.match(/^\-(.+)/); + if (!match) + return options; + + // e.g. chars = ['R', 'f'] + var chars = match[1].split(''); + + var opt; + chars.forEach(function(c) { + if (c in map) { + opt = map[c]; + if (opt.match('^!')) + options[opt.slice(1, opt.length-1)] = false; + else + options[opt] = true; + } else { + error('option not recognized: '+c); + } + }); + + return options; +} +exports.parseOptions = parseOptions; + +// Expands wildcards with matching (ie. existing) file names. +// For example: +// expand(['file*.js']) = ['file1.js', 'file2.js', ...] +// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) +function expand(list) { + var expanded = []; + list.forEach(function(listEl) { + // Wildcard present on directory names ? + if(listEl.search(/\*[^\/]*\//) > -1 || listEl.search(/\*\*[^\/]*\//) > -1) { + var match = listEl.match(/^([^*]+\/|)(.*)/); + var root = match[1]; + var rest = match[2]; + var restRegex = rest.replace(/\*\*/g, ".*").replace(/\*/g, "[^\\/]*"); + restRegex = new RegExp(restRegex); + + _ls('-R', root).filter(function (e) { + return restRegex.test(e); + }).forEach(function(file) { + expanded.push(file); + }); + } + // Wildcard present on file names ? + else if (listEl.search(/\*/) > -1) { + _ls('', listEl).forEach(function(file) { + expanded.push(file); + }); + } else { + expanded.push(listEl); + } + }); + return expanded; +} +exports.expand = expand; + +// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. +// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 +function unlinkSync(file) { + try { + fs.unlinkSync(file); + } catch(e) { + // Try to override file permission + if (e.code === 'EPERM') { + fs.chmodSync(file, '0666'); + fs.unlinkSync(file); + } else { + throw e; + } + } +} +exports.unlinkSync = unlinkSync; + +// e.g. 'shelljs_a5f185d0443ca...' +function randomFileName() { + function randomHash(count) { + if (count === 1) + return parseInt(16*Math.random(), 10).toString(16); + else { + var hash = ''; + for (var i=0; i and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + if (options.recursive) { + // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" + // (see Github issue #15) + sources.forEach(function(src, i) { + if (src[src.length - 1] === '/') { + sources[i] += '*'; + // If src is a directory and dest doesn't exist, 'cp -r src dest' should copy src/* into dest + } else if (fs.statSync(src).isDirectory() && !exists) { + sources[i] += '/*'; + } + }); + + // Create dest + try { + fs.mkdirSync(dest, parseInt('0777', 8)); + } catch (e) { + // like Unix's cp, keep going even if we can't create dest dir + } + } + + sources = common.expand(sources); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + if (fs.statSync(src).isDirectory()) { + if (!options.recursive) { + // Non-Recursive + common.log(src + ' is a directory (not copied)'); + } else { + // Recursive + // 'cp /a/source dest' should create 'source' in 'dest' + var newDest = path.join(dest, path.basename(src)), + checkDir = fs.statSync(src); + try { + fs.mkdirSync(newDest, checkDir.mode); + } catch (e) { + //if the directory already exists, that's okay + if (e.code !== 'EEXIST') { + common.error('dest file no such file or directory: ' + newDest, true); + throw e; + } + } + + cpdirSyncRecursive(src, newDest, {no_force: options.no_force}); + } + return; // done with dir + } + + // If here, src is a file + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + copyFileSync(src, thisDest); + }); // forEach(src) +} +module.exports = _cp; + +var common = require('./common'); +var _cd = require('./cd'); +var path = require('path'); + +// Pushd/popd/dirs internals +var _dirStack = []; + +function _isStackIndex(index) { + return (/^[\-+]\d+$/).test(index); +} + +function _parseStackIndex(index) { + if (_isStackIndex(index)) { + if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd + return (/^-/).test(index) ? Number(index) - 1 : Number(index); + } else { + common.error(index + ': directory stack index out of range'); + } + } else { + common.error(index + ': invalid number'); + } +} + +function _actualDirStack() { + return [process.cwd()].concat(_dirStack); +} + +//@ +//@ ### pushd([options,] [dir | '-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. +//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ // process.cwd() === '/usr' +//@ pushd('/etc'); // Returns /etc /usr +//@ pushd('+1'); // Returns /usr /etc +//@ ``` +//@ +//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. +function _pushd(options, dir) { + if (_isStackIndex(options)) { + dir = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + var dirs = _actualDirStack(); + + if (dir === '+0') { + return dirs; // +0 is a noop + } else if (!dir) { + if (dirs.length > 1) { + dirs = dirs.splice(1, 1).concat(dirs); + } else { + return common.error('no other directory'); + } + } else if (_isStackIndex(dir)) { + var n = _parseStackIndex(dir); + dirs = dirs.slice(n).concat(dirs.slice(0, n)); + } else { + if (options['no-cd']) { + dirs.splice(1, 0, dir); + } else { + dirs.unshift(dir); + } + } + + if (options['no-cd']) { + dirs = dirs.slice(1); + } else { + dir = path.resolve(dirs.shift()); + _cd('', dir); + } + + _dirStack = dirs; + return _dirs(''); +} +exports.pushd = _pushd; + +//@ +//@ ### popd([options,] ['-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. +//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo(process.cwd()); // '/usr' +//@ pushd('/etc'); // '/etc /usr' +//@ echo(process.cwd()); // '/etc' +//@ popd(); // '/usr' +//@ echo(process.cwd()); // '/usr' +//@ ``` +//@ +//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. +function _popd(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + if (!_dirStack.length) { + return common.error('directory stack empty'); + } + + index = _parseStackIndex(index || '+0'); + + if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { + index = index > 0 ? index - 1 : index; + _dirStack.splice(index, 1); + } else { + var dir = path.resolve(_dirStack.shift()); + _cd('', dir); + } + + return _dirs(''); +} +exports.popd = _popd; + +//@ +//@ ### dirs([options | '+N' | '-N']) +//@ +//@ Available options: +//@ +//@ + `-c`: Clears the directory stack by deleting all of the elements. +//@ +//@ Arguments: +//@ +//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. +//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. +//@ +//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. +//@ +//@ See also: pushd, popd +function _dirs(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'c' : 'clear' + }); + + if (options['clear']) { + _dirStack = []; + return _dirStack; + } + + var stack = _actualDirStack(); + + if (index) { + index = _parseStackIndex(index); + + if (index < 0) { + index = stack.length + index; + } + + common.log(stack[index]); + return stack[index]; + } + + common.log(stack.join(' ')); + + return stack; +} +exports.dirs = _dirs; + +var common = require('./common'); + +//@ +//@ ### echo(string [, string ...]) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo('hello world'); +//@ var str = echo('hello world'); +//@ ``` +//@ +//@ Prints string to stdout, and returns string with additional utility methods +//@ like `.to()`. +function _echo() { + var messages = [].slice.call(arguments, 0); + console.log.apply(console, messages); + return common.ShellString(messages.join(' ')); +} +module.exports = _echo; + +var common = require('./common'); + +//@ +//@ ### error() +//@ Tests if error occurred in the last command. Returns `null` if no error occurred, +//@ otherwise returns string explaining the error +function error() { + return common.state.error; +} +module.exports = error; + +var common = require('./common'); +var _tempDir = require('./tempdir'); +var _pwd = require('./pwd'); +var path = require('path'); +var fs = require('fs'); +var child = require('child_process'); + +// Hack to run child_process.exec() synchronously (sync avoids callback hell) +// Uses a custom wait loop that checks for a flag file, created when the child process is done. +// (Can't do a wait loop that checks for internal Node variables/messages as +// Node is single-threaded; callbacks and other internal state changes are done in the +// event loop). +function execSync(cmd, opts) { + var tempDir = _tempDir(); + var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), + stderrFile = path.resolve(tempDir+'/'+common.randomFileName()), + codeFile = path.resolve(tempDir+'/'+common.randomFileName()), + scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), + sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var previousStdoutContent = '', + previousStderrContent = ''; + // Echoes stdout and stderr changes from running process, if not silent + function updateStream(streamFile) { + if (options.silent || !fs.existsSync(streamFile)) + return; + + var previousStreamContent, + proc_stream; + if (streamFile === stdoutFile) { + previousStreamContent = previousStdoutContent; + proc_stream = process.stdout; + } else { // assume stderr + previousStreamContent = previousStderrContent; + proc_stream = process.stderr; + } + + var streamContent = fs.readFileSync(streamFile, 'utf8'); + // No changes since last time? + if (streamContent.length <= previousStreamContent.length) + return; + + proc_stream.write(streamContent.substr(previousStreamContent.length)); + previousStreamContent = streamContent; + } + + function escape(str) { + return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); + } + + if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); + if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); + if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); + + var execCommand = '"'+process.execPath+'" '+scriptFile; + var execOptions = { + env: process.env, + cwd: _pwd(), + maxBuffer: 20*1024*1024 + }; + + var script; + + if (typeof child.execSync === 'function') { + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});", + "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", + "var stderrStream = fs.createWriteStream('"+escape(stderrFile)+"');", + "childProcess.stdout.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stderrStream, {end: false});", + "childProcess.stdout.pipe(process.stdout);", + "childProcess.stderr.pipe(process.stderr);", + "var stdoutEnded = false, stderrEnded = false;", + "function tryClosingStdout(){ if(stdoutEnded){ stdoutStream.end(); } }", + "function tryClosingStderr(){ if(stderrEnded){ stderrStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosingStdout(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosingStderr(); });" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + if (options.silent) { + execOptions.stdio = 'ignore'; + } else { + execOptions.stdio = [0, 1, 2]; + } + + // Welcome to the future + child.execSync(execCommand, execOptions); + } else { + cmd += ' > '+stdoutFile+' 2> '+stderrFile; // works on both win/unix + + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + child.exec(execCommand, execOptions); + + // The wait loop + // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage + // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing + // CPU usage, though apparently not so much on Windows) + while (!fs.existsSync(codeFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stderrFile)) { updateStream(stderrFile); fs.writeFileSync(sleepFile, 'a'); } + } + + // At this point codeFile exists, but it's not necessarily flushed yet. + // Keep reading it until it is. + var code = parseInt('', 10); + while (isNaN(code)) { + code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); + } + + var stdout = fs.readFileSync(stdoutFile, 'utf8'); + var stderr = fs.readFileSync(stderrFile, 'utf8'); + + // No biggie if we can't erase the files now -- they're in a temp dir anyway + try { common.unlinkSync(scriptFile); } catch(e) {} + try { common.unlinkSync(stdoutFile); } catch(e) {} + try { common.unlinkSync(stderrFile); } catch(e) {} + try { common.unlinkSync(codeFile); } catch(e) {} + try { common.unlinkSync(sleepFile); } catch(e) {} + + // some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html + if (code === 1 || code === 2 || code >= 126) { + common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes + } + // True if successful, false if not + var obj = { + code: code, + output: stdout, // deprecated + stdout: stdout, + stderr: stderr + }; + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, callback) { + var stdout = ''; + var stderr = ''; + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) { + if (callback) + callback(err ? err.code : 0, stdout, stderr); + }); + + c.stdout.on('data', function(data) { + stdout += data; + if (!options.silent) + process.stdout.write(data); + }); + + c.stderr.on('data', function(data) { + stderr += data; + if (!options.silent) + process.stderr.write(data); + }); + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ Available options (all `false` by default): +//@ +//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to +//@ `true`, regardless of the passed value. +//@ + `silent`: Do not echo program output to console. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).stdout; +//@ +//@ var child = exec('some_long_running_process', {async:true}); +//@ child.stdout.on('data', function(data) { +//@ /* ... do something with data ... */ +//@ }); +//@ +//@ exec('some_long_running_process', function(code, stdout, stderr) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', stdout); +//@ console.log('Program stderr:', stderr); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +//@ and the `callback` gets the arguments `(code, stdout, stderr)`. +//@ +//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as +//@ the current synchronous implementation uses a lot of CPU. This should be getting +//@ fixed soon. +function _exec(command, options, callback) { + if (!command) + common.error('must specify command'); + + // Callback is defined instead of options. + if (typeof options === 'function') { + callback = options; + options = { async: true }; + } + + // Callback is defined with options. + if (typeof options === 'object' && typeof callback === 'function') { + options.async = true; + } + + options = common.extend({ + silent: common.config.silent, + async: false + }, options); + + if (options.async) + return execAsync(command, options, callback); + else + return execSync(command, options); +} +module.exports = _exec; + +var fs = require('fs'); +var common = require('./common'); +var _ls = require('./ls'); + +//@ +//@ ### find(path [, path ...]) +//@ ### find(path_array) +//@ Examples: +//@ +//@ ```javascript +//@ find('src', 'lib'); +//@ find(['src', 'lib']); // same as above +//@ find('.').filter(function(file) { return file.match(/\.js$/); }); +//@ ``` +//@ +//@ Returns array of all files (however deep) in the given paths. +//@ +//@ The main difference from `ls('-R', path)` is that the resulting file names +//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. +function _find(options, paths) { + if (!paths) + common.error('no path specified'); + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + function pushFile(file) { + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + list.push(file); + } + + // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs + // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory + + paths.forEach(function(file) { + pushFile(file); + + if (fs.statSync(file).isDirectory()) { + _ls('-RA', file+'/*').forEach(function(subfile) { + pushFile(subfile); + }); + } + }); + + return list; +} +module.exports = _find; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### grep([options,] regex_filter, file [, file ...]) +//@ ### grep([options,] regex_filter, file_array) +//@ Available options: +//@ +//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); +//@ grep('GLOBAL_VARIABLE', '*.js'); +//@ ``` +//@ +//@ Reads input string from given files and returns a string containing all lines of the +//@ file that match the given `regex_filter`. Wildcard `*` accepted. +function _grep(options, regex, files) { + options = common.parseOptions(options, { + 'v': 'inverse' + }); + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 2); + // if it's array leave it as it is + + files = common.expand(files); + + var grep = ''; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var contents = fs.readFileSync(file, 'utf8'), + lines = contents.split(/\r*\n/); + lines.forEach(function(line) { + var matched = line.match(regex); + if ((options.inverse && !matched) || (!options.inverse && matched)) + grep += line + '\n'; + }); + }); + + return common.ShellString(grep); +} +module.exports = _grep; + +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### ln([options,] source, dest) +//@ Available options: +//@ +//@ + `-s`: symlink +//@ + `-f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ln('file', 'newlink'); +//@ ln('-sf', 'file', 'existing'); +//@ ``` +//@ +//@ Links source to dest. Use -f to force the link, should dest already exist. +function _ln(options, source, dest) { + options = common.parseOptions(options, { + 's': 'symlink', + 'f': 'force' + }); + + if (!source || !dest) { + common.error('Missing and/or '); + } + + source = String(source); + var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); + var isAbsolute = (path.resolve(source) === sourcePath); + dest = path.resolve(process.cwd(), String(dest)); + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', true); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + var isWindows = common.platform === 'win'; + var linkType = isWindows ? 'file' : null; + var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); + if (!fs.existsSync(resolvedSourcePath)) { + common.error('Source file does not exist', true); + } else if (isWindows && fs.statSync(resolvedSourcePath).isDirectory()) { + linkType = 'junction'; + } + + try { + fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath: source, dest, linkType); + } catch (err) { + common.error(err.message); + } + } else { + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + try { + fs.linkSync(source, dest); + } catch (err) { + common.error(err.message); + } + } +} +module.exports = _ln; + +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options,] [path, ...]) +//@ ### ls([options,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ + `-d`: list directories themselves, not their contents +//@ + `-l`: list objects representing each file, each with fields containing `ls +//@ -l` output fields. See +//@ [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) +//@ for more info +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} +//@ ``` +//@ +//@ Returns array of files in the given path, or in current directory if no path provided. +function _ls(options, paths) { + options = common.parseOptions(options, { + 'R': 'recursive', + 'A': 'all', + 'a': 'all_deprecated', + 'd': 'directory', + 'l': 'long' + }); + + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) + paths = ['.']; + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + // Conditionally pushes file to list - returns true if pushed, false otherwise + // (e.g. prevents hidden files to be included unless explicitly told so) + function pushFile(file, query) { + var name = file.name || file; + // hidden file? + if (path.basename(name)[0] === '.') { + // not explicitly asking for hidden files? + if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) + return false; + } + + if (common.platform === 'win') + name = name.replace(/\\/g, '/'); + + if (file.name) { + file.name = name; + } else { + file = name; + } + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = ls_stat(p); + // Simple file? + if (stats.isFile()) { + if (options.long) { + pushFile(stats, p); + } else { + pushFile(p, p); + } + return; // continue + } + + // Simple dir? + if (options.directory) { + pushFile(p, p); + return; + } else if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + var orig_file = file; + if (options.long) + file = ls_stat(path.join(p, file)); + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(orig_file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), orig_file+'/*')); + _cd('', oldDir); + } + }); + return; // continue + } + } + + // p does not exist - possible wildcard present + + var basename = path.basename(p); + var dirname = path.dirname(p); + // Wildcard present on an existing dir? (e.g. '/tmp/*.js') + if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { + // Escape special regular expression chars + var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); + // Translates wildcard into regex + regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; + // Iterate over directory contents + fs.readdirSync(dirname).forEach(function(file) { + if (file.match(new RegExp(regexp))) { + var file_path = path.join(dirname, file); + file_path = options.long ? ls_stat(file_path) : file_path; + if (file_path.name) + file_path.name = path.normalize(file_path.name); + else + file_path = path.normalize(file_path); + if (!pushFile(file_path, basename)) + return; + + // Recursive? + if (options.recursive) { + var pp = dirname + '/' + file; + if (fs.lstatSync(pp).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); + } // recursive + } // if file matches + }); // forEach + return; + } + + common.error('no such file or directory: ' + p, true); + }); + + return list; +} +module.exports = _ls; + + +function ls_stat(path) { + var stats = fs.statSync(path); + // Note: this object will contain more information than .toString() returns + stats.name = path; + stats.toString = function() { + // Return a string resembling unix's `ls -l` format + return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); + }; + return stats; +} + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Recursively creates 'dir' +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options,] dir [, dir ...]) +//@ ### mkdir([options,] dir_array) +//@ Available options: +//@ +//@ + `-p`: full path (will create intermediate dirs if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + options = common.parseOptions(options, { + 'p': 'fullpath' + }); + if (!dirs) + common.error('no paths given'); + + if (typeof dirs === 'string') + dirs = [].slice.call(arguments, 1); + // if it's array leave it as it is + + dirs.forEach(function(dir) { + if (fs.existsSync(dir)) { + if (!options.fullpath) + common.error('path already exists: ' + dir, true); + return; // skip dir + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, true); + return; // skip dir + } + + if (options.fullpath) + mkdirSyncRecursive(dir); + else + fs.mkdirSync(dir, parseInt('0777', 8)); + }); +} // mkdir +module.exports = _mkdir; + +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv([options ,] source [, source ...], dest') +//@ ### mv([options ,] source_array, dest') +//@ Available options: +//@ +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-n', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves files. The wildcard `*` is accepted. +function _mv(options, sources, dest) { + options = common.parseOptions(options, { + 'f': '!no_force', + 'n': 'no_force' + }); + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + sources = common.expand(sources); + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: '+src, true); + return; // skip file + } + + fs.renameSync(src, thisDest); + }); // forEach(src) +} // mv +module.exports = _mv; + +// see dirs.js +// see dirs.js +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### pwd() +//@ Returns the current directory. +function _pwd() { + var pwd = path.resolve(process.cwd()); + return common.ShellString(pwd); +} +module.exports = _pwd; + +var common = require('./common'); +var fs = require('fs'); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for(var i = 0; i < files.length; i++) { + var file = dir + "/" + files[i], + currFile = fs.lstatSync(file); + + if(currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } + + else if(currFile.isSymbolicLink()) { // Unlink symlinks + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + else // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + // Retry on windows, sometimes it takes a little time before all the files in the directory are gone + var start = Date.now(); + while (true) { + try { + result = fs.rmdirSync(dir); + if (fs.existsSync(dir)) throw { code: "EAGAIN" }; + break; + } catch(er) { + // In addition to error codes, also check if the directory still exists and loop again if true + if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) { + if (Date.now() - start > 1000) throw er; + } else if (er.code === "ENOENT") { + // Directory did not exist, deletion was successful + break; + } else { + throw er; + } + } + } + } catch(e) { + common.error('could not remove directory (code '+e.code+'): ' + dir, true); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch(e) { + writePermission = false; + } + + return writePermission; +} + +//@ +//@ ### rm([options,] file [, file ...]) +//@ ### rm([options,] file_array) +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. The wildcard `*` is accepted. +function _rm(options, files) { + options = common.parseOptions(options, { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive' + }); + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) { + // Path does not exist, no force flag given + if (!options.force) + common.error('no such file or directory: '+file, true); + + return; // skip file + } + + // If here, path exists + + var stats = fs.lstatSync(file); + if (stats.isFile() || stats.isSymbolicLink()) { + + // Do not check for file writing permissions + if (options.force) { + common.unlinkSync(file); + return; + } + + if (isWriteable(file)) + common.unlinkSync(file); + else + common.error('permission denied: '+file, true); + + return; + } // simple file + + // Path is an existing directory, but no -r flag given + if (stats.isDirectory() && !options.recursive) { + common.error('path is a directory', true); + return; // skip path + } + + // Recursively remove existing directory + if (stats.isDirectory() && options.recursive) { + rmdirSyncRecursive(file, options.force); + } + }); // forEach(file) +} // rm +module.exports = _rm; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options,] search_regex, replacement, file [, file ...]) +//@ ### sed([options,] search_regex, replacement, file_array) +//@ Available options: +//@ +//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `files` and performs a JavaScript `replace()` on the input +//@ using the given search regex and replacement string or function. Returns the new string after replacement. +function _sed(options, regex, replacement, files) { + options = common.parseOptions(options, { + 'i': 'inplace' + }); + + if (typeof replacement === 'string' || typeof replacement === 'function') + replacement = replacement; // no-op + else if (typeof replacement === 'number') + replacement = replacement.toString(); // fallback + else + common.error('invalid replacement string'); + + // Convert all search strings to RegExp + if (typeof regex === 'string') + regex = RegExp(regex); + + if (!files) + common.error('no files given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 3); + // if it's array leave it as it is + + files = common.expand(files); + + var sed = []; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var result = fs.readFileSync(file, 'utf8').split('\n').map(function (line) { + return line.replace(regex, replacement); + }).join('\n'); + + sed.push(result); + + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + }); + + return common.ShellString(sed.join('\n')); +} +module.exports = _sed; + +var common = require('./common'); + +//@ +//@ ### set(options) +//@ Available options: +//@ +//@ + `+/-e`: exit upon error (`config.fatal`) +//@ + `+/-v`: verbose: show all commands (`config.verbose`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ set('-e'); // exit upon first error +//@ set('+e'); // this undoes a "set('-e')" +//@ ``` +//@ +//@ Sets global configuration variables +function _set(options) { + if (!options) { + var args = [].slice.call(arguments, 0); + if (args.length < 2) + common.error('must provide an argument'); + options = args[1]; + } + var negate = (options[0] === '+'); + if (negate) { + options = '-' + options.slice(1); // parseOptions needs a '-' prefix + } + options = common.parseOptions(options, { + 'e': 'fatal', + 'v': 'verbose' + }); + + var key; + if (negate) { + for (key in options) + options[key] = !options[key]; + } + + for (key in options) { + // Only change the global config if `negate` is false and the option is true + // or if `negate` is true and the option is false (aka negate !== option) + if (negate !== options[key]) { + common.config[key] = options[key]; + } + } + return; +} +module.exports = _set; + +var common = require('./common'); +var os = require('os'); +var fs = require('fs'); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) + return false; + + if (!fs.statSync(dir).isDirectory()) + return false; + + var testFile = dir+'/'+common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + return false; + } +} + + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + var state = common.state; + if (state.tempDir) + return state.tempDir; // from cache + + state.tempDir = writeableDir(os.tmpdir && os.tmpdir()) || // node 0.10+ + writeableDir(os.tmpDir && os.tmpDir()) || // node 0.8+ + writeableDir(process.env['TMPDIR']) || + writeableDir(process.env['TEMP']) || + writeableDir(process.env['TMP']) || + writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return state.tempDir; +} +module.exports = _tempDir; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### test(expression) +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symbolic link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates expression using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) + common.error('no path given'); + + // hack - only works with unary primaries + options = common.parseOptions(options, { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket' + }); + + var canInterpret = false; + for (var key in options) + if (options[key] === true) { + canInterpret = true; + break; + } + + if (!canInterpret) + common.error('could not interpret expression'); + + if (options.link) { + try { + return fs.lstatSync(path).isSymbolicLink(); + } catch(e) { + return false; + } + } + + if (!fs.existsSync(path)) + return false; + + if (options.exists) + return true; + + var stats = fs.statSync(path); + + if (options.block) + return stats.isBlockDevice(); + + if (options.character) + return stats.isCharacterDevice(); + + if (options.directory) + return stats.isDirectory(); + + if (options.file) + return stats.isFile(); + + if (options.pipe) + return stats.isFIFO(); + + if (options.socket) + return stats.isSocket(); +} // test +module.exports = _test; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.writeFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not write to file (code '+e.code+'): '+file, true); + } +} +module.exports = _to; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). +function _toEnd(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.appendFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not append to file (code '+e.code+'): '+file, true); + } +} +module.exports = _toEnd; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### touch([options,] file) +//@ Available options: +//@ +//@ + `-a`: Change only the access time +//@ + `-c`: Do not create any files +//@ + `-m`: Change only the modification time +//@ + `-d DATE`: Parse DATE and use it instead of current time +//@ + `-r FILE`: Use FILE's times instead of current time +//@ +//@ Examples: +//@ +//@ ```javascript +//@ touch('source.js'); +//@ touch('-c', '/path/to/some/dir/source.js'); +//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +//@ ``` +//@ +//@ Update the access and modification times of each FILE to the current time. +//@ A FILE argument that does not exist is created empty, unless -c is supplied. +//@ This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. +function _touch(opts, files) { + opts = common.parseOptions(opts, { + 'a': 'atime_only', + 'c': 'no_create', + 'd': 'date', + 'm': 'mtime_only', + 'r': 'reference', + }); + + if (!files) { + common.error('no paths given'); + } + + + if (Array.isArray(files)) { + files.forEach(function(f) { + touchFile(opts, f); + }); + } else if (typeof files === 'string') { + touchFile(opts, files); + } else { + common.error('file arg should be a string file path or an Array of string file paths'); + } + +} + +function touchFile(opts, file) { + var stat = tryStatFile(file); + + if (stat && stat.isDirectory()) { + // don't error just exit + return; + } + + // if the file doesn't already exist and the user has specified --no-create then + // this script is finished + if (!stat && opts.no_create) { + return; + } + + // open the file and then close it. this will create it if it doesn't exist but will + // not truncate the file + fs.closeSync(fs.openSync(file, 'a')); + + // + // Set timestamps + // + + // setup some defaults + var now = new Date(); + var mtime = opts.date || now; + var atime = opts.date || now; + + // use reference file + if (opts.reference) { + var refStat = tryStatFile(opts.reference); + if (!refStat) { + common.error('failed to get attributess of ' + opts.reference); + } + mtime = refStat.mtime; + atime = refStat.atime; + } else if (opts.date) { + mtime = opts.date; + atime = opts.date; + } + + if (opts.atime_only && opts.mtime_only) { + // keep the new values of mtime and atime like GNU + } else if (opts.atime_only) { + mtime = stat.mtime; + } else if (opts.mtime_only) { + atime = stat.atime; + } + + fs.utimesSync(file, atime, mtime); +} + +module.exports = _touch; + +function tryStatFile(filePath) { + try { + return fs.statSync(filePath); + } catch (e) { + return null; + } +} + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// XP's system default value for PATHEXT system variable, just in case it's not +// set on Windows. +var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + if (!p) + return []; + + if (common.platform === 'win') + return p.split(';'); + else + return p.split(':'); +} + +function checkPath(path) { + return fs.existsSync(path) && !fs.statSync(path).isDirectory(); +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows, this uses the +//@ `PATHEXT` variable to append the extension if it's not already executable. +//@ Returns string containing the absolute path to the command. +function _which(options, cmd) { + if (!cmd) + common.error('must specify command'); + + var pathEnv = process.env.path || process.env.Path || process.env.PATH, + pathArray = splitPath(pathEnv), + where = null; + + // No relative/absolute paths provided? + if (cmd.search(/\//) === -1) { + // Search for command in PATH + pathArray.forEach(function(dir) { + if (where) + return; // already found it + + var attempt = path.resolve(dir, cmd); + + if (common.platform === 'win') { + attempt = attempt.toUpperCase(); + + // In case the PATHEXT variable is somehow not set (e.g. + // child_process.spawn with an empty environment), use the XP default. + var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; + var pathExtArray = splitPath(pathExtEnv.toUpperCase()); + var i; + + // If the extension is already in PATHEXT, just return that. + for (i = 0; i < pathExtArray.length; i++) { + var ext = pathExtArray[i]; + if (attempt.slice(-ext.length) === ext && checkPath(attempt)) { + where = attempt; + return; + } + } + + // Cycle through the PATHEXT variable + var baseAttempt = attempt; + for (i = 0; i < pathExtArray.length; i++) { + attempt = baseAttempt + pathExtArray[i]; + if (checkPath(attempt)) { + where = attempt; + return; + } + } + } else { + // Assume it's Unix-like + if (checkPath(attempt)) { + where = attempt; + return; + } + } + }); + } + + // Command not found anywhere? + if (!checkPath(cmd) && !where) + return null; + + where = where || path.resolve(cmd); + + return common.ShellString(where); +} +module.exports = _which; diff --git a/tools/eslint/node_modules/shelljs/make.js b/tools/eslint/node_modules/shelljs/make.js index f78b4cfd4237e9..a8438c84e818b6 100644 --- a/tools/eslint/node_modules/shelljs/make.js +++ b/tools/eslint/node_modules/shelljs/make.js @@ -31,10 +31,11 @@ setTimeout(function() { // Wrap it global.target[t] = function() { - if (oldTarget.done) - return; - oldTarget.done = true; - return oldTarget.apply(oldTarget, arguments); + if (!oldTarget.done){ + oldTarget.done = true; + oldTarget.result = oldTarget.apply(oldTarget, arguments); + } + return oldTarget.result; }; })(t, global.target[t]); diff --git a/tools/eslint/node_modules/shelljs/package.json b/tools/eslint/node_modules/shelljs/package.json index 0bcea2ed20dc30..f366ad9b3a9815 100644 --- a/tools/eslint/node_modules/shelljs/package.json +++ b/tools/eslint/node_modules/shelljs/package.json @@ -1,38 +1,42 @@ { "_args": [ [ - "shelljs@^0.5.3", - "/Users/trott/test/node_modules/eslint" + "shelljs@^0.6.0", + "/Users/trott/io.js/tools/node_modules/eslint" ] ], - "_from": "shelljs@>=0.5.3 <0.6.0", - "_id": "shelljs@0.5.3", + "_from": "shelljs@>=0.6.0 <0.7.0", + "_id": "shelljs@0.6.0", "_inCache": true, "_installable": true, - "_location": "/eslint/shelljs", - "_nodeVersion": "1.2.0", + "_location": "/shelljs", + "_nodeVersion": "5.4.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/shelljs-0.6.0.tgz_1454632811074_0.5800695188809186" + }, "_npmUser": { - "email": "arturadib@gmail.com", - "name": "artur" + "email": "ari@ariporad.com", + "name": "ariporad" }, - "_npmVersion": "2.5.1", + "_npmVersion": "3.6.0", "_phantomChildren": {}, "_requested": { "name": "shelljs", - "raw": "shelljs@^0.5.3", - "rawSpec": "^0.5.3", + "raw": "shelljs@^0.6.0", + "rawSpec": "^0.6.0", "scope": null, - "spec": ">=0.5.3 <0.6.0", + "spec": ">=0.6.0 <0.7.0", "type": "range" }, "_requiredBy": [ "/eslint" ], - "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", - "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", + "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.0.tgz", + "_shasum": "ce1ed837b4b0e55b5ec3dab84251ab9dbdc0c7ec", "_shrinkwrap": null, - "_spec": "shelljs@^0.5.3", - "_where": "/Users/trott/test/node_modules/eslint", + "_spec": "shelljs@^0.6.0", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "arturadib@gmail.com", "name": "Artur Adib" @@ -41,23 +45,35 @@ "shjs": "./bin/shjs" }, "bugs": { - "url": "https://github.com/arturadib/shelljs/issues" + "url": "https://github.com/shelljs/shelljs/issues" }, + "contributors": [ + { + "email": "ari@ariporad.com", + "name": "Ari Porad", + "url": "http://ariporad.com/" + }, + { + "email": "ntfschr@gmail.com", + "name": "Nate Fischer" + } + ], "dependencies": {}, "description": "Portable Unix shell commands for Node.js", "devDependencies": { + "coffee-script": "^1.10.0", "jshint": "~2.1.11" }, "directories": {}, "dist": { - "shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", - "tarball": "http://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz" + "shasum": "ce1ed837b4b0e55b5ec3dab84251ab9dbdc0c7ec", + "tarball": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.0.tgz" }, "engines": { - "node": ">=0.8.0" + "node": ">=0.10.0" }, - "gitHead": "22d0975040b9b8234755dc6e692d6869436e8485", - "homepage": "http://github.com/arturadib/shelljs", + "gitHead": "fe06baf1173ec6f0a70cd58ddb7d373f4c6446f5", + "homepage": "http://github.com/shelljs/shelljs", "keywords": [ "unix", "shell", @@ -66,12 +82,20 @@ "jake", "synchronous" ], - "license": "BSD*", + "license": "BSD-3-Clause", "main": "./shell.js", "maintainers": [ + { + "email": "ari@ariporad.com", + "name": "ariporad" + }, { "email": "arturadib@gmail.com", "name": "artur" + }, + { + "email": "ntfschr@gmail.com", + "name": "nfischer" } ], "name": "shelljs", @@ -79,10 +103,10 @@ "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git://github.com/arturadib/shelljs.git" + "url": "git://github.com/shelljs/shelljs.git" }, "scripts": { "test": "node scripts/run-tests" }, - "version": "0.5.3" + "version": "0.6.0" } diff --git a/tools/eslint/node_modules/shelljs/scripts/generate-docs.js b/tools/eslint/node_modules/shelljs/scripts/generate-docs.js index 532fed9f090caa..3a31a91abd2a13 100755 --- a/tools/eslint/node_modules/shelljs/scripts/generate-docs.js +++ b/tools/eslint/node_modules/shelljs/scripts/generate-docs.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +/* globals cat, cd, echo, grep, sed */ require('../global'); echo('Appending docs to README.md'); @@ -15,7 +16,11 @@ docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) { // Remove '//@' docs = docs.replace(/\/\/\@ ?/g, ''); -// Append docs to README -sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); + +// Wipe out the old docs +cat('README.md').replace(/## Command reference(.|\n)*/, '## Command reference').to('README.md'); + +// Append new docs to README +sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md'); echo('All done.'); diff --git a/tools/eslint/node_modules/shelljs/scripts/run-tests.js b/tools/eslint/node_modules/shelljs/scripts/run-tests.js index f9d31e06892bab..e8e7ff2f879a82 100755 --- a/tools/eslint/node_modules/shelljs/scripts/run-tests.js +++ b/tools/eslint/node_modules/shelljs/scripts/run-tests.js @@ -1,14 +1,14 @@ #!/usr/bin/env node +/* globals cd, echo, exec, exit, ls, pwd, test */ require('../global'); - -var path = require('path'); +var common = require('../src/common'); var failed = false; // // Lint // -JSHINT_BIN = './node_modules/jshint/bin/jshint'; +var JSHINT_BIN = 'node_modules/jshint/bin/jshint'; cd(__dirname + '/..'); if (!test('-f', JSHINT_BIN)) { @@ -16,7 +16,12 @@ if (!test('-f', JSHINT_BIN)) { exit(1); } -if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) { +var jsfiles = common.expand([pwd() + '/*.js', + pwd() + '/scripts/*.js', + pwd() + '/src/*.js', + pwd() + '/test/*.js' + ]).join(' '); +if (exec('node ' + pwd() + '/' + JSHINT_BIN + ' ' + jsfiles).code !== 0) { failed = true; echo('*** JSHINT FAILED! (return code != 0)'); echo(); diff --git a/tools/eslint/node_modules/shelljs/shell.js b/tools/eslint/node_modules/shelljs/shell.js index bdeb5597249678..93aff709a3931f 100644 --- a/tools/eslint/node_modules/shelljs/shell.js +++ b/tools/eslint/node_modules/shelljs/shell.js @@ -107,6 +107,13 @@ exports.exec = common.wrap('exec', _exec, {notUnix:true}); var _chmod = require('./src/chmod'); exports.chmod = common.wrap('chmod', _chmod); +//@include ./src/touch +var _touch = require('./src/touch'); +exports.touch = common.wrap('touch', _touch); + +//@include ./src/set +var _set = require('./src/set'); +exports.set = common.wrap('set', _set); //@ @@ -151,9 +158,27 @@ exports.config = common.config; //@ //@ ```javascript //@ require('shelljs/global'); -//@ config.fatal = true; +//@ config.fatal = true; // or set('-e'); //@ cp('this_file_does_not_exist', '/dev/null'); // dies here //@ /* more commands... */ //@ ``` //@ -//@ If `true` the script will die on errors. Default is `false`. +//@ If `true` the script will die on errors. Default is `false`. This is +//@ analogous to Bash's `set -e` + +//@ +//@ ### config.verbose +//@ Example: +//@ +//@ ```javascript +//@ config.verbose = true; // or set('-v'); +//@ cd('dir/'); +//@ ls('subdir/'); +//@ ``` +//@ +//@ Will print each command as follows: +//@ +//@ ``` +//@ cd dir/ +//@ ls subdir/ +//@ ``` diff --git a/tools/eslint/node_modules/shelljs/src/cat.js b/tools/eslint/node_modules/shelljs/src/cat.js index f6f4d254ae2cbd..5840b4ea77b590 100644 --- a/tools/eslint/node_modules/shelljs/src/cat.js +++ b/tools/eslint/node_modules/shelljs/src/cat.js @@ -32,12 +32,9 @@ function _cat(options, files) { if (!fs.existsSync(file)) common.error('no such file or directory: ' + file); - cat += fs.readFileSync(file, 'utf8') + '\n'; + cat += fs.readFileSync(file, 'utf8'); }); - 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 index 230f432651e84b..b7b9931b8f41df 100644 --- a/tools/eslint/node_modules/shelljs/src/cd.js +++ b/tools/eslint/node_modules/shelljs/src/cd.js @@ -2,11 +2,19 @@ var fs = require('fs'); var common = require('./common'); //@ -//@ ### cd('dir') -//@ Changes to directory `dir` for the duration of the script +//@ ### cd([dir]) +//@ Changes to directory `dir` for the duration of the script. Changes to home +//@ directory if no argument is supplied. function _cd(options, dir) { if (!dir) - common.error('directory not specified'); + dir = common.getUserHome(); + + if (dir === '-') { + if (!common.state.previousDir) + common.error('could not find previous directory'); + else + dir = common.state.previousDir; + } if (!fs.existsSync(dir)) common.error('no such file or directory: ' + dir); @@ -14,6 +22,7 @@ function _cd(options, dir) { if (!fs.statSync(dir).isDirectory()) common.error('not a directory: ' + dir); + common.state.previousDir = process.cwd(); process.chdir(dir); } module.exports = _cd; diff --git a/tools/eslint/node_modules/shelljs/src/chmod.js b/tools/eslint/node_modules/shelljs/src/chmod.js index f2888930b35079..6c6de10ce12e49 100644 --- a/tools/eslint/node_modules/shelljs/src/chmod.js +++ b/tools/eslint/node_modules/shelljs/src/chmod.js @@ -114,7 +114,9 @@ function _chmod(options, mode, filePattern) { return; } - var perms = fs.statSync(file).mode; + var stat = fs.statSync(file); + var isDir = stat.isDirectory(); + var perms = stat.mode; var type = perms & PERMS.TYPE_MASK; var newPerms = perms; @@ -135,11 +137,15 @@ function _chmod(options, mode, filePattern) { 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 changeRead = change.indexOf('r') != -1; + var changeWrite = change.indexOf('w') != -1; + var changeExec = change.indexOf('x') != -1; + var changeExecDir = change.indexOf('X') != -1; + var changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + if (changeExecDir && isDir) + changeExec = true; var mask = 0; if (changeOwner) { @@ -177,14 +183,15 @@ function _chmod(options, mode, filePattern) { } if (options.verbose) { - log(file + ' -> ' + newPerms.toString(8)); + console.log(file + ' -> ' + newPerms.toString(8)); } if (perms != newPerms) { if (!options.verbose && options.changes) { - log(file + ' -> ' + newPerms.toString(8)); + console.log(file + ' -> ' + newPerms.toString(8)); } fs.chmodSync(file, newPerms); + perms = newPerms; // for the next round of changes! } } else { diff --git a/tools/eslint/node_modules/shelljs/src/common.js b/tools/eslint/node_modules/shelljs/src/common.js index 8d10f3dde7281a..33198bd8a0a265 100644 --- a/tools/eslint/node_modules/shelljs/src/common.js +++ b/tools/eslint/node_modules/shelljs/src/common.js @@ -5,13 +5,15 @@ var _ls = require('./ls'); // Module globals var config = { silent: false, - fatal: false + fatal: false, + verbose: false, }; exports.config = config; var state = { error: null, currentCmd: 'shell.js', + previousDir: null, tempDir: null }; exports.state = state; @@ -21,7 +23,7 @@ exports.platform = platform; function log() { if (!config.silent) - console.log.apply(this, arguments); + console.error.apply(console, arguments); } exports.log = log; @@ -29,10 +31,14 @@ exports.log = log; function error(msg, _continue) { if (state.error === null) state.error = ''; - state.error += state.currentCmd + ': ' + msg + '\n'; + var log_entry = state.currentCmd + ': ' + msg; + if (state.error === '') + state.error = log_entry; + else + state.error += '\n' + log_entry; if (msg.length > 0) - log(state.error); + log(log_entry); if (config.fatal) process.exit(1); @@ -49,38 +55,69 @@ function ShellString(str) { } exports.ShellString = ShellString; -// Returns {'alice': true, 'bob': false} when passed a dictionary, e.g.: +// Return the home directory in a platform-agnostic way, with consideration for +// older versions of node +function getUserHome() { + var result; + if (os.homedir) + result = os.homedir(); // node 3+ + else + result = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']; + return result; +} +exports.getUserHome = getUserHome; + +// Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: // parseOptions('-a', {'a':'alice', 'b':'bob'}); -function parseOptions(str, map) { +// Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: +// parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); +function parseOptions(opt, map) { if (!map) error('parseOptions() internal error: no map given'); // All options are false by default var options = {}; - for (var letter in map) - options[map[letter]] = false; + for (var letter in map) { + if (map[letter][0] !== '!') + options[map[letter]] = false; + } - if (!str) + if (!opt) 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; + var optionName; + if (typeof opt === 'string') { + if (opt[0] !== '-') + 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); - }); + // e.g. chars = ['R', 'f'] + var chars = opt.slice(1).split(''); + chars.forEach(function(c) { + if (c in map) { + optionName = map[c]; + if (optionName[0] === '!') + options[optionName.slice(1, optionName.length-1)] = false; + else + options[optionName] = true; + } else { + error('option not recognized: '+c); + } + }); + } else if (typeof opt === 'object') { + for (var key in opt) { + // key is a string of the form '-r', '-d', etc. + var c = key[1]; + if (c in map) { + optionName = map[c]; + options[optionName] = opt[key]; // assign the given value + } else { + error('option not recognized: '+c); + } + } + } else { + error('options must be strings or key-value pairs'); + } return options; } exports.parseOptions = parseOptions; @@ -178,11 +215,28 @@ function wrap(cmd, fn, options) { try { var args = [].slice.call(arguments, 0); + if (config.verbose) { + args.unshift(cmd); + console.log.apply(console, args); + args.shift(); + } + if (options && options.notUnix) { retValue = fn.apply(this, args); } else { - if (args.length === 0 || typeof args[0] !== 'string' || args[0][0] !== '-') + if (typeof args[0] === 'object' && args[0].constructor.name === 'Object') { + args = args; // object count as options + } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') { args.unshift(''); // only add dummy option if '-option' not already present + } + // Expand the '~' if appropriate + var homeDir = getUserHome(); + args = args.map(function(arg) { + if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') + return arg.replace(/^~/, homeDir); + else + return arg; + }); retValue = fn.apply(this, args); } } catch (e) { diff --git a/tools/eslint/node_modules/shelljs/src/cp.js b/tools/eslint/node_modules/shelljs/src/cp.js index ef19f96ecfc5bc..54404efb161ff1 100644 --- a/tools/eslint/node_modules/shelljs/src/cp.js +++ b/tools/eslint/node_modules/shelljs/src/cp.js @@ -76,7 +76,7 @@ function cpdirSyncRecursive(sourceDir, destDir, opts) { fs.symlinkSync(symlinkFull, destFile, os.platform() === "win32" ? "junction" : null); } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ - if (fs.existsSync(destFile) && !opts.force) { + if (fs.existsSync(destFile) && opts.no_force) { common.log('skipping existing file: ' + files[i]); } else { copyFileSync(srcFile, destFile); @@ -88,11 +88,12 @@ function cpdirSyncRecursive(sourceDir, destDir, opts) { //@ -//@ ### cp([options ,] source [,source ...], dest) -//@ ### cp([options ,] source_array, dest) +//@ ### cp([options,] source [, source ...], dest) +//@ ### cp([options,] source_array, dest) //@ Available options: //@ -//@ + `-f`: force +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber //@ + `-r, -R`: recursive //@ //@ Examples: @@ -106,7 +107,8 @@ function cpdirSyncRecursive(sourceDir, destDir, opts) { //@ Copies files. The wildcard `*` is accepted. function _cp(options, sources, dest) { options = common.parseOptions(options, { - 'f': 'force', + 'f': '!no_force', + 'n': 'no_force', 'R': 'recursive', 'r': 'recursive' }); @@ -133,15 +135,19 @@ function _cp(options, sources, dest) { 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) + if (exists && stats.isFile() && options.no_force) common.error('dest file already exists: ' + dest); if (options.recursive) { // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" // (see Github issue #15) sources.forEach(function(src, i) { - if (src[src.length - 1] === '/') + if (src[src.length - 1] === '/') { sources[i] += '*'; + // If src is a directory and dest doesn't exist, 'cp -r src dest' should copy src/* into dest + } else if (fs.statSync(src).isDirectory() && !exists) { + sources[i] += '/*'; + } }); // Create dest @@ -180,7 +186,7 @@ function _cp(options, sources, dest) { } } - cpdirSyncRecursive(src, newDest, {force: options.force}); + cpdirSyncRecursive(src, newDest, {no_force: options.no_force}); } return; // done with dir } @@ -193,7 +199,7 @@ function _cp(options, sources, dest) { if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) thisDest = path.normalize(dest + '/' + path.basename(src)); - if (fs.existsSync(thisDest) && !options.force) { + if (fs.existsSync(thisDest) && options.no_force) { common.error('dest file already exists: ' + thisDest, true); return; // skip file } diff --git a/tools/eslint/node_modules/shelljs/src/echo.js b/tools/eslint/node_modules/shelljs/src/echo.js index 760ea840f07218..b574adc5c38465 100644 --- a/tools/eslint/node_modules/shelljs/src/echo.js +++ b/tools/eslint/node_modules/shelljs/src/echo.js @@ -1,7 +1,7 @@ var common = require('./common'); //@ -//@ ### echo(string [,string ...]) +//@ ### echo(string [, string ...]) //@ //@ Examples: //@ @@ -14,7 +14,7 @@ var common = require('./common'); //@ like `.to()`. function _echo() { var messages = [].slice.call(arguments, 0); - console.log.apply(this, messages); + console.log.apply(console, messages); return common.ShellString(messages.join(' ')); } module.exports = _echo; diff --git a/tools/eslint/node_modules/shelljs/src/error.js b/tools/eslint/node_modules/shelljs/src/error.js index cca3efb608d0dc..112563db80311e 100644 --- a/tools/eslint/node_modules/shelljs/src/error.js +++ b/tools/eslint/node_modules/shelljs/src/error.js @@ -6,5 +6,5 @@ var common = require('./common'); //@ 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 index d259a9f26c8341..4174adbd32d317 100644 --- a/tools/eslint/node_modules/shelljs/src/exec.js +++ b/tools/eslint/node_modules/shelljs/src/exec.js @@ -5,6 +5,8 @@ var path = require('path'); var fs = require('fs'); var child = require('child_process'); +var DEFAULT_MAXBUFFER_SIZE = 20*1024*1024; + // Hack to run child_process.exec() synchronously (sync avoids callback hell) // Uses a custom wait loop that checks for a flag file, created when the child process is done. // (Can't do a wait loop that checks for internal Node variables/messages as @@ -13,27 +15,42 @@ var child = require('child_process'); function execSync(cmd, opts) { var tempDir = _tempDir(); var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), + stderrFile = path.resolve(tempDir+'/'+common.randomFileName()), codeFile = path.resolve(tempDir+'/'+common.randomFileName()), scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); - var options = common.extend({ - silent: common.config.silent + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE }, opts); - var previousStdoutContent = ''; - // Echoes stdout changes from running process, if not silent - function updateStdout() { - if (options.silent || !fs.existsSync(stdoutFile)) + var previousStdoutContent = '', + previousStderrContent = ''; + // Echoes stdout and stderr changes from running process, if not silent + function updateStream(streamFile) { + if (opts.silent || !fs.existsSync(streamFile)) return; - var stdoutContent = fs.readFileSync(stdoutFile, 'utf8'); + var previousStreamContent, + proc_stream; + if (streamFile === stdoutFile) { + previousStreamContent = previousStdoutContent; + proc_stream = process.stdout; + } else { // assume stderr + previousStreamContent = previousStderrContent; + proc_stream = process.stderr; + } + + var streamContent = fs.readFileSync(streamFile, 'utf8'); // No changes since last time? - if (stdoutContent.length <= previousStdoutContent.length) + if (streamContent.length <= previousStreamContent.length) return; - process.stdout.write(stdoutContent.substr(previousStdoutContent.length)); - previousStdoutContent = stdoutContent; + proc_stream.write(streamContent.substr(previousStreamContent.length)); + previousStreamContent = streamContent; } function escape(str) { @@ -42,64 +59,64 @@ function execSync(cmd, opts) { if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); var execCommand = '"'+process.execPath+'" '+scriptFile; - var execOptions = { - env: process.env, - cwd: _pwd(), - maxBuffer: 20*1024*1024 - }; + var script; if (typeof child.execSync === 'function') { - var script = [ + script = [ "var child = require('child_process')", " , fs = require('fs');", - "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: "+opts.maxBuffer+"}, function(err) {", " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", "});", "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", + "var stderrStream = fs.createWriteStream('"+escape(stderrFile)+"');", "childProcess.stdout.pipe(stdoutStream, {end: false});", - "childProcess.stderr.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stderrStream, {end: false});", "childProcess.stdout.pipe(process.stdout);", "childProcess.stderr.pipe(process.stderr);", "var stdoutEnded = false, stderrEnded = false;", - "function tryClosing(){ if(stdoutEnded && stderrEnded){ stdoutStream.end(); } }", - "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosing(); });", - "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosing(); });" + "function tryClosingStdout(){ if(stdoutEnded){ stdoutStream.end(); } }", + "function tryClosingStderr(){ if(stderrEnded){ stderrStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosingStdout(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosingStderr(); });" ].join('\n'); fs.writeFileSync(scriptFile, script); - if (options.silent) { - execOptions.stdio = 'ignore'; + if (opts.silent) { + opts.stdio = 'ignore'; } else { - execOptions.stdio = [0, 1, 2]; + opts.stdio = [0, 1, 2]; } // Welcome to the future - child.execSync(execCommand, execOptions); + child.execSync(execCommand, opts); } else { - cmd += ' > '+stdoutFile+' 2>&1'; // works on both win/unix + cmd += ' > '+stdoutFile+' 2> '+stderrFile; // works on both win/unix - var script = [ + script = [ "var child = require('child_process')", " , fs = require('fs');", - "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: "+opts.maxBuffer+"}, function(err) {", " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", "});" ].join('\n'); fs.writeFileSync(scriptFile, script); - child.exec(execCommand, execOptions); + child.exec(execCommand, opts); // The wait loop // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing // CPU usage, though apparently not so much on Windows) - while (!fs.existsSync(codeFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - while (!fs.existsSync(stdoutFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(codeFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stderrFile)) { updateStream(stderrFile); fs.writeFileSync(sleepFile, 'a'); } } // At this point codeFile exists, but it's not necessarily flushed yet. @@ -110,10 +127,12 @@ function execSync(cmd, opts) { } var stdout = fs.readFileSync(stdoutFile, 'utf8'); + var stderr = fs.readFileSync(stderrFile, 'utf8'); // No biggie if we can't erase the files now -- they're in a temp dir anyway try { common.unlinkSync(scriptFile); } catch(e) {} try { common.unlinkSync(stdoutFile); } catch(e) {} + try { common.unlinkSync(stderrFile); } catch(e) {} try { common.unlinkSync(codeFile); } catch(e) {} try { common.unlinkSync(sleepFile); } catch(e) {} @@ -124,34 +143,40 @@ function execSync(cmd, opts) { // True if successful, false if not var obj = { code: code, - output: stdout + output: stdout, // deprecated + stdout: stdout, + stderr: stderr }; return obj; } // execSync() // Wrapper around exec() to enable echoing output to console in real time function execAsync(cmd, opts, callback) { - var output = ''; + var stdout = ''; + var stderr = ''; - var options = common.extend({ - silent: common.config.silent + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE }, opts); - var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) { + var c = child.exec(cmd, opts, function(err) { if (callback) - callback(err ? err.code : 0, output); + callback(err ? err.code : 0, stdout, stderr); }); c.stdout.on('data', function(data) { - output += data; - if (!options.silent) + stdout += data; + if (!opts.silent) process.stdout.write(data); }); c.stderr.on('data', function(data) { - output += data; - if (!options.silent) - process.stdout.write(data); + stderr += data; + if (!opts.silent) + process.stderr.write(data); }); return c; @@ -161,29 +186,33 @@ function execAsync(cmd, opts, callback) { //@ ### exec(command [, options] [, callback]) //@ Available options (all `false` by default): //@ -//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. +//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to +//@ `true`, regardless of the passed value. //@ + `silent`: Do not echo program output to console. +//@ + and any option available to NodeJS's +//@ [child_process.exec()](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) //@ //@ Examples: //@ //@ ```javascript -//@ var version = exec('node --version', {silent:true}).output; +//@ var version = exec('node --version', {silent:true}).stdout; //@ //@ var child = exec('some_long_running_process', {async:true}); //@ child.stdout.on('data', function(data) { //@ /* ... do something with data ... */ //@ }); //@ -//@ exec('some_long_running_process', function(code, output) { +//@ exec('some_long_running_process', function(code, stdout, stderr) { //@ console.log('Exit code:', code); -//@ console.log('Program output:', output); +//@ console.log('Program output:', stdout); +//@ console.log('Program stderr:', stderr); //@ }); //@ ``` //@ -//@ Executes the given `command` _synchronously_, unless otherwise specified. -//@ When in synchronous mode returns the object `{ code:..., 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)`. +//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +//@ and the `callback` gets the arguments `(code, stdout, stderr)`. //@ //@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as //@ the current synchronous implementation uses a lot of CPU. This should be getting @@ -208,9 +237,13 @@ function _exec(command, options, callback) { async: false }, options); - if (options.async) - return execAsync(command, options, callback); - else - return execSync(command, options); + try { + if (options.async) + return execAsync(command, options, callback); + else + return execSync(command, options); + } catch (e) { + common.error('internal error'); + } } module.exports = _exec; diff --git a/tools/eslint/node_modules/shelljs/src/find.js b/tools/eslint/node_modules/shelljs/src/find.js index d9eeec26a93b67..c96fb2f7ad51e7 100644 --- a/tools/eslint/node_modules/shelljs/src/find.js +++ b/tools/eslint/node_modules/shelljs/src/find.js @@ -3,7 +3,7 @@ var common = require('./common'); var _ls = require('./ls'); //@ -//@ ### find(path [,path ...]) +//@ ### find(path [, path ...]) //@ ### find(path_array) //@ Examples: //@ diff --git a/tools/eslint/node_modules/shelljs/src/grep.js b/tools/eslint/node_modules/shelljs/src/grep.js index 00c7d6a4068435..78008ce19e6d2f 100644 --- a/tools/eslint/node_modules/shelljs/src/grep.js +++ b/tools/eslint/node_modules/shelljs/src/grep.js @@ -2,8 +2,8 @@ var common = require('./common'); var fs = require('fs'); //@ -//@ ### grep([options ,] regex_filter, file [, file ...]) -//@ ### grep([options ,] regex_filter, file_array) +//@ ### 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. diff --git a/tools/eslint/node_modules/shelljs/src/ln.js b/tools/eslint/node_modules/shelljs/src/ln.js index a7b9701b3723cb..878fda13e23d45 100644 --- a/tools/eslint/node_modules/shelljs/src/ln.js +++ b/tools/eslint/node_modules/shelljs/src/ln.js @@ -1,15 +1,13 @@ var fs = require('fs'); var path = require('path'); var common = require('./common'); -var os = require('os'); //@ -//@ ### ln(options, source, dest) -//@ ### ln(source, dest) +//@ ### ln([options,] source, dest) //@ Available options: //@ -//@ + `s`: symlink -//@ + `f`: force +//@ + `-s`: symlink +//@ + `-f`: force //@ //@ Examples: //@ @@ -29,13 +27,11 @@ function _ln(options, source, dest) { common.error('Missing and/or '); } - source = path.resolve(process.cwd(), String(source)); + source = String(source); + var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); + var isAbsolute = (path.resolve(source) === sourcePath); dest = path.resolve(process.cwd(), String(dest)); - if (!fs.existsSync(source)) { - common.error('Source file does not exist', true); - } - if (fs.existsSync(dest)) { if (!options.force) { common.error('Destination file exists', true); @@ -45,9 +41,29 @@ function _ln(options, source, dest) { } if (options.symlink) { - fs.symlinkSync(source, dest, os.platform() === "win32" ? "junction" : null); + var isWindows = common.platform === 'win'; + var linkType = isWindows ? 'file' : null; + var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); + if (!fs.existsSync(resolvedSourcePath)) { + common.error('Source file does not exist', true); + } else if (isWindows && fs.statSync(resolvedSourcePath).isDirectory()) { + linkType = 'junction'; + } + + try { + fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath: source, dest, linkType); + } catch (err) { + common.error(err.message); + } } else { - fs.linkSync(source, dest, os.platform() === "win32" ? "junction" : null); + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + try { + fs.linkSync(source, dest); + } catch (err) { + common.error(err.message); + } } } module.exports = _ln; diff --git a/tools/eslint/node_modules/shelljs/src/ls.js b/tools/eslint/node_modules/shelljs/src/ls.js index 3345db4466bc52..6a54b3a8d8426a 100644 --- a/tools/eslint/node_modules/shelljs/src/ls.js +++ b/tools/eslint/node_modules/shelljs/src/ls.js @@ -5,12 +5,17 @@ var _cd = require('./cd'); var _pwd = require('./pwd'); //@ -//@ ### ls([options ,] path [,path ...]) -//@ ### ls([options ,] path_array) +//@ ### ls([options,] [path, ...]) +//@ ### ls([options,] path_array) //@ Available options: //@ //@ + `-R`: recursive //@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ + `-d`: list directories themselves, not their contents +//@ + `-l`: list objects representing each file, each with fields containing `ls +//@ -l` output fields. See +//@ [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) +//@ for more info //@ //@ Examples: //@ @@ -18,6 +23,7 @@ var _pwd = require('./pwd'); //@ ls('projs/*.js'); //@ ls('-R', '/users/me', '/tmp'); //@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} //@ ``` //@ //@ Returns array of files in the given path, or in current directory if no path provided. @@ -25,7 +31,9 @@ function _ls(options, paths) { options = common.parseOptions(options, { 'R': 'recursive', 'A': 'all', - 'a': 'all_deprecated' + 'a': 'all_deprecated', + 'd': 'directory', + 'l': 'long' }); if (options.all_deprecated) { @@ -48,33 +56,49 @@ function _ls(options, paths) { // Conditionally pushes file to list - returns true if pushed, false otherwise // (e.g. prevents hidden files to be included unless explicitly told so) function pushFile(file, query) { + var name = file.name || file; // hidden file? - if (path.basename(file)[0] === '.') { + if (path.basename(name)[0] === '.') { // not explicitly asking for hidden files? if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) return false; } if (common.platform === 'win') - file = file.replace(/\\/g, '/'); + name = name.replace(/\\/g, '/'); + if (file.name) { + file.name = name; + } else { + file = name; + } list.push(file); return true; } paths.forEach(function(p) { if (fs.existsSync(p)) { - var stats = fs.statSync(p); + var stats = ls_stat(p); // Simple file? if (stats.isFile()) { - pushFile(p, p); + if (options.long) { + pushFile(stats, p); + } else { + pushFile(p, p); + } return; // continue } // Simple dir? - if (stats.isDirectory()) { + if (options.directory) { + pushFile(p, p); + return; + } else if (stats.isDirectory()) { // Iterate over p contents fs.readdirSync(p).forEach(function(file) { + var orig_file = file; + if (options.long) + file = ls_stat(path.join(p, file)); if (!pushFile(file, p)) return; @@ -82,8 +106,8 @@ function _ls(options, paths) { if (options.recursive) { var oldDir = _pwd(); _cd('', p); - if (fs.statSync(file).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); + if (fs.statSync(orig_file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), orig_file+'/*')); _cd('', oldDir); } }); @@ -104,7 +128,13 @@ function _ls(options, paths) { // Iterate over directory contents fs.readdirSync(dirname).forEach(function(file) { if (file.match(new RegExp(regexp))) { - if (!pushFile(path.normalize(dirname+'/'+file), basename)) + var file_path = path.join(dirname, file); + file_path = options.long ? ls_stat(file_path) : file_path; + if (file_path.name) + file_path.name = path.normalize(file_path.name); + else + file_path = path.normalize(file_path); + if (!pushFile(file_path, basename)) return; // Recursive? @@ -124,3 +154,15 @@ function _ls(options, paths) { return list; } module.exports = _ls; + + +function ls_stat(path) { + var stats = fs.statSync(path); + // Note: this object will contain more information than .toString() returns + stats.name = path; + stats.toString = function() { + // Return a string resembling unix's `ls -l` format + return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); + }; + return stats; +} diff --git a/tools/eslint/node_modules/shelljs/src/mkdir.js b/tools/eslint/node_modules/shelljs/src/mkdir.js index 5a7088f2609c9f..8b4fd99075053a 100644 --- a/tools/eslint/node_modules/shelljs/src/mkdir.js +++ b/tools/eslint/node_modules/shelljs/src/mkdir.js @@ -20,11 +20,11 @@ function mkdirSyncRecursive(dir) { } //@ -//@ ### mkdir([options ,] dir [, dir ...]) -//@ ### mkdir([options ,] dir_array) +//@ ### mkdir([options,] dir [, dir ...]) +//@ ### mkdir([options,] dir_array) //@ Available options: //@ -//@ + `p`: full path (will create intermediate dirs if necessary) +//@ + `-p`: full path (will create intermediate dirs if necessary) //@ //@ Examples: //@ diff --git a/tools/eslint/node_modules/shelljs/src/mv.js b/tools/eslint/node_modules/shelljs/src/mv.js index 11f96071875a47..69cc03fe1ebe2b 100644 --- a/tools/eslint/node_modules/shelljs/src/mv.js +++ b/tools/eslint/node_modules/shelljs/src/mv.js @@ -3,16 +3,17 @@ var path = require('path'); var common = require('./common'); //@ -//@ ### mv(source [, source ...], dest') -//@ ### mv(source_array, dest') +//@ ### mv([options ,] source [, source ...], dest') +//@ ### mv([options ,] source_array, dest') //@ Available options: //@ -//@ + `f`: force +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber //@ //@ Examples: //@ //@ ```javascript -//@ mv('-f', 'file', 'dir/'); +//@ mv('-n', 'file', 'dir/'); //@ mv('file1', 'file2', 'dir/'); //@ mv(['file1', 'file2'], 'dir/'); // same as above //@ ``` @@ -20,7 +21,8 @@ var common = require('./common'); //@ Moves files. The wildcard `*` is accepted. function _mv(options, sources, dest) { options = common.parseOptions(options, { - 'f': 'force' + 'f': '!no_force', + 'n': 'no_force' }); // Get sources, dest @@ -47,7 +49,7 @@ function _mv(options, sources, dest) { 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) + if (exists && stats.isFile() && options.no_force) common.error('dest file already exists: ' + dest); sources.forEach(function(src) { @@ -64,7 +66,7 @@ function _mv(options, sources, dest) { if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) thisDest = path.normalize(dest + '/' + path.basename(src)); - if (fs.existsSync(thisDest) && !options.force) { + if (fs.existsSync(thisDest) && options.no_force) { common.error('dest file already exists: ' + thisDest, true); return; // skip file } diff --git a/tools/eslint/node_modules/shelljs/src/pwd.js b/tools/eslint/node_modules/shelljs/src/pwd.js index 41727bb918b78c..26cefe0a0454d0 100644 --- a/tools/eslint/node_modules/shelljs/src/pwd.js +++ b/tools/eslint/node_modules/shelljs/src/pwd.js @@ -4,7 +4,7 @@ var common = require('./common'); //@ //@ ### pwd() //@ Returns the current directory. -function _pwd(options) { +function _pwd() { var pwd = path.resolve(process.cwd()); return common.ShellString(pwd); } diff --git a/tools/eslint/node_modules/shelljs/src/rm.js b/tools/eslint/node_modules/shelljs/src/rm.js index bd608cb09a59e8..cf2e95b6d816bc 100644 --- a/tools/eslint/node_modules/shelljs/src/rm.js +++ b/tools/eslint/node_modules/shelljs/src/rm.js @@ -53,7 +53,7 @@ function rmdirSyncRecursive(dir, force) { while (true) { try { result = fs.rmdirSync(dir); - if (fs.existsSync(dir)) throw { code: "EAGAIN" } + 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 @@ -89,8 +89,8 @@ function isWriteable(file) { } //@ -//@ ### rm([options ,] file [, file ...]) -//@ ### rm([options ,] file_array) +//@ ### rm([options,] file [, file ...]) +//@ ### rm([options,] file_array) //@ Available options: //@ //@ + `-f`: force diff --git a/tools/eslint/node_modules/shelljs/src/sed.js b/tools/eslint/node_modules/shelljs/src/sed.js index 65f7cb49d1cae1..baa385ba1167d4 100644 --- a/tools/eslint/node_modules/shelljs/src/sed.js +++ b/tools/eslint/node_modules/shelljs/src/sed.js @@ -2,7 +2,8 @@ var common = require('./common'); var fs = require('fs'); //@ -//@ ### sed([options ,] search_regex, replacement, file) +//@ ### sed([options,] search_regex, replacement, file [, file ...]) +//@ ### sed([options,] search_regex, replacement, file_array) //@ Available options: //@ //@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ @@ -14,9 +15,9 @@ var fs = require('fs'); //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); //@ ``` //@ -//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input +//@ Reads an input string from `files` and performs a JavaScript `replace()` on the input //@ using the given search regex and replacement string or function. Returns the new string after replacement. -function _sed(options, regex, replacement, file) { +function _sed(options, regex, replacement, files) { options = common.parseOptions(options, { 'i': 'inplace' }); @@ -28,16 +29,36 @@ function _sed(options, regex, replacement, file) { else common.error('invalid replacement string'); - if (!file) - common.error('no file given'); + // Convert all search strings to RegExp + if (typeof regex === 'string') + regex = RegExp(regex); - if (!fs.existsSync(file)) - common.error('no such file or directory: ' + file); + if (!files) + common.error('no files given'); - var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); - if (options.inplace) - fs.writeFileSync(file, result, 'utf8'); + if (typeof files === 'string') + files = [].slice.call(arguments, 3); + // if it's array leave it as it is - return common.ShellString(result); + files = common.expand(files); + + var sed = []; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var result = fs.readFileSync(file, 'utf8').split('\n').map(function (line) { + return line.replace(regex, replacement); + }).join('\n'); + + sed.push(result); + + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + }); + + return common.ShellString(sed.join('\n')); } module.exports = _sed; diff --git a/tools/eslint/node_modules/shelljs/src/set.js b/tools/eslint/node_modules/shelljs/src/set.js new file mode 100644 index 00000000000000..19e26d979d3f4b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/set.js @@ -0,0 +1,49 @@ +var common = require('./common'); + +//@ +//@ ### set(options) +//@ Available options: +//@ +//@ + `+/-e`: exit upon error (`config.fatal`) +//@ + `+/-v`: verbose: show all commands (`config.verbose`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ set('-e'); // exit upon first error +//@ set('+e'); // this undoes a "set('-e')" +//@ ``` +//@ +//@ Sets global configuration variables +function _set(options) { + if (!options) { + var args = [].slice.call(arguments, 0); + if (args.length < 2) + common.error('must provide an argument'); + options = args[1]; + } + var negate = (options[0] === '+'); + if (negate) { + options = '-' + options.slice(1); // parseOptions needs a '-' prefix + } + options = common.parseOptions(options, { + 'e': 'fatal', + 'v': 'verbose' + }); + + var key; + if (negate) { + for (key in options) + options[key] = !options[key]; + } + + for (key in options) { + // Only change the global config if `negate` is false and the option is true + // or if `negate` is true and the option is false (aka negate !== option) + if (negate !== options[key]) { + common.config[key] = options[key]; + } + } + return; +} +module.exports = _set; diff --git a/tools/eslint/node_modules/shelljs/src/tempdir.js b/tools/eslint/node_modules/shelljs/src/tempdir.js index 45953c24e98134..79b949f0d4f15b 100644 --- a/tools/eslint/node_modules/shelljs/src/tempdir.js +++ b/tools/eslint/node_modules/shelljs/src/tempdir.js @@ -37,7 +37,8 @@ function _tempDir() { if (state.tempDir) return state.tempDir; // from cache - state.tempDir = writeableDir(os.tempDir && os.tempDir()) || // node 0.8+ + state.tempDir = writeableDir(os.tmpdir && os.tmpdir()) || // node 0.10+ + writeableDir(os.tmpDir && os.tmpDir()) || // node 0.8+ writeableDir(process.env['TMPDIR']) || writeableDir(process.env['TEMP']) || writeableDir(process.env['TMP']) || diff --git a/tools/eslint/node_modules/shelljs/src/test.js b/tools/eslint/node_modules/shelljs/src/test.js index 8a4ac7d4d10270..068a1ce06ef4c9 100644 --- a/tools/eslint/node_modules/shelljs/src/test.js +++ b/tools/eslint/node_modules/shelljs/src/test.js @@ -10,7 +10,7 @@ var fs = require('fs'); //@ + `'-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 +//@ + `'-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 //@ diff --git a/tools/eslint/node_modules/shelljs/src/to.js b/tools/eslint/node_modules/shelljs/src/to.js index f0299993a7ae25..65d6d54af90837 100644 --- a/tools/eslint/node_modules/shelljs/src/to.js +++ b/tools/eslint/node_modules/shelljs/src/to.js @@ -22,6 +22,7 @@ function _to(options, file) { try { fs.writeFileSync(file, this.toString(), 'utf8'); + return this; } catch(e) { common.error('could not write to file (code '+e.code+'): '+file, true); } diff --git a/tools/eslint/node_modules/shelljs/src/toEnd.js b/tools/eslint/node_modules/shelljs/src/toEnd.js index f6d099d9a3a5ed..bf29a6526d0f97 100644 --- a/tools/eslint/node_modules/shelljs/src/toEnd.js +++ b/tools/eslint/node_modules/shelljs/src/toEnd.js @@ -22,6 +22,7 @@ function _toEnd(options, file) { try { fs.appendFileSync(file, this.toString(), 'utf8'); + return this; } catch(e) { common.error('could not append to file (code '+e.code+'): '+file, true); } diff --git a/tools/eslint/node_modules/shelljs/src/touch.js b/tools/eslint/node_modules/shelljs/src/touch.js new file mode 100644 index 00000000000000..bbc2c1968654ab --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/touch.js @@ -0,0 +1,109 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### touch([options,] file) +//@ Available options: +//@ +//@ + `-a`: Change only the access time +//@ + `-c`: Do not create any files +//@ + `-m`: Change only the modification time +//@ + `-d DATE`: Parse DATE and use it instead of current time +//@ + `-r FILE`: Use FILE's times instead of current time +//@ +//@ Examples: +//@ +//@ ```javascript +//@ touch('source.js'); +//@ touch('-c', '/path/to/some/dir/source.js'); +//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +//@ ``` +//@ +//@ Update the access and modification times of each FILE to the current time. +//@ A FILE argument that does not exist is created empty, unless -c is supplied. +//@ This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. +function _touch(opts, files) { + opts = common.parseOptions(opts, { + 'a': 'atime_only', + 'c': 'no_create', + 'd': 'date', + 'm': 'mtime_only', + 'r': 'reference', + }); + + if (!files) { + common.error('no paths given'); + } + + if (Array.isArray(files)) { + files.forEach(function(f) { + touchFile(opts, f); + }); + } else if (typeof files === 'string') { + touchFile(opts, files); + } else { + common.error('file arg should be a string file path or an Array of string file paths'); + } + +} + +function touchFile(opts, file) { + var stat = tryStatFile(file); + + if (stat && stat.isDirectory()) { + // don't error just exit + return; + } + + // if the file doesn't already exist and the user has specified --no-create then + // this script is finished + if (!stat && opts.no_create) { + return; + } + + // open the file and then close it. this will create it if it doesn't exist but will + // not truncate the file + fs.closeSync(fs.openSync(file, 'a')); + + // + // Set timestamps + // + + // setup some defaults + var now = new Date(); + var mtime = opts.date || now; + var atime = opts.date || now; + + // use reference file + if (opts.reference) { + var refStat = tryStatFile(opts.reference); + if (!refStat) { + common.error('failed to get attributess of ' + opts.reference); + } + mtime = refStat.mtime; + atime = refStat.atime; + } else if (opts.date) { + mtime = opts.date; + atime = opts.date; + } + + if (opts.atime_only && opts.mtime_only) { + // keep the new values of mtime and atime like GNU + } else if (opts.atime_only) { + mtime = stat.mtime; + } else if (opts.mtime_only) { + atime = stat.atime; + } + + fs.utimesSync(file, atime, mtime); +} + +module.exports = _touch; + +function tryStatFile(filePath) { + try { + return fs.statSync(filePath); + } catch (e) { + return null; + } +} diff --git a/tools/eslint/node_modules/shelljs/src/which.js b/tools/eslint/node_modules/shelljs/src/which.js index 2822ecfb14c97e..d17634ee941d96 100644 --- a/tools/eslint/node_modules/shelljs/src/which.js +++ b/tools/eslint/node_modules/shelljs/src/which.js @@ -2,10 +2,12 @@ var common = require('./common'); var fs = require('fs'); var path = require('path'); +// XP's system default value for PATHEXT system variable, just in case it's not +// set on Windows. +var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; + // Cross-platform method for splitting environment PATH variables function splitPath(p) { - for (i=1;i<2;i++) {} - if (!p) return []; @@ -16,7 +18,7 @@ function splitPath(p) { } function checkPath(path) { - return fs.existsSync(path) && fs.statSync(path).isDirectory() == false; + return fs.existsSync(path) && !fs.statSync(path).isDirectory(); } //@ @@ -28,7 +30,8 @@ function checkPath(path) { //@ var nodeExec = which('node'); //@ ``` //@ -//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +//@ Searches for `command` in the system's PATH. On Windows, this uses the +//@ `PATHEXT` variable to append the extension if it's not already executable. //@ Returns string containing the absolute path to the command. function _which(options, cmd) { if (!cmd) @@ -45,30 +48,42 @@ function _which(options, cmd) { if (where) return; // already found it - var attempt = path.resolve(dir + '/' + cmd); - if (checkPath(attempt)) { - where = attempt; - return; - } + var attempt = path.resolve(dir, cmd); if (common.platform === 'win') { - var baseAttempt = attempt; - attempt = baseAttempt + '.exe'; - if (checkPath(attempt)) { - where = attempt; - return; + attempt = attempt.toUpperCase(); + + // In case the PATHEXT variable is somehow not set (e.g. + // child_process.spawn with an empty environment), use the XP default. + var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; + var pathExtArray = splitPath(pathExtEnv.toUpperCase()); + var i; + + // If the extension is already in PATHEXT, just return that. + for (i = 0; i < pathExtArray.length; i++) { + var ext = pathExtArray[i]; + if (attempt.slice(-ext.length) === ext && checkPath(attempt)) { + where = attempt; + return; + } } - attempt = baseAttempt + '.cmd'; - if (checkPath(attempt)) { - where = attempt; - return; + + // Cycle through the PATHEXT variable + var baseAttempt = attempt; + for (i = 0; i < pathExtArray.length; i++) { + attempt = baseAttempt + pathExtArray[i]; + if (checkPath(attempt)) { + where = attempt; + return; + } } - attempt = baseAttempt + '.bat'; + } else { + // Assume it's Unix-like if (checkPath(attempt)) { where = attempt; return; } - } // if 'win' + } }); } diff --git a/tools/eslint/node_modules/slice-ansi/index.js b/tools/eslint/node_modules/slice-ansi/index.js index fbf1c5a2a3c3b2..c65de4d4a51f9e 100755 --- a/tools/eslint/node_modules/slice-ansi/index.js +++ b/tools/eslint/node_modules/slice-ansi/index.js @@ -77,3 +77,4 @@ module.exports = function (str, begin, end) { return output; }; + diff --git a/tools/eslint/node_modules/slice-ansi/package.json b/tools/eslint/node_modules/slice-ansi/package.json index 603644f32955a3..b71d24f67780f1 100644 --- a/tools/eslint/node_modules/slice-ansi/package.json +++ b/tools/eslint/node_modules/slice-ansi/package.json @@ -2,14 +2,14 @@ "_args": [ [ "slice-ansi@0.0.4", - "/Users/trott/test/node_modules/eslint/node_modules/table" + "/Users/trott/io.js/tools/node_modules/table" ] ], "_from": "slice-ansi@0.0.4", "_id": "slice-ansi@0.0.4", "_inCache": true, "_installable": true, - "_location": "/eslint/slice-ansi", + "_location": "/slice-ansi", "_nodeVersion": "3.2.0", "_npmUser": { "email": "threedeecee@gmail.com", @@ -26,13 +26,13 @@ "type": "version" }, "_requiredBy": [ - "/eslint/table" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/table", "author": { "email": "threedeecee@gmail.com", "name": "David Caccavella" @@ -51,7 +51,7 @@ "directories": {}, "dist": { "shasum": "edbf8903f66f7ce2f8eafd6ceed65e264c831b35", - "tarball": "http://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz" + "tarball": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/slice-ansi/readme.md b/tools/eslint/node_modules/slice-ansi/readme.md index 920b929887898b..31be6124db8c37 100755 --- a/tools/eslint/node_modules/slice-ansi/readme.md +++ b/tools/eslint/node_modules/slice-ansi/readme.md @@ -1,4 +1,4 @@ -# slice-ansi +# 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) diff --git a/tools/eslint/node_modules/sprintf-js/.npmignore b/tools/eslint/node_modules/sprintf-js/.npmignore deleted file mode 100644 index 096746c1480d8f..00000000000000 --- a/tools/eslint/node_modules/sprintf-js/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ \ No newline at end of file diff --git a/tools/eslint/node_modules/sprintf-js/bower.json b/tools/eslint/node_modules/sprintf-js/bower.json deleted file mode 100644 index d90a75989f7b05..00000000000000 --- a/tools/eslint/node_modules/sprintf-js/bower.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/sprintf-js/demo/angular.html b/tools/eslint/node_modules/sprintf-js/demo/angular.html deleted file mode 100644 index 3559efd7635634..00000000000000 --- a/tools/eslint/node_modules/sprintf-js/demo/angular.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - -
    {{ "%+010d"|sprintf:-123 }}
    -
    {{ "%+010d"|vsprintf:[-123] }}
    -
    {{ "%+010d"|fmt:-123 }}
    -
    {{ "%+010d"|vfmt:[-123] }}
    -
    {{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
    -
    {{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
    - - - - diff --git a/tools/eslint/node_modules/sprintf-js/gruntfile.js b/tools/eslint/node_modules/sprintf-js/gruntfile.js deleted file mode 100644 index 246e1c3b9801fc..00000000000000 --- a/tools/eslint/node_modules/sprintf-js/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/tools/eslint/node_modules/sprintf-js/package.json b/tools/eslint/node_modules/sprintf-js/package.json index b347d2ebbd0d35..2fabbfab458cc9 100644 --- a/tools/eslint/node_modules/sprintf-js/package.json +++ b/tools/eslint/node_modules/sprintf-js/package.json @@ -2,14 +2,14 @@ "_args": [ [ "sprintf-js@~1.0.2", - "/Users/trott/test/node_modules/eslint/node_modules/argparse" + "/Users/trott/io.js/tools/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", + "_location": "/sprintf-js", "_nodeVersion": "0.12.4", "_npmUser": { "email": "hello@alexei.ro", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/argparse" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/argparse", "author": { "email": "hello@alexei.ro", "name": "Alexandru Marasteanu", diff --git a/tools/eslint/node_modules/sprintf-js/test/test.js b/tools/eslint/node_modules/sprintf-js/test/test.js deleted file mode 100644 index 6f57b2538c8522..00000000000000 --- a/tools/eslint/node_modules/sprintf-js/test/test.js +++ /dev/null @@ -1,82 +0,0 @@ -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/package.json b/tools/eslint/node_modules/string-width/package.json index 6fe09bdcc74427..0ec302382e3069 100644 --- a/tools/eslint/node_modules/string-width/package.json +++ b/tools/eslint/node_modules/string-width/package.json @@ -2,14 +2,14 @@ "_args": [ [ "string-width@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/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", + "_location": "/string-width", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer", - "/eslint/table" + "/inquirer", + "/table" ], "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", "_shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", "_shrinkwrap": null, "_spec": "string-width@^1.0.1", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/string_decoder/package.json b/tools/eslint/node_modules/string_decoder/package.json index 1f448bb2cc2cf8..1c26751f90d3d0 100644 --- a/tools/eslint/node_modules/string_decoder/package.json +++ b/tools/eslint/node_modules/string_decoder/package.json @@ -2,14 +2,14 @@ "_args": [ [ "string_decoder@~0.10.x", - "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + "/Users/trott/io.js/tools/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", + "_location": "/string_decoder", "_npmUser": { "email": "rod@vagg.org", "name": "rvagg" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readable-stream" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/readable-stream", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, diff --git a/tools/eslint/node_modules/strip-ansi/package.json b/tools/eslint/node_modules/strip-ansi/package.json index 189069f4b5c9b2..5549445f70216a 100644 --- a/tools/eslint/node_modules/strip-ansi/package.json +++ b/tools/eslint/node_modules/strip-ansi/package.json @@ -2,20 +2,24 @@ "_args": [ [ "strip-ansi@^3.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/chalk" + "/Users/trott/io.js/tools/node_modules/chalk" ] ], "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_id": "strip-ansi@3.0.0", + "_id": "strip-ansi@3.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/strip-ansi", - "_nodeVersion": "0.12.5", + "_location": "/strip-ansi", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/strip-ansi-3.0.1.tgz_1456057278183_0.28958667791448534" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "email": "jappelman@xebia.com", + "name": "jbnicolai" }, - "_npmVersion": "2.11.2", + "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { "name": "strip-ansi", @@ -26,35 +30,36 @@ "type": "range" }, "_requiredBy": [ - "/eslint/chalk", - "/eslint/inquirer", - "/eslint/string-width", - "/eslint/table" + "/chalk", + "/inquirer", + "/string-width", + "/table" ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", "_shrinkwrap": null, "_spec": "strip-ansi@^3.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/chalk", + "_where": "/Users/trott/io.js/tools/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", "url": "sindresorhus.com" }, "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" + "url": "https://github.com/chalk/strip-ansi/issues" }, "dependencies": { "ansi-regex": "^2.0.0" }, "description": "Strip ANSI escape codes", "devDependencies": { - "ava": "0.0.4" + "ava": "*", + "xo": "*" }, "directories": {}, "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" + "shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -62,8 +67,8 @@ "files": [ "index.js" ], - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "homepage": "https://github.com/sindresorhus/strip-ansi", + "gitHead": "8270705c704956da865623e564eba4875c3ea17f", + "homepage": "https://github.com/chalk/strip-ansi", "keywords": [ "strip", "trim", @@ -104,10 +109,10 @@ "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" + "url": "git+https://github.com/chalk/strip-ansi.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "3.0.0" + "version": "3.0.1" } diff --git a/tools/eslint/node_modules/strip-ansi/readme.md b/tools/eslint/node_modules/strip-ansi/readme.md index 76091512df5e46..cb7d9ff7ee403d 100644 --- a/tools/eslint/node_modules/strip-ansi/readme.md +++ b/tools/eslint/node_modules/strip-ansi/readme.md @@ -1,4 +1,4 @@ -# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) > Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) @@ -22,10 +22,10 @@ stripAnsi('\u001b[4mcake\u001b[0m'); ## 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 +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right ## License diff --git a/tools/eslint/node_modules/strip-json-comments/package.json b/tools/eslint/node_modules/strip-json-comments/package.json index 3727967f5af0bb..d504405aef0de0 100644 --- a/tools/eslint/node_modules/strip-json-comments/package.json +++ b/tools/eslint/node_modules/strip-json-comments/package.json @@ -2,14 +2,14 @@ "_args": [ [ "strip-json-comments@~1.0.1", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/strip-json-comments", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -32,7 +32,7 @@ "_shasum": "1e15fbcac97d3ee99bf2d73b4c656b082bbafb91", "_shrinkwrap": null, "_spec": "strip-json-comments@~1.0.1", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/supports-color/package.json b/tools/eslint/node_modules/supports-color/package.json index 6378600d9eed16..9740f02034d2a3 100644 --- a/tools/eslint/node_modules/supports-color/package.json +++ b/tools/eslint/node_modules/supports-color/package.json @@ -2,14 +2,14 @@ "_args": [ [ "supports-color@^2.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/chalk" + "/Users/trott/io.js/tools/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", + "_location": "/supports-color", "_nodeVersion": "0.12.5", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/chalk" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/chalk", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", diff --git a/tools/eslint/node_modules/table/README.md b/tools/eslint/node_modules/table/README.md index be0589bc48b947..2b5669755594e8 100644 --- a/tools/eslint/node_modules/table/README.md +++ b/tools/eslint/node_modules/table/README.md @@ -484,7 +484,7 @@ setInterval(() => { `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). +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. @@ -649,3 +649,4 @@ console.log(output); ║ amet viverra. ║ ╚══════════════════════╝ ``` + diff --git a/tools/eslint/node_modules/table/package.json b/tools/eslint/node_modules/table/package.json index 2db6c296e24acc..1d8bca3d3fc1fd 100644 --- a/tools/eslint/node_modules/table/package.json +++ b/tools/eslint/node_modules/table/package.json @@ -2,14 +2,14 @@ "_args": [ [ "table@^3.7.8", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/node_modules/eslint" ] ], "_from": "table@>=3.7.8 <4.0.0", "_id": "table@3.7.8", "_inCache": true, "_installable": true, - "_location": "/eslint/table", + "_location": "/table", "_nodeVersion": "5.3.0", "_npmUser": { "email": "gajus@gajus.com", @@ -32,7 +32,7 @@ "_shasum": "b424433ef596851922b2fd77224a69a1951618eb", "_shrinkwrap": null, "_spec": "table@^3.7.8", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "gajus@gajus.com", "name": "Gajus Kuizinas", @@ -62,7 +62,7 @@ "directories": {}, "dist": { "shasum": "b424433ef596851922b2fd77224a69a1951618eb", - "tarball": "http://registry.npmjs.org/table/-/table-3.7.8.tgz" + "tarball": "https://registry.npmjs.org/table/-/table-3.7.8.tgz" }, "gitHead": "7464b27999c5c6da43c754fb5f94931423d41839", "homepage": "https://github.com/gajus/table#readme", diff --git a/tools/eslint/node_modules/text-table/.travis.yml b/tools/eslint/node_modules/text-table/.travis.yml deleted file mode 100644 index cc4dba29d959a2..00000000000000 --- a/tools/eslint/node_modules/text-table/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/tools/eslint/node_modules/text-table/example/align.js b/tools/eslint/node_modules/text-table/example/align.js deleted file mode 100644 index 9be43098cf87b8..00000000000000 --- a/tools/eslint/node_modules/text-table/example/align.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] -], { align: [ 'l', 'r' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/center.js b/tools/eslint/node_modules/text-table/example/center.js deleted file mode 100644 index 52b1c69e012cb1..00000000000000 --- a/tools/eslint/node_modules/text-table/example/center.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] -], { align: [ 'l', 'c', 'l' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/dotalign.js b/tools/eslint/node_modules/text-table/example/dotalign.js deleted file mode 100644 index 2cea6299368475..00000000000000 --- a/tools/eslint/node_modules/text-table/example/dotalign.js +++ /dev/null @@ -1,9 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] -], { align: [ 'l', '.' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/doubledot.js b/tools/eslint/node_modules/text-table/example/doubledot.js deleted file mode 100644 index bab983b664cd6d..00000000000000 --- a/tools/eslint/node_modules/text-table/example/doubledot.js +++ /dev/null @@ -1,11 +0,0 @@ -var table = require('../'); -var t = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] -], { align: [ '.' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/table.js b/tools/eslint/node_modules/text-table/example/table.js deleted file mode 100644 index 903ea4c417ccb0..00000000000000 --- a/tools/eslint/node_modules/text-table/example/table.js +++ /dev/null @@ -1,6 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] -]); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/package.json b/tools/eslint/node_modules/text-table/package.json index fa69f07ccf6acb..05b25746ab8ce1 100644 --- a/tools/eslint/node_modules/text-table/package.json +++ b/tools/eslint/node_modules/text-table/package.json @@ -2,14 +2,14 @@ "_args": [ [ "text-table@~0.2.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/text-table", "_npmUser": { "email": "mail@substack.net", "name": "substack" @@ -31,7 +31,7 @@ "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", "_shrinkwrap": null, "_spec": "text-table@~0.2.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "mail@substack.net", "name": "James Halliday", @@ -50,7 +50,7 @@ "directories": {}, "dist": { "shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", - "tarball": "http://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" + "tarball": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" }, "homepage": "https://github.com/substack/text-table", "keywords": [ diff --git a/tools/eslint/node_modules/text-table/test/align.js b/tools/eslint/node_modules/text-table/test/align.js deleted file mode 100644 index 245357f26a76b9..00000000000000 --- a/tools/eslint/node_modules/text-table/test/align.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] - ], { align: [ 'l', 'r' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 33450', - 'foo 1006', - 'bar 45' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/ansi-colors.js b/tools/eslint/node_modules/text-table/test/ansi-colors.js deleted file mode 100644 index fbc5bb10ad732a..00000000000000 --- a/tools/eslint/node_modules/text-table/test/ansi-colors.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var table = require('../'); -var color = require('cli-color'); -var ansiTrim = require('cli-color/lib/trim'); - -test('center', function (t) { - t.plan(1); - var opts = { - align: [ 'l', 'c', 'l' ], - stringLength: function(s) { return ansiTrim(s).length } - }; - var s = table([ - [ - color.red('Red'), color.green('Green'), color.blue('Blue') - ], - [ - color.bold('Bold'), color.underline('Underline'), - color.italic('Italic') - ], - [ - color.inverse('Inverse'), color.strike('Strike'), - color.blink('Blink') - ], - [ 'bar', '45', 'lmno' ] - ], opts); - t.equal(ansiTrim(s), [ - 'Red Green Blue', - 'Bold Underline Italic', - 'Inverse Strike Blink', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/center.js b/tools/eslint/node_modules/text-table/test/center.js deleted file mode 100644 index c2c7a62a8f8cca..00000000000000 --- a/tools/eslint/node_modules/text-table/test/center.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('center', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] - ], { align: [ 'l', 'c', 'l' ] }); - t.equal(s, [ - 'beep 1024 xyz', - 'boop 3388450 tuv', - 'foo 10106 qrstuv', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/dotalign.js b/tools/eslint/node_modules/text-table/test/dotalign.js deleted file mode 100644 index f804f9281ab135..00000000000000 --- a/tools/eslint/node_modules/text-table/test/dotalign.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] - ], { align: [ 'l', '.' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 334.212', - 'foo 1006', - 'bar 45.6', - 'baz 123.' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/doubledot.js b/tools/eslint/node_modules/text-table/test/doubledot.js deleted file mode 100644 index 659b57c9314bca..00000000000000 --- a/tools/eslint/node_modules/text-table/test/doubledot.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] - ], { align: [ '.' ] }); - t.equal(s, [ - ' 0.1.2', - '11.22.33', - ' 5.6.7', - ' 1.22222', - '12345.', - ' 5555.', - ' 123' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/table.js b/tools/eslint/node_modules/text-table/test/table.js deleted file mode 100644 index 9c6701464cf66a..00000000000000 --- a/tools/eslint/node_modules/text-table/test/table.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('table', function (t) { - t.plan(1); - var s = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] - ]); - t.equal(s, [ - 'master 0123456789abcdef', - 'staging fedcba9876543210' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/through/.travis.yml b/tools/eslint/node_modules/through/.travis.yml deleted file mode 100644 index c693a939df9809..00000000000000 --- a/tools/eslint/node_modules/through/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - "0.10" diff --git a/tools/eslint/node_modules/through/LICENSE.MIT b/tools/eslint/node_modules/through/LICENSE.MIT index 49e7da41fec2be..6eafbd734a6e06 100644 --- a/tools/eslint/node_modules/through/LICENSE.MIT +++ b/tools/eslint/node_modules/through/LICENSE.MIT @@ -2,23 +2,23 @@ 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, +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/eslint/node_modules/through/index.js b/tools/eslint/node_modules/through/index.js index 9f443ffd2b1936..ca5fc5901fd875 100644 --- a/tools/eslint/node_modules/through/index.js +++ b/tools/eslint/node_modules/through/index.js @@ -105,3 +105,4 @@ function through (write, end, opts) { } return stream } + diff --git a/tools/eslint/node_modules/through/package.json b/tools/eslint/node_modules/through/package.json index 70aa857120166c..b7446ea02bbb47 100644 --- a/tools/eslint/node_modules/through/package.json +++ b/tools/eslint/node_modules/through/package.json @@ -2,14 +2,14 @@ "_args": [ [ "through@^2.3.6", - "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + "/Users/trott/io.js/tools/node_modules/inquirer" ] ], "_from": "through@>=2.3.6 <3.0.0", "_id": "through@2.3.8", "_inCache": true, "_installable": true, - "_location": "/eslint/through", + "_location": "/through", "_nodeVersion": "2.3.1", "_npmUser": { "email": "dominic.tarr@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inquirer" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/inquirer", "author": { "email": "dominic.tarr@gmail.com", "name": "Dominic Tarr", @@ -51,7 +51,7 @@ "directories": {}, "dist": { "shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", - "tarball": "http://registry.npmjs.org/through/-/through-2.3.8.tgz" + "tarball": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" }, "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", "homepage": "https://github.com/dominictarr/through", diff --git a/tools/eslint/node_modules/through/readme.markdown b/tools/eslint/node_modules/through/readme.markdown index 4939fffe422cf5..cb34c8135f53eb 100644 --- a/tools/eslint/node_modules/through/readme.markdown +++ b/tools/eslint/node_modules/through/readme.markdown @@ -3,14 +3,14 @@ [![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`. +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 +This function is the basis for most of the synchronous streams in [event-stream](http://github.com/dominictarr/event-stream). ``` js @@ -32,7 +32,7 @@ var through = require('through') through(function write(data) { this.emit('data', data) - //this.pause() + //this.pause() }, function end () { //optional this.emit('end') diff --git a/tools/eslint/node_modules/through/test/async.js b/tools/eslint/node_modules/through/test/async.js deleted file mode 100644 index f6fc95f4ffad8f..00000000000000 --- a/tools/eslint/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/through/test/auto-destroy.js b/tools/eslint/node_modules/through/test/auto-destroy.js deleted file mode 100644 index 305fff23d35d9b..00000000000000 --- a/tools/eslint/node_modules/through/test/auto-destroy.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - ts.autoDestroy = false - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.notOk(closed) - ts.destroy() - assert.ok(closed) - assert.end() -}) diff --git a/tools/eslint/node_modules/through/test/buffering.js b/tools/eslint/node_modules/through/test/buffering.js deleted file mode 100644 index b0084bfc6ed5ac..00000000000000 --- a/tools/eslint/node_modules/through/test/buffering.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('buffering', function(assert) { - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - assert.deepEqual(actual, [1, 2, 3]) - ts.pause() - ts.write(4) - ts.write(5) - ts.write(6) - assert.deepEqual(actual, [1, 2, 3]) - ts.resume() - assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) - ts.pause() - ts.end() - assert.ok(!ended) - ts.resume() - assert.ok(ended) - assert.end() -}) - -test('buffering has data in queue, when ends', function (assert) { - - /* - * If stream ends while paused with data in the queue, - * stream should still emit end after all data is written - * on resume. - */ - - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.pause() - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.deepEqual(actual, [], 'no data written yet, still paused') - assert.ok(!ended, 'end not emitted yet, still paused') - ts.resume() - assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') - assert.ok(ended, 'end should be emitted once all data was delivered') - assert.end(); -}) diff --git a/tools/eslint/node_modules/through/test/end.js b/tools/eslint/node_modules/through/test/end.js deleted file mode 100644 index fa113f58e0360a..00000000000000 --- a/tools/eslint/node_modules/through/test/end.js +++ /dev/null @@ -1,45 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.ok(closed) - assert.end() -}) - -test('end only once', function (t) { - - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - t.equal(ended, false) - ended = true - }) - - ts.queue(null) - ts.queue(null) - ts.queue(null) - - ts.resume() - - t.end() -}) diff --git a/tools/eslint/node_modules/through/test/index.js b/tools/eslint/node_modules/through/test/index.js deleted file mode 100644 index 1d9523f40e495a..00000000000000 --- a/tools/eslint/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/tryit/.npmignore b/tools/eslint/node_modules/tryit/.npmignore deleted file mode 100644 index 9daa8247da451d..00000000000000 --- a/tools/eslint/node_modules/tryit/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -node_modules diff --git a/tools/eslint/node_modules/tryit/README.md b/tools/eslint/node_modules/tryit/README.md index 25a6ad580962f4..80418843eb8131 100644 --- a/tools/eslint/node_modules/tryit/README.md +++ b/tools/eslint/node_modules/tryit/README.md @@ -1,6 +1,6 @@ # tryit -Tiny module wrapping try/catch in JavaScript. +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. @@ -11,7 +11,7 @@ It's *literally 11 lines of code*, [just read it](tryit.js) that's all the docum npm install tryit ``` -## usage +## usage What you'd normally do: ```js @@ -40,15 +40,15 @@ tryit(dangerousThing, function (e) { 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!? +## 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. +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. +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 diff --git a/tools/eslint/node_modules/tryit/package.json b/tools/eslint/node_modules/tryit/package.json index b138c6ea6a7331..56fd925cb58139 100644 --- a/tools/eslint/node_modules/tryit/package.json +++ b/tools/eslint/node_modules/tryit/package.json @@ -2,14 +2,14 @@ "_args": [ [ "tryit@^1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/is-resolvable" + "/Users/trott/io.js/tools/node_modules/is-resolvable" ] ], "_from": "tryit@>=1.0.1 <2.0.0", "_id": "tryit@1.0.2", "_inCache": true, "_installable": true, - "_location": "/eslint/tryit", + "_location": "/tryit", "_nodeVersion": "4.1.0", "_npmUser": { "email": "henrik@joreteg.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/is-resolvable" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/is-resolvable", "author": { "email": "henrik@andyet.net", "name": "Henrik Joreteg" diff --git a/tools/eslint/node_modules/tryit/test/test.js b/tools/eslint/node_modules/tryit/test/test.js deleted file mode 100644 index 68f6f2b8cf0c6a..00000000000000 --- a/tools/eslint/node_modules/tryit/test/test.js +++ /dev/null @@ -1,37 +0,0 @@ -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/tv4/lang/nb.js b/tools/eslint/node_modules/tv4/lang/nb.js index 41831a17f98c91..d6b1a84f82d069 100644 --- a/tools/eslint/node_modules/tv4/lang/nb.js +++ b/tools/eslint/node_modules/tv4/lang/nb.js @@ -36,7 +36,7 @@ // 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) { @@ -53,3 +53,4 @@ 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 index f46aaa4388b584..c4b8ba86eeb53d 100755 --- a/tools/eslint/node_modules/tv4/lang/pl-PL.js +++ b/tools/eslint/node_modules/tv4/lang/pl-PL.js @@ -36,7 +36,7 @@ // 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) { diff --git a/tools/eslint/node_modules/tv4/lang/pt-PT.js b/tools/eslint/node_modules/tv4/lang/pt-PT.js index 0413251d2bf8a5..6fa5a98e14caa6 100644 --- a/tools/eslint/node_modules/tv4/lang/pt-PT.js +++ b/tools/eslint/node_modules/tv4/lang/pt-PT.js @@ -36,7 +36,7 @@ // 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) { diff --git a/tools/eslint/node_modules/tv4/lang/sv-SE.js b/tools/eslint/node_modules/tv4/lang/sv-SE.js index 28f2994c4adeb1..3621a3480dccdd 100644 --- a/tools/eslint/node_modules/tv4/lang/sv-SE.js +++ b/tools/eslint/node_modules/tv4/lang/sv-SE.js @@ -1,42 +1,42 @@ (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)" + 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) { diff --git a/tools/eslint/node_modules/tv4/package.json b/tools/eslint/node_modules/tv4/package.json index 4b20e94f2bce62..587c38bb3299b8 100644 --- a/tools/eslint/node_modules/tv4/package.json +++ b/tools/eslint/node_modules/tv4/package.json @@ -2,14 +2,14 @@ "_args": [ [ "tv4@^1.2.7", - "/Users/trott/test/node_modules/eslint/node_modules/table" + "/Users/trott/io.js/tools/node_modules/table" ] ], "_from": "tv4@>=1.2.7 <2.0.0", "_id": "tv4@1.2.7", "_inCache": true, "_installable": true, - "_location": "/eslint/tv4", + "_location": "/tv4", "_nodeVersion": "0.12.4", "_npmUser": { "email": "luffgd@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/table" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/table", "author": { "name": "Geraint Luff" }, @@ -65,7 +65,7 @@ "directories": {}, "dist": { "shasum": "bd29389afc73ade49ae5f48142b5d544bf68d120", - "tarball": "http://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz" + "tarball": "https://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz" }, "engines": { "node": ">= 0.8.0" diff --git a/tools/eslint/node_modules/type-check/package.json b/tools/eslint/node_modules/type-check/package.json index 0a23aceaa86d62..ab691cba012c31 100644 --- a/tools/eslint/node_modules/type-check/package.json +++ b/tools/eslint/node_modules/type-check/package.json @@ -2,14 +2,14 @@ "_args": [ [ "type-check@~0.3.2", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/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", + "_location": "/type-check", "_nodeVersion": "4.2.4", "_npmUser": { "email": "z@georgezahariev.com", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/levn", - "/eslint/optionator" + "/levn", + "/optionator" ], "_resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "_shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", "_shrinkwrap": null, "_spec": "type-check@~0.3.2", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/optionator", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "z@georgezahariev.com", "name": "George Zahariev" @@ -54,7 +54,7 @@ "directories": {}, "dist": { "shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", - "tarball": "http://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + "tarball": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" }, "engines": { "node": ">= 0.8.0" diff --git a/tools/eslint/node_modules/typedarray/.travis.yml b/tools/eslint/node_modules/typedarray/.travis.yml deleted file mode 100644 index cc4dba29d959a2..00000000000000 --- a/tools/eslint/node_modules/typedarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/tools/eslint/node_modules/typedarray/example/tarray.js b/tools/eslint/node_modules/typedarray/example/tarray.js deleted file mode 100644 index 8423d7c9b1c327..00000000000000 --- a/tools/eslint/node_modules/typedarray/example/tarray.js +++ /dev/null @@ -1,4 +0,0 @@ -var Uint8Array = require('../').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); diff --git a/tools/eslint/node_modules/typedarray/package.json b/tools/eslint/node_modules/typedarray/package.json index 4e2e57f91e2fae..08ddc62523993f 100644 --- a/tools/eslint/node_modules/typedarray/package.json +++ b/tools/eslint/node_modules/typedarray/package.json @@ -2,14 +2,14 @@ "_args": [ [ "typedarray@~0.0.5", - "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + "/Users/trott/io.js/tools/node_modules/concat-stream" ] ], "_from": "typedarray@>=0.0.5 <0.1.0", "_id": "typedarray@0.0.6", "_inCache": true, "_installable": true, - "_location": "/eslint/typedarray", + "_location": "/typedarray", "_npmUser": { "email": "mail@substack.net", "name": "substack" @@ -25,13 +25,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/concat-stream" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/concat-stream", "author": { "email": "mail@substack.net", "name": "James Halliday", diff --git a/tools/eslint/node_modules/typedarray/test/server/undef_globals.js b/tools/eslint/node_modules/typedarray/test/server/undef_globals.js deleted file mode 100644 index e57dabdcebc9c1..00000000000000 --- a/tools/eslint/node_modules/typedarray/test/server/undef_globals.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); - -test('u8a without globals', function (t) { - var c = { - module: { exports: {} }, - }; - c.exports = c.module.exports; - vm.runInNewContext(src, c); - var TA = c.module.exports; - var ua = new(TA.Uint8Array)(5); - - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/tools/eslint/node_modules/typedarray/test/tarray.js b/tools/eslint/node_modules/typedarray/test/tarray.js deleted file mode 100644 index df596a34f23c0e..00000000000000 --- a/tools/eslint/node_modules/typedarray/test/tarray.js +++ /dev/null @@ -1,10 +0,0 @@ -var TA = require('../'); -var test = require('tape'); - -test('tiny u8a test', function (t) { - var ua = new(TA.Uint8Array)(5); - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/tools/eslint/node_modules/user-home/package.json b/tools/eslint/node_modules/user-home/package.json index 2f733e80ecf68b..a4375f7bb19a43 100644 --- a/tools/eslint/node_modules/user-home/package.json +++ b/tools/eslint/node_modules/user-home/package.json @@ -2,14 +2,14 @@ "_args": [ [ "user-home@^2.0.0", - "/Users/trott/test/node_modules/eslint" + "/Users/trott/io.js/tools/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", + "_location": "/user-home", "_nodeVersion": "0.12.4", "_npmUser": { "email": "sindresorhus@gmail.com", @@ -32,7 +32,7 @@ "_shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", "_shrinkwrap": null, "_spec": "user-home@^2.0.0", - "_where": "/Users/trott/test/node_modules/eslint", + "_where": "/Users/trott/io.js/tools/node_modules/eslint", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", @@ -52,7 +52,7 @@ "directories": {}, "dist": { "shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", - "tarball": "http://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" + "tarball": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/util-deprecate/package.json b/tools/eslint/node_modules/util-deprecate/package.json index 36c7407627731f..f2b883cdf31a09 100644 --- a/tools/eslint/node_modules/util-deprecate/package.json +++ b/tools/eslint/node_modules/util-deprecate/package.json @@ -2,14 +2,14 @@ "_args": [ [ "util-deprecate@~1.0.1", - "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + "/Users/trott/io.js/tools/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", + "_location": "/util-deprecate", "_nodeVersion": "4.1.2", "_npmUser": { "email": "nathan@tootallnate.net", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/readable-stream" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/readable-stream", "author": { "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", diff --git a/tools/eslint/node_modules/wordwrap/example/center.js b/tools/eslint/node_modules/wordwrap/example/center.js deleted file mode 100644 index a3fbaae9880f76..00000000000000 --- a/tools/eslint/node_modules/wordwrap/example/center.js +++ /dev/null @@ -1,10 +0,0 @@ -var wrap = require('wordwrap')(20, 60); -console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' -)); diff --git a/tools/eslint/node_modules/wordwrap/example/meat.js b/tools/eslint/node_modules/wordwrap/example/meat.js deleted file mode 100644 index a4665e1058b5ec..00000000000000 --- a/tools/eslint/node_modules/wordwrap/example/meat.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('wordwrap')(15); - -console.log(wrap('You and your whole family are made out of meat.')); diff --git a/tools/eslint/node_modules/wordwrap/index.js b/tools/eslint/node_modules/wordwrap/index.js index 67c8a61ecb8f6d..c9bc94521d8c7a 100644 --- a/tools/eslint/node_modules/wordwrap/index.js +++ b/tools/eslint/node_modules/wordwrap/index.js @@ -4,22 +4,22 @@ var wordwrap = module.exports = function (start, stop, params) { 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) @@ -33,16 +33,16 @@ var wordwrap = module.exports = function (start, stop, params) { 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(' ') @@ -63,7 +63,7 @@ var wordwrap = module.exports = function (start, stop, params) { else { lines[i] += chunk; } - + return lines; }, [ new Array(start + 1).join(' ') ]).join('\n'); }; diff --git a/tools/eslint/node_modules/wordwrap/package.json b/tools/eslint/node_modules/wordwrap/package.json index 384454f186898f..2c069debb85c9a 100644 --- a/tools/eslint/node_modules/wordwrap/package.json +++ b/tools/eslint/node_modules/wordwrap/package.json @@ -2,14 +2,14 @@ "_args": [ [ "wordwrap@~1.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/optionator" + "/Users/trott/io.js/tools/node_modules/optionator" ] ], "_from": "wordwrap@>=1.0.0 <1.1.0", "_id": "wordwrap@1.0.0", "_inCache": true, "_installable": true, - "_location": "/eslint/wordwrap", + "_location": "/wordwrap", "_nodeVersion": "2.0.0", "_npmUser": { "email": "substack@gmail.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/optionator" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/optionator", "author": { "email": "mail@substack.net", "name": "James Halliday", diff --git a/tools/eslint/node_modules/wordwrap/test/break.js b/tools/eslint/node_modules/wordwrap/test/break.js deleted file mode 100644 index 6e7a9a55d65461..00000000000000 --- a/tools/eslint/node_modules/wordwrap/test/break.js +++ /dev/null @@ -1,32 +0,0 @@ -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/wordwrap/test/idleness.txt b/tools/eslint/node_modules/wordwrap/test/idleness.txt deleted file mode 100644 index aa3f4907fe889e..00000000000000 --- a/tools/eslint/node_modules/wordwrap/test/idleness.txt +++ /dev/null @@ -1,63 +0,0 @@ -In Praise of Idleness - -By Bertrand Russell - -[1932] - -Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. - -Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. - -One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. - -But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. - -All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. - -First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. - -Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. - -From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. - -It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. - -Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. - -This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? - -The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. - -Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. - -I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. - -If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. - -The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. - -In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. - -The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. - -For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? - -In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. - -In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. - -The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. - -It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. - -When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. - -In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. - -The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. - -In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. - -Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. - -[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/tools/eslint/node_modules/wordwrap/test/wrap.js b/tools/eslint/node_modules/wordwrap/test/wrap.js deleted file mode 100644 index a478bd442d1ed5..00000000000000 --- a/tools/eslint/node_modules/wordwrap/test/wrap.js +++ /dev/null @@ -1,33 +0,0 @@ -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/package.json b/tools/eslint/node_modules/wrappy/package.json index 6b42a3ffd6f81a..4713c4acc606fd 100644 --- a/tools/eslint/node_modules/wrappy/package.json +++ b/tools/eslint/node_modules/wrappy/package.json @@ -2,14 +2,14 @@ "_args": [ [ "wrappy@1", - "/Users/trott/test/node_modules/eslint/node_modules/inflight" + "/Users/trott/io.js/tools/node_modules/inflight" ] ], "_from": "wrappy@>=1.0.0 <2.0.0", "_id": "wrappy@1.0.1", "_inCache": true, "_installable": true, - "_location": "/eslint/wrappy", + "_location": "/wrappy", "_nodeVersion": "0.10.31", "_npmUser": { "email": "i@izs.me", @@ -26,14 +26,14 @@ "type": "range" }, "_requiredBy": [ - "/eslint/inflight", - "/eslint/once" + "/inflight", + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/inflight", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", diff --git a/tools/eslint/node_modules/wrappy/test/basic.js b/tools/eslint/node_modules/wrappy/test/basic.js deleted file mode 100644 index 5ed0fcdfd9c52e..00000000000000 --- a/tools/eslint/node_modules/wrappy/test/basic.js +++ /dev/null @@ -1,51 +0,0 @@ -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/write/package.json b/tools/eslint/node_modules/write/package.json index 288a9ad77e8598..7c0e2e07d1c0d3 100644 --- a/tools/eslint/node_modules/write/package.json +++ b/tools/eslint/node_modules/write/package.json @@ -2,14 +2,14 @@ "_args": [ [ "write@^0.2.1", - "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + "/Users/trott/io.js/tools/node_modules/flat-cache" ] ], "_from": "write@>=0.2.1 <0.3.0", "_id": "write@0.2.1", "_inCache": true, "_installable": true, - "_location": "/eslint/write", + "_location": "/write", "_nodeVersion": "0.12.4", "_npmUser": { "email": "github@sellside.com", @@ -26,13 +26,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/flat-cache" + "/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", + "_where": "/Users/trott/io.js/tools/node_modules/flat-cache", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" @@ -53,7 +53,7 @@ "directories": {}, "dist": { "shasum": "5fc03828e264cea3fe91455476f7a3c566cb0757", - "tarball": "http://registry.npmjs.org/write/-/write-0.2.1.tgz" + "tarball": "https://registry.npmjs.org/write/-/write-0.2.1.tgz" }, "engines": { "node": ">=0.10.0" diff --git a/tools/eslint/node_modules/xregexp/LICENSE b/tools/eslint/node_modules/xregexp/LICENSE index 561f996b7fb583..5561edc5d2ffce 100644 --- a/tools/eslint/node_modules/xregexp/LICENSE +++ b/tools/eslint/node_modules/xregexp/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2007-2015 Steven Levithan +Copyright (c) 2007-2016 Steven Levithan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tools/eslint/node_modules/xregexp/README.md b/tools/eslint/node_modules/xregexp/README.md index 3acfd7e928ee25..3ea582c5e9ad48 100644 --- a/tools/eslint/node_modules/xregexp/README.md +++ b/tools/eslint/node_modules/xregexp/README.md @@ -1,7 +1,7 @@ -[XRegExp](http://xregexp.com/) 3.0.0 +[XRegExp](http://xregexp.com/) 3.1.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 provides augmented (and extensible) JavaScript regular expressions. You get new modern syntax and flags beyond what browsers support natively. XRegExp is also a regex utility belt with tools to make your client-side grepping and parsing easier, while freeing you from worrying about pesky aspects of JavaScript regexes like cross-browser inconsistencies and manually manipulating `lastIndex`. XRegExp supports all native ES6 regular expression syntax. It supports Internet Explorer 5.5+, Firefox 1.5+, Chrome, Safari 3+, and Opera 11+. You can also use it with Node.js, or as a RequireJS module. The base library is about 4.25 KB, minified and gzipped. @@ -40,15 +40,6 @@ 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) { @@ -79,7 +70,7 @@ These examples should give you the flavor of what's possible, but XRegExp has mo ## 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. +You can either load addons individually, or bundle all addons together with XRegExp by loading `xregexp-all.js`. XRegExp's [npm package](https://www.npmjs.com/package/xregexp) uses `xregexp-all.js`, so addons are always available when XRegExp is installed using npm. ### Unicode @@ -106,15 +97,19 @@ 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`. +By default, `\p{…}` and `\P{…}` support the Basic Multilingual Plane (i.e. code points up to `U+FFFF`). You can opt-in to full 21-bit Unicode support (with code points up to `U+10FFFF`) on a per-regex basis by using flag `A`. In XRegExp, this is called *astral mode*. You can automatically add flag `A` for all new regexes by running `XRegExp.install('astral')`. When in astral mode, `\p{…}` and `\P{…}` always match a full code point rather than a code unit, using surrogate pairs for code points above `U+FFFF`. ```js -// Using flag A. The test string uses a surrogate pair to represent U+1F4A9 -XRegExp('^\\pS$', 'A').test('\uD83D\uDCA9'); // -> true +// Using flag A to match astral code points +XRegExp('^\\pS$').test('💩'); // -> false +XRegExp('^\\pS$', 'A').test('💩'); // -> true +XRegExp('(?A)^\\pS$').test('💩'); // -> true +// Using surrogate pair U+D83D U+DCA9 to represent U+1F4A9 (pile of poo) +XRegExp('(?A)^\\pS$').test('\uD83D\uDCA9'); // -> true // Implicit flag A XRegExp.install('astral'); -XRegExp('^\\pS$').test('\uD83D\uDCA9'); // -> true +XRegExp('^\\pS$').test('💩'); // -> true ``` Opting in to astral mode disables the use of `\p{…}` and `\P{…}` within character classes. In astral mode, use e.g. `(\pL|[0-9_])+` instead of `[\pL0-9_]+`. @@ -179,16 +174,16 @@ XRegExp.matchRecursive(str, '', '
    ', 'gi', { ] */ // Omitting unneeded parts with null valueNames, and using escapeChar -str = '...{1}\\{{function(x,y){return y+x;}}'; +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} +{name: 'literal', value: '...', start: 0, end: 3}, +{name: 'value', value: '1', start: 4, end: 5}, +{name: 'literal', value: '.\\{', start: 6, end: 9}, +{name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} ] */ // Sticky mode via flag y @@ -213,7 +208,7 @@ Or, to bundle XRegExp with all of its addons: ``` -Using [npm](http://npmjs.org/): +Using [npm](https://www.npmjs.com/): ```bash npm install xregexp @@ -224,7 +219,6 @@ 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/): @@ -234,21 +228,16 @@ require({paths: {xregexp: 'xregexp-all'}}, ['xregexp'], function(XRegExp) { }); ``` -## 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/). +XRegExp copyright 2007-2016 by [Steven Levithan](http://stevenlevithan.com/). -Tools: Unicode range generators by [Mathias Bynens](http://mathiasbynens.be/), and adapted from his [unicode-data](https://github.com/mathiasbynens/unicode-data) project. Source file concatenator by [Bjarke Walling](http://twitter.com/walling). +Tools: Unicode range generators by [Mathias Bynens](http://mathiasbynens.be/), and adapted from his [unicode-data](https://github.com/mathiasbynens/unicode-data) project. -Tests: Uses [Jasmine](http://pivotal.github.com/jasmine/) for unit tests, and [Benchmark.js](http://benchmarkjs.com) for performance tests. +Tests: Uses [Jasmine](http://jasmine.github.io/) for unit tests, and [Benchmark.js](http://benchmarkjs.com) for performance tests. Prior art: `XRegExp.build` inspired by [Lea Verou](http://lea.verou.me/)'s [RegExp.create](http://lea.verou.me/2011/03/create-complex-regexps-more-easily/). `XRegExp.union` inspired by [Ruby](http://www.ruby-lang.org/). XRegExp's syntax extensions and flags come from [Perl](http://www.perl.org/), [.NET](http://www.microsoft.com/net), etc. -All code, including addons, tools, and tests, is released under the terms of the [MIT License](http://mit-license.org/). +All code, including addons, tools, and tests, is released under the terms of the [MIT](http://mit-license.org/) license. Fork me to show support, fix, and extend. diff --git a/tools/eslint/node_modules/xregexp/package.json b/tools/eslint/node_modules/xregexp/package.json index 6a3ec75414b251..76cb517195c525 100644 --- a/tools/eslint/node_modules/xregexp/package.json +++ b/tools/eslint/node_modules/xregexp/package.json @@ -2,15 +2,19 @@ "_args": [ [ "xregexp@^3.0.0", - "/Users/trott/test/node_modules/eslint/node_modules/table" + "/Users/trott/io.js/tools/node_modules/table" ] ], "_from": "xregexp@>=3.0.0 <4.0.0", - "_id": "xregexp@3.0.0", + "_id": "xregexp@3.1.0", "_inCache": true, "_installable": true, - "_location": "/eslint/xregexp", + "_location": "/xregexp", "_nodeVersion": "3.3.1", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/xregexp-3.1.0.tgz_1456271836601_0.7557942552957684" + }, "_npmUser": { "email": "steves_list@hotmail.com", "name": "slevithan" @@ -26,13 +30,13 @@ "type": "range" }, "_requiredBy": [ - "/eslint/table" + "/table" ], - "_resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.0.0.tgz", - "_shasum": "a04f25d9ffe16c1aee40ed521a1b1366e8d34636", + "_resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.0.tgz", + "_shasum": "14d8461e0bdd38224bfee5039a0898fc42fcd336", "_shrinkwrap": null, "_spec": "xregexp@^3.0.0", - "_where": "/Users/trott/test/node_modules/eslint/node_modules/table", + "_where": "/Users/trott/io.js/tools/node_modules/table", "author": { "email": "steves_list@hotmail.com", "name": "Steven Levithan" @@ -42,24 +46,25 @@ }, "dependencies": {}, "description": "Extended regular expressions", - "devDependencies": {}, + "devDependencies": { + "browserify": "^12.0.1" + }, "directories": {}, "dist": { - "shasum": "a04f25d9ffe16c1aee40ed521a1b1366e8d34636", - "tarball": "http://registry.npmjs.org/xregexp/-/xregexp-3.0.0.tgz" + "shasum": "14d8461e0bdd38224bfee5039a0898fc42fcd336", + "tarball": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.0.tgz" }, "files": [ - "LICENSE", - "xregexp-all.js" + "src" ], - "gitHead": "8183679d136bda6c0d015160a912ce2e54375917", + "gitHead": "bbd5b1c2f759bdf278192be5df70af16342ffa4d", "homepage": "http://xregexp.com/", "keywords": [ "regex", "regexp" ], "license": "MIT", - "main": "xregexp-all.js", + "main": "./src/index.js", "maintainers": [ { "email": "steves_list@hotmail.com", @@ -74,7 +79,7 @@ "url": "git+https://github.com/slevithan/xregexp.git" }, "scripts": { - "build": "./tools/concatenate-source.sh" + "build": "browserify src/index.js --standalone XRegExp > xregexp-all.js" }, - "version": "3.0.0" + "version": "3.1.0" } diff --git a/tools/eslint/node_modules/xregexp/src/addons/build.js b/tools/eslint/node_modules/xregexp/src/addons/build.js new file mode 100644 index 00000000000000..221cb26fa940cf --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/build.js @@ -0,0 +1,189 @@ +/*! + * XRegExp.build 3.1.0 + * + * Steven Levithan (c) 2012-2016 MIT License + * Inspired by Lea Verou's RegExp.create + */ + +module.exports = function(XRegExp) { + 'use strict'; + + var REGEX_DATA = 'xregexp', + subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g, + parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g'); + +/** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/, + trailingAnchor = /\$(?:\(\?:\))*$/; + + if ( + leadingAnchor.test(pattern) && + trailingAnchor.test(pattern) && + // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, '')) + ) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + +/** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + function asXRegExp(value) { + return XRegExp.isRegExp(value) ? + (value[REGEX_DATA] && value[REGEX_DATA].captureNames ? + // Don't recompile, to preserve capture names + value : + // Recompile as XRegExp + XRegExp(value.source) + ) : + // Compile string as XRegExp + XRegExp(value); + } + +/** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in the + * outer pattern and provided subpatterns are automatically renumbered to work correctly. Native + * flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * var time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.build = function(pattern, subs, flags) { + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern), + data = {}, + numCaps = 0, // 'Caps' is short for captures + numPriorCaps, + numOuterCaps = 0, + outerCapsMap = [0], + outerCapNames, + sub, + p; + + // Add flags within a leading mode modifier to the overall pattern's flags + if (inlineFlags) { + flags = flags || ''; + inlineFlags[1].replace(/./g, function(flag) { + // Don't add duplicates + flags += (flags.indexOf(flag) > -1 ? '' : flag); + }); + } + + for (p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity + sub = asXRegExp(subs[p]); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`) + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } + + // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back + pattern = asXRegExp(pattern); + outerCapNames = pattern[REGEX_DATA].captureNames || []; + pattern = pattern.source.replace(parts, function($0, $1, $2, $3, $4) { + var subName = $1 || $2, + capName, + intro, + localCapIndex; + // Named subpattern + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError('Undefined property ' + $0); + } + // Named subpattern was wrapped in a capturing group + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + intro = '(?<' + (capName || subName) + '>'; + } else { + intro = '(?:'; + } + numPriorCaps = numCaps; + return intro + data[subName].pattern.replace(subParts, function(match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if (backref) { + localCapIndex = +backref - 1; + // Rewrite the backreference + return data[subName].names[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + data[subName].names[localCapIndex] + '>' : + '\\' + (+backref + numPriorCaps); + } + return match; + }) + ')'; + } + // Capturing group + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if ($4) { + localCapIndex = +$4 - 1; + // Rewrite the backreference + return outerCapNames[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + outerCapNames[localCapIndex] + '>' : + '\\' + outerCapsMap[+$4]; + } + return $0; + }); + + return XRegExp(pattern, flags); + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js b/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js new file mode 100644 index 00000000000000..1de3bdc5579cea --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js @@ -0,0 +1,191 @@ +/*! + * XRegExp.matchRecursive 3.1.0 + * + * Steven Levithan (c) 2009-2016 MIT License + */ + +module.exports = function(XRegExp) { + 'use strict'; + +/** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + +/** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * var str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
    an
    example'; + * XRegExp.matchRecursive(str, '', '
    ', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
    ', start: 8, end: 13}, + * // {name: 'match', value: '
    an
    ', start: 13, end: 27}, + * // {name: 'right', value: '
    ', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + XRegExp.matchRecursive = function(str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') > -1, + sticky = flags.indexOf('y') > -1, + // Flag `y` is controlled internally + basicFlags = flags.replace(/y/g, ''), + escapeChar = options.escapeChar, + vN = options.valueNames, + output = [], + openTokens = 0, + delimStart = 0, + delimEnd = 0, + lastOuterEnd = 0, + outerStart, + innerStart, + leftMatch, + rightMatch, + esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + escapeChar = XRegExp.escape(escapeChar); + // Using `XRegExp.union` safely rewrites backreferences in `left` and `right` + esc = new RegExp( + '(?:' + escapeChar + '[\\S\\s]|(?:(?!' + + XRegExp.union([left, right]).source + + ')[^' + escapeChar + '])+)+', + // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '') + ); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); + // Keep the leftmost match only + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } + // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + ++openTokens; + } else if (rightMatch && openTokens) { + if (!--openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } + // If the delimiter matched an empty string, avoid an infinite loop + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js new file mode 100644 index 00000000000000..2a323041b60e3e --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js @@ -0,0 +1,236 @@ +/*! + * XRegExp Unicode Base 3.1.0 + * + * Steven Levithan (c) 2008-2016 MIT License + */ + +/** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the braces + * for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are available + * to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ +module.exports = function(XRegExp) { + 'use strict'; + +// Storage for Unicode data + var unicode = {}; + +/* ============================== + * Private functions + * ============================== */ + +// Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } + +// Adds leading zeros if shorter than four characters + function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; + } + +// Converts a hexadecimal number to decimal + function dec(hex) { + return parseInt(hex, 16); + } + +// Converts a decimal number to hexadecimal + function hex(dec) { + return parseInt(dec, 10).toString(16); + } + +// Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? + dec(esc[1]) : + chr.charCodeAt(chr.charAt(0) === '\\' ? 1 : 0); + } + +// Inverts a list of ordered BMP characters and ranges + function invertBmp(range) { + var output = '', + lastEnd = -1, + start; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function(m) { + start = charCode(m[1]); + if (start > (lastEnd + 1)) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (start > (lastEnd + 2)) { + output += '-\\u' + pad4(hex(start - 1)); + } + } + lastEnd = charCode(m[2] || m[1]); + }); + if (lastEnd < 0xFFFF) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + return output; + } + +// Generates an inverted BMP range on first use + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || ( + unicode[slug][prop] = invertBmp(unicode[slug].bmp) + ); + } + +// Combines and optionally negates BMP and astral data + function buildAstral(slug, isNegated) { + var item = unicode[slug], + combined = ''; + if (item.bmp && !item.isBmpLast) { + combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); + } + if (item.astral) { + combined += item.astral; + } + if (item.isBmpLast && item.bmp) { + combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; + } + // Astral Unicode tokens always match a code point, never a code unit + return isNegated ? + '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : + '(?:' + combined + ')'; + } + +// Builds a complete astral pattern on first use + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || ( + unicode[slug][prop] = buildAstral(slug, isNegated) + ); + } + +/* ============================== + * Core functionality + * ============================== */ + +/* + * Add Unicode token syntax: \p{..}, \P{..}, \p{^..}. Also add astral mode (flag A). + */ + XRegExp.addToken( + // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, + function(match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation ', + ERR_UNKNOWN_NAME = 'Unknown Unicode token ', + ERR_UNKNOWN_REF = 'Unicode token missing data ', + ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token ', + ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes', + // Negated via \P{..} or \p{^..} + isNegated = match[1] === 'P' || !!match[2], + // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + isAstralMode = flags.indexOf('A') > -1, + // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + slug = normalize(match[4] || match[3]), + // Token data object + item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } + + // Switch to the negated form of the referenced Unicode token + if (item.inverseOf) { + slug = normalize(item.inverseOf); + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); + } + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? + (isNegated ? cacheInvertedBmp(slug) : item.bmp) : + (isNegated ? '[^' : '[') + item.bmp + ']'; + }, + { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + } + ); + +/** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties `name`, + * `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are optional, although + * one of `bmp` or `astral` is required (unless `inverseOf` is set). If `astral` is absent, the + * `bmp` data is used for BMP and astral modes. If `bmp` is absent, the name errors in BMP mode + * but works in astral mode. If both `bmp` and `astral` are provided, the `bmp` data only is used + * in BMP mode, and the combination of `bmp` and `astral` data is used in astral mode. + * `isBmpLast` is needed when a token matches orphan high surrogates *and* uses surrogate pairs + * to match astral code points. The `bmp` and `astral` data should be a combination of literal + * characters and `\xHH` or `\uHHHH` escape sequences, with hyphens to create ranges. Any regex + * metacharacters in the data should be escaped, apart from range-creating hyphens. The `astral` + * data can additionally use character classes and alternation, and should use surrogate pairs to + * represent astral code points. `inverseOf` can be used to avoid duplicating character data if a + * Unicode token is defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + XRegExp.addUnicodeData = function(data) { + var ERR_NO_NAME = 'Unicode token requires name', + ERR_NO_DATA = 'Unicode token has no character data ', + item, + i; + + for (i = 0; i < data.length; ++i) { + item = data[i]; + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + unicode[normalize(item.name)] = item; + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js new file mode 100644 index 00000000000000..918dc9d5c45742 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js @@ -0,0 +1,1074 @@ +/*! + * XRegExp Unicode Blocks 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., `\p{InBasicLatin}`. + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData([ + { + name: 'InAegean_Numbers', + astral: '\uD800[\uDD00-\uDD3F]' + }, + { + name: 'InAhom', + astral: '\uD805[\uDF00-\uDF3F]' + }, + { + name: 'InAlchemical_Symbols', + astral: '\uD83D[\uDF00-\uDF7F]' + }, + { + name: 'InAlphabetic_Presentation_Forms', + bmp: '\uFB00-\uFB4F' + }, + { + name: 'InAnatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE7F]' + }, + { + name: 'InAncient_Greek_Musical_Notation', + astral: '\uD834[\uDE00-\uDE4F]' + }, + { + name: 'InAncient_Greek_Numbers', + astral: '\uD800[\uDD40-\uDD8F]' + }, + { + name: 'InAncient_Symbols', + astral: '\uD800[\uDD90-\uDDCF]' + }, + { + name: 'InArabic', + bmp: '\u0600-\u06FF' + }, + { + name: 'InArabic_Extended_A', + bmp: '\u08A0-\u08FF' + }, + { + name: 'InArabic_Mathematical_Alphabetic_Symbols', + astral: '\uD83B[\uDE00-\uDEFF]' + }, + { + name: 'InArabic_Presentation_Forms_A', + bmp: '\uFB50-\uFDFF' + }, + { + name: 'InArabic_Presentation_Forms_B', + bmp: '\uFE70-\uFEFF' + }, + { + name: 'InArabic_Supplement', + bmp: '\u0750-\u077F' + }, + { + name: 'InArmenian', + bmp: '\u0530-\u058F' + }, + { + name: 'InArrows', + bmp: '\u2190-\u21FF' + }, + { + name: 'InAvestan', + astral: '\uD802[\uDF00-\uDF3F]' + }, + { + name: 'InBalinese', + bmp: '\u1B00-\u1B7F' + }, + { + name: 'InBamum', + bmp: '\uA6A0-\uA6FF' + }, + { + name: 'InBamum_Supplement', + astral: '\uD81A[\uDC00-\uDE3F]' + }, + { + name: 'InBasic_Latin', + bmp: '\0-\x7F' + }, + { + name: 'InBassa_Vah', + astral: '\uD81A[\uDED0-\uDEFF]' + }, + { + name: 'InBatak', + bmp: '\u1BC0-\u1BFF' + }, + { + name: 'InBengali', + bmp: '\u0980-\u09FF' + }, + { + name: 'InBlock_Elements', + bmp: '\u2580-\u259F' + }, + { + name: 'InBopomofo', + bmp: '\u3100-\u312F' + }, + { + name: 'InBopomofo_Extended', + bmp: '\u31A0-\u31BF' + }, + { + name: 'InBox_Drawing', + bmp: '\u2500-\u257F' + }, + { + name: 'InBrahmi', + astral: '\uD804[\uDC00-\uDC7F]' + }, + { + name: 'InBraille_Patterns', + bmp: '\u2800-\u28FF' + }, + { + name: 'InBuginese', + bmp: '\u1A00-\u1A1F' + }, + { + name: 'InBuhid', + bmp: '\u1740-\u175F' + }, + { + name: 'InByzantine_Musical_Symbols', + astral: '\uD834[\uDC00-\uDCFF]' + }, + { + name: 'InCJK_Compatibility', + bmp: '\u3300-\u33FF' + }, + { + name: 'InCJK_Compatibility_Forms', + bmp: '\uFE30-\uFE4F' + }, + { + name: 'InCJK_Compatibility_Ideographs', + bmp: '\uF900-\uFAFF' + }, + { + name: 'InCJK_Compatibility_Ideographs_Supplement', + astral: '\uD87E[\uDC00-\uDE1F]' + }, + { + name: 'InCJK_Radicals_Supplement', + bmp: '\u2E80-\u2EFF' + }, + { + name: 'InCJK_Strokes', + bmp: '\u31C0-\u31EF' + }, + { + name: 'InCJK_Symbols_and_Punctuation', + bmp: '\u3000-\u303F' + }, + { + name: 'InCJK_Unified_Ideographs', + bmp: '\u4E00-\u9FFF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_A', + bmp: '\u3400-\u4DBF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_B', + astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_C', + astral: '\uD86D[\uDC00-\uDF3F]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD869[\uDF00-\uDFFF]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_D', + astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_E', + astral: '[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]|\uD86E[\uDC20-\uDFFF]' + }, + { + name: 'InCarian', + astral: '\uD800[\uDEA0-\uDEDF]' + }, + { + name: 'InCaucasian_Albanian', + astral: '\uD801[\uDD30-\uDD6F]' + }, + { + name: 'InChakma', + astral: '\uD804[\uDD00-\uDD4F]' + }, + { + name: 'InCham', + bmp: '\uAA00-\uAA5F' + }, + { + name: 'InCherokee', + bmp: '\u13A0-\u13FF' + }, + { + name: 'InCherokee_Supplement', + bmp: '\uAB70-\uABBF' + }, + { + name: 'InCombining_Diacritical_Marks', + bmp: '\u0300-\u036F' + }, + { + name: 'InCombining_Diacritical_Marks_Extended', + bmp: '\u1AB0-\u1AFF' + }, + { + name: 'InCombining_Diacritical_Marks_Supplement', + bmp: '\u1DC0-\u1DFF' + }, + { + name: 'InCombining_Diacritical_Marks_for_Symbols', + bmp: '\u20D0-\u20FF' + }, + { + name: 'InCombining_Half_Marks', + bmp: '\uFE20-\uFE2F' + }, + { + name: 'InCommon_Indic_Number_Forms', + bmp: '\uA830-\uA83F' + }, + { + name: 'InControl_Pictures', + bmp: '\u2400-\u243F' + }, + { + name: 'InCoptic', + bmp: '\u2C80-\u2CFF' + }, + { + name: 'InCoptic_Epact_Numbers', + astral: '\uD800[\uDEE0-\uDEFF]' + }, + { + name: 'InCounting_Rod_Numerals', + astral: '\uD834[\uDF60-\uDF7F]' + }, + { + name: 'InCuneiform', + astral: '\uD808[\uDC00-\uDFFF]' + }, + { + name: 'InCuneiform_Numbers_and_Punctuation', + astral: '\uD809[\uDC00-\uDC7F]' + }, + { + name: 'InCurrency_Symbols', + bmp: '\u20A0-\u20CF' + }, + { + name: 'InCypriot_Syllabary', + astral: '\uD802[\uDC00-\uDC3F]' + }, + { + name: 'InCyrillic', + bmp: '\u0400-\u04FF' + }, + { + name: 'InCyrillic_Extended_A', + bmp: '\u2DE0-\u2DFF' + }, + { + name: 'InCyrillic_Extended_B', + bmp: '\uA640-\uA69F' + }, + { + name: 'InCyrillic_Supplement', + bmp: '\u0500-\u052F' + }, + { + name: 'InDeseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'InDevanagari', + bmp: '\u0900-\u097F' + }, + { + name: 'InDevanagari_Extended', + bmp: '\uA8E0-\uA8FF' + }, + { + name: 'InDingbats', + bmp: '\u2700-\u27BF' + }, + { + name: 'InDomino_Tiles', + astral: '\uD83C[\uDC30-\uDC9F]' + }, + { + name: 'InDuployan', + astral: '\uD82F[\uDC00-\uDC9F]' + }, + { + name: 'InEarly_Dynastic_Cuneiform', + astral: '\uD809[\uDC80-\uDD4F]' + }, + { + name: 'InEgyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + name: 'InElbasan', + astral: '\uD801[\uDD00-\uDD2F]' + }, + { + name: 'InEmoticons', + astral: '\uD83D[\uDE00-\uDE4F]' + }, + { + name: 'InEnclosed_Alphanumeric_Supplement', + astral: '\uD83C[\uDD00-\uDDFF]' + }, + { + name: 'InEnclosed_Alphanumerics', + bmp: '\u2460-\u24FF' + }, + { + name: 'InEnclosed_CJK_Letters_and_Months', + bmp: '\u3200-\u32FF' + }, + { + name: 'InEnclosed_Ideographic_Supplement', + astral: '\uD83C[\uDE00-\uDEFF]' + }, + { + name: 'InEthiopic', + bmp: '\u1200-\u137F' + }, + { + name: 'InEthiopic_Extended', + bmp: '\u2D80-\u2DDF' + }, + { + name: 'InEthiopic_Extended_A', + bmp: '\uAB00-\uAB2F' + }, + { + name: 'InEthiopic_Supplement', + bmp: '\u1380-\u139F' + }, + { + name: 'InGeneral_Punctuation', + bmp: '\u2000-\u206F' + }, + { + name: 'InGeometric_Shapes', + bmp: '\u25A0-\u25FF' + }, + { + name: 'InGeometric_Shapes_Extended', + astral: '\uD83D[\uDF80-\uDFFF]' + }, + { + name: 'InGeorgian', + bmp: '\u10A0-\u10FF' + }, + { + name: 'InGeorgian_Supplement', + bmp: '\u2D00-\u2D2F' + }, + { + name: 'InGlagolitic', + bmp: '\u2C00-\u2C5F' + }, + { + name: 'InGothic', + astral: '\uD800[\uDF30-\uDF4F]' + }, + { + name: 'InGrantha', + astral: '\uD804[\uDF00-\uDF7F]' + }, + { + name: 'InGreek_Extended', + bmp: '\u1F00-\u1FFF' + }, + { + name: 'InGreek_and_Coptic', + bmp: '\u0370-\u03FF' + }, + { + name: 'InGujarati', + bmp: '\u0A80-\u0AFF' + }, + { + name: 'InGurmukhi', + bmp: '\u0A00-\u0A7F' + }, + { + name: 'InHalfwidth_and_Fullwidth_Forms', + bmp: '\uFF00-\uFFEF' + }, + { + name: 'InHangul_Compatibility_Jamo', + bmp: '\u3130-\u318F' + }, + { + name: 'InHangul_Jamo', + bmp: '\u1100-\u11FF' + }, + { + name: 'InHangul_Jamo_Extended_A', + bmp: '\uA960-\uA97F' + }, + { + name: 'InHangul_Jamo_Extended_B', + bmp: '\uD7B0-\uD7FF' + }, + { + name: 'InHangul_Syllables', + bmp: '\uAC00-\uD7AF' + }, + { + name: 'InHanunoo', + bmp: '\u1720-\u173F' + }, + { + name: 'InHatran', + astral: '\uD802[\uDCE0-\uDCFF]' + }, + { + name: 'InHebrew', + bmp: '\u0590-\u05FF' + }, + { + name: 'InHigh_Private_Use_Surrogates', + bmp: '\uDB80-\uDBFF' + }, + { + name: 'InHigh_Surrogates', + bmp: '\uD800-\uDB7F' + }, + { + name: 'InHiragana', + bmp: '\u3040-\u309F' + }, + { + name: 'InIPA_Extensions', + bmp: '\u0250-\u02AF' + }, + { + name: 'InIdeographic_Description_Characters', + bmp: '\u2FF0-\u2FFF' + }, + { + name: 'InImperial_Aramaic', + astral: '\uD802[\uDC40-\uDC5F]' + }, + { + name: 'InInscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF7F]' + }, + { + name: 'InInscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF5F]' + }, + { + name: 'InJavanese', + bmp: '\uA980-\uA9DF' + }, + { + name: 'InKaithi', + astral: '\uD804[\uDC80-\uDCCF]' + }, + { + name: 'InKana_Supplement', + astral: '\uD82C[\uDC00-\uDCFF]' + }, + { + name: 'InKanbun', + bmp: '\u3190-\u319F' + }, + { + name: 'InKangxi_Radicals', + bmp: '\u2F00-\u2FDF' + }, + { + name: 'InKannada', + bmp: '\u0C80-\u0CFF' + }, + { + name: 'InKatakana', + bmp: '\u30A0-\u30FF' + }, + { + name: 'InKatakana_Phonetic_Extensions', + bmp: '\u31F0-\u31FF' + }, + { + name: 'InKayah_Li', + bmp: '\uA900-\uA92F' + }, + { + name: 'InKharoshthi', + astral: '\uD802[\uDE00-\uDE5F]' + }, + { + name: 'InKhmer', + bmp: '\u1780-\u17FF' + }, + { + name: 'InKhmer_Symbols', + bmp: '\u19E0-\u19FF' + }, + { + name: 'InKhojki', + astral: '\uD804[\uDE00-\uDE4F]' + }, + { + name: 'InKhudawadi', + astral: '\uD804[\uDEB0-\uDEFF]' + }, + { + name: 'InLao', + bmp: '\u0E80-\u0EFF' + }, + { + name: 'InLatin_Extended_Additional', + bmp: '\u1E00-\u1EFF' + }, + { + name: 'InLatin_Extended_A', + bmp: '\u0100-\u017F' + }, + { + name: 'InLatin_Extended_B', + bmp: '\u0180-\u024F' + }, + { + name: 'InLatin_Extended_C', + bmp: '\u2C60-\u2C7F' + }, + { + name: 'InLatin_Extended_D', + bmp: '\uA720-\uA7FF' + }, + { + name: 'InLatin_Extended_E', + bmp: '\uAB30-\uAB6F' + }, + { + name: 'InLatin_1_Supplement', + bmp: '\x80-\xFF' + }, + { + name: 'InLepcha', + bmp: '\u1C00-\u1C4F' + }, + { + name: 'InLetterlike_Symbols', + bmp: '\u2100-\u214F' + }, + { + name: 'InLimbu', + bmp: '\u1900-\u194F' + }, + { + name: 'InLinear_A', + astral: '\uD801[\uDE00-\uDF7F]' + }, + { + name: 'InLinear_B_Ideograms', + astral: '\uD800[\uDC80-\uDCFF]' + }, + { + name: 'InLinear_B_Syllabary', + astral: '\uD800[\uDC00-\uDC7F]' + }, + { + name: 'InLisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'InLow_Surrogates', + bmp: '\uDC00-\uDFFF' + }, + { + name: 'InLycian', + astral: '\uD800[\uDE80-\uDE9F]' + }, + { + name: 'InLydian', + astral: '\uD802[\uDD20-\uDD3F]' + }, + { + name: 'InMahajani', + astral: '\uD804[\uDD50-\uDD7F]' + }, + { + name: 'InMahjong_Tiles', + astral: '\uD83C[\uDC00-\uDC2F]' + }, + { + name: 'InMalayalam', + bmp: '\u0D00-\u0D7F' + }, + { + name: 'InMandaic', + bmp: '\u0840-\u085F' + }, + { + name: 'InManichaean', + astral: '\uD802[\uDEC0-\uDEFF]' + }, + { + name: 'InMathematical_Alphanumeric_Symbols', + astral: '\uD835[\uDC00-\uDFFF]' + }, + { + name: 'InMathematical_Operators', + bmp: '\u2200-\u22FF' + }, + { + name: 'InMeetei_Mayek', + bmp: '\uABC0-\uABFF' + }, + { + name: 'InMeetei_Mayek_Extensions', + bmp: '\uAAE0-\uAAFF' + }, + { + name: 'InMende_Kikakui', + astral: '\uD83A[\uDC00-\uDCDF]' + }, + { + name: 'InMeroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDFF]' + }, + { + name: 'InMeroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'InMiao', + astral: '\uD81B[\uDF00-\uDF9F]' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_A', + bmp: '\u27C0-\u27EF' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_B', + bmp: '\u2980-\u29FF' + }, + { + name: 'InMiscellaneous_Symbols', + bmp: '\u2600-\u26FF' + }, + { + name: 'InMiscellaneous_Symbols_and_Arrows', + bmp: '\u2B00-\u2BFF' + }, + { + name: 'InMiscellaneous_Symbols_and_Pictographs', + astral: '\uD83D[\uDC00-\uDDFF]|\uD83C[\uDF00-\uDFFF]' + }, + { + name: 'InMiscellaneous_Technical', + bmp: '\u2300-\u23FF' + }, + { + name: 'InModi', + astral: '\uD805[\uDE00-\uDE5F]' + }, + { + name: 'InModifier_Tone_Letters', + bmp: '\uA700-\uA71F' + }, + { + name: 'InMongolian', + bmp: '\u1800-\u18AF' + }, + { + name: 'InMro', + astral: '\uD81A[\uDE40-\uDE6F]' + }, + { + name: 'InMultani', + astral: '\uD804[\uDE80-\uDEAF]' + }, + { + name: 'InMusical_Symbols', + astral: '\uD834[\uDD00-\uDDFF]' + }, + { + name: 'InMyanmar', + bmp: '\u1000-\u109F' + }, + { + name: 'InMyanmar_Extended_A', + bmp: '\uAA60-\uAA7F' + }, + { + name: 'InMyanmar_Extended_B', + bmp: '\uA9E0-\uA9FF' + }, + { + name: 'InNKo', + bmp: '\u07C0-\u07FF' + }, + { + name: 'InNabataean', + astral: '\uD802[\uDC80-\uDCAF]' + }, + { + name: 'InNew_Tai_Lue', + bmp: '\u1980-\u19DF' + }, + { + name: 'InNumber_Forms', + bmp: '\u2150-\u218F' + }, + { + name: 'InOgham', + bmp: '\u1680-\u169F' + }, + { + name: 'InOl_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'InOld_Hungarian', + astral: '\uD803[\uDC80-\uDCFF]' + }, + { + name: 'InOld_Italic', + astral: '\uD800[\uDF00-\uDF2F]' + }, + { + name: 'InOld_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'InOld_Permic', + astral: '\uD800[\uDF50-\uDF7F]' + }, + { + name: 'InOld_Persian', + astral: '\uD800[\uDFA0-\uDFDF]' + }, + { + name: 'InOld_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'InOld_Turkic', + astral: '\uD803[\uDC00-\uDC4F]' + }, + { + name: 'InOptical_Character_Recognition', + bmp: '\u2440-\u245F' + }, + { + name: 'InOriya', + bmp: '\u0B00-\u0B7F' + }, + { + name: 'InOrnamental_Dingbats', + astral: '\uD83D[\uDE50-\uDE7F]' + }, + { + name: 'InOsmanya', + astral: '\uD801[\uDC80-\uDCAF]' + }, + { + name: 'InPahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF8F]' + }, + { + name: 'InPalmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'InPau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEFF]' + }, + { + name: 'InPhags_pa', + bmp: '\uA840-\uA87F' + }, + { + name: 'InPhaistos_Disc', + astral: '\uD800[\uDDD0-\uDDFF]' + }, + { + name: 'InPhoenician', + astral: '\uD802[\uDD00-\uDD1F]' + }, + { + name: 'InPhonetic_Extensions', + bmp: '\u1D00-\u1D7F' + }, + { + name: 'InPhonetic_Extensions_Supplement', + bmp: '\u1D80-\u1DBF' + }, + { + name: 'InPlaying_Cards', + astral: '\uD83C[\uDCA0-\uDCFF]' + }, + { + name: 'InPrivate_Use_Area', + bmp: '\uE000-\uF8FF' + }, + { + name: 'InPsalter_Pahlavi', + astral: '\uD802[\uDF80-\uDFAF]' + }, + { + name: 'InRejang', + bmp: '\uA930-\uA95F' + }, + { + name: 'InRumi_Numeral_Symbols', + astral: '\uD803[\uDE60-\uDE7F]' + }, + { + name: 'InRunic', + bmp: '\u16A0-\u16FF' + }, + { + name: 'InSamaritan', + bmp: '\u0800-\u083F' + }, + { + name: 'InSaurashtra', + bmp: '\uA880-\uA8DF' + }, + { + name: 'InSharada', + astral: '\uD804[\uDD80-\uDDDF]' + }, + { + name: 'InShavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'InShorthand_Format_Controls', + astral: '\uD82F[\uDCA0-\uDCAF]' + }, + { + name: 'InSiddham', + astral: '\uD805[\uDD80-\uDDFF]' + }, + { + name: 'InSinhala', + bmp: '\u0D80-\u0DFF' + }, + { + name: 'InSinhala_Archaic_Numbers', + astral: '\uD804[\uDDE0-\uDDFF]' + }, + { + name: 'InSmall_Form_Variants', + bmp: '\uFE50-\uFE6F' + }, + { + name: 'InSora_Sompeng', + astral: '\uD804[\uDCD0-\uDCFF]' + }, + { + name: 'InSpacing_Modifier_Letters', + bmp: '\u02B0-\u02FF' + }, + { + name: 'InSpecials', + bmp: '\uFFF0-\uFFFF' + }, + { + name: 'InSundanese', + bmp: '\u1B80-\u1BBF' + }, + { + name: 'InSundanese_Supplement', + bmp: '\u1CC0-\u1CCF' + }, + { + name: 'InSuperscripts_and_Subscripts', + bmp: '\u2070-\u209F' + }, + { + name: 'InSupplemental_Arrows_A', + bmp: '\u27F0-\u27FF' + }, + { + name: 'InSupplemental_Arrows_B', + bmp: '\u2900-\u297F' + }, + { + name: 'InSupplemental_Arrows_C', + astral: '\uD83E[\uDC00-\uDCFF]' + }, + { + name: 'InSupplemental_Mathematical_Operators', + bmp: '\u2A00-\u2AFF' + }, + { + name: 'InSupplemental_Punctuation', + bmp: '\u2E00-\u2E7F' + }, + { + name: 'InSupplemental_Symbols_and_Pictographs', + astral: '\uD83E[\uDD00-\uDDFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_A', + astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_B', + astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'InSutton_SignWriting', + astral: '\uD836[\uDC00-\uDEAF]' + }, + { + name: 'InSyloti_Nagri', + bmp: '\uA800-\uA82F' + }, + { + name: 'InSyriac', + bmp: '\u0700-\u074F' + }, + { + name: 'InTagalog', + bmp: '\u1700-\u171F' + }, + { + name: 'InTagbanwa', + bmp: '\u1760-\u177F' + }, + { + name: 'InTags', + astral: '\uDB40[\uDC00-\uDC7F]' + }, + { + name: 'InTai_Le', + bmp: '\u1950-\u197F' + }, + { + name: 'InTai_Tham', + bmp: '\u1A20-\u1AAF' + }, + { + name: 'InTai_Viet', + bmp: '\uAA80-\uAADF' + }, + { + name: 'InTai_Xuan_Jing_Symbols', + astral: '\uD834[\uDF00-\uDF5F]' + }, + { + name: 'InTakri', + astral: '\uD805[\uDE80-\uDECF]' + }, + { + name: 'InTamil', + bmp: '\u0B80-\u0BFF' + }, + { + name: 'InTelugu', + bmp: '\u0C00-\u0C7F' + }, + { + name: 'InThaana', + bmp: '\u0780-\u07BF' + }, + { + name: 'InThai', + bmp: '\u0E00-\u0E7F' + }, + { + name: 'InTibetan', + bmp: '\u0F00-\u0FFF' + }, + { + name: 'InTifinagh', + bmp: '\u2D30-\u2D7F' + }, + { + name: 'InTirhuta', + astral: '\uD805[\uDC80-\uDCDF]' + }, + { + name: 'InTransport_and_Map_Symbols', + astral: '\uD83D[\uDE80-\uDEFF]' + }, + { + name: 'InUgaritic', + astral: '\uD800[\uDF80-\uDF9F]' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics', + bmp: '\u1400-\u167F' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + bmp: '\u18B0-\u18FF' + }, + { + name: 'InVai', + bmp: '\uA500-\uA63F' + }, + { + name: 'InVariation_Selectors', + bmp: '\uFE00-\uFE0F' + }, + { + name: 'InVariation_Selectors_Supplement', + astral: '\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'InVedic_Extensions', + bmp: '\u1CD0-\u1CFF' + }, + { + name: 'InVertical_Forms', + bmp: '\uFE10-\uFE1F' + }, + { + name: 'InWarang_Citi', + astral: '\uD806[\uDCA0-\uDCFF]' + }, + { + name: 'InYi_Radicals', + bmp: '\uA490-\uA4CF' + }, + { + name: 'InYi_Syllables', + bmp: '\uA000-\uA48F' + }, + { + name: 'InYijing_Hexagram_Symbols', + bmp: '\u4DC0-\u4DFF' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js new file mode 100644 index 00000000000000..6da732f505abcc --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js @@ -0,0 +1,235 @@ +/*! + * XRegExp Unicode Categories 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token names + * are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData([ + { + name: 'C', + alias: 'Other', + isBmpLast: true, + bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5-\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF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128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FB-\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E43-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FF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09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD19-\uDD7F\uDD85-\uDDBF\uDDC1-\uDFFF]|\uD873[\uDEA2-\uDFFF]' + }, + { + name: 'Cc', + alias: 'Control', + bmp: '\0-\x1F\x7F-\x9F' + }, + { + name: 'Cf', + alias: 'Format', + bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + astral: '\uDB40[\uDC01\uDC20-\uDC7F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uD804\uDCBD' + }, + { + name: 'Cn', + alias: 'Unassigned', + bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u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u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FB-\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E43-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AE\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\u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C0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + name: 'Cs', + alias: 'Surrogate', + bmp: '\uD800-\uDFFF' + }, + { + name: 'L', + alias: 'Letter', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD83A[\uDC00-\uDCC4]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD809[\uDC80-\uDD43]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD808[\uDC00-\uDF99]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD811[\uDC00-\uDE46]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD82C[\uDC00\uDC01]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Ll', + alias: 'Lowercase_Letter', + bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD803[\uDCC0-\uDCF2]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]|\uD806[\uDCC0-\uDCDF]' + }, + { + name: 'Lm', + alias: 'Modifier_Letter', + bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F]' + }, + { + name: 'Lo', + alias: 'Other_Letter', + bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD83A[\uDC00-\uDCC4]|\uD803[\uDC00-\uDC48]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD809[\uDC80-\uDD43]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD808[\uDC00-\uDF99]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD811[\uDC00-\uDE46]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD82C[\uDC00\uDC01]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Lt', + alias: 'Titlecase_Letter', + bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + name: 'Lu', + alias: 'Uppercase_Letter', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28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A\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD806[\uDCA0-\uDCBF]|\uD803[\uDC80-\uDCB2]|\uD801[\uDC00-\uDC27]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]' + }, + { + name: 'M', + alias: 'Mark', + bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD82F[\uDC9D\uDC9E]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Mc', + alias: 'Spacing_Mark', + bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + astral: '\uD834[\uDD65\uDD66\uDD6D-\uDD72]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD81B[\uDF51-\uDF7E]' + }, + { + name: 'Me', + alias: 'Enclosing_Mark', + bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + name: 'Mn', + alias: 'Nonspacing_Mark', + bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6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E00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'N', + alias: 'Number', + bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD806[\uDCE0-\uDCF2]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD834[\uDF60-\uDF71]|\uD83C[\uDD00-\uDD0C]|\uD809[\uDC00-\uDC6E]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]' + }, + { + name: 'Nd', + alias: 'Decimal_Number', + bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD801[\uDCA0-\uDCA9]|\uD835[\uDFCE-\uDFFF]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]' + }, + { + name: 'Nl', + alias: 'Letter_Number', + bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + astral: '\uD809[\uDC00-\uDC6E]|\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]' + }, + { + name: 'No', + alias: 'Other_Number', + bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D70-\u0D75\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + astral: '\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD83C[\uDD00-\uDD0C]|\uD806[\uDCEA-\uDCF2]|\uD83A[\uDCC7-\uDCCF]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD805[\uDF3A\uDF3B]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]' + }, + { + name: 'P', + alias: 'Punctuation', + bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + astral: '\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD809[\uDC70-\uDC74]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD836[\uDE87-\uDE8B]|\uD801\uDD6F|\uD82F\uDC9F|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]' + }, + { + name: 'Pc', + alias: 'Connector_Punctuation', + bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + name: 'Pd', + alias: 'Dash_Punctuation', + bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + name: 'Pe', + alias: 'Close_Punctuation', + bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + name: 'Pf', + alias: 'Final_Punctuation', + bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + name: 'Pi', + alias: 'Initial_Punctuation', + bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + name: 'Po', + alias: 'Other_Punctuation', + bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + astral: '\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD809[\uDC70-\uDC74]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD836[\uDE87-\uDE8B]|\uD801\uDD6F|\uD82F\uDC9F|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]' + }, + { + name: 'Ps', + alias: 'Open_Punctuation', + bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + name: 'S', + alias: 'Symbol', + bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FA\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + astral: '\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDD79\uDD7B-\uDDA3\uDDA5-\uDED0\uDEE0-\uDEEC\uDEF0-\uDEF3\uDF00-\uDF73\uDF80-\uDFD4]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD82F\uDC9C|\uD805\uDF3F|\uD802[\uDC77\uDC78\uDEC8]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD83B[\uDEF0\uDEF1]' + }, + { + name: 'Sc', + alias: 'Currency_Symbol', + bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' + }, + { + name: 'Sk', + alias: 'Modifier_Symbol', + bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + astral: '\uD83C[\uDFFB-\uDFFF]' + }, + { + name: 'Sm', + alias: 'Math_Symbol', + bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + astral: '\uD83B[\uDEF0\uDEF1]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]' + }, + { + name: 'So', + alias: 'Other_Symbol', + bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FA\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + astral: '\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD83D[\uDC00-\uDD79\uDD7B-\uDDA3\uDDA5-\uDED0\uDEE0-\uDEEC\uDEF0-\uDEF3\uDF00-\uDF73\uDF80-\uDFD4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD82F\uDC9C|\uD805\uDF3F|\uD802[\uDC77\uDC78\uDEC8]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]' + }, + { + name: 'Z', + alias: 'Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + name: 'Zl', + alias: 'Line_Separator', + bmp: '\u2028' + }, + { + name: 'Zp', + alias: 'Paragraph_Separator', + bmp: '\u2029' + }, + { + name: 'Zs', + alias: 'Space_Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js new file mode 100644 index 00000000000000..92a041b4f85839 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js @@ -0,0 +1,105 @@ +/*! + * XRegExp Unicode Properties 3.1.0 + * + * Steven Levithan (c) 2012-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from UAX + * #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + Lo + + * Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should be + * ignored in rendering (unless explicitly supported) will be assigned in these ranges, permitting + * programs to correctly handle the default rendering of such characters when not otherwise + * supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS #18 + * RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = [ + { + name: 'ASCII', + bmp: '\0-\x7F' + }, + { + name: 'Alphabetic', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C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C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD83A[\uDC00-\uDCC4]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\u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C8-\uDFCF\uDFD1-\uDFD5]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD811[\uDC00-\uDE46]|\uD82C[\uDC00\uDC01]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Any', + isBmpLast: true, + bmp: '\0-\uFFFF', + astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'Default_Ignorable_Code_Point', + bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + astral: '[\uDB40-\uDB43][\uDC00-\uDFFF]|\uD834[\uDD73-\uDD7A]|\uD82F[\uDCA0-\uDCA3]' + }, + { + name: 'Lowercase', + bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527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F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD803[\uDCC0-\uDCF2]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]|\uD806[\uDCC0-\uDCDF]' + }, + { + name: 'Noncharacter_Code_Point', + bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', + astral: '[\uDB3F\uDB7F\uDBBF\uDBFF\uD83F\uD87F\uD8BF\uDAFF\uD97F\uD9BF\uD9FF\uDA3F\uD8FF\uDABF\uDA7F\uD93F][\uDFFE\uDFFF]' + }, + { + name: 'Uppercase', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD806[\uDCA0-\uDCBF]|\uD803[\uDC80-\uDCB2]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD801[\uDC00-\uDC27]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + name: 'White_Space', + bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } + ]; + + // Add non-generated data + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + + XRegExp.addUnicodeData(unicodeData); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js new file mode 100644 index 00000000000000..bb28ec36a09b31 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js @@ -0,0 +1,559 @@ +/*! + * XRegExp Unicode Scripts 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, and + * any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData([ + { + name: 'Ahom', + astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + name: 'Anatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE46]' + }, + { + name: 'Arabic', + bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + name: 'Armenian', + bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + name: 'Avestan', + astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + name: 'Balinese', + bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + name: 'Bamum', + bmp: '\uA6A0-\uA6F7', + astral: '\uD81A[\uDC00-\uDE38]' + }, + { + name: 'Bassa_Vah', + astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + name: 'Batak', + bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + name: 'Bengali', + bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' + }, + { + name: 'Bopomofo', + bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' + }, + { + name: 'Brahmi', + astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + name: 'Braille', + bmp: '\u2800-\u28FF' + }, + { + name: 'Buginese', + bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + name: 'Buhid', + bmp: '\u1740-\u1753' + }, + { + name: 'Canadian_Aboriginal', + bmp: '\u1400-\u167F\u18B0-\u18F5' + }, + { + name: 'Carian', + astral: '\uD800[\uDEA0-\uDED0]' + }, + { + name: 'Caucasian_Albanian', + astral: '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + name: 'Chakma', + astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' + }, + { + name: 'Cham', + bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + name: 'Cherokee', + bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + name: 'Common', + bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FA\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E42\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\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uDF00-\uDFFF]' + }, + { + name: 'Coptic', + bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + name: 'Cuneiform', + astral: '\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]|\uD808[\uDC00-\uDF99]' + }, + { + name: 'Cypriot', + astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + name: 'Cyrillic', + bmp: '\u0400-\u0484\u0487-\u052F\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + name: 'Deseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'Devanagari', + bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' + }, + { + name: 'Duployan', + astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + name: 'Egyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + name: 'Elbasan', + astral: '\uD801[\uDD00-\uDD27]' + }, + { + name: 'Ethiopic', + bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + name: 'Georgian', + bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + name: 'Glagolitic', + bmp: '\u2C00-\u2C2E\u2C30-\u2C5E' + }, + { + name: 'Gothic', + astral: '\uD800[\uDF30-\uDF4A]' + }, + { + name: 'Grantha', + astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + name: 'Greek', + bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + astral: '\uD800[\uDD40-\uDD8C\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + name: 'Gujarati', + bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' + }, + { + name: 'Gurmukhi', + bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' + }, + { + name: 'Han', + bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD87E[\uDC00-\uDE1D]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Hangul', + bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + name: 'Hanunoo', + bmp: '\u1720-\u1734' + }, + { + name: 'Hatran', + astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + name: 'Hebrew', + bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + name: 'Hiragana', + bmp: '\u3041-\u3096\u309D-\u309F', + astral: '\uD82C\uDC01|\uD83C\uDE00' + }, + { + name: 'Imperial_Aramaic', + astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + name: 'Inherited', + bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + astral: '\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD800[\uDDFD\uDEE0]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Inscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + name: 'Inscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + name: 'Javanese', + bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + name: 'Kaithi', + astral: '\uD804[\uDC80-\uDCC1]' + }, + { + name: 'Kannada', + bmp: '\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + name: 'Katakana', + bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + astral: '\uD82C\uDC00' + }, + { + name: 'Kayah_Li', + bmp: '\uA900-\uA92D\uA92F' + }, + { + name: 'Kharoshthi', + astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' + }, + { + name: 'Khmer', + bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + name: 'Khojki', + astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3D]' + }, + { + name: 'Khudawadi', + astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + name: 'Lao', + bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + name: 'Latin', + bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + name: 'Lepcha', + bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + name: 'Limbu', + bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + name: 'Linear_A', + astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + name: 'Linear_B', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + name: 'Lisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'Lycian', + astral: '\uD800[\uDE80-\uDE9C]' + }, + { + name: 'Lydian', + astral: '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + name: 'Mahajani', + astral: '\uD804[\uDD50-\uDD76]' + }, + { + name: 'Malayalam', + bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D75\u0D79-\u0D7F' + }, + { + name: 'Mandaic', + bmp: '\u0840-\u085B\u085E' + }, + { + name: 'Manichaean', + astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + name: 'Meetei_Mayek', + bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + name: 'Mende_Kikakui', + astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + name: 'Meroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + name: 'Meroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'Miao', + astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + name: 'Modi', + astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + name: 'Mongolian', + bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA' + }, + { + name: 'Mro', + astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + name: 'Multani', + astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + name: 'Myanmar', + bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + name: 'Nabataean', + astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + name: 'New_Tai_Lue', + bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + name: 'Nko', + bmp: '\u07C0-\u07FA' + }, + { + name: 'Ogham', + bmp: '\u1680-\u169C' + }, + { + name: 'Ol_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'Old_Hungarian', + astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + name: 'Old_Italic', + astral: '\uD800[\uDF00-\uDF23]' + }, + { + name: 'Old_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'Old_Permic', + astral: '\uD800[\uDF50-\uDF7A]' + }, + { + name: 'Old_Persian', + astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + name: 'Old_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'Old_Turkic', + astral: '\uD803[\uDC00-\uDC48]' + }, + { + name: 'Oriya', + bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + name: 'Osmanya', + astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + name: 'Pahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + name: 'Palmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'Pau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEF8]' + }, + { + name: 'Phags_Pa', + bmp: '\uA840-\uA877' + }, + { + name: 'Phoenician', + astral: '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + name: 'Psalter_Pahlavi', + astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + name: 'Rejang', + bmp: '\uA930-\uA953\uA95F' + }, + { + name: 'Runic', + bmp: '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + name: 'Samaritan', + bmp: '\u0800-\u082D\u0830-\u083E' + }, + { + name: 'Saurashtra', + bmp: '\uA880-\uA8C4\uA8CE-\uA8D9' + }, + { + name: 'Sharada', + astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + name: 'Shavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'Siddham', + astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + name: 'SignWriting', + astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + name: 'Sinhala', + bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + astral: '\uD804[\uDDE1-\uDDF4]' + }, + { + name: 'Sora_Sompeng', + astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + name: 'Sundanese', + bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + name: 'Syloti_Nagri', + bmp: '\uA800-\uA82B' + }, + { + name: 'Syriac', + bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' + }, + { + name: 'Tagalog', + bmp: '\u1700-\u170C\u170E-\u1714' + }, + { + name: 'Tagbanwa', + bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + name: 'Tai_Le', + bmp: '\u1950-\u196D\u1970-\u1974' + }, + { + name: 'Tai_Tham', + bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + name: 'Tai_Viet', + bmp: '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + name: 'Takri', + astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + name: 'Tamil', + bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + name: 'Telugu', + bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + name: 'Thaana', + bmp: '\u0780-\u07B1' + }, + { + name: 'Thai', + bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + name: 'Tibetan', + bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + name: 'Tifinagh', + bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + name: 'Tirhuta', + astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + name: 'Ugaritic', + astral: '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + name: 'Vai', + bmp: '\uA500-\uA62B' + }, + { + name: 'Warang_Citi', + astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + name: 'Yi', + bmp: '\uA000-\uA48C\uA490-\uA4C6' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/index.js b/tools/eslint/node_modules/xregexp/src/index.js new file mode 100644 index 00000000000000..0d0bd455aaed5b --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/index.js @@ -0,0 +1,11 @@ +var XRegExp = require('./xregexp'); + +require('./addons/build')(XRegExp); +require('./addons/matchrecursive')(XRegExp); +require('./addons/unicode-base')(XRegExp); +require('./addons/unicode-blocks')(XRegExp); +require('./addons/unicode-categories')(XRegExp); +require('./addons/unicode-properties')(XRegExp); +require('./addons/unicode-scripts')(XRegExp); + +module.exports = XRegExp; diff --git a/tools/eslint/node_modules/xregexp/src/xregexp.js b/tools/eslint/node_modules/xregexp/src/xregexp.js new file mode 100644 index 00000000000000..91c60b640660f6 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/xregexp.js @@ -0,0 +1,1871 @@ +/*! + * XRegExp 3.1.0 + * + * Steven Levithan (c) 2007-2016 MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ + + 'use strict'; + +/* ============================== + * Private stuff + * ============================== */ + + // Property name used for extended regex instance data + var REGEX_DATA = 'xregexp'; + // Optional features that can be installed and uninstalled + var features = { + astral: false, + natives: false + }; + // Native methods to use and restore ('native' is an ES3 reserved keyword) + var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }; + // Storage for fixed/extended native methods + var fixed = {}; + // Storage for regexes cached by `XRegExp.cache` + var regexCache = {}; + // Storage for pattern details cached by the `XRegExp` constructor + var patternCache = {}; + // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + var tokens = []; + // Token scopes + var defaultScope = 'default'; + var classScope = 'class'; + // Regexes that match native regex syntax, including octals + var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ + }; + // Any backreference or dollar-prefixed character in replacement strings + var replacementToken = /\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g; + // Check for correct `exec` handling of nonparticipating capturing groups + var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; + // Check for ES6 `flags` prop support + var hasFlagsProp = /x/.flags !== undefined; + // Shortcut to `Object.prototype.toString` + var toString = {}.toString; + + function hasNativeFlag(flag) { + // Can't check based on the presense of properties/getters since + // browsers might support such properties even when don't support the + // corresponding flag in regex construction (tested in Chrome 48, where + // `'unicode' in /x/` is true but trying to construct a regex with flag + // `u` throws an error). + var isSupported = true; + try { + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + return isSupported; + } + // Check for ES6 `u` flag support + var hasNativeU = hasNativeFlag('u'); + // Check for ES6 `y` flag support + var hasNativeY = hasNativeFlag('y'); + // Tracker for known flags, including addon flags + var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY + }; + +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + var p; + + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } + + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since + // this is performance sensitive, and enumerable `Object.prototype` or + // `RegExp.prototype` extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; + // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + + return regex; + } + +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); + } + +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + *
  • `addG` {Boolean} Add flag g while copying the regex. + *
  • `addY` {Boolean} Add flag y while copying the regex. + *
  • `removeG` {Boolean} Remove flag g while copying the regex. + *
  • `removeY` {Boolean} Remove flag y while copying the regex. + *
  • `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}, + flags = getNativeFlags(regex), + flagsToAdd = '', + flagsToRemove = '', + xregexpSource = null, + xregexpFlags = null; + + options = options || {}; + + if (options.removeG) {flagsToRemove += 'g';} + if (options.removeY) {flagsToRemove += 'y';} + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); + } + + if (options.addG) {flagsToAdd += 'g';} + if (options.addY) {flagsToAdd += 'y';} + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } + // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are + // never removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } + + // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to + // avoid searching for special tokens. That would be wrong for regexes constructed by + // `RegExp`, and unnecessary for regexes constructed by `XRegExp` because the regex has + // already undergone the translation to native regex syntax + regex = augment( + new RegExp(regex.source, flags), + hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, + xregexpSource, + xregexpFlags, + options.isInternalOnly + ); + + return regex; + } + +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + function dec(hex) { + return parseInt(hex, 16); + } + +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + function getNativeFlags(regex) { + return hasFlagsProp ? + regex.flags : + // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or + // concatenation with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overriden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; + } + +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); + } + +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + function hex(dec) { + return parseInt(dec, 10).toString(16); + } + +/** + * Returns the first index at which a given value can be found in an array. + * + * @private + * @param {Array} array Array to search. + * @param {*} value Value to locate in the array. + * @returns {Number} Zero-based index at which the item is found, or -1. + */ + function indexOf(array, value) { + var len = array.length, i; + + for (i = 0; i < len; ++i) { + if (array[i] === value) { + return i; + } + } + + return -1; + } + +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + function isType(value, type) { + return toString.call(value) === '[object ' + type + ']'; + } + +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next token is a quantifier. + */ + function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call( + flags.indexOf('x') > -1 ? + // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : + // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, + pattern.slice(pos) + ); + } + +/** + * Pads the provided string with as many leading zeros as needed to get to length 4. Used to produce + * fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; + } + +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + function prepareFlags(pattern, flags) { + var i; + + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError('Invalid duplicate regex flag ' + flags); + } + + // Strip and apply a leading mode modifier with any combination of flags except g or y + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); + } + // Allow duplicate flags within the mode modifier + flags = clipDuplicates(flags + $1); + return ''; + }); + + // Throw on unknown native or nonnative flags + for (i = 0; i < flags.length; ++i) { + if (!registeredFlags[flags.charAt(i)]) { + throw new SyntaxError('Unknown regex flag ' + flags.charAt(i)); + } + } + + return { + pattern: pattern, + flags: flags + }; + } + +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function(match) { + options[match] = true; + }); + + return options; + } + + return value; + } + +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; + } + +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length, + leadChar = pattern.charAt(pos), + result = null, + match, + t; + + // Run in reverse insertion order + while (i--) { + t = tokens[i]; + if ( + (t.leadChar && t.leadChar !== leadChar) || + (t.scope !== scope && t.scope !== 'all') || + (t.flag && flags.indexOf(t.flag) === -1) + ) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; + // Finished with token tests + break; + } + } + + return result; + } + +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setAstral(on) { + features.astral = on; + } + +/** + * Enables or disables native method overrides. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setNatives(on) { + RegExp.prototype.exec = (on ? fixed : nativ).exec; + RegExp.prototype.test = (on ? fixed : nativ).test; + String.prototype.match = (on ? fixed : nativ).match; + String.prototype.replace = (on ? fixed : nativ).replace; + String.prototype.split = (on ? fixed : nativ).split; + + features.natives = on; + } + +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; + } + +/* ============================== + * Constructor + * ============================== */ + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + *
  • `g` - global + *
  • `i` - ignore case + *
  • `m` - multiline anchors + *
  • `u` - unicode (ES6) + *
  • `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + *
  • `n` - explicit capture + *
  • `s` - dot matches all (aka singleline) + *
  • `x` - free-spacing and line comments (aka extended) + *
  • `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp('(? [0-9]{4} ) -? # year \n\ + * (? [0-9]{2} ) -? # month \n\ + * (? [0-9]{2} ) # day ', 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + function XRegExp(pattern, flags) { + var context = { + hasNamedCapture: false, + captureNames: [] + }, + scope = defaultScope, + output = '', + pos = 0, + result, + token, + generated, + appliedPattern, + appliedFlags; + + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + return copyRegex(pattern); + } + + // Copy the argument behavior of `RegExp` + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && flags.indexOf('A') === -1) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + // Check for flag-related errors, and strip/apply flags in a leading mode modifier + result = prepareFlags(pattern, flags); + appliedPattern = result.pattern; + appliedFlags = result.flags; + + // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); + // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + + result.output + + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += (result.matchLength || 1); + } else { + // Get the native token at the current position + token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; + output += token; + pos += token.length; + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + pattern: output, + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + generated = patternCache[pattern][flags]; + return augment( + new RegExp(generated.pattern, generated.flags), + generated.captures, + pattern, + flags + ); + }; + +// Add `RegExp.prototype` to the prototype chain + XRegExp.prototype = new RegExp(); + +/* ============================== + * Public properties + * ============================== */ + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + XRegExp.version = '3.1.0'; + +/* ============================== + * Public methods + * ============================== */ + +// Intentionally undocumented + XRegExp._hasNativeFlag = hasNativeFlag; + +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + *
  • The match array, with named backreference properties. + *
  • The regex scope where the match was found: 'default' or 'class'. + *
  • The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + *
  • `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + *
  • `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + *
  • `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + *
  • `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + *
  • `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * function() {return '\\x07';}, + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * function(match) {return match[1] + (match[2] ? '' : '?');}, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + XRegExp.addToken = function(regex, handler, options) { + options = options || {}; + var optionalFlags = options.optionalFlags, i; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + for (i = 0; i < optionalFlags.length; ++i) { + registerFlag(optionalFlags[i]); + } + } + + // Add to the private list of syntax tokens + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + XRegExp.cache = function(pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + return regexCache[pattern][flags] || ( + regexCache[pattern][flags] = XRegExp(pattern, flags) + ); + }; + +// Intentionally undocumented + XRegExp.cache.flush = function(cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } + }; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + XRegExp.escape = function(str) { + return nativ.replace.call(toObject(str), /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + }; + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * var match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * var pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + XRegExp.exec = function(str, regex, pos, sticky) { + var cacheKey = 'g', + addY = false, + match, + r2; + + addY = hasNativeY && !!(sticky || (regex.sticky && sticky !== false)); + if (addY) { + cacheKey += 'y'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.match`/`replace` + r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + removeY: sticky === false, + isInternalOnly: true + }) + ); + + r2.lastIndex = pos = pos || 0; + + // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + match = fixed.exec.call(r2, str); + + if (sticky && match && match.index !== pos) { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; + }; + +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + *
  • The match array, with named backreference properties. + *
  • The zero-based match index. + *
  • The string being traversed. + *
  • The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * var evens = []; + * XRegExp.forEach('1a2345', /\d/, function(match, i) { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + XRegExp.forEach = function(str, regex, callback) { + var pos = 0, + i = -1, + match; + + while ((match = XRegExp.exec(str, regex, pos))) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since + // `XRegExp.exec` doesn't use `lastIndex` to set the search position, this can't lead + // to an infinite loop, at least. Actually, because of the way `XRegExp.exec` caches + // globalized versions of regexes, mutating the regex will not have any effect on the + // iteration or matched strings, which is a nice side effect that brings extra safety + callback(match, ++i, str, regex); + + pos = match.index + (match[0].length || 1); + } + }; + +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * var globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + XRegExp.globalize = function(regex) { + return copyRegex(regex, {addG: true}); + }; + +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // DEPRECATED: Overrides native regex methods with fixed/extended versions + * natives: true + * }); + * + * // With an options string + * XRegExp.install('astral natives'); + */ + XRegExp.install = function(options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.natives && options.natives) { + setNatives(true); + } + }; + +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + *
  • `astral` + *
  • `natives` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + XRegExp.isInstalled = function(feature) { + return !!(features[feature]); + }; + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + XRegExp.isRegExp = function(value) { + return toString.call(value) === '[object RegExp]'; + //return isType(value, 'RegExp'); + }; + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + XRegExp.match = function(str, regex, scope) { + var global = (regex.global && scope !== 'one') || scope === 'all', + cacheKey = ((global ? 'g' : '') + (regex.sticky ? 'y' : '')) || 'noGY', + result, + r2; + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`replace` + r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + + result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = ( + (scope === 'one' && result) ? + // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + (result.index + result[0].length) : 0 + ); + } + + return global ? (result || []) : (result && result[0]); + }; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = 'XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + XRegExp.matchChain = function(str, chain) { + return (function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + matches = [], + addMatch = function(match) { + if (item.backref) { + /* Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold + * the `undefined`s for backreferences to nonparticipating capturing + * groups. In such cases, a `hasOwnProperty` or `in` check on its own would + * inappropriately throw the exception, so also check if the backreference + * is a number that is within the bounds of the array. + */ + if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { + throw new ReferenceError('Backreference to undefined group: ' + item.backref); + } + + matches.push(match[item.backref] || ''); + } else { + matches.push(match[0]); + } + }, + i; + + for (i = 0; i < values.length; ++i) { + XRegExp.forEach(values[i], item.regex, addMatch); + } + + return ((level === chain.length - 1) || !matches.length) ? + matches : + recurseChain(matches, level + 1); + }([str], 0)); + }; + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` for named and numbered backreferences. Replacement + * functions can use named backreferences via `arguments[0].name`. Also fixes browser bugs compared + * to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + *
  • $$ - Inserts a literal $ character. + *
  • $&, $0 - Inserts the matched substring. + *
  • $` - Inserts the string that precedes the matched substring (left context). + *
  • $' - Inserts the string that follows the matched substring (right context). + *
  • $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + *
  • ${n} - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + *
  • The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + *
  • 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + *
  • The zero-based index of the match within the total search string. + *
  • The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * var name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '${last}, ${first}'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, function(match) { + * return match.last + ', ' + match.first; + * }); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + XRegExp.replace = function(str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search), + global = (search.global && scope !== 'one') || scope === 'all', + cacheKey = ((global ? 'g' : '') + (search.sticky ? 'y' : '')) || 'noGY', + s2 = search, + result; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + s2 = search[REGEX_DATA][cacheKey] || ( + search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } + + // Fixed `replace` required for named backreferences, etc. + result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; + }; + +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, function($0) { + * return $0.toUpperCase(); + * }] + * ]); + */ + XRegExp.replaceEach = function(str, replacements) { + var i, r; + + for (i = 0; i < replacements.length; ++i) { + r = replacements[i]; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + + return str; + }; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + XRegExp.split = function(str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); + }; + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ + XRegExp.test = function(str, regex, pos, sticky) { + // Do this the easy way :-) + return !!XRegExp.exec(str, regex, pos, sticky); + }; + +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // DEPRECATED: Restores native regex methods + * natives: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral natives'); + */ + XRegExp.uninstall = function(options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.natives && options.natives) { + setNatives(false); + } + }; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + */ + XRegExp.union = function(patterns, flags) { + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g, + output = [], + numCaptures = 0, + numPriorCaptures, + captureNames, + pattern, + rewrite = function(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; + + // Capturing group + if (paren) { + ++numCaptures; + // If the current capture has a name, preserve the name + if (name) { + return '(?<' + name + '>'; + } + // Backreference + } else if (backref) { + // Rewrite the backreference + return '\\' + (+backref + numPriorCaptures); + } + + return match; + }, + i; + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + for (i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = (pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames) || []; + + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns + // are independently valid; helps keep this simple. Named captures are put back + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + + return XRegExp(output.join('|'), flags); + }; + +/* ============================== + * Fixed/extended native methods + * ============================== */ + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Calling `XRegExp.install('natives')` uses this to + * override the native method. Use via `XRegExp.exec` without overriding natives. + * + * @private + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + fixed.exec = function(str) { + var origLastIndex = this.lastIndex, + match = nativ.exec.apply(this, arguments), + name, + r2, + i; + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating + // capturing groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of + // older IEs. IE 9 in standards mode follows the spec + if (!correctExecNpcg && match.length > 1 && indexOf(match, '') > -1) { + r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, function() { + var len = arguments.length, i; + // Skip index 0 and the last 2 + for (i = 1; i < len - 2; ++i) { + if (arguments[i] === undefined) { + match[i] = undefined; + } + } + }); + } + + // Attach named capture properties + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (i = 1; i < match.length; ++i) { + name = this[REGEX_DATA].captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && (this.lastIndex > match.index)) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; + }; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. Calling `XRegExp.install('natives')` + * uses this to override the native method. + * + * @private + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + fixed.test = function(str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); + }; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. Calling `XRegExp.install('natives')` uses this to + * override the native method. + * + * @private + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + fixed.match = function(regex) { + var result; + + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + result = nativ.match.apply(this, arguments); + // Fixes IE bug + regex.lastIndex = 0; + + return result; + } + + return fixed.exec.call(regex, toObject(this)); + }; + +/** + * Adds support for `${n}` tokens for named and numbered backreferences in replacement text, and + * provides named backreferences to replacement functions as `arguments[0].name`. Also fixes browser + * bugs in replacement text syntax when performing a replacement using a nonregex search value, and + * the value of a replacement regex's `lastIndex` property during replacement iterations and upon + * completion. Calling `XRegExp.install('natives')` uses this to override the native method. Note + * that this doesn't support SpiderMonkey's proprietary third (`flags`) argument. Use via + * `XRegExp.replace` without overriding natives. + * + * @private + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + fixed.replace = function(search, replacement) { + var isRegex = XRegExp.isRegExp(search), + origLastIndex, + captureNames, + result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } + // Only needed if `search` is nonglobal + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } + + // Don't use `typeof`; some older browsers return 'function' for regex objects + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function() { + var args = arguments, i; + if (captureNames) { + // Change the `arguments[0]` string primitive to a `String` object that can + // store properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, + // Safari bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + // ES6 specs the context for replacement functions as `undefined` + return replacement.apply(undefined, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function() { + // Keep this function's `arguments` available through closure + var args = arguments; + return nativ.replace.call(String(replacement), replacementToken, function($0, $1, $2) { + var n; + // Named or numbered backreference with curly braces + if ($1) { + // XRegExp behavior for `${n}`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for + // for the entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an + // integer overridden by numbered capture. In practice, this does not + // overlap with numbered capture since XRegExp does not allow named + // capture to use a bare integer as the name. + // 3. If the name or number does not refer to an existing capturing group, + // it's an error. + n = +$1; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ''; + } + // Groups with the same name is an error, else would need `lastIndexOf` + n = captureNames ? indexOf(captureNames, $1) : -1; + if (n < 0) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[n + 1] || ''; + } + // Else, special variable or numbered backreference without curly braces + if ($2 === '$') { // $$ + return '$'; + } + if ($2 === '&' || +$2 === 0) { // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + if ($2 === '`') { // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + if ($2 === "'") { // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } + // Else, numbered backreference without curly braces + $2 = +$2; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + if (!isNaN($2)) { + if ($2 > args.length - 3) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[$2] || ''; + } + // `$` followed by an unsupported char is an error, unlike native JS + throw new SyntaxError('Invalid token ' + $0); + }); + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; + }; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Calling `XRegExp.install('natives')` + * uses this to override the native method. Use via `XRegExp.split` without overriding natives. + * + * @private + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + fixed.split = function(separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this), + output = [], + origLastIndex = separator.lastIndex, + lastLastIndex = 0, + lastLength; + + // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, + // unless Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + limit = (limit === undefined ? -1 : limit) >>> 0; + + XRegExp.forEach(str, separator, function(match) { + // This condition is not the same as `if (match[0].length)` + if ((match.index + match[0].length) > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; + }; + +/* ============================== + * Built-in syntax/flag tokens + * ============================== */ + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + XRegExp.addToken( + /\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, + function(match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError('Invalid escape ' + match[0]); + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + XRegExp.addToken( + /\\u{([\dA-Fa-f]+)}/, + function(match, scope, flags) { + var code = dec(match[1]); + if (code > 0x10FFFF) { + throw new SyntaxError('Invalid Unicode code point ' + match[0]); + } + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return '\\u' + pad4(hex(code)); + } + // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + if (hasNativeU && flags.indexOf('u') > -1) { + return match[0]; + } + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + XRegExp.addToken( + /\[(\^?)]/, + function(match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in some versions of Firefox + return match[1] ? '[\\s\\S]' : '\\b\\B'; + }, + {leadChar: '['} + ); + +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + XRegExp.addToken( + /\(\?#[^)]*\)/, + function(match, scope, flags) { + // Keep tokens separated unless the following token is a quantifier + return isQuantifierNext(match.input, match.index + match[0].length, flags) ? + '' : '(?:)'; + }, + {leadChar: '('} + ); + +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + XRegExp.addToken( + /\s+|#.*/, + function(match, scope, flags) { + // Keep tokens separated unless the following token is a quantifier + return isQuantifierNext(match.input, match.index + match[0].length, flags) ? + '' : '(?:)'; + }, + {flag: 'x'} + ); + +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + XRegExp.addToken( + /\./, + function() { + return '[\\s\\S]'; + }, + { + flag: 's', + leadChar: '.' + } + ); + +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + XRegExp.addToken( + /\\k<([\w$]+)>/, + function(match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? (indexOf(this.captureNames, match[1]) + 1) : +match[1], + endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError('Backreference to undefined group ' + match[0]); + } + // Keep backreferences separate from subsequent literal numbers + return '\\' + index + ( + endIndex === match.input.length || isNaN(match.input.charAt(endIndex)) ? + '' : '(?:)' + ); + }, + {leadChar: '\\'} + ); + +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + XRegExp.addToken( + /\\(\d+)/, + function(match, scope) { + if ( + !( + scope === defaultScope && + /^[1-9]/.test(match[1]) && + +match[1] <= this.captureNames.length + ) && + match[1] !== '0' + ) { + throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + + match[0]); + } + return match[0]; + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + XRegExp.addToken( + /\(\?P?<([\w$]+)>/, + function(match) { + // Disallow bare integers as names because named backreferences are added to match + // arrays and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError('Cannot use integer as capture name ' + match[0]); + } + if (match[1] === 'length' || match[1] === '__proto__') { + throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); + } + if (indexOf(this.captureNames, match[1]) > -1) { + throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; + }, + {leadChar: '('} + ); + +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + XRegExp.addToken( + /\((?!\?)/, + function(match, scope, flags) { + if (flags.indexOf('n') > -1) { + return '(?:'; + } + this.captureNames.push(null); + return '('; + }, + { + optionalFlags: 'n', + leadChar: '(' + } + ); + +/* ============================== + * Expose XRegExp + * ============================== */ + + module.exports = XRegExp; diff --git a/tools/eslint/node_modules/xregexp/xregexp-all.js b/tools/eslint/node_modules/xregexp/xregexp-all.js deleted file mode 100644 index cfeed86e354004..00000000000000 --- a/tools/eslint/node_modules/xregexp/xregexp-all.js +++ /dev/null @@ -1,4486 +0,0 @@ -/*! - * 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; - //